diff --git a/.clang-format b/.clang-format index c71e50e2..03ea4a3a 100644 --- a/.clang-format +++ b/.clang-format @@ -1,19 +1,18 @@ ---- +IndentWidth: 4 Language: Cpp -BasedOnStyle: Google - -BinPackArguments: false -BinPackParameters: false - -IncludeBlocks: Regroup -IncludeCategories: - - Regex: 'pch.h' - Priority: 0 - - Regex: '^<' - Priority: 1 - - Regex: '^".*/' - Priority: 2 - - Regex: '(^((?!/).)*$)' - Priority: 3 - -SortIncludes: true +AlignAfterOpenBracket: Align +SortIncludes: false +ColumnLimit: 104 +PointerAlignment: Right +AllowShortFunctionsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: false +BinPackArguments: true +BinPackParameters: true +SpaceAfterCStyleCast: true +BreakBeforeBraces: Attach +BreakBeforeTernaryOperators: true +BreakBeforeBinaryOperators: NonAssignment +Cpp11BracedListStyle: false +IndentCaseLabels: true +AlignTrailingComments: true +UseTab: Never diff --git a/.gitignore b/.gitignore index f151da89..0caa3e08 100644 --- a/.gitignore +++ b/.gitignore @@ -7,11 +7,16 @@ *.ilk *.exp +# Patch and wiggle related residdue +*.rej +*.porig + # Precompiled Headers *.gch *.pch # Libraries +*.lib *.a *.la *.lo @@ -40,15 +45,16 @@ # Text editor remnants *.swp .vscode/* +.idea/* # General project-specific ignores -__pycache__/* doxygen/doxygen/* build/* *.dump *.mio0 *.z64 *.map +*.sav .assets-local.txt sm64_save_file.bin sm64config.txt @@ -72,12 +78,3 @@ sm64config.txt !/sound/**/*custom*/**/*.aiff !/assets/**/*custom*.bin !/assets/**/*custom*/**/*.bin - -# Visual Studio. -/.vs/**/* -/x64/**/* -/tst/x64/**/* -/packages/**/* -*.cache -*.log -*.tlog diff --git a/3D Objects - Shortcut.lnk b/3D Objects - Shortcut.lnk deleted file mode 100644 index a8417b60..00000000 Binary files a/3D Objects - Shortcut.lnk and /dev/null differ diff --git a/Build.props b/Build.props deleted file mode 100644 index 711a7d08..00000000 --- a/Build.props +++ /dev/null @@ -1,19 +0,0 @@ - - - - - 1 - 1 - - - - - - $(NON_MATCHING) - true - - - $(AVOID_UB) - - - \ No newline at end of file diff --git a/Makefile b/Makefile index dca1980b..85eaaecf 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ + # Makefile to rebuild SM64 split image ### Default target ### @@ -9,98 +10,125 @@ default: all # These options can either be changed by modifying the makefile, or # by building with 'make SETTING=value'. 'make clean' may be required. +# Build debug version +DEBUG ?= 0 # Version of the game to build VERSION ?= us # Graphics microcode used -GRUCODE ?= f3d_old +GRUCODE ?= f3dex2e # If COMPARE is 1, check the output sha1sum when building 'all' COMPARE ?= 1 # If NON_MATCHING is 1, define the NON_MATCHING and AVOID_UB macros when building (recommended) -NON_MATCHING ?= 0 -# Build for the N64 (turn this off for ports) -TARGET_N64 ?= 0 +NON_MATCHING ?= 1 + +# Build and optimize for Raspberry Pi(s) +TARGET_RPI ?= 0 + # Build for Emscripten/WebGL TARGET_WEB ?= 0 -# Compiler to use (ido or gcc) -COMPILER ?= ido -# Automatic settings only for ports -ifeq ($(TARGET_N64),0) +# Makeflag to enable OSX fixes +OSX_BUILD ?= 0 - NON_MATCHING := 1 - GRUCODE := f3dex2e - TARGET_WINDOWS := 0 - ifeq ($(TARGET_WEB),0) - ifeq ($(OS),Windows_NT) - TARGET_WINDOWS := 1 - else - # TODO: Detect Mac OS X, BSD, etc. For now, assume Linux - TARGET_LINUX := 1 - endif +# Specify the target you are building for, TARGET_BITS=0 means native +TARGET_ARCH ?= native +TARGET_BITS ?= 0 + +# Disable better camera by default +BETTERCAMERA ?= 0 +# Disable no drawing distance by default +NODRAWINGDISTANCE ?= 0 +# Disable texture fixes by default (helps with them purists) +TEXTURE_FIX ?= 0 +# Enable extended options menu by default +EXT_OPTIONS_MENU ?= 1 +# Disable text-based save-files by default +TEXTSAVES ?= 0 +# Load resources from external files +EXTERNAL_DATA ?= 0 +# Enable Discord Rich Presence +DISCORDRPC ?= 0 + +# Various workarounds for weird toolchains + +NO_BZERO_BCOPY ?= 0 +NO_LDIV ?= 0 + +# Backend selection + +# Renderers: GL, GL_LEGACY, D3D11, D3D12 +RENDER_API ?= GL +# Window managers: SDL2, DXGI (forced if D3D11 or D3D12 in RENDER_API) +WINDOW_API ?= SDL2 +# Audio backends: SDL2 +AUDIO_API ?= SDL2 +# Controller backends (can have multiple, space separated): SDL2 +CONTROLLER_API ?= SDL2 + +# Modern rendering system (will eventually replace other backends) +RMODERN ?= 0 + +# Misc settings for EXTERNAL_DATA + +LEGACY_RES ?= 0 +BASEDIR ?= res + +# Automatic settings for PC port(s) + +WINDOWS_BUILD ?= 0 + +# Attempt to detect OS + +ifeq ($(OS),Windows_NT) + HOST_OS ?= Windows +else + HOST_OS ?= $(shell uname -s 2>/dev/null || echo Unknown) + # some weird MINGW/Cygwin env that doesn't define $OS + ifneq (,$(findstring MINGW,HOST_OS)) + HOST_OS := Windows endif - - ifeq ($(TARGET_WINDOWS),1) - # On Windows, default to DirectX 11 - ifneq ($(ENABLE_OPENGL),1) - ifneq ($(ENABLE_DX12),1) - ENABLE_DX11 ?= 1 - endif - endif - else - # On others, default to OpenGL - ENABLE_OPENGL ?= 1 - endif - - # Sanity checks - ifeq ($(ENABLE_DX11),1) - ifneq ($(TARGET_WINDOWS),1) - $(error The DirectX 11 backend is only supported on Windows) - endif - ifeq ($(ENABLE_OPENGL),1) - $(error Cannot specify multiple graphics backends) - endif - ifeq ($(ENABLE_DX12),1) - $(error Cannot specify multiple graphics backends) - endif - endif - ifeq ($(ENABLE_DX12),1) - ifneq ($(TARGET_WINDOWS),1) - $(error The DirectX 12 backend is only supported on Windows) - endif - ifeq ($(ENABLE_OPENGL),1) - $(error Cannot specify multiple graphics backends) - endif - ifeq ($(ENABLE_DX11),1) - $(error Cannot specify multiple graphics backends) - endif - endif - endif -ifeq ($(COMPILER),gcc) - NON_MATCHING := 1 +ifeq ($(TARGET_WEB),0) + ifeq ($(HOST_OS),Windows) + WINDOWS_BUILD := 1 + endif endif -# Release +# MXE overrides + +ifeq ($(WINDOWS_BUILD),1) + ifeq ($(CROSS),i686-w64-mingw32.static-) + TARGET_ARCH = i386pe + TARGET_BITS = 32 + NO_BZERO_BCOPY := 1 + else ifeq ($(CROSS),x86_64-w64-mingw32.static-) + TARGET_ARCH = i386pe + TARGET_BITS = 64 + NO_BZERO_BCOPY := 1 + endif +endif + +ifneq ($(TARGET_BITS),0) + BITS := -m$(TARGET_BITS) +endif + +# Release (version) flag defs ifeq ($(VERSION),jp) VERSION_DEF := VERSION_JP - GRUCODE_DEF := F3D_OLD else ifeq ($(VERSION),us) VERSION_DEF := VERSION_US - GRUCODE_DEF := F3D_OLD else ifeq ($(VERSION),eu) VERSION_DEF := VERSION_EU - GRUCODE_DEF := F3D_NEW else ifeq ($(VERSION),sh) $(warning Building SH is experimental and is prone to breaking. Try at your own risk.) VERSION_DEF := VERSION_SH - GRUCODE_DEF := F3D_NEW # TODO: GET RID OF THIS!!! We should mandate assets for Shindou like EU but we dont have the addresses extracted yet so we'll just pretend you have everything extracted for now. - NOEXTRACT := 1 + NOEXTRACT := 1 else $(error unknown version "$(VERSION)") endif @@ -109,9 +137,19 @@ endif endif TARGET := sm64.$(VERSION) -VERSION_CFLAGS := -D$(VERSION_DEF) +VERSION_CFLAGS := -D$(VERSION_DEF) -D_LANGUAGE_C VERSION_ASFLAGS := --defsym $(VERSION_DEF)=1 +# Stuff for showing the git hash in the intro +# From https://stackoverflow.com/questions/44038428/include-git-commit-hash-and-or-branch-name-in-c-c-source +GIT_HASH=`git rev-parse --short HEAD` +COMPILE_TIME=`date -u +'%Y-%m-%d %H:%M:%S UTC'` +VERSION_CFLAGS += -DGIT_HASH="\"$(GIT_HASH)\"" -DCOMPILE_TIME="\"$(COMPILE_TIME)\"" + +ifeq ($(shell git rev-parse --abbrev-ref HEAD),nightly) + VERSION_CFLAGS += -DNIGHTLY +endif + # Microcode ifeq ($(GRUCODE),f3dex) # Fast3DEX @@ -120,13 +158,13 @@ ifeq ($(GRUCODE),f3dex) # Fast3DEX TARGET := $(TARGET).f3dex COMPARE := 0 else -ifeq ($(GRUCODE), f3dex2) # Fast3DEX2 +ifeq ($(GRUCODE),f3dex2) # Fast3DEX2 GRUCODE_DEF := F3DEX_GBI_2 GRUCODE_ASFLAGS := --defsym F3DEX_GBI_SHARED=1 TARGET := $(TARGET).f3dex2 COMPARE := 0 else -ifeq ($(GRUCODE), f3dex2e) # Fast3DEX2 Extended (for PC) +ifeq ($(GRUCODE),f3dex2e) # Fast3DEX2 Extended (PC default) GRUCODE_DEF := F3DEX_GBI_2E TARGET := $(TARGET).f3dex2e COMPARE := 0 @@ -151,10 +189,38 @@ endif GRUCODE_CFLAGS := -D$(GRUCODE_DEF) GRUCODE_ASFLAGS := $(GRUCODE_ASFLAGS) --defsym $(GRUCODE_DEF)=1 -ifeq ($(NON_MATCHING),1) - MATCH_CFLAGS := -DNON_MATCHING -DAVOID_UB - MATCH_ASFLAGS := --defsym AVOID_UB=1 - COMPARE := 0 +# Default build is for PC now +VERSION_CFLAGS := $(VERSION_CFLAGS) -DNON_MATCHING -DAVOID_UB + +ifeq ($(TARGET_RPI),1) # Define RPi to change SDL2 title & GLES2 hints + VERSION_CFLAGS += -DUSE_GLES +endif + +ifeq ($(OSX_BUILD),1) # Modify GFX & SDL2 for OSX GL + VERSION_CFLAGS += -DOSX_BUILD +endif + +VERSION_ASFLAGS := --defsym AVOID_UB=1 +COMPARE := 0 + +ifeq ($(TARGET_WEB),1) + VERSION_CFLAGS := $(VERSION_CFLAGS) -DTARGET_WEB -DUSE_GLES +endif + +# Check backends + +ifneq (,$(filter $(RENDER_API),D3D11 D3D12)) + ifneq ($(WINDOWS_BUILD),1) + $(error DirectX is only supported on Windows) + endif + ifneq ($(WINDOW_API),DXGI) + $(warning DirectX renderers require DXGI, forcing WINDOW_API value) + WINDOW_API := DXGI + endif +else + ifeq ($(WINDOW_API),DXGI) + $(error DXGI can only be used with DirectX renderers) + endif endif ################### Universal Dependencies ################### @@ -176,7 +242,7 @@ endif endif # Make tools if out of date -DUMMY != make -s -C tools >&2 || echo FAIL +DUMMY != make -C tools >&2 || echo FAIL ifeq ($(DUMMY),FAIL) $(error Failed to build tools) endif @@ -188,27 +254,38 @@ endif # BUILD_DIR is location where all build artifacts are placed BUILD_DIR_BASE := build -ifeq ($(TARGET_N64),1) - BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION) -else + ifeq ($(TARGET_WEB),1) BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)_web else BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)_pc endif + +ifeq ($(DEBUG),1) + BUILD_DIR := $(BUILD_DIR)_debug +endif + +ifeq ($(RMODERN),1) + BUILD_DIR := $(BUILD_DIR)_rmodern endif LIBULTRA := $(BUILD_DIR)/libultra.a + ifeq ($(TARGET_WEB),1) EXE := $(BUILD_DIR)/$(TARGET).html -else -ifeq ($(TARGET_WINDOWS),1) -EXE := $(BUILD_DIR)/$(TARGET).exe -else -EXE := $(BUILD_DIR)/$(TARGET) + else + ifeq ($(WINDOWS_BUILD),1) + EXE := $(BUILD_DIR)/$(TARGET).exe + + else # Linux builds/binary namer + ifeq ($(TARGET_RPI),1) + EXE := $(BUILD_DIR)/$(TARGET).arm + else + EXE := $(BUILD_DIR)/$(TARGET) + endif + endif endif -endif -ROM := $(BUILD_DIR)/$(TARGET).z64 + ELF := $(BUILD_DIR)/$(TARGET).elf LD_SCRIPT := sm64.ld MIO0_DIR := $(BUILD_DIR)/bin @@ -217,18 +294,20 @@ TEXTURE_DIR := textures ACTOR_DIR := actors LEVEL_DIRS := $(patsubst levels/%,%,$(dir $(wildcard levels/*/header.h))) -rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d)) -listsubdirs=$(shell find $(1) -type d) - # Directories containing source files -SRC_DIRS := src src/engine src/game src/audio src/menu src/buffers actors levels bin bin/$(VERSION) data assets -ASM_DIRS := lib -ifeq ($(TARGET_N64),1) - ASM_DIRS := asm $(ASM_DIRS) -else - SRC_DIRS := $(SRC_DIRS) $(call listsubdirs,src/common) $(call listsubdirs,src/util) $(call listsubdirs,src/pc) $(call listsubdirs,src/game/behaviors) - ASM_DIRS := + +# Hi, I'm a PC +SRC_DIRS := src src/engine src/game src/audio src/menu src/buffers actors levels bin data assets src/pc src/pc/gfx src/pc/audio src/pc/controller src/pc/fs src/pc/fs/packtypes +ASM_DIRS := + +ifeq ($(RMODERN),1) + SRC_DIRS += src/pc/rmodern src/pc/rmodern/render src/pc/rmodern/window endif + +ifeq ($(DISCORDRPC),1) + SRC_DIRS += src/pc/discord +endif + BIN_DIRS := bin bin/$(VERSION) ULTRA_SRC_DIRS := lib/src lib/src/math @@ -240,33 +319,48 @@ GODDARD_SRC_DIRS := src/goddard src/goddard/dynlists MIPSISET := -mips2 MIPSBIT := -32 -ifeq ($(COMPILER),gcc) - MIPSISET := -mips3 -endif - -ifeq ($(TARGET_N64),1) - -ifeq ($(VERSION),eu) - OPT_FLAGS := -O2 -else -ifeq ($(VERSION),sh) - OPT_FLAGS := -O2 -else +ifeq ($(DEBUG),1) OPT_FLAGS := -g -endif -endif - - # Use a default opt flag for gcc - ifeq ($(COMPILER),gcc) - OPT_FLAGS := -O2 - endif - else + OPT_FLAGS := -O2 +endif + +# Set BITS (32/64) to compile for +OPT_FLAGS += $(BITS) + ifeq ($(TARGET_WEB),1) OPT_FLAGS := -O2 -g4 --source-map-base http://localhost:8080/ -else - OPT_FLAGS := -O2 endif + +ifeq ($(TARGET_RPI),1) + machine = $(shell sh -c 'uname -m 2>/dev/null || echo unknown') +# Raspberry Pi B+, Zero, etc + ifneq (,$(findstring armv6l,$(machine))) + OPT_FLAGS := -march=armv6zk+fp -mfpu=vfp -Ofast + endif + +# Raspberry Pi 2 and 3 in ARM 32bit mode + ifneq (,$(findstring armv7l,$(machine))) + model = $(shell sh -c 'cat /sys/firmware/devicetree/base/model 2>/dev/null || echo unknown') + + ifneq (,$(findstring 3,$(model))) + OPT_FLAGS := -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -O3 + else + OPT_FLAGS := -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -O3 + endif + endif + +# RPi3 or RPi4, in ARM64 (aarch64) mode. NEEDS TESTING 32BIT. +# DO NOT pass -mfpu stuff here, thats for 32bit ARM only and will fail for 64bit ARM. + ifneq (,$(findstring aarch64,$(machine))) + model = $(shell sh -c 'cat /sys/firmware/devicetree/base/model 2>/dev/null || echo unknown') + ifneq (,$(findstring 3,$(model))) + OPT_FLAGS := -march=armv8-a+crc -mtune=cortex-a53 -O3 + else ifneq (,$(findstring 4,$(model))) + OPT_FLAGS := -march=armv8-a+crc+simd -mtune=cortex-a72 -O3 + endif + + endif endif # File dependencies and variables for specific files @@ -274,47 +368,30 @@ include Makefile.split # Source code files LEVEL_C_FILES := $(wildcard levels/*/leveldata.c) $(wildcard levels/*/script.c) $(wildcard levels/*/geo.c) - -ifeq ($(TARGET_N64),1) - C_FILES_ := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c)) $(LEVEL_C_FILES) - CXX_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp)) -else - C_FILES_ := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c)) $(LEVEL_C_FILES) - CXX_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp)) - #$(call rwildcard,src,*.cpp) -endif - -INC_C_FILES = $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.inc.c)); -C_FILES = $(filter-out $(INC_C_FILES), $(C_FILES_)) - +C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c)) $(LEVEL_C_FILES) +CXX_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp)) S_FILES := $(foreach dir,$(ASM_DIRS),$(wildcard $(dir)/*.s)) -ULTRA_C_FILES := $(foreach dir,$(ULTRA_SRC_DIRS),$(wildcard $(dir)/*.c)) GODDARD_C_FILES := $(foreach dir,$(GODDARD_SRC_DIRS),$(wildcard $(dir)/*.c)) -ifeq ($(TARGET_N64),1) - ULTRA_S_FILES := $(foreach dir,$(ULTRA_ASM_DIRS),$(wildcard $(dir)/*.s)) -endif + GENERATED_C_FILES := $(BUILD_DIR)/assets/mario_anim_data.c $(BUILD_DIR)/assets/demo_data.c \ $(addprefix $(BUILD_DIR)/bin/,$(addsuffix _skybox.c,$(notdir $(basename $(wildcard textures/skyboxes/*.png))))) -ifeq ($(TARGET_WINDOWS),0) - CXX_FILES := -endif +ULTRA_C_FILES := \ + alBnkfNew.c \ + guLookAtRef.c \ + guMtxF2L.c \ + guNormalize.c \ + guOrthoF.c \ + guPerspectiveF.c \ + guRotateF.c \ + guScaleF.c \ + guTranslateF.c \ + ldiv.c -ifneq ($(TARGET_N64),1) - ULTRA_C_FILES := \ - alBnkfNew.c \ - guLookAtRef.c \ - guMtxF2L.c \ - guNormalize.c \ - guOrthoF.c \ - guPerspectiveF.c \ - guRotateF.c \ - guScaleF.c \ - guTranslateF.c +C_FILES := $(filter-out src/game/main.c,$(C_FILES)) +ULTRA_C_FILES := $(addprefix lib/src/,$(ULTRA_C_FILES)) - C_FILES := $(filter-out src/game/main.c,$(C_FILES)) - ULTRA_C_FILES := $(addprefix lib/src/,$(ULTRA_C_FILES)) -endif +# "If we're not N64, use the above" ifeq ($(VERSION),sh) SOUND_BANK_FILES := $(wildcard sound/sound_banks/*.json) @@ -336,7 +413,6 @@ SOUND_SAMPLE_TABLES := $(foreach file,$(SOUND_SAMPLE_AIFFS),$(BUILD_DIR)/$(file: SOUND_SAMPLE_AIFCS := $(foreach file,$(SOUND_SAMPLE_AIFFS),$(BUILD_DIR)/$(file:.aiff=.aifc)) SOUND_OBJ_FILES := $(SOUND_BIN_DIR)/sound_data.o - # Object files O_FILES := $(foreach file,$(C_FILES),$(BUILD_DIR)/$(file:.c=.o)) \ $(foreach file,$(CXX_FILES),$(BUILD_DIR)/$(file:.cpp=.o)) \ @@ -348,16 +424,21 @@ ULTRA_O_FILES := $(foreach file,$(ULTRA_S_FILES),$(BUILD_DIR)/$(file:.s=.o)) \ GODDARD_O_FILES := $(foreach file,$(GODDARD_C_FILES),$(BUILD_DIR)/$(file:.c=.o)) +RPC_LIBS := +ifeq ($(DISCORDRPC),1) + ifeq ($(WINDOWS_BUILD),1) + RPC_LIBS := lib/discord/libdiscord-rpc.dll + else ifeq ($(OSX_BUILD),1) + # needs testing + RPC_LIBS := lib/discord/libdiscord-rpc.dylib + else + RPC_LIBS := lib/discord/libdiscord-rpc.so + endif +endif + # Automatic dependency files DEP_FILES := $(O_FILES:.o=.d) $(ULTRA_O_FILES:.o=.d) $(GODDARD_O_FILES:.o=.d) $(BUILD_DIR)/$(LD_SCRIPT).d -# Files with GLOBAL_ASM blocks -ifeq ($(NON_MATCHING),0) -GLOBAL_ASM_C_FILES != grep -rl 'GLOBAL_ASM(' $(wildcard src/**/*.c) -GLOBAL_ASM_O_FILES = $(foreach file,$(GLOBAL_ASM_C_FILES),$(BUILD_DIR)/$(file:.c=.o)) -GLOBAL_ASM_DEP = $(BUILD_DIR)/src/audio/non_matching_dep -endif - # Segment elf files SEG_FILES := $(SEGMENT_ELF_FILES) $(ACTOR_ELF_FILES) $(LEVEL_ELF_FILES) @@ -365,156 +446,220 @@ SEG_FILES := $(SEGMENT_ELF_FILES) $(ACTOR_ELF_FILES) $(LEVEL_ELF_FILES) INCLUDE_CFLAGS := -I include -I $(BUILD_DIR) -I $(BUILD_DIR)/include -I src -I . ENDIAN_BITWIDTH := $(BUILD_DIR)/endian-and-bitwidth -ifeq ($(TARGET_N64),1) -IRIX_ROOT := tools/ido5.3_compiler +# Huge deleted N64 section was here -ifeq ($(shell type mips-linux-gnu-ld >/dev/null 2>/dev/null; echo $$?), 0) - CROSS := mips-linux-gnu- -else ifeq ($(shell type mips64-linux-gnu-ld >/dev/null 2>/dev/null; echo $$?), 0) - CROSS := mips64-linux-gnu- -else - CROSS := mips64-elf- +AS := $(CROSS)as + +ifeq ($(OSX_BUILD),1) +AS := i686-w64-mingw32-as endif -# check that either QEMU_IRIX is set or qemu-irix package installed -ifeq ($(COMPILER),ido) - ifndef QEMU_IRIX - QEMU_IRIX := $(shell which qemu-irix 2>/dev/null) - ifeq (, $(QEMU_IRIX)) - $(error Please install qemu-irix package or set QEMU_IRIX env var to the full qemu-irix binary path) - endif +ifneq ($(TARGET_WEB),1) # As in, not-web PC port + CC ?= $(CROSS)gcc + CXX ?= $(CROSS)g++ +else + CC := emcc + CXX := emcc +endif + +LD := $(CC) + +ifeq ($(DISCORDRPC),1) + LD := $(CXX) +else ifeq ($(WINDOWS_BUILD),1) + ifeq ($(CROSS),i686-w64-mingw32.static-) # fixes compilation in MXE on Linux and WSL + LD := $(CC) + else ifeq ($(CROSS),x86_64-w64-mingw32.static-) + LD := $(CC) + else + LD := $(CXX) endif endif -AS := $(CROSS)as -CPP := cpp -P -Wno-trigraphs -CC := $(CPP) -# $(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/bin/cc -LD := $(CROSS)ld -AR := $(CROSS)ar -OBJDUMP := $(CROSS)objdump -OBJCOPY := $(CROSS)objcopy -PYTHON := python3 - -# change the compiler to gcc, to use the default, install the gcc-mips-linux-gnu package -ifeq ($(COMPILER),gcc) - CC := $(CROSS)gcc +ifeq ($(WINDOWS_BUILD),1) # fixes compilation in MXE on Linux and WSL + CPP := cpp -P + OBJCOPY := objcopy + OBJDUMP := $(CROSS)objdump +else ifeq ($(OSX_BUILD),1) + CPP := cpp-9 -P + OBJDUMP := i686-w64-mingw32-objdump + OBJCOPY := i686-w64-mingw32-objcopy +else # Linux & other builds + CPP := $(CROSS)cpp -P + OBJCOPY := $(CROSS)objcopy + OBJDUMP := $(CROSS)objdump endif -ifeq ($(TARGET_N64),1) - TARGET_CFLAGS := -nostdinc -I include/libc -DTARGET_N64 -D_LANGUAGE_C - CC_CFLAGS := -fno-builtin +PYTHON := python3 +SDLCONFIG := $(CROSS)sdl2-config + +# configure backend flags + +BACKEND_CFLAGS := -DRAPI_$(RENDER_API)=1 -DWAPI_$(WINDOW_API)=1 -DAAPI_$(AUDIO_API)=1 + +# rmodern +ifeq ($(RMODERN),1) + BACKEND_CFLAGS += -DRMODERN endif -INCLUDE_CFLAGS := -I include -I $(BUILD_DIR) -I $(BUILD_DIR)/include -I src -I . +# can have multiple controller APIs +BACKEND_CFLAGS += $(foreach capi,$(CONTROLLER_API),-DCAPI_$(capi)=1) +BACKEND_LDFLAGS := +SDL2_USED := 0 -# Check code syntax with host compiler -CC_CHECK := gcc -CC_CHECK_CFLAGS := -fsyntax-only -fsigned-char $(CC_CFLAGS) $(TARGET_CFLAGS) $(INCLUDE_CFLAGS) -std=gnu90 -Wall -Wextra -Wno-format-security -Wno-main -DNON_MATCHING -DAVOID_UB $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) - -COMMON_CFLAGS = $(OPT_FLAGS) $(TARGET_CFLAGS) $(INCLUDE_CFLAGS) $(VERSION_CFLAGS) $(MATCH_CFLAGS) $(MIPSISET) $(GRUCODE_CFLAGS) - -ASFLAGS := -march=vr4300 -mabi=32 -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS) $(MATCH_ASFLAGS) $(GRUCODE_ASFLAGS) -CFLAGS = -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm -Xfullwarn -signed $(COMMON_CFLAGS) $(MIPSBIT) -OBJCOPYFLAGS := --pad-to=0x800000 --gap-fill=0xFF -SYMBOL_LINKING_FLAGS := $(addprefix -R ,$(SEG_FILES)) -LDFLAGS := -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(SYMBOL_LINKING_FLAGS) -ENDIAN_BITWIDTH := $(BUILD_DIR)/endian-and-bitwidth - -ifeq ($(COMPILER),gcc) - CFLAGS := -march=vr4300 -mfix4300 -mabi=32 -mno-shared -G 0 -mhard-float -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -I include -I src/ -I $(BUILD_DIR)/include -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra $(COMMON_CFLAGS) +# for now, it's either SDL+GL or DXGI+DirectX, so choose based on WAPI +ifeq ($(WINDOW_API),DXGI) + DXBITS := `cat $(ENDIAN_BITWIDTH) | tr ' ' '\n' | tail -1` + ifeq ($(RENDER_API),D3D12) + BACKEND_CFLAGS += -Iinclude/dxsdk + endif + BACKEND_LDFLAGS += -ld3dcompiler -ldxgi -ldxguid + BACKEND_LDFLAGS += -lsetupapi -ldinput8 -luser32 -lgdi32 -limm32 -lole32 -loleaut32 -lshell32 -lwinmm -lversion -luuid -static +else ifeq ($(WINDOW_API),SDL2) + ifeq ($(WINDOWS_BUILD),1) + BACKEND_LDFLAGS += -lglew32 -lglu32 -lopengl32 + else ifeq ($(TARGET_RPI),1) + BACKEND_LDFLAGS += -lGLESv2 + else ifeq ($(OSX_BUILD),1) + BACKEND_LDFLAGS += -framework OpenGL `pkg-config --libs glew` + else + BACKEND_LDFLAGS += -lGL + endif + SDL_USED := 2 endif -ifeq ($(shell getconf LONG_BIT), 32) - # Work around memory allocation bug in QEMU - export QEMU_GUEST_BASE := 1 +ifeq ($(AUDIO_API),SDL2) + SDL_USED := 2 +endif + +ifneq (,$(findstring SDL,$(CONTROLLER_API))) + SDL_USED := 2 +endif + +# SDL can be used by different systems, so we consolidate all of that shit into this +ifeq ($(SDL_USED),2) + BACKEND_CFLAGS += -DHAVE_SDL2=1 `$(SDLCONFIG) --cflags` + ifeq ($(WINDOWS_BUILD),1) + BACKEND_LDFLAGS += `$(SDLCONFIG) --static-libs` -lsetupapi -luser32 -limm32 -lole32 -loleaut32 -lshell32 -lwinmm -lversion + else + BACKEND_LDFLAGS += `$(SDLCONFIG) --libs` + endif +endif + +ifeq ($(WINDOWS_BUILD),1) + CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(BACKEND_CFLAGS) $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) + CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(BACKEND_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv + +else ifeq ($(TARGET_WEB),1) + CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(BACKEND_CFLAGS) $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -s USE_SDL=2 + CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(BACKEND_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv -s USE_SDL=2 + +# Linux / Other builds below else - # Ensure that gcc treats the code as 32-bit - CC_CHECK_CFLAGS += -m32 + CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(BACKEND_CFLAGS) $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) + CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(BACKEND_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv + endif +# Check for enhancement options + +# Check for Puppycam option +ifeq ($(BETTERCAMERA),1) + CC_CHECK += -DBETTERCAMERA + CFLAGS += -DBETTERCAMERA + EXT_OPTIONS_MENU := 1 +endif + +ifeq ($(TEXTSAVES),1) + CC_CHECK += -DTEXTSAVES + CFLAGS += -DTEXTSAVES +endif + +# Check for no drawing distance option +ifeq ($(NODRAWINGDISTANCE),1) + CC_CHECK += -DNODRAWINGDISTANCE + CFLAGS += -DNODRAWINGDISTANCE +endif + +# Check for Discord Rich Presence option +ifeq ($(DISCORDRPC),1) + CC_CHECK += -DDISCORDRPC + CFLAGS += -DDISCORDRPC +endif + +# Check for texture fix option +ifeq ($(TEXTURE_FIX),1) + CC_CHECK += -DTEXTURE_FIX + CFLAGS += -DTEXTURE_FIX +endif + +# Check for extended options menu option +ifeq ($(EXT_OPTIONS_MENU),1) + CC_CHECK += -DEXT_OPTIONS_MENU + CFLAGS += -DEXT_OPTIONS_MENU +endif + +# Check for no bzero/bcopy workaround option +ifeq ($(NO_BZERO_BCOPY),1) + CC_CHECK += -DNO_BZERO_BCOPY + CFLAGS += -DNO_BZERO_BCOPY +endif + +# Use internal ldiv()/lldiv() +ifeq ($(NO_LDIV),1) + CC_CHECK += -DNO_LDIV + CFLAGS += -DNO_LDIV +endif + +# Use OpenGL 1.3 +ifeq ($(LEGACY_GL),1) + CC_CHECK += -DLEGACY_GL + CFLAGS += -DLEGACY_GL +endif + +# Load external textures +ifeq ($(EXTERNAL_DATA),1) + CC_CHECK += -DEXTERNAL_DATA -DFS_BASEDIR="\"$(BASEDIR)\"" + CFLAGS += -DEXTERNAL_DATA -DFS_BASEDIR="\"$(BASEDIR)\"" + # tell skyconv to write names instead of actual texture data and save the split tiles so we can use them later + SKYTILE_DIR := $(BUILD_DIR)/textures/skybox_tiles + SKYCONV_ARGS := --store-names --write-tiles "$(SKYTILE_DIR)" +endif + +ASFLAGS := -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS) + +ifeq ($(TARGET_WEB),1) +LDFLAGS := -lm -lGL -lSDL2 -no-pie -s TOTAL_MEMORY=20MB -g4 --source-map-base http://localhost:8080/ -s "EXTRA_EXPORTED_RUNTIME_METHODS=['callMain']" + +else ifeq ($(WINDOWS_BUILD),1) + LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -Llib -lpthread $(BACKEND_LDFLAGS) -static + ifeq ($(CROSS),) + LDFLAGS += -no-pie + endif + ifeq ($(WINDOWS_CONSOLE),1) + LDFLAGS += -mconsole + endif + +else ifeq ($(TARGET_RPI),1) + LDFLAGS := $(OPT_FLAGS) -lm $(BACKEND_LDFLAGS) -no-pie + +else ifeq ($(OSX_BUILD),1) + LDFLAGS := -lm $(BACKEND_LDFLAGS) -no-pie -lpthread + +else + LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -lm $(BACKEND_LDFLAGS) -no-pie -lpthread + ifeq ($(DISCORDRPC),1) + LDFLAGS += -ldl -Wl,-rpath . + endif + +endif # End of LDFLAGS + # Prevent a crash with -sopt export LANG := C -else # TARGET_N64 - -AS := as -ifneq ($(TARGET_WEB),1) - CC := g++ - CXX := g++ -else - CC := emcc -endif -ifeq ($(TARGET_WINDOWS),1) - LD := $(CXX) -else - LD := $(CC) -endif -CPP := cpp -P -OBJDUMP := objdump -OBJCOPY := objcopy -PYTHON := python3 - -# Platform-specific compiler and linker flags -ifeq ($(TARGET_WINDOWS),1) - PLATFORM_CFLAGS := -DTARGET_WINDOWS - PLATFORM_LDFLAGS := -lm -lxinput9_1_0 -lole32 -no-pie -mwindows -endif -ifeq ($(TARGET_LINUX),1) - PLATFORM_CFLAGS := -DTARGET_LINUX `pkg-config --cflags libusb-1.0` - PLATFORM_LDFLAGS := -lm -lpthread `pkg-config --libs libusb-1.0` -lasound -lpulse -no-pie -endif -ifeq ($(TARGET_WEB),1) - PLATFORM_CFLAGS := -DTARGET_WEB - PLATFORM_LDFLAGS := -lm -no-pie -s TOTAL_MEMORY=20MB -g4 --source-map-base http://localhost:8080/ -s "EXTRA_EXPORTED_RUNTIME_METHODS=['callMain']" -endif - -PLATFORM_CFLAGS += -DNO_SEGMENTED_MEMORY - -# Compiler and linker flags for graphics backend -ifeq ($(ENABLE_OPENGL),1) - GFX_CFLAGS := -DENABLE_OPENGL - GFX_LDFLAGS := - ifeq ($(TARGET_WINDOWS),1) - GFX_CFLAGS += $(shell sdl2-config --cflags) -DGLEW_STATIC - GFX_LDFLAGS += $(shell sdl2-config --libs) -lglew32 -lopengl32 -lwinmm -limm32 -lversion -loleaut32 -lsetupapi - endif - ifeq ($(TARGET_LINUX),1) - GFX_CFLAGS += $(shell sdl2-config --cflags) - GFX_LDFLAGS += -lGL $(shell sdl2-config --libs) -lX11 -lXrandr - endif - ifeq ($(TARGET_WEB),1) - GFX_CFLAGS += -s USE_SDL=2 - GFX_LDFLAGS += -lGL -lSDL2 - endif -endif -ifeq ($(ENABLE_DX11),1) - GFX_CFLAGS := -DENABLE_DX11 - PLATFORM_LDFLAGS += -lgdi32 -static -endif -ifeq ($(ENABLE_DX12),1) - GFX_CFLAGS := -DENABLE_DX12 - PLATFORM_LDFLAGS += -lgdi32 -static -endif - -GFX_CFLAGS += -DWIDESCREEN - -CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security -D_LANGUAGE_C_PLUS_PLUS $(VERSION_CFLAGS) $(MATCH_CFLAGS) $(PLATFORM_CFLAGS) $(GFX_CFLAGS) $(GRUCODE_CFLAGS) -CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) -D_LANGUAGE_C_PLUS_PLUS $(VERSION_CFLAGS) $(MATCH_CFLAGS) $(PLATFORM_CFLAGS) $(GFX_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv -march=native - -CFLAGS += -Wno-narrowing -O0 -CC_CHECK += -Wno-narrowing -O0 - -ASFLAGS := -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS) - -LDFLAGS := $(PLATFORM_LDFLAGS) $(GFX_LDFLAGS) -LDFLAGS += -Wno-narrowing - -endif - ####################### Other Tools ######################### -# N64 tools +# N64 conversion tools TOOLS_DIR = tools MIO0TOOL = $(TOOLS_DIR)/mio0 N64CKSUM = $(TOOLS_DIR)/n64cksum @@ -530,32 +675,59 @@ EMU_FLAGS = --noosd LOADER = loader64 LOADER_FLAGS = -vwf SHA1SUM = sha1sum +ZEROTERM = $(PYTHON) $(TOOLS_DIR)/zeroterm.py -ifeq (, $(shell which armips 2>/dev/null)) - RSPASM := $(TOOLS_DIR)/armips -else - RSPASM = armips -endif +###################### Dependency Check ##################### -# Use Objcopy instead of extract_data_for_mio -ifeq ($(COMPILER),gcc) -EXTRACT_DATA_FOR_MIO := $(OBJCOPY) -O binary --only-section=.data -endif +# Stubbed ######################## Targets ############################# -ifeq ($(TARGET_N64),1) -all: $(ROM) -ifeq ($(COMPARE),1) - @$(SHA1SUM) -c $(TARGET).sha1 || (echo 'The build succeeded, but did not match the official ROM. This is expected if you are making changes to the game.\nTo silence this message, use "make COMPARE=0"'. && false) -endif -else all: $(EXE) + +# thank you apple very cool +ifeq ($(HOST_OS),Darwin) + CP := gcp +else + CP := cp +endif + +ifeq ($(EXTERNAL_DATA),1) + +BASEPACK_PATH := $(BUILD_DIR)/$(BASEDIR)/ +BASEPACK_LST := $(BUILD_DIR)/basepack.lst + +# depend on resources as well +all: $(BASEPACK_PATH) + +# phony target for building resources +res: $(BASEPACK_PATH) + +# prepares the basepack.lst +$(BASEPACK_LST): $(EXE) + @mkdir -p $(BUILD_DIR)/$(BASEDIR) + @echo -n > $(BASEPACK_LST) + @echo "$(BUILD_DIR)/sound/bank_sets sound/bank_sets" >> $(BASEPACK_LST) + @echo "$(BUILD_DIR)/sound/sequences.bin sound/sequences.bin" >> $(BASEPACK_LST) + @echo "$(BUILD_DIR)/sound/sound_data.ctl sound/sound_data.ctl" >> $(BASEPACK_LST) + @echo "$(BUILD_DIR)/sound/sound_data.tbl sound/sound_data.tbl" >> $(BASEPACK_LST) + @$(foreach f, $(wildcard $(SKYTILE_DIR)/*), echo $(f) gfx/$(f:$(BUILD_DIR)/%=%) >> $(BASEPACK_LST);) + @find actors -name \*.png -exec echo "{} gfx/{}" >> $(BASEPACK_LST) \; + @find levels -name \*.png -exec echo "{} gfx/{}" >> $(BASEPACK_LST) \; + @find textures -name \*.png -exec echo "{} gfx/{}" >> $(BASEPACK_LST) \; + +# prepares the resource ZIP with base data +$(BASEPACK_PATH): $(BASEPACK_LST) + @$(PYTHON) $(TOOLS_DIR)/mkzip.py $(BASEPACK_LST) $(BASEPACK_PATH) $(LEGACY_RES) + endif clean: $(RM) -r $(BUILD_DIR_BASE) +cleantools: + $(MAKE) -s -C tools clean + distclean: $(RM) -r $(BUILD_DIR_BASE) ./extract_assets.py --clean @@ -566,6 +738,9 @@ test: $(ROM) load: $(ROM) $(LOADER) $(LOADER_FLAGS) $< +$(BUILD_DIR)/$(RPC_LIBS): + @$(CP) -f $(RPC_LIBS) $(BUILD_DIR) + libultra: $(BUILD_DIR)/libultra.a $(BUILD_DIR)/asm/boot.o: $(IPL3_RAW_FILES) @@ -573,15 +748,17 @@ $(BUILD_DIR)/src/game/crash_screen.o: $(CRASH_TEXTURE_C_FILES) $(BUILD_DIR)/lib/rsp.o: $(BUILD_DIR)/rsp/rspboot.bin $(BUILD_DIR)/rsp/fast3d.bin $(BUILD_DIR)/rsp/audio.bin +#Required so the compiler doesn't complain about this not existing. +$(BUILD_DIR)/src/game/camera.o: $(BUILD_DIR)/include/text_strings.h + $(BUILD_DIR)/include/text_strings.h: include/text_strings.h.in $(TEXTCONV) charmap.txt $< $@ $(BUILD_DIR)/include/text_menu_strings.h: include/text_menu_strings.h.in $(TEXTCONV) charmap_menu.txt $< $@ -ifeq ($(COMPILER),gcc) -$(BUILD_DIR)/lib/src/math/%.o: CFLAGS += -fno-builtin -endif +$(BUILD_DIR)/include/text_options_strings.h: include/text_options_strings.h.in + $(TEXTCONV) charmap.txt $< $@ ifeq ($(VERSION),eu) TEXT_DIRS := text/de text/us text/fr @@ -621,22 +798,51 @@ ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(ASM_DIRS) $(GOD DUMMY != mkdir -p $(ALL_DIRS) $(BUILD_DIR)/include/text_strings.h: $(BUILD_DIR)/include/text_menu_strings.h +$(BUILD_DIR)/include/text_strings.h: $(BUILD_DIR)/include/text_options_strings.h + +ifeq ($(VERSION),eu) +$(BUILD_DIR)/src/menu/file_select.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/bin/eu/translation_en.o $(BUILD_DIR)/bin/eu/translation_de.o $(BUILD_DIR)/bin/eu/translation_fr.o +$(BUILD_DIR)/src/menu/star_select.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/bin/eu/translation_en.o $(BUILD_DIR)/bin/eu/translation_de.o $(BUILD_DIR)/bin/eu/translation_fr.o +$(BUILD_DIR)/src/game/ingame_menu.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/bin/eu/translation_en.o $(BUILD_DIR)/bin/eu/translation_de.o $(BUILD_DIR)/bin/eu/translation_fr.o +$(BUILD_DIR)/src/game/options_menu.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/bin/eu/translation_en.o $(BUILD_DIR)/bin/eu/translation_de.o $(BUILD_DIR)/bin/eu/translation_fr.o +O_FILES += $(BUILD_DIR)/bin/eu/translation_en.o $(BUILD_DIR)/bin/eu/translation_de.o $(BUILD_DIR)/bin/eu/translation_fr.o +ifeq ($(DISCORDRPC),1) + $(BUILD_DIR)/src/pc/discord/discordrpc.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/bin/eu/translation_en.o $(BUILD_DIR)/bin/eu/translation_de.o $(BUILD_DIR)/bin/eu/translation_fr.o +endif +else $(BUILD_DIR)/src/menu/file_select.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/src/menu/star_select.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/src/game/ingame_menu.o: $(BUILD_DIR)/include/text_strings.h +$(BUILD_DIR)/src/game/options_menu.o: $(BUILD_DIR)/include/text_strings.h +ifeq ($(DISCORDRPC),1) + $(BUILD_DIR)/src/pc/discord/discordrpc.o: $(BUILD_DIR)/include/text_strings.h +endif +endif ################################################################ # TEXTURE GENERATION # ################################################################ # RGBA32, RGBA16, IA16, IA8, IA4, IA1, I8, I4 + +ifeq ($(EXTERNAL_DATA),1) + +$(BUILD_DIR)/%: %.png + $(ZEROTERM) "$(patsubst %.png,%,$^)" > $@ + +else + $(BUILD_DIR)/%: %.png $(N64GRAPHICS) -i $@ -g $< -f $(lastword $(subst ., ,$@)) +endif + $(BUILD_DIR)/%.inc.c: $(BUILD_DIR)/% %.png hexdump -v -e '1/1 "0x%X,"' $< > $@ echo >> $@ +ifeq ($(EXTERNAL_DATA),0) + # Color Index CI8 $(BUILD_DIR)/%.ci8: %.ci8.png $(N64GRAPHICS_CI) -i $@ -g $< -f ci8 @@ -645,42 +851,13 @@ $(BUILD_DIR)/%.ci8: %.ci8.png $(BUILD_DIR)/%.ci4: %.ci4.png $(N64GRAPHICS_CI) -i $@ -g $< -f ci4 +endif + ################################################################ # compressed segment generation -ifeq ($(TARGET_N64),1) -# TODO: ideally this would be `-Trodata-segment=0x07000000` but that doesn't set the address - -$(BUILD_DIR)/bin/%.elf: $(BUILD_DIR)/bin/%.o - $(LD) -e 0 -Ttext=$(SEGMENT_ADDRESS) -Map $@.map -o $@ $< -$(BUILD_DIR)/actors/%.elf: $(BUILD_DIR)/actors/%.o - $(LD) -e 0 -Ttext=$(SEGMENT_ADDRESS) -Map $@.map -o $@ $< - -# Override for level.elf, which otherwise matches the above pattern -.SECONDEXPANSION: -$(BUILD_DIR)/levels/%/leveldata.elf: $(BUILD_DIR)/levels/%/leveldata.o $(BUILD_DIR)/bin/$$(TEXTURE_BIN).elf - $(LD) -e 0 -Ttext=$(SEGMENT_ADDRESS) -Map $@.map --just-symbols=$(BUILD_DIR)/bin/$(TEXTURE_BIN).elf -o $@ $< - -$(BUILD_DIR)/bin/%.bin: $(BUILD_DIR)/bin/%.elf - $(EXTRACT_DATA_FOR_MIO) $< $@ - -$(BUILD_DIR)/actors/%.bin: $(BUILD_DIR)/actors/%.elf - $(EXTRACT_DATA_FOR_MIO) $< $@ - -$(BUILD_DIR)/levels/%/leveldata.bin: $(BUILD_DIR)/levels/%/leveldata.elf - $(EXTRACT_DATA_FOR_MIO) $< $@ - -$(BUILD_DIR)/%.mio0: $(BUILD_DIR)/%.bin - $(MIO0TOOL) $< $@ - -$(BUILD_DIR)/%.mio0.o: $(BUILD_DIR)/%.mio0.s - $(AS) $(ASFLAGS) -o $@ $< - -$(BUILD_DIR)/%.mio0.s: $(BUILD_DIR)/%.mio0 - printf ".section .data\n\n.incbin \"$<\"\n" > $@ -endif - +# PC Area $(BUILD_DIR)/%.table: %.aiff $(AIFF_EXTRACT_CODEBOOK) $< >$@ @@ -720,10 +897,19 @@ $(SOUND_BIN_DIR)/%.m64: $(SOUND_BIN_DIR)/%.o $(SOUND_BIN_DIR)/%.o: $(SOUND_BIN_DIR)/%.s $(AS) $(ASFLAGS) -o $@ $< +ifeq ($(EXTERNAL_DATA),1) + +$(SOUND_BIN_DIR)/%.inc.c: $(SOUND_BIN_DIR)/% + $(ZEROTERM) "$(patsubst $(BUILD_DIR)/%,%,$^)" | hexdump -v -e '1/1 "0x%X,"' > $@ + +else + $(SOUND_BIN_DIR)/%.inc.c: $(SOUND_BIN_DIR)/% hexdump -v -e '1/1 "0x%X,"' $< > $@ echo >> $@ +endif + $(SOUND_BIN_DIR)/sound_data.o: $(SOUND_BIN_DIR)/sound_data.ctl.inc.c $(SOUND_BIN_DIR)/sound_data.tbl.inc.c $(SOUND_BIN_DIR)/sequences.bin.inc.c $(SOUND_BIN_DIR)/bank_sets.inc.c $(BUILD_DIR)/levels/scripts.o: $(BUILD_DIR)/include/level_headers.h @@ -737,7 +923,6 @@ $(BUILD_DIR)/assets/mario_anim_data.c: $(wildcard assets/anims/*.inc.c) $(BUILD_DIR)/assets/demo_data.c: assets/demo_data.json $(wildcard assets/demos/*.bin) $(PYTHON) tools/demo_data_converter.py assets/demo_data.json $(VERSION_CFLAGS) > $@ -ifeq ($(COMPILER),ido) # Source code $(BUILD_DIR)/levels/%/leveldata.o: OPT_FLAGS := -g $(BUILD_DIR)/actors/%.o: OPT_FLAGS := -g @@ -785,11 +970,6 @@ $(BUILD_DIR)/src/audio/%.copt: $(BUILD_DIR)/src/audio/%.acpp $(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/lib/copt -signed -I=$< -CMP=$@ -cp=i -scalaroptimize=1 endif -endif - -ifeq ($(NON_MATCHING),0) -$(GLOBAL_ASM_O_FILES): CC := $(PYTHON) tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) -- -endif # Rebuild files with 'GLOBAL_ASM' if the NON_MATCHING flag changes. $(GLOBAL_ASM_O_FILES): $(GLOBAL_ASM_DEP).$(NON_MATCHING) @@ -804,53 +984,27 @@ $(BUILD_DIR)/%.o: %.cpp $(BUILD_DIR)/%.o: %.c @$(CC_CHECK) $(CC_CHECK_CFLAGS) -MMD -MP -MT $@ -MF $(BUILD_DIR)/$*.d $< $(CC) -c $(CFLAGS) -o $@ $< - + + $(BUILD_DIR)/%.o: $(BUILD_DIR)/%.c @$(CC_CHECK) $(CC_CHECK_CFLAGS) -MMD -MP -MT $@ -MF $(BUILD_DIR)/$*.d $< $(CC) -c $(CFLAGS) -o $@ $< -$(BUILD_DIR)/%.o: $(BUILD_DIR)/%.cpp - @$(CXX) -fsyntax-only $(CFLAGS) -MMD -MP -MT $@ -MF $(BUILD_DIR)/$*.d $< - $(CXX) -c $(CFLAGS) -o $@ $< - $(BUILD_DIR)/%.o: %.s $(AS) $(ASFLAGS) -MD $(BUILD_DIR)/$*.d -o $@ $< -ifeq ($(TARGET_N64),1) -$(BUILD_DIR)/$(LD_SCRIPT): $(LD_SCRIPT) - $(CPP) $(VERSION_CFLAGS) -MMD -MP -MT $@ -MF $@.d -I include/ -I . -DBUILD_DIR=$(BUILD_DIR) -o $@ $< -$(BUILD_DIR)/libultra.a: $(ULTRA_O_FILES) - $(AR) rcs -o $@ $(ULTRA_O_FILES) - tools/patch_libultra_math $@ -$(BUILD_DIR)/libgoddard.a: $(GODDARD_O_FILES) - $(AR) rcs -o $@ $(GODDARD_O_FILES) - -$(ELF): $(O_FILES) $(MIO0_OBJ_FILES) $(SOUND_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/$(LD_SCRIPT) undefined_syms.txt $(BUILD_DIR)/libultra.a $(BUILD_DIR)/libgoddard.a - $(LD) -L $(BUILD_DIR) $(LDFLAGS) -o $@ $(O_FILES)$(LIBS) -lultra -lgoddard - -$(ROM): $(ELF) - $(OBJCOPY) $(OBJCOPYFLAGS) $< $(@:.z64=.bin) -O binary - $(N64CKSUM) $(@:.z64=.bin) $@ - -$(BUILD_DIR)/$(TARGET).objdump: $(ELF) - $(OBJDUMP) -D $< > $@ - -else -$(EXE): $(O_FILES) $(MIO0_FILES:.mio0=.o) $(SOUND_OBJ_FILES) $(ULTRA_O_FILES) $(GODDARD_O_FILES) +$(EXE): $(O_FILES) $(MIO0_FILES:.mio0=.o) $(SOUND_OBJ_FILES) $(ULTRA_O_FILES) $(GODDARD_O_FILES) $(BUILD_DIR)/$(RPC_LIBS) $(LD) -L $(BUILD_DIR) -o $@ $(O_FILES) $(SOUND_OBJ_FILES) $(ULTRA_O_FILES) $(GODDARD_O_FILES) $(LDFLAGS) -endif - - -.PHONY: all clean distclean default diff test load libultra -# with no prerequisites, .SECONDARY causes no intermediate target to be removed -.SECONDARY: +.PHONY: all clean distclean default diff test load libultra res +.PRECIOUS: $(BUILD_DIR)/bin/%.elf $(SOUND_BIN_DIR)/%.ctl $(SOUND_BIN_DIR)/%.tbl $(SOUND_SAMPLE_TABLES) $(SOUND_BIN_DIR)/%.s $(BUILD_DIR)/% +.DELETE_ON_ERROR: # Remove built-in rules, to improve performance MAKEFLAGS += --no-builtin-rules -include $(DEP_FILES) -print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true +print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true \ No newline at end of file diff --git a/Makefile.split b/Makefile.split index 0b756529..609222f0 100644 --- a/Makefile.split +++ b/Makefile.split @@ -5,7 +5,7 @@ # obtain a list of segments from the *.c files in bin directory SEGMENTS := $(notdir $(basename $(wildcard bin/*.c))) $(addprefix $(VERSION)/,$(notdir $(basename $(wildcard bin/$(VERSION)/*.c)))) $(addsuffix _skybox,$(notdir $(basename $(wildcard textures/skyboxes/*.png)))) ACTORS := $(filter %/,$(wildcard actors/*/)) -TEXTURE_DIRS := $(addprefix textures/,$(SEGMENTS)) $(ACTORS) textures/crash_screen textures/intro_raw textures/ipl3_raw +TEXTURE_DIRS := $(addprefix textures/,$(SEGMENTS)) $(ACTORS) textures/crash_screen textures/intro_raw textures/ipl3_raw textures/skybox_tiles # NOTE: textures assume naming convention "texture..png" generates "texture." @@ -165,9 +165,9 @@ $(eval $(call level_rules,menu,generic)) # Menu (File Select) # Ending cake textures are generated in a special way $(BUILD_DIR)/levels/ending/cake_eu.inc.c: levels/ending/cake_eu.png - $(SKYCONV) --type cake-eu --split $^ $(BUILD_DIR)/levels/ending + $(SKYCONV) $(SKYCONV_ARGS) --type cake-eu --split $^ $(BUILD_DIR)/levels/ending $(BUILD_DIR)/levels/ending/cake.inc.c: levels/ending/cake.png - $(SKYCONV) --type cake --split $^ $(BUILD_DIR)/levels/ending + $(SKYCONV) $(SKYCONV_ARGS) --type cake --split $^ $(BUILD_DIR)/levels/ending # -------------------------------------- # Texture Bin Rules @@ -235,7 +235,7 @@ $(BUILD_DIR)/bin/eu/translation_fr.elf: SEGMENT_ADDRESS := 0x19000000 # -------------------------------------- $(BUILD_DIR)/bin/%_skybox.c: textures/skyboxes/%.png - $(SKYCONV) --type sky --split $^ $(BUILD_DIR)/bin + $(SKYCONV) $(SKYCONV_ARGS) --type sky --split $^ $(BUILD_DIR)/bin $(BUILD_DIR)/bin/%_skybox.elf: SEGMENT_ADDRESS := 0x0A000000 diff --git a/README.md b/README.md index f8111aa8..c4814182 100644 --- a/README.md +++ b/README.md @@ -1,90 +1,6 @@ -# Super Mario 64 Port +# Render96ex +Fork of [sm64ex](https://github.com/sm64pc/sm64ex) -- This repo contains a full decompilation of Super Mario 64 (J), (U), and (E) with minor exceptions in the audio subsystem. -- Naming and documentation of the source code and data structures are in progress. -- Efforts to decompile the Shindou ROM steadily advance toward a matching build. -- Beyond Nintendo 64, it can also target Linux and Windows natively. - -This repo does not include all assets necessary for compiling the game. -A prior copy of the game is required to extract the assets. - -## Building native executables - -### Linux - -1. Install prerequisites (Ubuntu): `sudo apt install -y git build-essential pkg-config libusb-1.0-0-dev libsdl2-dev`. -2. Clone the repo: `git clone https://github.com/sm64-port/sm64-port.git`, which will create a directory `sm64-port` and then **enter** it `cd sm64-port`. -3. Place a Super Mario 64 ROM called `baserom..z64` into the repository's root directory for asset extraction, where `VERSION` can be `us`, `jp`, or `eu`. -4. Run `make` to build. Qualify the version through `make VERSION=`. Add `-j4` to improve build speed (hardware dependent based on the amount of CPU cores available). -5. The executable binary will be located at `build/_pc/sm64..f3dex2e`. - -### Windows - -1. Install and update MSYS2, following all the directions listed on https://www.msys2.org/. -2. From the start menu, launch MSYS2 MinGW and install required packages depending on your machine (do **NOT** launch "MSYS2 MSYS"): - * 64-bit: Launch "MSYS2 MinGW 64-bit" and install: `pacman -S git make python3 mingw-w64-x86_64-gcc` - * 32-bit (will also work on 64-bit machines): Launch "MSYS2 MinGW 32-bit" and install: `pacman -S git make python3 mingw-w64-i686-gcc` - * Do **NOT** by mistake install the package called simply `gcc`. -3. The MSYS2 terminal has a _current working directory_ that initially is `C:\msys64\home\` (home directory). At the prompt, you will see the current working directory in yellow. `~` is an alias for the home directory. You can change the current working directory to `My Documents` by entering `cd /c/Users//Documents`. -4. Clone the repo: `git clone https://github.com/sm64-port/sm64-port.git`, which will create a directory `sm64-port` and then **enter** it `cd sm64-port`. -5. Place a *Super Mario 64* ROM called `baserom..z64` into the repository's root directory for asset extraction, where `VERSION` can be `us`, `jp`, or `eu`. -6. Run `make` to build. Qualify the version through `make VERSION=`. Add `-j4` to improve build speed (hardware dependent based on the amount of CPU cores available). -7. The executable binary will be located at `build/_pc/sm64..f3dex2e.exe` inside the repository. - -#### Troubleshooting - -1. If you get `make: gcc: command not found` or `make: gcc: No such file or directory` although the packages did successfully install, you probably launched the wrong MSYS2. Read the instructions again. The terminal prompt should contain "MINGW32" or "MINGW64" in purple text, and **NOT** "MSYS". -2. If you get `Failed to open baserom.us.z64!` you failed to place the baserom in the repository. You can write `ls` to list the files in the current working directory. If you are in the `sm64-port` directory, make sure you see it here. -3. If you get `make: *** No targets specified and no makefile found. Stop.`, you are not in the correct directory. Make sure the yellow text in the terminal ends with `sm64-port`. Use `cd ` to enter the correct directory. If you write `ls` you should see all the project files, including `Makefile` if everything is correct. -4. If you get any error, be sure MSYS2 packages are up to date by executing `pacman -Syu` and `pacman -Su`. If the MSYS2 window closes immediately after opening it, restart your computer. -5. When you execute `gcc -v`, be sure you see `Target: i686-w64-mingw32` or `Target: x86_64-w64-mingw32`. If you see `Target: x86_64-pc-msys`, you either opened the wrong MSYS start menu entry or installed the incorrect gcc package. - -### Debugging - -The code can be debugged using `gdb`. On Linux install the `gdb` package and execute `gdb `. On MSYS2 install by executing `pacman -S winpty gdb` and execute `winpty gdb `. The `winpty` program makes sure the keyboard works correctly in the terminal. Also consider changing the `-mwindows` compile flag to `-mconsole` to be able to see stdout/stderr as well as be able to press Ctrl+C to interrupt the program. In the Makefile, make sure you compile the sources using `-g` rather than `-O2` to include debugging symbols. See any online tutorial for how to use gdb. - -## ROM building - -It is possible to build N64 ROMs as well with this repository. See https://github.com/n64decomp/sm64 for instructions. - -## Project Structure - -``` -sm64 -├── actors: object behaviors, geo layout, and display lists -├── asm: handwritten assembly code, rom header -│ └── non_matchings: asm for non-matching sections -├── assets: animation and demo data -│ ├── anims: animation data -│ └── demos: demo data -├── bin: C files for ordering display lists and textures -├── build: output directory -├── data: behavior scripts, misc. data -├── doxygen: documentation infrastructure -├── enhancements: example source modifications -├── include: header files -├── levels: level scripts, geo layout, and display lists -├── lib: SDK library code -├── rsp: audio and Fast3D RSP assembly code -├── sound: sequences, sound samples, and sound banks -├── src: C source code for game -│ ├── audio: audio code -│ ├── buffers: stacks, heaps, and task buffers -│ ├── engine: script processing engines and utils -│ ├── game: behaviors and rest of game source -│ ├── goddard: Mario intro screen -│ ├── menu: title screen and file, act, and debug level selection menus -│ └── pc: port code, audio and video renderer -├── text: dialog, level names, act names -├── textures: skybox and generic texture data -└── tools: build tools -``` - -## Contributing - -Pull requests are welcome. For major changes, please open an issue first to -discuss what you would like to change. - -Run `clang-format` on your code to ensure it meets the project's coding standards. - -Official Discord: https://discord.gg/7bcNTPK +This is meant to be a fork where the team can upload their code. +If you want to help sm64ex then go to their repo. +If you want to help us out then message me on discord DorfDork#4516 diff --git a/README_es_ES.md b/README_es_ES.md new file mode 100644 index 00000000..44a34a1c --- /dev/null +++ b/README_es_ES.md @@ -0,0 +1,205 @@ +# sm64pc +Adaptación a OpenGL de [n64decomp/sm64](https://github.com/n64decomp/sm64). + +No dudes en contribuir o reportar bugs, pero recuerda: **no se debe subir nada con copyright**. +Ejecuta `./extract_assets.py --clean && make clean` o `make distclean` para borrar todo el contenido proveniente de la ROM. Este port es posible gracias a [n64-fast32-engine](https://github.com/Emill/n64-fast3d-engine/) creado por [Emill](https://github.com/Emill). + +## Funcionalidades + + * Renderizado nativo. Podrás jugar a Super Mario 64 sin necesidad de un emulador. + * Resolución y relación de aspecto variables. Puedes jugar a Super Mario 64 a básicamente cualquier resolución o tamaño de ventana. + * Soporte nativo para mandos XInput. En Linux, se ha confirmado que el DualShock 4 funciona sin más. + * Cámara analógica y cámara controlada con el ratón. (Se activa con `make BETTERCAMERA=1`.) + * Opción para desactivar el límite de distancia de renderizado. (Se activa con `make NODRAWINGDISTANCE=1`.) + * Configurar los controles desde el juego. + * Posibilidad de saltarte la intro con la opción de línea de comandos `--skip-intro` + * Menú de trucos (_cheats_) en _options_. (Se activa con la opción de línea de comandos `--cheats`) Ten en cuenta que si un cheat te pide pulsar el botón "L", se refiere al botón de N64, el cual tendrá que estar asignado a un botón de tu mando. Ve a los ajustes de control y asegúrate de que tienes "L" mapeado a un botón de tu mando. + +## Compilar en Windows +**No intentes compilar ejecutables para Windows bajo Linux usando `WINDOWS_BUILD=1`. No va a funcionar. Sigue la guía.** +#### 1. Instalación y configuración de MSYS2. + +1. Descarga [msys2-x86_64-latest.exe](http://repo.msys2.org/distrib/msys2-x86_64-latest.exe) y ejecútalo. Si tu sistema operativo es de 32 bits (¿por qué?) descarga [msys2-i686-latest.exe](http://repo.msys2.org/distrib/msys2-i686-latest.exe) en su lugar. Asegúrate de que lo instalas en `C:\dev\msys64` (o `C:\dev\msys32` para 32 bits...). Ejecuta MSYS2. + +2. En la ventana de comandos de MSYS2, ejecuta el siguiente comando: + ``` + pacman -Syuu + ``` +3. Abre "MSYS2 MinGW 64-Bit". Ejecuta este comando __repetidamente__ hasta que MSYS diga que ya no hay más actualizaciones. Es posible que tengas que volver a cerrar y abrir MSYS2. + + ``` + pacman -Syuu + ``` + +5. Ejecuta este comando y cuando te pida confirmación pulsa intro: + + ``` + pacman -S --needed base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain \ + git subversion mercurial \ + mingw-w64-i686-cmake mingw-w64-x86_64-cmake + ``` +6. Listo. +#### Instala las dependencias +``` +pacman -S mingw-w64-i686-glew mingw-w64-x86_64-glew mingw-w64-i686-SDL2 mingw-w64-x86_64-SDL2 python3 +``` +### Crea el directorio en el que preparar todo +Desde el explorador de Windows, navega a `C:\msys64\home\(nombre de usuario)\` y crea una carpeta con el nombre que te apetezca. Aquí es donde vamos a preparar todo. +### Clona el repositorio +En MSYS2, introduce el siguiente comando: +``` +git clone https://github.com/sm64pc/sm64pc/ +``` +(Si no funciona, prueba a escribirlo manualmente, en lugar de copiar y pegar) +#### Copia la ROM base al directorio correspondiente +El paso anterior tiene que haber creado una carpeta llamada sm64pc. Dentro de esa carpeta, y para cada version de la ROM (jp/us/eu) de la cual quieras compilar un ejecutable, coloca la ROM con el nombre `baserom..z64` para extraer sus assets. Por ejemplo, `baserom.us.z64` para la versión americana, o `baserom.eu.z64` para la versión europea. + +#### En MSYS2, vamos a navegar a la carpeta `./tools/audiofile-0.3.6/` y ejecutar el `autoreconf-i`. Introduce los siguientes comandos, en orden, uno a uno: +``` +cd sm64pc/tools/audiofile-0.3.6/ +autoreconf -i +``` +No te vayas de este directorio hasta el paso 9. + +#### Ejecuta el script `configure` +``` +PATH=/mingw64/bin:/mingw32/bin:$PATH LIBS=-lstdc++ ./configure --disable-docs +``` +#### Ejecuta el script `make` +``` +PATH=/mingw64/bin:/mingw32/bin:$PATH make +``` +#### Crea un directorio `lib` en `tools/` +``` +mkdir ../lib +``` + +#### Acabas de compilar `libaudiofile`. Ahora cópialo a `tools/lib/` +``` +cp libaudiofile/.libs/libaudiofile.a ../lib/ +cp libaudiofile/.libs/libaudiofile.la ../lib/ +``` +#### Ahora toca hacer algo desde Windows. +En el explorador de Windows, ve a sm64pc\tools y edita el archivo Makefile desde un editor de texto (es recomendable usar un editor decente como Notepad++ o Sublime Text, en lugar del bloc de notas, para asegurarte de que no rompes el formato del texto) Busca la línea que contiene esto: + +```tabledesign_CFLAGS := -Wno-uninitialized -laudiofile``` + +Y añade ` -lstdc++` al final, de manera que quede así (¡no olvides el espacio!) + +```tabledesign_CFLAGS := -Wno-uninitialized -laudiofile -lstdc++``` + +Guarda el archivo. +#### Vuelve a la carpeta tools y ejecuta `make` con los siguientes comandos. +``` +cd .. +PATH=/mingw64/bin:/mingw32/bin:$PATH make +``` +#### Vuelve al directorio sm64pc +``` +cd .. +``` +#### Finalmente, ejecuta ```make``` de nuevo. + +(Ten en cuenta que mingw32 y mingw64 han sido intercambiados. Esto es para que puedas compilar la versión de 32 bits si quieres.) + +Aquí pones las opciones que quieras según la versión que quieras compilar. Por ejemplo, si quieres activar la cámara analógica, añade al final BETTERCAMERA=1. Si quieres la opción de distancia de renderizado ilimitada, añade NODRAWINGDISTANCE=1. + +Por ejemplo: +``` +PATH=/mingw32/bin:/mingw64/bin:$PATH make BETTERCAMERA=1 NODRAWINGDISTANCE=1 +``` +Listo. El .exe estará en sm64pc\build\. Disfruta. +## Compilar en Linux + +### Nota para usuarios de Windows +No intentes compilar un ejecutable para Windows desde Linux o WSL. No funciona. Sigue la guía para Windows. + +#### Copia la(s) ROM(s) base para la extracción de assets. + +Por cada versión de la cual quieras compilar un ejecutable, copia la ROM en `./baserom..z64` para extraer los assets. + +#### Instala las dependencias. + +Para compilar necesitas las sigueintes dependencias. + * python3 >= 3.6 + * libsdl2-dev + * [audiofile](https://audiofile.68k.org/) + * libglew-dev + * git + +Puedes instalarlas con este comando: + +##### Debian / Ubuntu - (compilando para 32 bits) +``` +sudo apt install build-essential git python3 libaudiofile-dev libglew-dev:i386 libsdl2-dev:i386 +``` +##### Debian / Ubuntu - (compilando para 64 bits) +``` +sudo apt install build-essential git python3 libaudiofile-dev libglew-dev libsdl2-dev +``` +##### Arch Linux +Hay un paquete AUR (cortesía de @narukeh) disponible bajo el nombre [sm64pc-git](https://aur.archlinux.org/packages/sm64pc-git/). Instálalo con tu gestor de AURs preferido. + +Si quieres compilarlo por tu cuenta: +``` +sudo pacman -S base-devel python audiofile sdl2 glew +``` + +##### Void Linux - (compilando para 64 bits) +``` +sudo xbps-install -S base-devel python3 audiofile-devel SDL2-devel glew-devel +``` + +##### Void Linux - (compilando para 32 bits) +``` +sudo xbps-install -S base-devel python3 audiofile-devel-32bit SDL2-devel-32bit glew-devel-32bit +``` + +#### Compila el ejecutable. + +Ejecuta `make` para compilar (por defecto `VERSION=us`) + +``` +make VERSION=jp -j6 # Compila la versión (J) usando 6 hilos +make VERSION=us MARCH=i686 TARGET_BITS=32 # Compila un ejecutable de la versión (U) de 32 bits +make TARGET_RPI=1 # Compila un ejecutable para Raspberry Pi +``` +## Compilar para la web +Puedes compilar el juego para navegadores que admitan WebGL usando [Emscripten](https://github.com/emscripten-core). Para hacerlo, instala [emsdk](https://github.com/emscripten-core/emsdk) y ejecuta `make TARGET_WEB=1`. + +## Script para compilar para Raspberry Pi + +[Hyenadae](https://github.com/Hyenadae/) ha creado un script que ayuda a compilar el juego para Raspberry Pi. Estos son los pasos que hace el script: + + * Instala las dependencias; + * Cambia VC4_DRM en la RPi de 0 a 3; + * Cambia ajustes en la memoria de las RPis 0 y 1 para que se pueda completar la compilación; + * Permite la instalación de un SDL2 con KMS, lo que elimina la necesidad de usar X11 y garantiza el máximo rendimiento de cualquier RPi que ejecute VC4; + * Clona sm64pc si no encuentra los archivos necesarios; + * Comprueba si existen los assets y la ROM base necesaria (baserom.*.z64); + * Compila sm64pc. + +El script está incluído en la rama master, pero también puede descargarse [aquí](https://raw.githubusercontent.com/sm64pc/sm64pc/master/pisetup.sh). +# Problemas conocidos +### Problemas ya conocidos: + * La versión EU tiene bugs en los textos y no tiene audio. + * El movimiento analógico horizontal de la cámara vuelve al estilo antiguo en el nivel Bowser in the Dark World (#72) + * La cámara con el ratón falla cuando disparas a Mario hacia un árbol o un tubo. (#71) + * "make: Nothing to be done for 'default'" al compilar para web. (#67) + +### Estos problemas están marcados como solucionados. Por favor, contacta si sigues teniendo estos problemas. + * El juego se llena de flags aleatorias en las builds de 64 bits para Windows + * Hazy Maze Cave se cuelga en pantalla completa (#57) + * La pantalla de título no tiene el cursor para manipular a Mario en pantalla completa. (#28) + +## Parches +En la carpeta `./enhancements` hay varios archivos `patch`, que pueden aplicarse de la siguiente manera: + +``` + git apply fps.patch --ignore-whitespace --reject +``` +Si ocurre un rechazo, puedes buscarlo con el comando `find | grep .rej`. +Intenta resolver los rechazos a través de [wiggle](https://github.com/neilbrown/wiggle). +``` +wiggle rejection.rej --replace +``` diff --git a/README_pt_BR.md b/README_pt_BR.md new file mode 100644 index 00000000..758733d1 --- /dev/null +++ b/README_pt_BR.md @@ -0,0 +1,33 @@ +# sm64pc +Adaptação em OpenGL de [n64decomp/sm64](https://github.com/n64decomp/sm64). + +Sinta-se livre para reportar bugs [aqui](https://github.com/sm64pc/sm64pc/issues) e contribuir, mas tenha em mente que não +aceitamos compartilhamento de conteúdo protegido com direitos autorais. + +Se necessário, rode `./extract_assets.py --clean && make clean` ou `make distclean` para remover conteúdos advindos da ROM do jogo. +Este port é possível graças à [Emill](https://github.com/Emill), [n64-fast32-engine](https://github.com/Emill/n64-fast3d-engine/), e, é claro, ao +time do [n64decomp](https://github.com/n64decomp). + +Em caso de contribuições, crie _pull requests_ apenas para a [branch nightly](https://github.com/sm64pc/sm64pc/tree/nightly/). +Novas funcionalidades serão adicionadas à branch master quando forem consideradas bem testadas. + +*Leia isso em outras linguas: [English](README.md) [简体中文](README_zh_CN.md).* + +## Recursos + + * Renderização nativa. Você agora pode jogar SM64 no PC sem precisar de emulador. + * Proporção de tela e resolução variáveis. O jogo renderiza corretamente em basicamente qualquer tamanho de janela. + * Suporte a entradas de controle através de `xinput`. Tal como usando DualShock 4 em distribuições Linux. + * Controle de câmera com analógico ou mouse. (Ative com `make BETTERCAMERA=1`.) + * Uma opção para desativar distância de renderização. (Ative com `make NODRAWINGDISTANCE=1`.) + * Remapeamento de controles _in-game_. + * Pule as cenas introdutórias da Peach e Lakitu com usando a opção `--skip-intro` ao executar o jogo na linha de comando. + * Menu de cheats nas opções. (Ative com `--cheats`) + ** Note que se algum cheat pedir pelo botão "L", o botão em questão é o "L" do N64. Certifique-se de que este está mapeado, caso necessário. + +## Compilação +Para instruções de compilaçao, consulte a [wiki](https://github.com/sm64pc/sm64pc/wiki). + +## Para usuários de Windows + +**Certifique-se de que você tem o [MXE](mxe.cc) antes de tentar compilar em Windows. Siga o guia na Wiki.** diff --git a/README_zh_CN.md b/README_zh_CN.md new file mode 100644 index 00000000..b3e90f92 --- /dev/null +++ b/README_zh_CN.md @@ -0,0 +1,21 @@ +# sm64pc +本项目是 [n64decomp/sm64](https://github.com/n64decomp/sm64) 的 OpenGL 移植版本。 + +我们欢迎贡献代码与 bug 报告,但请切记,**不得上传任何被版权保护(来自 ROM 文件)的资源**。 +提交前请运行 `./extract_assets.py --clean && make clean` 或 `make distclean` 来清除所有从 ROM 文件中提取的内容。 +本移植是基于 [Emill](https://github.com/Emill) 的工作 [n64-fast32-engine](https://github.com/Emill/n64-fast3d-engine/) 才得以实现的。 + +## 主要功能 + + * 原生渲染。现在不用任何模拟器就可以运行 马力欧64 了。 + * 长宽比和分辨率可以自由改变。本游戏目前可以在几乎任何窗口尺寸下正确渲染。 + * 原生 xinput 手柄支持。在 Linux 下,已经确认 PS4 手柄可以即插即用。 + * 支持模拟量视点控制、鼠标控制视点。(请使用 `make BETTERCAMERA=1` 编译) + * 可取消可视距离限制。(请使用 `make NODRAWINGDISTANCE=1` 编译) + * 游戏内操作设定功能,目前在 `testing` 分支下可用。 + * 使用 `--skip-intro` 命令行选项跳过碧奇公主与 Lakitu 的片头剧情。目前在 `testing` 及 `skip-intro` 分支下可用。 + +## 编译方法 +关于如何编译,请参考 [wiki](https://github.com/sm64pc/sm64pc/wiki)。 + +**请勿在 Linux 或者 WSL 下使用 `WINDOWS_BUILD=1` 参数尝试编译 Windows 版本,这样无法编译成功。请参考 Wiki。 diff --git a/SAVE_FORMAT.MD b/SAVE_FORMAT.MD new file mode 100644 index 00000000..5f44a011 --- /dev/null +++ b/SAVE_FORMAT.MD @@ -0,0 +1,158 @@ +# Text-based savefile format +This small document describes a new, TOML-like text format for game saves. This format allows the user to use a simple text editor to change the data necessary for the game (for example, special saves for speedrun training). + +All data is stored in pairs (*key = value*). Pairs can be placed arbitrarily within a single section. The format of values may differ for each section. + +Each savefile (4 total) must be named `save_file_X.sav`, where X - save slot (0, 1, 2 or 3). + +> **Note**: The game creates the savefile only when you are saved in the game after completing a course! +___ +## Header +The header is automatically generated by the game when saving progress. It mainly contains information about the value of the 0 and 1 flags, the character that the comment starts with, and the time when the file content changed. + +Example: +``` +# Super Mario 64 save file +# Comment starts with # +# True = 1, False = 0 +# 2020-05-18 17:37:07 +``` + +___ +## Commenting +All comment lines starts with `#` character. Comments can be located on a separate line or as part of another line. When the game reads the save, comments are ignored. + +Example: +``` +# This is a comment +coin_score_age = ?? # This is a comment too! +``` + +___ +## Menu Section - [menu] +This section contains two flags for menu. + +| Flag | Value | Description | +|---|---|---| +| coin_score_age | 0, 1, 2, 3 | Each save file has a 2 bit "age" for each course. The higher this value, the older the high score is. This is used for tie-breaking when displaying on the high score screen +| sound_mode | stereo, mono, headset | Sound mode for the game + +Example: +``` +[menu] +coin_score_age = 0 +sound_mode = stereo +``` +___ +## Flags Section - [flags] +This section contains all main game flags (walkthought milestones). +> **Note**: The value can be only 0 (False) or 1 (True). + +| Flag | Description | +|---|---| +| wing_cap | **Red Switch** is pressed +| metal_cap | **Green Switch** is pressed +| vanish_cap | **Blue Switch** is pressed. +| key_1 | Key is found in **Bowser in the Dark World** +| key_2 | Key is found in **Bowser in the Fire Sea** +| basement_door | Mario unlocked castle's basement door +| upstairs_door | Mario unlocked castle's upper floors +| ddd_moved_back | **Dire Dire Docks** painting is moved back +| moat_drained | Water is drained in the moat of the castle +| pps_door | **Princess's Secret Slide** window is unlocked +| wf_door | **Whomp's Fortress door** is unlocked +| ccm_door | **Cool, Cool Mountain door** is unlocked +| jrb_door | **Jolly Roger Bay door** is unlocked +| bitdw_door | **Bowser in the Dark World door** door is unlocked +| bitfs_door | **Bowser in the Fire Sea** door is unlocked +| 50star_door | **Endless Staircase** is not endless anymore + +Example: +``` +[flags] +wing_cap = 1 +metal_cap = 1 +vanish_cap = 0 +key_1 = 1 +key_2 = 1 +``` +___ +## Main Courses Section - [courses] +This section contains all stars and coins that Mario collected in each main course. + +The first value stores the number of coins collected. +> **Warning!**: Make sure that coins count will not exceed 255! + +The second value stores the stars (or completed missions). Each mission (6 main + 1 bonus) is must be marked `0` (not completed) and `1` (completed). +> **Warning!**: The sequence of stars' missions goes from **RIGHT** to **LEFT**! +> **Note**: Last star flag is **100 coins star** + +| Flag | Short for | +|---|---| +| bob | Bob-omb Battlefield | +| wf | Whomp's Fortress +| jrb | Jolly Roger Bay +| ccm | Cool, Cool Mountain +| bbh | Big Boo's Haunt +| hmc | Hazy Maze Cave +| lll | Lethal Lava Land +| ssl | Shifting Sand Land +| ddd | Dire, Dire Docks +| sl | Snowman's Land +| wdw | Wet-Dry World +| ttm | Tall, Tall Mountain +| thi | Tiny-Huge Island +| ttc | Tick Tock Clock +| rr | Rainbow Ride + +Example: +``` +[courses] +bob = "3, 0000011" +wf = "3, 0000101" +jrb = "0, 1000000" +ccm = "1, 1111111" +``` +___ +## Bonus Section - [bonus] +This section contains all bonus stars that Mario collected in the castle and all bonus courses. +> **Note**: The game takes into account only the number of bonus stars collected, the order of stars flags can be arbitrary + +| Flag | Stars | Description | +|---|---|---| +| hub | 5 | MIPS' stars and Toads' stars +| bitdw | 1 | Bowser in the Dark World +| bitfs | 1 | Bowser in the Fire Sea +| bits | 1 | Bowser in the Sky +| pss | 2 | The Princess's Secret Slide +| cotmc | 1 | Cavern of the Metal Cap +| totwc | 1 | Tower of the Wing Cap +| vcutm | 1 | Vanish Cap Under the Moat +| wmotr | 1 | Wing Mario Over the Rainbow +| sa | 1 | The Secret Aquarium + +Example: +``` +[bonus] +hub = 11101 +bitdw = 1 +bitfs = 0 +bits = 1 +pss = 10 +``` +___ +## Cap Section - [cap] +This section contains information about where Mario lost his cap and who take it. +| Flag | Value | Description | +|---|---|---| +| type | ground, klepto, ukiki, mrblizzard | The one who or what took the cap from Mario. Default flag is **"ground"** +| level | ssl, sl, ttm, none | Specifies the course where the cap is located. Default flag is **"none"**. +| area | 1, 2 | Specifies the area in the course. + +Example: +``` +[cap] +type = ground +level = ssl +area = 1 +``` \ No newline at end of file diff --git a/actors/amp/model.inc.c b/actors/amp/model.inc.c index a667fce0..094a6f12 100644 --- a/actors/amp/model.inc.c +++ b/actors/amp/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/common0.h" - // Amp // 0x08000F18 diff --git a/actors/bird/model.inc.c b/actors/bird/model.inc.c index 943452af..d7e2ca82 100644 --- a/actors/bird/model.inc.c +++ b/actors/bird/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group10.h" - // Birds // 0x05000000 diff --git a/actors/blue_coin_switch/collision.inc.c b/actors/blue_coin_switch/collision.inc.c index 7c8f51e5..5134eac2 100644 --- a/actors/blue_coin_switch/collision.inc.c +++ b/actors/blue_coin_switch/collision.inc.c @@ -1,5 +1,3 @@ -#include "actors/common0.h" - // Blue Coin Switch // 0x08000E98 - 0x08000F10 diff --git a/actors/blue_coin_switch/model.inc.c b/actors/blue_coin_switch/model.inc.c index 47339bb1..f83d5a2a 100644 --- a/actors/blue_coin_switch/model.inc.c +++ b/actors/blue_coin_switch/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/common0.h" - // Blue Coin Switch // 0x08000000 diff --git a/actors/boo/model.inc.c b/actors/boo/model.inc.c index 435a668c..40ce7824 100644 --- a/actors/boo/model.inc.c +++ b/actors/boo/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group9.h" - // Boo // 0x05009B28 diff --git a/actors/bookend/model.inc.c b/actors/bookend/model.inc.c index b3dbb0a7..3796ec0d 100644 --- a/actors/bookend/model.inc.c +++ b/actors/bookend/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group9.h" - // Bookend // Unreferenced light group diff --git a/actors/bowser/model.inc.c b/actors/bowser/model.inc.c index ee0a995b..c4f78399 100644 --- a/actors/bowser/model.inc.c +++ b/actors/bowser/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group12.h" - // Bowser (King Koopa) // 0x0601F438 diff --git a/actors/bowser_flame/model.inc.c b/actors/bowser_flame/model.inc.c index 21488b73..2551342e 100644 --- a/actors/bowser_flame/model.inc.c +++ b/actors/bowser_flame/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group12.h" - // Bowser Flame // TODO: Are these seperate textures or unified 64x64 ones? @@ -80,10 +78,10 @@ static const Vtx flame_seg6_vertex_0601C000[] = { {{{ 150, 150, 0}, 0, { 2016, 992}, {0xff, 0xff, 0xff, 0xff}}}, {{{ 150, 300, 0}, 0, { 2016, 0}, {0xff, 0xff, 0xff, 0xff}}}, {{{ -150, 300, 0}, 0, { 0, 0}, {0xff, 0xff, 0xff, 0xff}}}, - {{{ -150, 0, 0}, 0, { 0, 992}, {0xff, 0xff, 0xff, 0xff}}}, - {{{ 150, 0, 0}, 0, { 2016, 992}, {0xff, 0xff, 0xff, 0xff}}}, - {{{ 150, 150, 0}, 0, { 2016, 0}, {0xff, 0xff, 0xff, 0xff}}}, - {{{ -150, 150, 0}, 0, { 0, 0}, {0xff, 0xff, 0xff, 0xff}}}, + {{{ -150, 0, 0}, 0, { 0, 2016}, {0xff, 0xff, 0xff, 0xff}}}, + {{{ 150, 0, 0}, 0, { 2016, 2016}, {0xff, 0xff, 0xff, 0xff}}}, + {{{ 150, 150, 0}, 0, { 2016, 992}, {0xff, 0xff, 0xff, 0xff}}}, + {{{ -150, 150, 0}, 0, { 0, 992}, {0xff, 0xff, 0xff, 0xff}}}, }; // 0x0601C080 - 0x0601C0B0 @@ -119,10 +117,9 @@ const Gfx flame_seg6_dl_0601C0E0[] = { // 0x0601C108 - 0x0601C1A8 const Gfx flame_seg6_dl_0601C108[] = { gsSPDisplayList(flame_seg6_dl_0601C080), - gsDPLoadTextureBlock(flame_seg6_texture_06000000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(flame_seg6_texture_06000000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(flame_seg6_vertex_0601C000, 8, 0), gsSPDisplayList(flame_seg6_dl_0601C0B0), - gsDPLoadTextureBlock(flame_seg6_texture_06000000 + 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(flame_seg6_dl_0601C0C8), gsSPDisplayList(flame_seg6_dl_0601C0E0), gsSPEndDisplayList(), @@ -131,10 +128,9 @@ const Gfx flame_seg6_dl_0601C108[] = { // 0x0601C1A8 - 0x0601C248 const Gfx flame_seg6_dl_0601C1A8[] = { gsSPDisplayList(flame_seg6_dl_0601C080), - gsDPLoadTextureBlock(flame_seg6_texture_06002000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(flame_seg6_texture_06002000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(flame_seg6_vertex_0601C000, 8, 0), gsSPDisplayList(flame_seg6_dl_0601C0B0), - gsDPLoadTextureBlock(flame_seg6_texture_06002000 + 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(flame_seg6_dl_0601C0C8), gsSPDisplayList(flame_seg6_dl_0601C0E0), gsSPEndDisplayList(), @@ -143,10 +139,9 @@ const Gfx flame_seg6_dl_0601C1A8[] = { // 0x0601C248 - 0x0601C2E8 const Gfx flame_seg6_dl_0601C248[] = { gsSPDisplayList(flame_seg6_dl_0601C080), - gsDPLoadTextureBlock(flame_seg6_texture_06004000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(flame_seg6_texture_06004000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(flame_seg6_vertex_0601C000, 8, 0), gsSPDisplayList(flame_seg6_dl_0601C0B0), - gsDPLoadTextureBlock(flame_seg6_texture_06004000 + 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(flame_seg6_dl_0601C0C8), gsSPDisplayList(flame_seg6_dl_0601C0E0), gsSPEndDisplayList(), @@ -155,10 +150,9 @@ const Gfx flame_seg6_dl_0601C248[] = { // 0x0601C2E8 - 0x0601C388 const Gfx flame_seg6_dl_0601C2E8[] = { gsSPDisplayList(flame_seg6_dl_0601C080), - gsDPLoadTextureBlock(flame_seg6_texture_06006000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(flame_seg6_texture_06006000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(flame_seg6_vertex_0601C000, 8, 0), gsSPDisplayList(flame_seg6_dl_0601C0B0), - gsDPLoadTextureBlock(flame_seg6_texture_06006000 + 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(flame_seg6_dl_0601C0C8), gsSPDisplayList(flame_seg6_dl_0601C0E0), gsSPEndDisplayList(), @@ -167,10 +161,9 @@ const Gfx flame_seg6_dl_0601C2E8[] = { // 0x0601C388 - 0x0601C428 const Gfx flame_seg6_dl_0601C388[] = { gsSPDisplayList(flame_seg6_dl_0601C080), - gsDPLoadTextureBlock(flame_seg6_texture_06008000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(flame_seg6_texture_06008000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(flame_seg6_vertex_0601C000, 8, 0), gsSPDisplayList(flame_seg6_dl_0601C0B0), - gsDPLoadTextureBlock(flame_seg6_texture_06008000 + 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(flame_seg6_dl_0601C0C8), gsSPDisplayList(flame_seg6_dl_0601C0E0), gsSPEndDisplayList(), @@ -179,10 +172,9 @@ const Gfx flame_seg6_dl_0601C388[] = { // 0x0601C428 - 0x0601C4C8 const Gfx flame_seg6_dl_0601C428[] = { gsSPDisplayList(flame_seg6_dl_0601C080), - gsDPLoadTextureBlock(flame_seg6_texture_0600A000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(flame_seg6_texture_0600A000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(flame_seg6_vertex_0601C000, 8, 0), gsSPDisplayList(flame_seg6_dl_0601C0B0), - gsDPLoadTextureBlock(flame_seg6_texture_0600A000 + 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(flame_seg6_dl_0601C0C8), gsSPDisplayList(flame_seg6_dl_0601C0E0), gsSPEndDisplayList(), @@ -191,10 +183,8 @@ const Gfx flame_seg6_dl_0601C428[] = { // 0x0601C4C8 - 0x0601C568 const Gfx flame_seg6_dl_0601C4C8[] = { gsSPDisplayList(flame_seg6_dl_0601C080), - gsDPLoadTextureBlock(flame_seg6_texture_0600C000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(flame_seg6_texture_0600C000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(flame_seg6_vertex_0601C000, 8, 0), - gsSPDisplayList(flame_seg6_dl_0601C0B0), - gsDPLoadTextureBlock(flame_seg6_texture_0600C000 + 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(flame_seg6_dl_0601C0C8), gsSPDisplayList(flame_seg6_dl_0601C0E0), gsSPEndDisplayList(), @@ -203,10 +193,9 @@ const Gfx flame_seg6_dl_0601C4C8[] = { // 0x0601C568 - 0x0601C608 const Gfx flame_seg6_dl_0601C568[] = { gsSPDisplayList(flame_seg6_dl_0601C080), - gsDPLoadTextureBlock(flame_seg6_texture_0600E000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(flame_seg6_texture_0600E000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(flame_seg6_vertex_0601C000, 8, 0), gsSPDisplayList(flame_seg6_dl_0601C0B0), - gsDPLoadTextureBlock(flame_seg6_texture_0600E000 + 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(flame_seg6_dl_0601C0C8), gsSPDisplayList(flame_seg6_dl_0601C0E0), gsSPEndDisplayList(), @@ -215,10 +204,9 @@ const Gfx flame_seg6_dl_0601C568[] = { // 0x0601C608 - 0x0601C6A8 const Gfx flame_seg6_dl_0601C608[] = { gsSPDisplayList(flame_seg6_dl_0601C080), - gsDPLoadTextureBlock(flame_seg6_texture_06010000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(flame_seg6_texture_06010000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(flame_seg6_vertex_0601C000, 8, 0), gsSPDisplayList(flame_seg6_dl_0601C0B0), - gsDPLoadTextureBlock(flame_seg6_texture_06010000 + 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(flame_seg6_dl_0601C0C8), gsSPDisplayList(flame_seg6_dl_0601C0E0), gsSPEndDisplayList(), @@ -227,10 +215,9 @@ const Gfx flame_seg6_dl_0601C608[] = { // 0x0601C6A8 - 0x0601C748 const Gfx flame_seg6_dl_0601C6A8[] = { gsSPDisplayList(flame_seg6_dl_0601C080), - gsDPLoadTextureBlock(flame_seg6_texture_06012000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(flame_seg6_texture_06012000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(flame_seg6_vertex_0601C000, 8, 0), gsSPDisplayList(flame_seg6_dl_0601C0B0), - gsDPLoadTextureBlock(flame_seg6_texture_06012000 + 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(flame_seg6_dl_0601C0C8), gsSPDisplayList(flame_seg6_dl_0601C0E0), gsSPEndDisplayList(), @@ -239,10 +226,9 @@ const Gfx flame_seg6_dl_0601C6A8[] = { // 0x0601C748 - 0x0601C7E8 const Gfx flame_seg6_dl_0601C748[] = { gsSPDisplayList(flame_seg6_dl_0601C080), - gsDPLoadTextureBlock(flame_seg6_texture_06014000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(flame_seg6_texture_06014000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(flame_seg6_vertex_0601C000, 8, 0), gsSPDisplayList(flame_seg6_dl_0601C0B0), - gsDPLoadTextureBlock(flame_seg6_texture_06014000 + 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(flame_seg6_dl_0601C0C8), gsSPDisplayList(flame_seg6_dl_0601C0E0), gsSPEndDisplayList(), @@ -251,10 +237,9 @@ const Gfx flame_seg6_dl_0601C748[] = { // 0x0601C7E8 - 0x0601C888 const Gfx flame_seg6_dl_0601C7E8[] = { gsSPDisplayList(flame_seg6_dl_0601C080), - gsDPLoadTextureBlock(flame_seg6_texture_06016000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(flame_seg6_texture_06016000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(flame_seg6_vertex_0601C000, 8, 0), gsSPDisplayList(flame_seg6_dl_0601C0B0), - gsDPLoadTextureBlock(flame_seg6_texture_06016000 + 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(flame_seg6_dl_0601C0C8), gsSPDisplayList(flame_seg6_dl_0601C0E0), gsSPEndDisplayList(), @@ -263,10 +248,9 @@ const Gfx flame_seg6_dl_0601C7E8[] = { // 0x0601C888 - 0x0601C928 const Gfx flame_seg6_dl_0601C888[] = { gsSPDisplayList(flame_seg6_dl_0601C080), - gsDPLoadTextureBlock(flame_seg6_texture_06018000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(flame_seg6_texture_06018000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(flame_seg6_vertex_0601C000, 8, 0), gsSPDisplayList(flame_seg6_dl_0601C0B0), - gsDPLoadTextureBlock(flame_seg6_texture_06018000 + 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(flame_seg6_dl_0601C0C8), gsSPDisplayList(flame_seg6_dl_0601C0E0), gsSPEndDisplayList(), @@ -275,10 +259,9 @@ const Gfx flame_seg6_dl_0601C888[] = { // 0x0601C928 - 0x0601C9C8 const Gfx flame_seg6_dl_0601C928[] = { gsSPDisplayList(flame_seg6_dl_0601C080), - gsDPLoadTextureBlock(flame_seg6_texture_0601A000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(flame_seg6_texture_0601A000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(flame_seg6_vertex_0601C000, 8, 0), gsSPDisplayList(flame_seg6_dl_0601C0B0), - gsDPLoadTextureBlock(flame_seg6_texture_0601A000 + 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(flame_seg6_dl_0601C0C8), gsSPDisplayList(flame_seg6_dl_0601C0E0), gsSPEndDisplayList(), diff --git a/actors/bowser_key/model.inc.c b/actors/bowser_key/model.inc.c index 09439742..7cee5952 100644 --- a/actors/bowser_key/model.inc.c +++ b/actors/bowser_key/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/common1.h" - // Bowser Key // 0x030156E0, ambient color brown - light color orange diff --git a/actors/bubba/model.inc.c b/actors/bubba/model.inc.c index 5aaa641f..1e9f31e5 100644 --- a/actors/bubba/model.inc.c +++ b/actors/bubba/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group11.h" - // Possible Removed Actor File // It's possible that bubba and bub used to be 2 "actors" in // one actor file. diff --git a/actors/bully/model.inc.c b/actors/bully/model.inc.c index b0c18dca..5573946e 100644 --- a/actors/bully/model.inc.c +++ b/actors/bully/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group2.h" - // Bully // 0x05000000 diff --git a/actors/burn_smoke/model.inc.c b/actors/burn_smoke/model.inc.c index a0f65578..bcf4fd6f 100644 --- a/actors/burn_smoke/model.inc.c +++ b/actors/burn_smoke/model.inc.c @@ -11,6 +11,9 @@ static const Vtx burn_smoke_seg4_vertex_040217C0[] = { // //! Wrong texture format. Called as rgba16, which makes the burn smoke appear // as a transparent black burn smoke. Probably meant to show up as white-ish // burn smoke, but mistakened for being intended as black smoke. +// Due to debate in the Koopa shorts PR surrounding the fix to a similar bug, +// said fix is on a compile-time variable. Use TEXTURE_FIX=1 at compile time +// to fix this. // 0x04021800 ALIGNED8 static const u8 burn_smoke_seg4_texture_04021800[] = { #include "actors/burn_smoke/burn_smoke.ia16.inc.c" @@ -44,7 +47,11 @@ const Gfx burn_smoke_seg4_dl_04022048[] = { // 0x04022070 - 0x040220C8 const Gfx burn_smoke_seg4_dl_04022070[] = { gsSPDisplayList(burn_smoke_seg4_dl_04022000), + #ifdef TEXTURE_FIX + gsDPLoadTextureBlock(burn_smoke_seg4_texture_04021800, G_IM_FMT_IA, G_IM_SIZ_16b, 32, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 5, 5, G_TX_NOLOD, G_TX_NOLOD), + #else gsDPLoadTextureBlock(burn_smoke_seg4_texture_04021800, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 5, 5, G_TX_NOLOD, G_TX_NOLOD), + #endif gsSPDisplayList(burn_smoke_seg4_dl_04022028), gsSPDisplayList(burn_smoke_seg4_dl_04022048), gsSPEndDisplayList(), diff --git a/actors/capswitch/model.inc.c b/actors/capswitch/model.inc.c index e3a78017..5adca94a 100644 --- a/actors/capswitch/model.inc.c +++ b/actors/capswitch/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group8.h" - // Capswitch // 0x05001BB8 diff --git a/actors/chain_chomp/model.inc.c b/actors/chain_chomp/model.inc.c index 51547e60..e7e39abf 100644 --- a/actors/chain_chomp/model.inc.c +++ b/actors/chain_chomp/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group14.h" - // Chain Chomp // 0x06021388 diff --git a/actors/chair/model.inc.c b/actors/chair/model.inc.c index 758c349f..ec0ad35d 100644 --- a/actors/chair/model.inc.c +++ b/actors/chair/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group9.h" - // Chair // Unreferenced light group diff --git a/actors/chillychief/anims/table.inc.c b/actors/chillychief/anims/table.inc.c index d772502b..23e1df37 100644 --- a/actors/chillychief/anims/table.inc.c +++ b/actors/chillychief/anims/table.inc.c @@ -1,5 +1,3 @@ -#include "actors/group16.h" - // 0x06003994 const struct Animation *const chilly_chief_seg6_anims_06003994[] = { &chilly_chief_seg6_anim_060035E0, diff --git a/actors/chillychief/geo.inc.c b/actors/chillychief/geo.inc.c index 00bc4c13..96ec2e1c 100644 --- a/actors/chillychief/geo.inc.c +++ b/actors/chillychief/geo.inc.c @@ -1,5 +1,3 @@ -#include "actors/group16.h" - // Why are these scripts compressed unlike the other ones? // 0x06003754 const GeoLayout chilly_chief_geo[] = { diff --git a/actors/chuckya/model.inc.c b/actors/chuckya/model.inc.c index 402df36d..2bc59908 100644 --- a/actors/chuckya/model.inc.c +++ b/actors/chuckya/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/common0.h" - // Chuckya // Unreferenced light group @@ -359,7 +357,7 @@ static const Vtx chuckya_seg8_vertex_0800A680[] = { const Gfx chuckya_seg8_dl_0800A700[] = { gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, chuckya_seg8_texture_08006778), gsDPLoadSync(), - gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), gsSPLight(&chuckya_seg8_lights_0800A668.l, 1), gsSPLight(&chuckya_seg8_lights_0800A668.a, 2), gsSPVertex(chuckya_seg8_vertex_0800A680, 8, 0), @@ -377,7 +375,7 @@ const Gfx chuckya_seg8_dl_0800A758[] = { gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), gsDPTileSync(), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD), - gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), + gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (64 - 1) << G_TEXTURE_IMAGE_FRAC), gsSPDisplayList(chuckya_seg8_dl_0800A700), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), gsDPPipeSync(), diff --git a/actors/clam_shell/model.inc.c b/actors/clam_shell/model.inc.c index 9ea9235c..4a9e57b7 100644 --- a/actors/clam_shell/model.inc.c +++ b/actors/clam_shell/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group4.h" - // Clam Shell // Unreferenced light group diff --git a/actors/coin/model.inc.c b/actors/coin/model.inc.c index f53274a7..482a4e5c 100644 --- a/actors/coin/model.inc.c +++ b/actors/coin/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/common1.h" - // Coin // 0x030056C0 diff --git a/actors/door/model.inc.c b/actors/door/model.inc.c index fa506d31..0b39b7df 100644 --- a/actors/door/model.inc.c +++ b/actors/door/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/common1.h" - // Door // 0x03009CE0 diff --git a/actors/dorrie/model.inc.c b/actors/dorrie/model.inc.c index 6fe6d226..6c9044d6 100644 --- a/actors/dorrie/model.inc.c +++ b/actors/dorrie/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group17.h" - // Dorrie // 0x06009BA0 diff --git a/actors/explosion/model.inc.c b/actors/explosion/model.inc.c index b45c055c..8f41b8fa 100644 --- a/actors/explosion/model.inc.c +++ b/actors/explosion/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/common1.h" - // Explosion // 0x030009C8 diff --git a/actors/flyguy/model.inc.c b/actors/flyguy/model.inc.c index f004dff0..05e38248 100644 --- a/actors/flyguy/model.inc.c +++ b/actors/flyguy/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/common0.h" - // Flyguy // ??? diff --git a/actors/goomba/model.inc.c b/actors/goomba/model.inc.c index 772bd0da..a68a9bff 100644 --- a/actors/goomba/model.inc.c +++ b/actors/goomba/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/common0.h" - // Goomba // Unreferenced light group diff --git a/actors/haunted_cage/model.inc.c b/actors/haunted_cage/model.inc.c index 9c6ea769..d763de20 100644 --- a/actors/haunted_cage/model.inc.c +++ b/actors/haunted_cage/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group9.h" - // Haunted Cage // 0x0500C258 diff --git a/actors/hoot/model.inc.c b/actors/hoot/model.inc.c index 99b5a8c7..ebffc2a6 100644 --- a/actors/hoot/model.inc.c +++ b/actors/hoot/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group1.h" - // Hoot // 0x05000900 diff --git a/actors/impact_smoke/model.inc.c b/actors/impact_smoke/model.inc.c index 48aeb602..012cf6f6 100644 --- a/actors/impact_smoke/model.inc.c +++ b/actors/impact_smoke/model.inc.c @@ -28,10 +28,10 @@ static const Vtx impact_smoke_seg6_vertex_06062A28[] = { {{{ 150, 150, 0}, 0, { 2016, 992}, {0x28, 0x19, 0x14, 0xff}}}, {{{ 150, 300, 0}, 0, { 2016, 0}, {0x28, 0x19, 0x14, 0xff}}}, {{{ -150, 300, 0}, 0, { 0, 0}, {0x28, 0x19, 0x14, 0xff}}}, - {{{ -150, 0, 0}, 0, { 0, 992}, {0x28, 0x19, 0x14, 0xff}}}, - {{{ 150, 0, 0}, 0, { 2016, 992}, {0x28, 0x19, 0x14, 0xff}}}, - {{{ 150, 150, 0}, 0, { 2016, 0}, {0x28, 0x19, 0x14, 0xff}}}, - {{{ -150, 150, 0}, 0, { 0, 0}, {0x28, 0x19, 0x14, 0xff}}}, + {{{ -150, 0, 0}, 0, { 0, 2016}, {0x28, 0x19, 0x14, 0xff}}}, + {{{ 150, 0, 0}, 0, { 2016, 2016}, {0x28, 0x19, 0x14, 0xff}}}, + {{{ 150, 150, 0}, 0, { 2016, 992}, {0x28, 0x19, 0x14, 0xff}}}, + {{{ -150, 150, 0}, 0, { 0, 992}, {0x28, 0x19, 0x14, 0xff}}}, }; // 0x06062AA8 - 0x06062AD8 @@ -68,10 +68,9 @@ const Gfx impact_smoke_seg6_dl_06062B08[] = { // 0x06062B38 - 0x06062BD8 const Gfx impact_smoke_seg6_dl_06062B38[] = { gsSPDisplayList(impact_smoke_seg6_dl_06062AA8), - gsDPLoadTextureBlock(impact_smoke_seg6_texture_0605AA28, G_IM_FMT_IA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(impact_smoke_seg6_texture_0605AA28, G_IM_FMT_IA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(impact_smoke_seg6_vertex_06062A28, 8, 0), gsSPDisplayList(impact_smoke_seg6_dl_06062AD8), - gsDPLoadTextureBlock(impact_smoke_seg6_texture_0605AA28 + 0x1000, G_IM_FMT_IA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(impact_smoke_seg6_dl_06062AF0), gsSPDisplayList(impact_smoke_seg6_dl_06062B08), gsSPEndDisplayList(), @@ -80,10 +79,9 @@ const Gfx impact_smoke_seg6_dl_06062B38[] = { // 0x06062BD8 - 0x06062C78 const Gfx impact_smoke_seg6_dl_06062BD8[] = { gsSPDisplayList(impact_smoke_seg6_dl_06062AA8), - gsDPLoadTextureBlock(impact_smoke_seg6_texture_0605CA28, G_IM_FMT_IA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(impact_smoke_seg6_texture_0605CA28, G_IM_FMT_IA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(impact_smoke_seg6_vertex_06062A28, 8, 0), gsSPDisplayList(impact_smoke_seg6_dl_06062AD8), - gsDPLoadTextureBlock(impact_smoke_seg6_texture_0605CA28 + 0x1000, G_IM_FMT_IA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(impact_smoke_seg6_dl_06062AF0), gsSPDisplayList(impact_smoke_seg6_dl_06062B08), gsSPEndDisplayList(), @@ -92,10 +90,9 @@ const Gfx impact_smoke_seg6_dl_06062BD8[] = { // 0x06062C78 - 0x06062D18 const Gfx impact_smoke_seg6_dl_06062C78[] = { gsSPDisplayList(impact_smoke_seg6_dl_06062AA8), - gsDPLoadTextureBlock(impact_smoke_seg6_texture_0605EA28, G_IM_FMT_IA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(impact_smoke_seg6_texture_0605EA28, G_IM_FMT_IA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(impact_smoke_seg6_vertex_06062A28, 8, 0), gsSPDisplayList(impact_smoke_seg6_dl_06062AD8), - gsDPLoadTextureBlock(impact_smoke_seg6_texture_0605EA28 + 0x1000, G_IM_FMT_IA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(impact_smoke_seg6_dl_06062AF0), gsSPDisplayList(impact_smoke_seg6_dl_06062B08), gsSPEndDisplayList(), @@ -104,10 +101,9 @@ const Gfx impact_smoke_seg6_dl_06062C78[] = { // 0x06062D18 - 0x06062DB8 const Gfx impact_smoke_seg6_dl_06062D18[] = { gsSPDisplayList(impact_smoke_seg6_dl_06062AA8), - gsDPLoadTextureBlock(impact_smoke_seg6_texture_06060A28, G_IM_FMT_IA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(impact_smoke_seg6_texture_06060A28, G_IM_FMT_IA, G_IM_SIZ_16b, 64, 64, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPVertex(impact_smoke_seg6_vertex_06062A28, 8, 0), gsSPDisplayList(impact_smoke_seg6_dl_06062AD8), - gsDPLoadTextureBlock(impact_smoke_seg6_texture_06060A28 + 0x1000, G_IM_FMT_IA, G_IM_SIZ_16b, 64, 32, 0, G_TX_CLAMP, G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPDisplayList(impact_smoke_seg6_dl_06062AF0), gsSPDisplayList(impact_smoke_seg6_dl_06062B08), gsSPEndDisplayList(), diff --git a/actors/king_bobomb/model.inc.c b/actors/king_bobomb/model.inc.c index 7c6616d8..dc1171a8 100644 --- a/actors/king_bobomb/model.inc.c +++ b/actors/king_bobomb/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group3.h" - // King Bobomb // Unreferenced light group @@ -533,7 +531,7 @@ static const Vtx king_bobomb_seg5_vertex_0500B218[] = { const Gfx king_bobomb_seg5_dl_0500B278[] = { gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, king_bobomb_seg5_texture_05004878), gsDPLoadSync(), - gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), gsSPLight(&king_bobomb_seg5_lights_0500B200.l, 1), gsSPLight(&king_bobomb_seg5_lights_0500B200.a, 2), gsSPVertex(king_bobomb_seg5_vertex_0500B218, 6, 0), @@ -550,7 +548,7 @@ const Gfx king_bobomb_seg5_dl_0500B2D0[] = { gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), gsDPTileSync(), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD), - gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), + gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (64 - 1) << G_TEXTURE_IMAGE_FRAC), gsSPDisplayList(king_bobomb_seg5_dl_0500B278), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), gsDPPipeSync(), diff --git a/actors/klepto/model.inc.c b/actors/klepto/model.inc.c index c3eeb588..9f83b07a 100644 --- a/actors/klepto/model.inc.c +++ b/actors/klepto/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group5.h" - // Possible Removed Actor File // Bin ID? What is this? diff --git a/actors/koopa/model.inc.c b/actors/koopa/model.inc.c index ff76eb84..6bf24187 100644 --- a/actors/koopa/model.inc.c +++ b/actors/koopa/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group14.h" - // Koopa (Small Koopa, Big Koopa [Koopa the Quick]) @@ -56,6 +54,8 @@ static const Lights1 koopa_seg6_lights_06002630 = gdSPDefLights1( // beneath its shell, despite the fact it was intended to be white like // the rest of its body. This is evident because once the mistake is corrected // it turns back to being white like the other polygons. +// Due to debate in the PR surrounding the fix to this, said fix is on +// a compile-time variable. Use TEXTURE_FIX=1 at compile time to fix this. // 0x06002648 ALIGNED8 static const u8 koopa_seg6_texture_06002648[] = { #include "actors/koopa/koopa_shell_front.rgba16.inc.c" @@ -2079,8 +2079,13 @@ const Gfx koopa_seg6_dl_0600C498[] = { gsSPVertex(koopa_seg6_vertex_0600B560, 9, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP1Triangle( 6, 7, 8, 0x0), + #ifdef TEXTURE_FIX + gsSPLight(&koopa_seg6_lights_06002630.l, 1), + gsSPLight(&koopa_seg6_lights_06002630.a, 2), + #else gsSPLight(koopa_seg6_texture_06002648 + 0x20, 1), // this malformed light results in a gsSPLight(koopa_seg6_texture_06002648 + 0x18, 2), // koopa appearing to wear pink shorts. + #endif gsSPVertex(koopa_seg6_vertex_0600B5F0, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 6, 7, 0, 0x0, 8, 5, 9, 0x0), diff --git a/actors/koopa_flag/model.inc.c b/actors/koopa_flag/model.inc.c index efe8c86b..a706dee2 100644 --- a/actors/koopa_flag/model.inc.c +++ b/actors/koopa_flag/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group14.h" - // Koopa Flag // 0x06000000 diff --git a/actors/lakitu_cameraman/model.inc.c b/actors/lakitu_cameraman/model.inc.c index 3f77c656..8db4d268 100644 --- a/actors/lakitu_cameraman/model.inc.c +++ b/actors/lakitu_cameraman/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group15.h" - // Lakitu (Cameraman) // 0x06000000 diff --git a/actors/lakitu_enemy/model.inc.c b/actors/lakitu_enemy/model.inc.c index bc61a507..0cc41831 100644 --- a/actors/lakitu_enemy/model.inc.c +++ b/actors/lakitu_enemy/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group11.h" - // Lakitu Enemy // Unreferenced light group diff --git a/actors/mad_piano/model.inc.c b/actors/mad_piano/model.inc.c index 55999409..8240963e 100644 --- a/actors/mad_piano/model.inc.c +++ b/actors/mad_piano/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group9.h" - // Mad Piano // Unreferenced light group diff --git a/actors/mario/model.inc.c b/actors/mario/model.inc.c index 446c4126..9d39ba24 100644 --- a/actors/mario/model.inc.c +++ b/actors/mario/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group0.h" - // Mario // 0x04000000 # solid color blue - butt, left thigh, right thigh - all poly types diff --git a/actors/mist/model.inc.c b/actors/mist/model.inc.c index 850019bd..ef4d4bab 100644 --- a/actors/mist/model.inc.c +++ b/actors/mist/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/common1.h" - // Mist // 0x03000000 diff --git a/actors/moneybag/model.inc.c b/actors/moneybag/model.inc.c index 772f5877..935aa123 100644 --- a/actors/moneybag/model.inc.c +++ b/actors/moneybag/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group16.h" - // Moneybag // 0x060039B0 diff --git a/actors/monty_mole/model.inc.c b/actors/monty_mole/model.inc.c index 74b6d5e1..6998aee0 100644 --- a/actors/monty_mole/model.inc.c +++ b/actors/monty_mole/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group6.h" - // Monty Mole // Unreferenced light group diff --git a/actors/monty_mole_hole/model.inc.c b/actors/monty_mole_hole/model.inc.c index 12bcdc46..8b4fe744 100644 --- a/actors/monty_mole_hole/model.inc.c +++ b/actors/monty_mole_hole/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group6.h" - // Monty Mole Hole // 0x05000000 diff --git a/actors/mr_i_eyeball/model.inc.c b/actors/mr_i_eyeball/model.inc.c index 5db35e8e..2798aff8 100644 --- a/actors/mr_i_eyeball/model.inc.c +++ b/actors/mr_i_eyeball/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group17.h" - // Mr I (white eyeball) // 0x06000000 diff --git a/actors/mr_i_iris/model.inc.c b/actors/mr_i_iris/model.inc.c index e11e6363..b617e879 100644 --- a/actors/mr_i_iris/model.inc.c +++ b/actors/mr_i_iris/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group17.h" - // Mr I (Iris) // 0x06002130 diff --git a/actors/peach/model.inc.c b/actors/peach/model.inc.c index c75ecf20..0514802f 100644 --- a/actors/peach/model.inc.c +++ b/actors/peach/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group10.h" - // Peach // 0x050009F8 diff --git a/actors/penguin/model.inc.c b/actors/penguin/model.inc.c index d029eb4c..ff9eed78 100644 --- a/actors/penguin/model.inc.c +++ b/actors/penguin/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group7.h" - // Penguin // 0x05002D80 diff --git a/actors/piranha_plant/model.inc.c b/actors/piranha_plant/model.inc.c index 0eb03ab7..31603f95 100644 --- a/actors/piranha_plant/model.inc.c +++ b/actors/piranha_plant/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group14.h" - // Piranha Plant // 0x060113B0 diff --git a/actors/scuttlebug/model.inc.c b/actors/scuttlebug/model.inc.c index 4debeb2d..38fdf271 100644 --- a/actors/scuttlebug/model.inc.c +++ b/actors/scuttlebug/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group17.h" - // Scuttlebug // Unreferenced light group diff --git a/actors/seaweed/model.inc.c b/actors/seaweed/model.inc.c index 50f49090..72a50866 100644 --- a/actors/seaweed/model.inc.c +++ b/actors/seaweed/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group13.h" - // Seaweed // 0x06007DF8 diff --git a/actors/skeeter/model.inc.c b/actors/skeeter/model.inc.c index 3b4e29f3..190bb83d 100644 --- a/actors/skeeter/model.inc.c +++ b/actors/skeeter/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group13.h" - // Skeeter // Unreferenced light group diff --git a/actors/small_key/model.inc.c b/actors/small_key/model.inc.c index 4feb7b2d..d6493eb7 100644 --- a/actors/small_key/model.inc.c +++ b/actors/small_key/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group9.h" - // Small Key (unused) // ??? diff --git a/actors/snowman/model.inc.c b/actors/snowman/model.inc.c index 675cce69..4cc5de38 100644 --- a/actors/snowman/model.inc.c +++ b/actors/snowman/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group7.h" - // Snowman // ??? diff --git a/actors/snufit/model.inc.c b/actors/snufit/model.inc.c index 6a2ebc70..6a5dbbef 100644 --- a/actors/snufit/model.inc.c +++ b/actors/snufit/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group17.h" - // Snufit // 0x060070E0 diff --git a/actors/spindrift/model.inc.c b/actors/spindrift/model.inc.c index 1a221c6b..b3833941 100644 --- a/actors/spindrift/model.inc.c +++ b/actors/spindrift/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group7.h" - // Spindrift // Unreferenced light group diff --git a/actors/spiny/model.inc.c b/actors/spiny/model.inc.c index ef429623..aedcd62e 100644 --- a/actors/spiny/model.inc.c +++ b/actors/spiny/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group11.h" - // Spiny // 0x050157F8 diff --git a/actors/springboard/model.inc.c b/actors/springboard/model.inc.c index edbb239d..4297a688 100644 --- a/actors/springboard/model.inc.c +++ b/actors/springboard/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group8.h" - // Springboard (unused) // 0x05000000 diff --git a/actors/star/model.inc.c b/actors/star/model.inc.c index 1b52118b..0a4c9b28 100644 --- a/actors/star/model.inc.c +++ b/actors/star/model.inc.c @@ -56,7 +56,7 @@ const Gfx star_seg3_dl_0302B870[] = { gsSPSetGeometryMode(G_TEXTURE_GEN), gsDPSetEnvColor(255, 255, 255, 255), gsDPSetCombineMode(G_CC_DECALFADE, G_CC_DECALFADE), - gsDPLoadTextureBlock(star_seg3_texture_0302A6F0, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 64, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, 5, 6, G_TX_NOLOD, G_TX_NOLOD), //! Dimensions loaded as 32x64 despite this texture having only 32x32 dimensions, harmless due to environment mapping (G_TEXTURE_GEN & gsSPTexture values) + gsDPLoadTextureBlock(star_seg3_texture_0302A6F0, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, 5, 6, G_TX_NOLOD, G_TX_NOLOD), gsSPTexture(0x07C0, 0x07C0, 0, G_TX_RENDERTILE, G_ON), gsSPDisplayList(star_seg3_dl_0302B7B0), gsDPPipeSync(), diff --git a/actors/sushi/model.inc.c b/actors/sushi/model.inc.c index db1e1647..f77c2c67 100644 --- a/actors/sushi/model.inc.c +++ b/actors/sushi/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group4.h" - // Sushi (Shark) // Could be a duplicate binid of the previous actor, but i'm putting it here for diff --git a/actors/swoop/model.inc.c b/actors/swoop/model.inc.c index 614e0625..fc99de1e 100644 --- a/actors/swoop/model.inc.c +++ b/actors/swoop/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group17.h" - // Swoop // Unreferenced light group diff --git a/actors/toad/model.inc.c b/actors/toad/model.inc.c index 4ae8570f..ecdfbfd1 100644 --- a/actors/toad/model.inc.c +++ b/actors/toad/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group15.h" - // Toad // 0x06005908 diff --git a/actors/treasure_chest/model.inc.c b/actors/treasure_chest/model.inc.c index bf6d6b0a..f9aaad24 100644 --- a/actors/treasure_chest/model.inc.c +++ b/actors/treasure_chest/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group13.h" - // Treasure Chest // 0x06013F90 diff --git a/actors/ukiki/model.inc.c b/actors/ukiki/model.inc.c index 3f4d1f7d..a0e37836 100644 --- a/actors/ukiki/model.inc.c +++ b/actors/ukiki/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group6.h" - // Ukiki // Unreferenced light group diff --git a/actors/unagi/model.inc.c b/actors/unagi/model.inc.c index 5a58ba7b..a8cb4191 100644 --- a/actors/unagi/model.inc.c +++ b/actors/unagi/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group4.h" - // Unagi (Eel) // Unreferenced light group diff --git a/actors/whomp/model.inc.c b/actors/whomp/model.inc.c index b2f75210..d98c77dd 100644 --- a/actors/whomp/model.inc.c +++ b/actors/whomp/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group14.h" - // Whomp // ??? diff --git a/actors/wiggler_body/model.inc.c b/actors/wiggler_body/model.inc.c index eacece5b..0b685b25 100644 --- a/actors/wiggler_body/model.inc.c +++ b/actors/wiggler_body/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group11.h" - // Wiggler Body // 0x05005A30 diff --git a/actors/yellow_sphere_small/model.inc.c b/actors/yellow_sphere_small/model.inc.c index 49d27108..8b221b23 100644 --- a/actors/yellow_sphere_small/model.inc.c +++ b/actors/yellow_sphere_small/model.inc.c @@ -1,5 +1,3 @@ -#include "actors/group1.h" - // Yellow Sphere (used in a lot of things) // 0x05000000 diff --git a/asmdiff.jp.sh b/asmdiff.jp.sh new file mode 100644 index 00000000..1f86c753 --- /dev/null +++ b/asmdiff.jp.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +OBJDUMP="mips-linux-gnu-objdump -D -z -bbinary -mmips -EB" +OPTIONS="--start-address=$(($1)) --stop-address=$(($2))" +$OBJDUMP $OPTIONS baserom.jp.z64 > baserom.jp.dump +$OBJDUMP $OPTIONS build/jp/sm64.jp.z64 > sm64.jp.dump +diff baserom.jp.dump sm64.jp.dump | colordiff diff --git a/bin/cave.c b/bin/cave.c index a6f7c5ab..56658cd6 100644 --- a/bin/cave.c +++ b/bin/cave.c @@ -1,7 +1,5 @@ #include "sm64.h" -#include "textures.h" - #include "make_const_nonconst.h" // 0x09000000 diff --git a/bin/debug_level_select.c b/bin/debug_level_select.c index b3835623..bc79a0b3 100644 --- a/bin/debug_level_select.c +++ b/bin/debug_level_select.c @@ -1,9 +1,6 @@ #include #include "sm64.h" -#include "src/menu/debug_level_select.h" -#include "textures.h" - #include "make_const_nonconst.h" // 0x07000000 - 0x07000018 diff --git a/bin/effect.c b/bin/effect.c index 25edef93..fd6af43c 100644 --- a/bin/effect.c +++ b/bin/effect.c @@ -1,8 +1,6 @@ #include #include "sm64.h" -#include "textures.h" - #include "make_const_nonconst.h" UNUSED static const u64 effect_unused_0 = 0; diff --git a/bin/fire.c b/bin/fire.c index afe699f4..ea0f5ec2 100644 --- a/bin/fire.c +++ b/bin/fire.c @@ -1,7 +1,5 @@ #include "sm64.h" -#include "textures.h" - #include "make_const_nonconst.h" // 0x09000000 diff --git a/bin/generic.c b/bin/generic.c index af172036..4ce36975 100644 --- a/bin/generic.c +++ b/bin/generic.c @@ -1,7 +1,5 @@ #include "sm64.h" -#include "textures.h" - #include "make_const_nonconst.h" // 0x09000000 diff --git a/bin/grass.c b/bin/grass.c index a1c25240..3df488d5 100644 --- a/bin/grass.c +++ b/bin/grass.c @@ -1,7 +1,5 @@ #include "sm64.h" -#include "textures.h" - #include "make_const_nonconst.h" // 0x09000000 diff --git a/bin/inside.c b/bin/inside.c index f6fc95c1..d668af33 100644 --- a/bin/inside.c +++ b/bin/inside.c @@ -1,7 +1,5 @@ #include "sm64.h" -#include "textures.h" - #include "make_const_nonconst.h" // 0x09000000 diff --git a/bin/machine.c b/bin/machine.c index df529b3b..95afb459 100644 --- a/bin/machine.c +++ b/bin/machine.c @@ -1,7 +1,5 @@ #include "sm64.h" -#include "textures.h" - #include "make_const_nonconst.h" // 0x09000000 diff --git a/bin/mountain.c b/bin/mountain.c index 0ebb58a6..8a675c39 100644 --- a/bin/mountain.c +++ b/bin/mountain.c @@ -1,7 +1,5 @@ #include "sm64.h" -#include "textures.h" - #include "make_const_nonconst.h" // 0x09000000 diff --git a/bin/outside.c b/bin/outside.c index e00cfc0e..8de85134 100644 --- a/bin/outside.c +++ b/bin/outside.c @@ -1,7 +1,5 @@ #include "sm64.h" -#include "textures.h" - #include "make_const_nonconst.h" // 0x09000000 diff --git a/bin/segment2.c b/bin/segment2.c index b3498bff..a6756e95 100644 --- a/bin/segment2.c +++ b/bin/segment2.c @@ -1,5 +1,3 @@ -#include "game/segment2.h" - #include #include "sm64.h" #include "game/ingame_menu.h" @@ -1803,7 +1801,7 @@ ALIGNED8 static const u8 texture_hud_char_arrow_down[] = { }; // Main HUD print table 0x02008250-0x02008337 -const u8* const main_hud_lut[] = { +const u8 *const main_hud_lut[] = { #ifdef VERSION_EU texture_hud_char_0, texture_hud_char_1, texture_hud_char_2, texture_hud_char_3, texture_hud_char_4, texture_hud_char_5, texture_hud_char_6, texture_hud_char_7, @@ -2109,7 +2107,7 @@ const Gfx dl_hud_img_load_tex_block[] = { gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 4, G_TX_NOLOD), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 16 * 16 - 1, CALC_DXT(16, G_IM_SIZ_16b_BYTES)), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 4, G_TX_NOLOD), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 4, G_TX_NOLOD, G_TX_CLAMP, 4, G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (16 - 1) << G_TEXTURE_IMAGE_FRAC, (16 - 1) << G_TEXTURE_IMAGE_FRAC), gsSPEndDisplayList(), }; @@ -2146,7 +2144,7 @@ const Gfx dl_rgba16_load_tex_block[] = { gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 4, G_TX_NOLOD), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 16 * 16 - 1, CALC_DXT(16, G_IM_SIZ_16b_BYTES)), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 4, G_TX_NOLOD), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 4, G_TX_NOLOD, G_TX_CLAMP, 4, G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (16 - 1) << G_TEXTURE_IMAGE_FRAC, (16 - 1) << G_TEXTURE_IMAGE_FRAC), gsSPEndDisplayList(), }; @@ -2457,39 +2455,39 @@ ALIGNED8 static const u8 texture_shadow_quarter_square[] = { #include "textures/segment2/shadow_quarter_square.ia8.inc.c" }; -ALIGNED8 u8 texture_transition_star_half[] = { +ALIGNED8 const u8 texture_transition_star_half[] = { #include "textures/segment2/segment2.0F458.ia8.inc.c" }; -ALIGNED8 u8 texture_transition_circle_half[] = { +ALIGNED8 const u8 texture_transition_circle_half[] = { #include "textures/segment2/segment2.0FC58.ia8.inc.c" }; -ALIGNED8 u8 texture_transition_mario[] = { +ALIGNED8 const u8 texture_transition_mario[] = { #include "textures/segment2/segment2.10458.ia8.inc.c" }; -ALIGNED8 u8 texture_transition_bowser_half[] = { +ALIGNED8 const u8 texture_transition_bowser_half[] = { #include "textures/segment2/segment2.11458.ia8.inc.c" }; -ALIGNED8 u8 texture_waterbox_water[] = { +ALIGNED8 const u8 texture_waterbox_water[] = { #include "textures/segment2/segment2.11C58.rgba16.inc.c" }; -ALIGNED8 u8 texture_waterbox_jrb_water[] = { +ALIGNED8 const u8 texture_waterbox_jrb_water[] = { #include "textures/segment2/segment2.12458.rgba16.inc.c" }; -ALIGNED8 u8 texture_waterbox_unknown_water[] = { +ALIGNED8 const u8 texture_waterbox_unknown_water[] = { #include "textures/segment2/segment2.12C58.rgba16.inc.c" }; -ALIGNED8 u8 texture_waterbox_mist[] = { +ALIGNED8 const u8 texture_waterbox_mist[] = { #include "textures/segment2/segment2.13458.ia16.inc.c" }; -ALIGNED8 u8 texture_waterbox_lava[] = { +ALIGNED8 const u8 texture_waterbox_lava[] = { #include "textures/segment2/segment2.13C58.rgba16.inc.c" }; @@ -2501,41 +2499,19 @@ static const Lights1 segment2_lights_unused = gdSPDefLights1( // 0x02014470 - 0x020144B0 static const Mtx matrix_identity = { -#ifndef GBI_FLOATS - {{0x00010000, 0x00000000, - 0x00000001, 0x00000000}, - {0x00000000, 0x00010000, - 0x00000000, 0x00000001}, - {0x00000000, 0x00000000, - 0x00000000, 0x00000000}, - {0x00000000, 0x00000000, - 0x00000000, 0x00000000}} -#else {{1.0f, 0.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 0.0f, 1.0f}} -#endif }; // 0x020144B0 - 0x020144F0 static const Mtx matrix_fullscreen = { -#ifndef GBI_FLOATS - {{0x00000000, 0x00000000, - 0x00000000, 0x00000000}, - {0x00000000, 0xffff0000, - 0xffffffff, 0xffff0001}, - {((65536 * 2 / SCREEN_WIDTH) << 16) | 0, 0x00000000, - (0 << 16) | (65536 * 2 / SCREEN_HEIGHT), 0x00000000}, - {0x00000000, 0x00000000, - 0x00000000, 0x00000000}} -#else {{2.0f / SCREEN_WIDTH, 0.0f, 0.0f, 0.0f}, {0.0f, 2.0f / SCREEN_HEIGHT, 0.0f, 0.0f}, {0.0f, 0.0f, -1.0f, 0.0f}, {-1.0f, -1.0f, -1.0f, 1.0f}} -#endif }; @@ -2654,7 +2630,7 @@ const Gfx dl_skybox_end[] = { }; // 0x02014790 - 0x020147D0 -Gfx dl_waterbox_rgba16_begin[] = { +const Gfx dl_waterbox_rgba16_begin[] = { gsDPPipeSync(), gsDPSetCombineMode(G_CC_MODULATERGBA, G_CC_MODULATERGBA), gsSPClearGeometryMode(G_LIGHTING | G_CULL_BACK), @@ -2678,7 +2654,7 @@ const Gfx dl_waterbox_ia16_begin[] = { }; // 0x02014810 - 0x02014838 -Gfx dl_waterbox_end[] = { +const Gfx dl_waterbox_end[] = { gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), gsDPPipeSync(), gsSPSetGeometryMode(G_LIGHTING | G_CULL_BACK), diff --git a/bin/sky.c b/bin/sky.c index dfa56e6d..861f7765 100644 --- a/bin/sky.c +++ b/bin/sky.c @@ -1,7 +1,5 @@ #include "sm64.h" -#include "textures.h" - #include "make_const_nonconst.h" // 0x09000000 diff --git a/bin/snow.c b/bin/snow.c index 91265fde..5e8999f7 100644 --- a/bin/snow.c +++ b/bin/snow.c @@ -1,7 +1,5 @@ #include "sm64.h" -#include "textures.h" - #include "make_const_nonconst.h" // 0x09000000 diff --git a/bin/spooky.c b/bin/spooky.c index 3cb56b32..391519ef 100644 --- a/bin/spooky.c +++ b/bin/spooky.c @@ -1,7 +1,5 @@ #include "sm64.h" -#include "textures.h" - #include "make_const_nonconst.h" // 0x09000000 diff --git a/bin/title_screen_bg.c b/bin/title_screen_bg.c index 3d91e33b..e63233ab 100644 --- a/bin/title_screen_bg.c +++ b/bin/title_screen_bg.c @@ -1,8 +1,6 @@ #include #include "sm64.h" -#include "textures.h" - #include "make_const_nonconst.h" // 0x0A000000 - 0x0A000100 diff --git a/bin/water.c b/bin/water.c index 5eb796d2..a9588917 100644 --- a/bin/water.c +++ b/bin/water.c @@ -1,7 +1,5 @@ #include "sm64.h" -#include "textures.h" - #include "make_const_nonconst.h" // 0x09000000 diff --git a/c2obj.py b/c2obj.py new file mode 100644 index 00000000..508a51ec --- /dev/null +++ b/c2obj.py @@ -0,0 +1,141 @@ +""" +This module attempts to parse the ``model.inc.c`` files and extract the +3D models within as standard Wavefront OBJ files. + +Example: + Specify the path to the ``.inc.c`` file and a directory where to save + the extracted ``.obj`` files. + + $ python c2obj.py ./actors/mario/model.inc.c ./actors/mario/obj/ + +This is a work in progress and it currently has some serious limitations: + * It only extracts geometry information, so no textures or any other info + * It makes assumptions about the layout of the code in the C source + * It hasn't been properly tested. + +""" + +def parse(filename, output_directory): + from os import path, mkdir + + if not path.isdir(output_directory): + try: + mkdir(output_directory) + except OSError: + print(f'Could not use output directory {output_directory}.') + + vtx_def = 'static const Vtx ' + vtx_data = {} + reading_vtx = False + current_vtx_name = '' + current_vtx_data = [] + current_vtx_vertices = 0 + + gfx_def = 'const Gfx ' + reading_gfx = False + current_gfx_vertices = 0 + current_gfx_faces = 0 + insert_vert_call = 'gsSPVertex(' + insert_1tri_call = 'gsSP1Triangle(' + insert_2tri_call = 'gsSP2Triangles(' + gfx_count = 0 + + end_of_block = '};' + + with open(filename, 'r') as f: + for line in f: + line = line.strip() + + if line.startswith(vtx_def): + vtx_name = line.split(' ')[3][:-2] + current_vtx_name = vtx_name + current_vtx_data = [] + reading_vtx = True + continue + + if line.startswith(gfx_def): + from datetime import datetime + + current_gfx_name = line.split(' ')[2][:-2] + current_gfx_file = open(path.join(output_directory, current_gfx_name + '.obj'), 'w') + current_gfx_file.write("# Armando Arredondo's SM64 Wavefront OBJ Geometry Converter\n") + current_gfx_file.write('# File Created: {}\n\n'.format(datetime.now())) + reading_gfx = True + continue + + if line == end_of_block: + if reading_vtx: + vtx_data[current_vtx_name] = current_vtx_data + reading_vtx = False + + elif reading_gfx: + current_gfx_file.write(f'# {current_gfx_faces} faces\n\n') + current_gfx_file.close() + current_gfx_vertices = 0 + reading_gfx = False + gfx_count += 1 + + continue + + if reading_vtx: + line = line.replace('{', '[').replace('}', ']') + tri = eval(line[:-1])[0] + current_vtx_data.append(tri) + continue + + if reading_gfx: + if line.startswith(insert_vert_call): + args = line[len(insert_vert_call):].split(',') + current_vtx_name = args[0] + + if current_gfx_vertices > 0: + current_gfx_file.write(f'# {current_gfx_faces} faces\n\n') + + current_gfx_faces = 0 + current_vtx_vertices = len(vtx_data[current_vtx_name]) + current_gfx_vertices += current_vtx_vertices + + current_gfx_file.write(f'#\n# object {current_vtx_name}\n#\n\n') + current_vtx_data = vtx_data[current_vtx_name] + for tri in current_vtx_data: + v = tri[0] + current_gfx_file.write('v {:.3f} {:.3f} {:.3f}\n'.format(*v)) + current_gfx_file.write(f'# {current_vtx_vertices} vertices\n\n') + + for tri in current_vtx_data: + n = [_decode_normal(u) for u in tri[3][:3]] + current_gfx_file.write('vn {:.3f} {:.3f} {:.3f}\n'.format(*n)) + current_gfx_file.write(f'# {current_vtx_vertices} vertex normals\n\n') + + current_gfx_file.write(f'g {current_vtx_name}\n\n') + + elif line.startswith(insert_2tri_call): + args = line[len(insert_2tri_call):].split(',') + correction = current_gfx_vertices - current_vtx_vertices + 1 + indexes = [eval(args[i]) + correction for i in [0, 1, 2, 4, 5, 6]] + current_gfx_file.write('f {0}//{0} {1}//{1} {2}//{2}\n'.format(*indexes[:3])) + current_gfx_file.write('f {0}//{0} {1}//{1} {2}//{2}\n'.format(*indexes[3:])) + current_gfx_faces += 2 + + elif line.startswith(insert_1tri_call): + args = line[len(insert_1tri_call):].split(',') + correction = current_gfx_vertices - current_vtx_vertices + 1 + indexes = [eval(args[i]) + correction for i in [0, 1, 2]] + current_gfx_file.write('f {0}//{0} {1}//{1} {2}//{2}\n'.format(*indexes)) + current_gfx_faces += 1 + + continue + + print(f'{gfx_count} models extracted.') + +def _decode_normal(x): + y = x if x <= 127 else x - 255 + return y / 127 + +if __name__ == "__main__": + import argparse + parser = argparse.ArgumentParser() + parser.add_argument('filename', help = 'filename of the .inc.c source file') + parser.add_argument('output_directory', help = 'directory where to put the extracted .obj files') + args = parser.parse_args() + parse(args.filename, args.output_directory) \ No newline at end of file diff --git a/data/behavior_data.c b/data/behavior_data.c index 15cdebd3..d27cf09f 100644 --- a/data/behavior_data.c +++ b/data/behavior_data.c @@ -6,12 +6,11 @@ #include "game/object_list_processor.h" #include "game/interaction.h" #include "game/behavior_actions.h" -#include "game/behaviors/thwomp/thwomp.hpp" #include "game/mario_actions_cutscene.h" #include "game/mario_misc.h" #include "game/object_helpers.h" #include "game/debug.h" -#include "menu/file_select.hpp" +#include "menu/file_select.h" #include "engine/surface_load.h" #include "actors/common0.h" @@ -56,7 +55,282 @@ #include "make_const_nonconst.h" #include "behavior_data.h" -#include "include/behavior_macros.h" + +#define BC_B(a) _SHIFTL(a, 24, 8) +#define BC_BB(a, b) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8)) +#define BC_BBBB(a, b, c, d) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 8, 8) | _SHIFTL(d, 0, 8)) +#define BC_BBH(a, b, c) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 0, 16)) +#define BC_B0H(a, b) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 0, 16)) +#define BC_H(a) _SHIFTL(a, 16, 16) +#define BC_HH(a, b) (_SHIFTL(a, 16, 16) | _SHIFTL(b, 0, 16)) +#define BC_W(a) ((uintptr_t)(u32)(a)) +#define BC_PTR(a) ((uintptr_t)(a)) + + +// Defines the start of the behavior script as well as the object list the object belongs to. +// Has some special behavior for certain objects. +#define BEGIN(objList) \ + BC_BB(0x00, objList) + +// Delays the behavior script for a certain number of frames. +#define DELAY(num) \ + BC_B0H(0x01, num) + +// Jumps to a new behavior command and stores the return address in the object's stack. +#define CALL(addr) \ + BC_B(0x02), \ + BC_PTR(addr) + +// Jumps back to the behavior command stored in the object's stack. +#define RETURN() \ + BC_B(0x03) + +// Jumps to a new behavior script without saving anything. +#define GOTO(addr) \ + BC_B(0x04), \ + BC_PTR(addr) + +// Marks the start of a loop that will repeat a certain number of times. +#define BEGIN_REPEAT(count) \ + BC_B0H(0x05, count) + +// Marks the end of a repeating loop. +#define END_REPEAT() \ + BC_B(0x06) + +// Also marks the end of a repeating loop, but continues executing commands following the loop on the same frame. +#define END_REPEAT_CONTINUE() \ + BC_B(0x07) + +// Marks the beginning of an infinite loop. +#define BEGIN_LOOP() \ + BC_B(0x08) + +// Marks the end of an infinite loop. +#define END_LOOP() \ + BC_B(0x09) + +// Exits the behavior script. +// Often used to end behavior scripts that do not contain an infinite loop. +#define BREAK() \ + BC_B(0x0A) + +// Exits the behavior script, unused. +#define BREAK_UNUSED() \ + BC_B(0x0B) + +// Executes a native game function. +#define CALL_NATIVE(func) \ + BC_B(0x0C), \ + BC_PTR(func) + +// Adds a float to the specified field. +#define ADD_FLOAT(field, value) \ + BC_BBH(0x0D, field, value) + +// Sets the specified field to a float. +#define SET_FLOAT(field, value) \ + BC_BBH(0x0E, field, value) + +// Adds an integer to the specified field. +#define ADD_INT(field, value) \ + BC_BBH(0x0F, field, value) + +// Sets the specified field to an integer. +#define SET_INT(field, value) \ + BC_BBH(0x10, field, value) + +// Performs a bitwise OR with the specified field and the given integer. +// Usually used to set an object's flags. +#define OR_INT(field, value) \ + BC_BBH(0x11, field, value) + +// Performs a bit clear with the specified short. Unused in favor of the 32-bit version. +#define BIT_CLEAR(field, value) \ + BC_BBH(0x12, field, value) + +// TODO: this one needs a better name / labelling +// Gets a random short, right shifts it the specified amount and adds min to it, then sets the specified field to that value. +#define SET_INT_RAND_RSHIFT(field, min, rshift) \ + BC_BBH(0x13, field, min), \ + BC_H(rshift) + +// Sets the specified field to a random float in the given range. +#define SET_RANDOM_FLOAT(field, min, range) \ + BC_BBH(0x14, field, min), \ + BC_H(range) + +// Sets the specified field to a random integer in the given range. +#define SET_RANDOM_INT(field, min, range) \ + BC_BBH(0x15, field, min), \ + BC_H(range) + +// Adds a random float in the given range to the specified field. +#define ADD_RANDOM_FLOAT(field, min, range) \ + BC_BBH(0x16, field, min), \ + BC_H(range) + +// TODO: better name (unused anyway) +// Gets a random short, right shifts it the specified amount and adds min to it, then adds the value to the specified field. Unused. +#define ADD_INT_RAND_RSHIFT(field, min, rshift) \ + BC_BBH(0x17, field, min), \ + BC_H(rshift) + +// No operation. Unused. +#define CMD_NOP_1(field) \ + BC_BB(0x18, field) + +// No operation. Unused. +#define CMD_NOP_2(field) \ + BC_BB(0x19, field) + +// No operation. Unused. +#define CMD_NOP_3(field) \ + BC_BB(0x1A, field) + +// Sets the current model ID of the object. +#define SET_MODEL(modelID) \ + BC_B0H(0x1B, modelID) + +// Spawns a child object with the specified model and behavior. +#define SPAWN_CHILD(modelID, behavior) \ + BC_B(0x1C), \ + BC_W(modelID), \ + BC_PTR(behavior) + +// Exits the behavior script and despawns the object. +// Often used to end behavior scripts that do not contain an infinite loop. +#define DEACTIVATE() \ + BC_B(0x1D) + +// Finds the floor triangle directly under the object and moves the object down to it. +#define DROP_TO_FLOOR() \ + BC_B(0x1E) + +// Sets the destination float field to the sum of the values of the given float fields. +#define SUM_FLOAT(fieldDst, fieldSrc1, fieldSrc2) \ + BC_BBBB(0x1F, fieldDst, fieldSrc1, fieldSrc2) + +// Sets the destination integer field to the sum of the values of the given integer fields. Unused. +#define SUM_INT(fieldDst, fieldSrc1, fieldSrc2) \ + BC_BBBB(0x20, fieldDst, fieldSrc1, fieldSrc2) + +// Billboards the current object, making it always face the camera. +#define BILLBOARD() \ + BC_B(0x21) + +#define CYLBOARD() \ + BC_B(0x38) + +// Hides the current object. +#define HIDE() \ + BC_B(0x22) + +// Sets the size of the object's cylindrical hitbox. +#define SET_HITBOX(radius, height) \ + BC_B(0x23), \ + BC_HH(radius, height) + +// No operation. Unused. +#define CMD_NOP_4(field, value) \ + BC_BBH(0x24, field, value) + +// Delays the behavior script for the number of frames given by the value of the specified field. +#define DELAY_VAR(field) \ + BC_BB(0x25, field) + +// Unused. Marks the start of a loop that will repeat a certain number of times. +// Uses a u8 as the argument, instead of a s16 like the other version does. +#define BEGIN_REPEAT_UNUSED(count) \ + BC_BB(0x26, count) + +// Loads the animations for the object. is always set to oAnimations. +#define LOAD_ANIMATIONS(field, anims) \ + BC_BB(0x27, field), \ + BC_PTR(anims) + +// Begins animation and sets the object's current animation index to the specified value. +#define ANIMATE(animIndex) \ + BC_BB(0x28, animIndex) + +// Spawns a child object with the specified model and behavior, plus a behavior param. +#define SPAWN_CHILD_WITH_PARAM(bhvParam, modelID, behavior) \ + BC_B0H(0x29, bhvParam), \ + BC_W(modelID), \ + BC_PTR(behavior) + +// Loads collision data for the object. +#define LOAD_COLLISION_DATA(collisionData) \ + BC_B(0x2A), \ + BC_PTR(collisionData) + +// Sets the size of the object's cylindrical hitbox, and applies a downwards offset. +#define SET_HITBOX_WITH_OFFSET(radius, height, downOffset) \ + BC_B(0x2B), \ + BC_HH(radius, height), \ + BC_H(downOffset) + +// Spawns a new object with the specified model and behavior. +#define SPAWN_OBJ(modelID, behavior) \ + BC_B(0x2C), \ + BC_W(modelID), \ + BC_PTR(behavior) + +// Sets the home position of the object to its current position. +#define SET_HOME() \ + BC_B(0x2D) + +// Sets the size of the object's cylindrical hurtbox. +#define SET_HURTBOX(radius, height) \ + BC_B(0x2E), \ + BC_HH(radius, height) + +// Sets the object's interaction type. +#define SET_INTERACT_TYPE(type) \ + BC_B(0x2F), \ + BC_W(type) + +// Sets various parameters that the object uses for calculating physics. +#define SET_OBJ_PHYSICS(wallHitboxRadius, gravity, bounciness, dragStrength, friction, buoyancy, unused1, unused2) \ + BC_B(0x30), \ + BC_HH(wallHitboxRadius, gravity), \ + BC_HH(bounciness, dragStrength), \ + BC_HH(friction, buoyancy), \ + BC_HH(unused1, unused2) + +// Sets the object's interaction subtype. Unused. +#define SET_INTERACT_SUBTYPE(subtype) \ + BC_B(0x31), \ + BC_W(subtype) + +// Sets the object's size to the specified percentage. +#define SCALE(unusedField, percent) \ + BC_BBH(0x32, unusedField, percent) + +// Performs a bit clear on the object's parent's field with the specified value. +// Used for clearing active particle flags fron Mario's object. +#define PARENT_BIT_CLEAR(field, flags) \ + BC_BB(0x33, field), \ + BC_W(flags) + +// Animates an object using texture animation. is always set to oAnimState. +#define ANIMATE_TEXTURE(field, rate) \ + BC_BBH(0x34, field, rate) + +// Disables rendering for the object. +#define DISABLE_RENDERING() \ + BC_B(0x35) + +// Unused. Sets the specified field to an integer. Wastes 4 bytes of space for no reason at all. +#define SET_INT_UNUSED(field, value) \ + BC_BB(0x36, field), \ + BC_HH(0, value) + +// Spawns a water droplet with the given parameters. +#define SPAWN_WATER_DROPLET(dropletParams) \ + BC_B(0x37), \ + BC_PTR(dropletParams) + const BehaviorScript bhvStarDoor[] = { BEGIN(OBJ_LIST_SURFACE), @@ -2909,7 +3183,11 @@ const BehaviorScript bhvFloorTrapInCastle[] = { const BehaviorScript bhvTree[] = { BEGIN(OBJ_LIST_POLELIKE), + #ifdef BETTERCAMERA + CYLBOARD(), + #else BILLBOARD(), + #endif OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE), SET_INT(oInteractType, INTERACT_POLE), SET_HITBOX(/*Radius*/ 80, /*Height*/ 500), @@ -5834,5 +6112,3 @@ const BehaviorScript bhvIntroScene[] = { CALL_NATIVE(bhv_intro_scene_loop), END_LOOP(), }; - - diff --git a/doxygen/logo.png b/doxygen/logo.png index f01a8654..0980cc0c 100644 Binary files a/doxygen/logo.png and b/doxygen/logo.png differ diff --git a/enhancements/60fps.patch b/enhancements/60fps_ex.patch similarity index 92% rename from enhancements/60fps.patch rename to enhancements/60fps_ex.patch index b0dcb3f9..9f459359 100644 --- a/enhancements/60fps.patch +++ b/enhancements/60fps_ex.patch @@ -1,5 +1,5 @@ diff --git a/include/types.h b/include/types.h -index a33dc721..18887a45 100644 +index b3dc27e..c46bdf0 100644 --- a/include/types.h +++ b/include/types.h @@ -118,6 +118,10 @@ struct GraphNodeObject_sub @@ -48,10 +48,10 @@ index a33dc721..18887a45 100644 struct MarioBodyState diff --git a/src/engine/graph_node.h b/src/engine/graph_node.h -index a680f70e..a31bb8ae 100644 +index 802d97a..1b0d677 100644 --- a/src/engine/graph_node.h +++ b/src/engine/graph_node.h -@@ -109,6 +109,8 @@ struct GraphNodePerspective +@@ -110,6 +110,8 @@ struct GraphNodePerspective /*0x1C*/ f32 fov; // horizontal field of view in degrees /*0x20*/ s16 near; // near clipping plane /*0x22*/ s16 far; // far clipping plane @@ -60,7 +60,7 @@ index a680f70e..a31bb8ae 100644 }; /** An entry in the master list. It is a linked list of display lists -@@ -117,7 +119,9 @@ struct GraphNodePerspective +@@ -118,7 +120,9 @@ struct GraphNodePerspective struct DisplayListNode { Mtx *transform; @@ -70,7 +70,7 @@ index a680f70e..a31bb8ae 100644 struct DisplayListNode *next; }; -@@ -184,7 +188,11 @@ struct GraphNodeCamera +@@ -185,7 +189,11 @@ struct GraphNodeCamera } config; /*0x1C*/ Vec3f pos; /*0x28*/ Vec3f focus; @@ -82,7 +82,7 @@ index a680f70e..a31bb8ae 100644 /*0x38*/ s16 roll; // roll in look at matrix. Doesn't account for light direction unlike rollScreen. /*0x3A*/ s16 rollScreen; // rolls screen while keeping the light direction consistent }; -@@ -225,7 +233,8 @@ struct GraphNodeRotation +@@ -226,7 +234,8 @@ struct GraphNodeRotation /*0x00*/ struct GraphNode node; /*0x14*/ void *displayList; /*0x18*/ Vec3s rotation; @@ -92,7 +92,7 @@ index a680f70e..a31bb8ae 100644 }; /** GraphNode part that transforms itself and its children based on animation -@@ -322,6 +331,9 @@ struct GraphNodeBackground +@@ -323,6 +332,9 @@ struct GraphNodeBackground /*0x00*/ struct FnGraphNode fnNode; /*0x18*/ s32 unused; /*0x1C*/ s32 background; // background ID, or rgba5551 color if fnNode.func is null @@ -102,7 +102,7 @@ index a680f70e..a31bb8ae 100644 }; /** Renders the object that Mario is holding. -@@ -332,6 +344,8 @@ struct GraphNodeHeldObject +@@ -333,6 +345,8 @@ struct GraphNodeHeldObject /*0x18*/ s32 playerIndex; /*0x1C*/ struct Object *objNode; /*0x20*/ Vec3s translation; @@ -112,18 +112,18 @@ index a680f70e..a31bb8ae 100644 /** A node that allows an object to specify a different culling radius than the diff --git a/src/engine/surface_collision.c b/src/engine/surface_collision.c -index 9aff62f9..9c062cf4 100644 +index 5b6775f..2c11e25 100644 --- a/src/engine/surface_collision.c +++ b/src/engine/surface_collision.c -@@ -7,6 +7,7 @@ - #include "game/object_list_processor.h" +@@ -8,6 +8,7 @@ #include "surface_collision.h" #include "surface_load.h" + #include "math_util.h" +#include "game/game_init.h" /************************************************** * WALLS * -@@ -393,26 +394,44 @@ f32 find_floor_height_and_data(f32 xPos, f32 yPos, f32 zPos, struct FloorGeometr +@@ -394,26 +395,44 @@ f32 find_floor_height_and_data(f32 xPos, f32 yPos, f32 zPos, struct FloorGeometr return floorHeight; } @@ -169,7 +169,7 @@ index 9aff62f9..9c062cf4 100644 // Check that the point is within the triangle bounds. if ((z1 - z) * (x2 - x1) - (x1 - x) * (z2 - z1) < 0) { -@@ -422,6 +441,10 @@ static struct Surface *find_floor_from_list(struct SurfaceNode *surfaceNode, s32 +@@ -423,6 +442,10 @@ static struct Surface *find_floor_from_list(struct SurfaceNode *surfaceNode, s32 // To slightly save on computation time, set this later. x3 = surf->vertex3[0]; z3 = surf->vertex3[2]; @@ -180,7 +180,7 @@ index 9aff62f9..9c062cf4 100644 if ((z2 - z) * (x3 - x2) - (x2 - x) * (z3 - z2) < 0) { continue; -@@ -441,10 +464,30 @@ static struct Surface *find_floor_from_list(struct SurfaceNode *surfaceNode, s32 +@@ -442,10 +465,30 @@ static struct Surface *find_floor_from_list(struct SurfaceNode *surfaceNode, s32 continue; } @@ -215,7 +215,7 @@ index 9aff62f9..9c062cf4 100644 // If a wall, ignore it. Likely a remnant, should never occur. if (ny == 0.0f) { -@@ -459,6 +502,15 @@ static struct Surface *find_floor_from_list(struct SurfaceNode *surfaceNode, s32 +@@ -460,6 +503,15 @@ static struct Surface *find_floor_from_list(struct SurfaceNode *surfaceNode, s32 } *pheight = height; @@ -232,7 +232,7 @@ index 9aff62f9..9c062cf4 100644 break; } diff --git a/src/engine/surface_load.c b/src/engine/surface_load.c -index 6936d8a1..b2b7b37a 100644 +index ac2ee50..323b7d0 100644 --- a/src/engine/surface_load.c +++ b/src/engine/surface_load.c @@ -14,6 +14,7 @@ @@ -256,10 +256,10 @@ index 6936d8a1..b2b7b37a 100644 surface->vertex2[0] = x2; surface->vertex3[0] = x3; diff --git a/src/game/camera.c b/src/game/camera.c -index 60bfb865..fd910268 100644 +index bde0662..9351dea 100644 --- a/src/game/camera.c +++ b/src/game/camera.c -@@ -483,6 +483,10 @@ CameraTransition sModeTransitions[] = { +@@ -484,6 +484,10 @@ CameraTransition sModeTransitions[] = { extern u8 sDanceCutsceneIndexTable[][4]; extern u8 sZoomOutAreaMasks[]; @@ -270,7 +270,7 @@ index 60bfb865..fd910268 100644 /** * Starts a camera shake triggered by an interaction */ -@@ -5502,6 +5506,7 @@ s32 set_camera_mode_fixed(struct Camera *c, s16 x, s16 y, s16 z) { +@@ -5552,6 +5556,7 @@ s32 set_camera_mode_fixed(struct Camera *c, s16 x, s16 y, s16 z) { c->mode = CAMERA_MODE_FIXED; vec3f_set(c->pos, sFixedModeBasePosition[0], sMarioCamState->pos[1], sFixedModeBasePosition[2]); @@ -278,7 +278,7 @@ index 60bfb865..fd910268 100644 } return basePosSet; } -@@ -5652,6 +5657,7 @@ BAD_RETURN(s32) cam_rr_enter_building_side(struct Camera *c) { +@@ -5714,6 +5719,7 @@ BAD_RETURN(s32) cam_rr_enter_building_side(struct Camera *c) { if (c->mode != CAMERA_MODE_FIXED) { sStatusFlags &= ~CAM_FLAG_SMOOTH_MOVEMENT; c->mode = CAMERA_MODE_FIXED; @@ -286,7 +286,7 @@ index 60bfb865..fd910268 100644 } } -@@ -5847,6 +5853,7 @@ BAD_RETURN(s32) cam_castle_enter_lobby(struct Camera *c) { +@@ -5909,6 +5915,7 @@ BAD_RETURN(s32) cam_castle_enter_lobby(struct Camera *c) { sStatusFlags &= ~CAM_FLAG_SMOOTH_MOVEMENT; set_fixed_cam_axis_sa_lobby(c->mode); c->mode = CAMERA_MODE_FIXED; @@ -294,7 +294,7 @@ index 60bfb865..fd910268 100644 } } -@@ -7214,6 +7221,7 @@ BAD_RETURN(s32) cutscene_unused_loop(UNUSED struct Camera *c) { +@@ -7279,6 +7286,7 @@ BAD_RETURN(s32) cutscene_unused_loop(UNUSED struct Camera *c) { BAD_RETURN(s32) cutscene_ending_mario_fall_start(struct Camera *c) { vec3f_set(c->focus, -26.f, 0.f, -137.f); vec3f_set(c->pos, 165.f, 4725.f, 324.f); @@ -302,7 +302,7 @@ index 60bfb865..fd910268 100644 } /** -@@ -7246,6 +7254,7 @@ BAD_RETURN(s32) cutscene_ending_mario_fall(struct Camera *c) { +@@ -7311,6 +7319,7 @@ BAD_RETURN(s32) cutscene_ending_mario_fall(struct Camera *c) { BAD_RETURN(s32) cutscene_ending_mario_land_closeup(struct Camera *c) { vec3f_set(c->focus, 85.f, 826.f, 250.f); vec3f_set(c->pos, -51.f, 988.f, -202.f); @@ -310,7 +310,7 @@ index 60bfb865..fd910268 100644 player2_rotate_cam(c, -0x2000, 0x2000, -0x2000, 0x2000); } -@@ -7255,6 +7264,7 @@ BAD_RETURN(s32) cutscene_ending_mario_land_closeup(struct Camera *c) { +@@ -7320,6 +7329,7 @@ BAD_RETURN(s32) cutscene_ending_mario_land_closeup(struct Camera *c) { BAD_RETURN(s32) cutscene_ending_reset_spline(UNUSED struct Camera *c) { sCutsceneVars[9].point[0] = 0.f; cutscene_reset_spline(); @@ -318,7 +318,7 @@ index 60bfb865..fd910268 100644 } /** -@@ -7290,6 +7300,7 @@ BAD_RETURN(s32) cutscene_ending_peach_appear_closeup(struct Camera *c) { +@@ -7355,6 +7365,7 @@ BAD_RETURN(s32) cutscene_ending_peach_appear_closeup(struct Camera *c) { vec3f_set(c->pos, 179.f, 2463.f, -1216.f); c->pos[1] = gCutsceneFocus->oPosY + 35.f; vec3f_set(c->focus, gCutsceneFocus->oPosX, gCutsceneFocus->oPosY + 125.f, gCutsceneFocus->oPosZ); @@ -326,7 +326,7 @@ index 60bfb865..fd910268 100644 } /** -@@ -7308,6 +7319,7 @@ BAD_RETURN(s32) cutscene_ending_peach_appears(struct Camera *c) { +@@ -7373,6 +7384,7 @@ BAD_RETURN(s32) cutscene_ending_peach_appears(struct Camera *c) { BAD_RETURN(s32) cutscene_ending_peach_descends_start(UNUSED struct Camera *c) { cutscene_reset_spline(); sCutsceneVars[2].point[1] = 150.f; @@ -334,7 +334,7 @@ index 60bfb865..fd910268 100644 } /** -@@ -7394,6 +7406,7 @@ BAD_RETURN(s32) cutscene_ending_peach_wakeup(struct Camera *c) { +@@ -7459,6 +7471,7 @@ BAD_RETURN(s32) cutscene_ending_peach_wakeup(struct Camera *c) { BAD_RETURN(s32) cutscene_ending_dialog(struct Camera *c) { vec3f_set(c->focus, 11.f, 983.f, -1273.f); vec3f_set(c->pos, -473.f, 970.f, -1152.f); @@ -342,7 +342,7 @@ index 60bfb865..fd910268 100644 player2_rotate_cam(c, -0x800, 0x2000, -0x2000, 0x2000); } -@@ -7404,6 +7417,7 @@ BAD_RETURN(s32) cutscene_ending_kiss_closeup(struct Camera *c) { +@@ -7469,6 +7482,7 @@ BAD_RETURN(s32) cutscene_ending_kiss_closeup(struct Camera *c) { set_fov_function(CAM_FOV_SET_29); vec3f_set(c->focus, 350.f, 1034.f, -1216.f); vec3f_set(c->pos, -149.f, 1021.f, -1216.f); @@ -350,7 +350,7 @@ index 60bfb865..fd910268 100644 } /** -@@ -7439,6 +7453,7 @@ BAD_RETURN(s32) cutscene_ending_kiss(struct Camera *c) { +@@ -7504,6 +7518,7 @@ BAD_RETURN(s32) cutscene_ending_kiss(struct Camera *c) { BAD_RETURN(s32) cutscene_ending_look_at_sky(struct Camera *c) { move_point_along_spline(c->focus, sEndingLookAtSkyFocus, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); vec3f_set(c->pos, 699.f, 1680.f, -703.f); @@ -358,7 +358,7 @@ index 60bfb865..fd910268 100644 } /** -@@ -10260,6 +10275,7 @@ BAD_RETURN(s32) cutscene_door_start(struct Camera *c) { +@@ -10340,6 +10355,7 @@ BAD_RETURN(s32) cutscene_door_start(struct Camera *c) { BAD_RETURN(s32) cutscene_door_fix_cam(struct Camera *c) { vec3f_copy(c->pos, sCutsceneVars[0].point); vec3f_copy(c->focus, sCutsceneVars[1].point); @@ -366,7 +366,7 @@ index 60bfb865..fd910268 100644 } /** -@@ -10293,6 +10309,7 @@ BAD_RETURN(s32) cutscene_door_move_behind_mario(struct Camera *c) { +@@ -10373,6 +10389,7 @@ BAD_RETURN(s32) cutscene_door_move_behind_mario(struct Camera *c) { } offset_rotated(c->pos, sMarioCamState->pos, camOffset, sCutsceneVars[0].angle); @@ -375,10 +375,10 @@ index 60bfb865..fd910268 100644 /** diff --git a/src/game/camera.h b/src/game/camera.h -index f56ed027..2b682ed0 100644 +index 173ab8a..b1abdc4 100644 --- a/src/game/camera.h +++ b/src/game/camera.h -@@ -654,6 +654,8 @@ struct LakituState +@@ -657,6 +657,8 @@ struct LakituState /// Mario's action from the previous frame. Only used to determine if Mario just finished a dive. /*0xB8*/ u32 lastFrameAction; /*0xBC*/ s16 unused; @@ -388,7 +388,7 @@ index f56ed027..2b682ed0 100644 // bss order hack to not affect BSS order. if possible, remove me, but it will be hard to match otherwise diff --git a/src/game/envfx_bubbles.c b/src/game/envfx_bubbles.c -index 16a92720..ee1b029d 100644 +index 16a9272..ee1b029 100644 --- a/src/game/envfx_bubbles.c +++ b/src/game/envfx_bubbles.c @@ -35,6 +35,20 @@ Vtx_t gBubbleTempVtx[3] = { @@ -496,7 +496,7 @@ index 16a92720..ee1b029d 100644 gSPDisplayList(sGfxCursor++, &tiny_bubble_dl_0B006AB0); gSPEndDisplayList(sGfxCursor++); diff --git a/src/game/envfx_snow.c b/src/game/envfx_snow.c -index c3c14a5c..d2212ef6 100644 +index c3c14a5..d2212ef 100644 --- a/src/game/envfx_snow.c +++ b/src/game/envfx_snow.c @@ -54,6 +54,26 @@ extern void *tiny_bubble_dl_0B006AB0; @@ -594,7 +594,7 @@ index c3c14a5c..d2212ef6 100644 gSPDisplayList(gfx++, &tiny_bubble_dl_0B006AB0) gSPEndDisplayList(gfx++); diff --git a/src/game/envfx_snow.h b/src/game/envfx_snow.h -index 7a83b536..f4acc2de 100644 +index 7a83b53..f4acc2d 100644 --- a/src/game/envfx_snow.h +++ b/src/game/envfx_snow.h @@ -25,7 +25,8 @@ struct EnvFxParticle { @@ -608,10 +608,10 @@ index 7a83b536..f4acc2de 100644 extern s8 gEnvFxMode; diff --git a/src/game/hud.c b/src/game/hud.c -index 8d4daa54..7ce2b222 100644 +index 1540b67..0de6e0b 100644 --- a/src/game/hud.c +++ b/src/game/hud.c -@@ -57,6 +57,20 @@ static struct UnusedHUDStruct sUnusedHUDValues = { 0x00, 0x0A, 0x00 }; +@@ -59,6 +59,20 @@ static struct UnusedHUDStruct sUnusedHUDValues = { 0x00, 0x0A, 0x00 }; static struct CameraHUD sCameraHUD = { CAM_STATUS_NONE }; @@ -632,7 +632,7 @@ index 8d4daa54..7ce2b222 100644 /** * Renders a rgba16 16x16 glyph texture from a table list. */ -@@ -109,6 +123,7 @@ void render_power_meter_health_segment(s16 numHealthWedges) { +@@ -111,6 +125,7 @@ void render_power_meter_health_segment(s16 numHealthWedges) { */ void render_dl_power_meter(s16 numHealthWedges) { Mtx *mtx; @@ -640,7 +640,7 @@ index 8d4daa54..7ce2b222 100644 mtx = alloc_display_list(sizeof(Mtx)); -@@ -116,7 +131,15 @@ void render_dl_power_meter(s16 numHealthWedges) { +@@ -118,7 +133,15 @@ void render_dl_power_meter(s16 numHealthWedges) { return; } @@ -658,12 +658,12 @@ index 8d4daa54..7ce2b222 100644 gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx++), G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH); diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c -index b9a43df2..281e0f3f 100644 +index 7ae9f1e..1c23c96 100644 --- a/src/game/ingame_menu.c +++ b/src/game/ingame_menu.c -@@ -111,6 +111,41 @@ u8 gMenuHoldKeyIndex = 0; - u8 gMenuHoldKeyTimer = 0; - s32 gDialogResponse = 0; +@@ -130,6 +130,42 @@ s32 gDialogResponse = 0; + static struct CachedChar { u8 used; u8 data[CHCACHE_BUFLEN]; } charCache[256]; + #endif // VERSION +static Gfx *sInterpolatedDialogOffsetPos; +static f32 sInterpolatedDialogOffset; @@ -700,10 +700,11 @@ index b9a43df2..281e0f3f 100644 + sInterpolatedDialogZoomPos = NULL; + } +} - ++ void create_dl_identity_matrix(void) { Mtx *matrix = (Mtx *) alloc_display_list(sizeof(Mtx)); -@@ -947,6 +982,14 @@ void render_dialog_box_type(struct DialogEntry *dialog, s8 linesPerBox) { + +@@ -969,6 +1005,14 @@ void render_dialog_box_type(struct DialogEntry *dialog, s8 linesPerBox) { switch (gDialogBoxType) { case DIALOG_TYPE_ROTATE: // Renders a dialog black box with zoom and rotation if (gDialogBoxState == DIALOG_STATE_OPENING || gDialogBoxState == DIALOG_STATE_CLOSING) { @@ -718,7 +719,7 @@ index b9a43df2..281e0f3f 100644 create_dl_scale_matrix(MENU_MTX_NOPUSH, 1.0 / gDialogBoxScale, 1.0 / gDialogBoxScale, 1.0f); // convert the speed into angle create_dl_rotation_matrix(MENU_MTX_NOPUSH, gDialogBoxOpenTimer * 4.0f, 0, 0, 1.0f); -@@ -955,6 +998,12 @@ void render_dialog_box_type(struct DialogEntry *dialog, s8 linesPerBox) { +@@ -977,6 +1021,12 @@ void render_dialog_box_type(struct DialogEntry *dialog, s8 linesPerBox) { break; case DIALOG_TYPE_ZOOM: // Renders a dialog white box with zoom if (gDialogBoxState == DIALOG_STATE_OPENING || gDialogBoxState == DIALOG_STATE_CLOSING) { @@ -731,7 +732,7 @@ index b9a43df2..281e0f3f 100644 create_dl_translation_matrix(MENU_MTX_NOPUSH, 65.0 - (65.0 / gDialogBoxScale), (40.0 / gDialogBoxScale) - 40, 0); create_dl_scale_matrix(MENU_MTX_NOPUSH, 1.0 / gDialogBoxScale, 1.0 / gDialogBoxScale, 1.0f); -@@ -1237,6 +1286,8 @@ void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 l +@@ -1259,6 +1309,8 @@ void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 l #ifdef VERSION_EU gDialogY -= gDialogScrollOffsetY; #else @@ -741,7 +742,7 @@ index b9a43df2..281e0f3f 100644 #endif } diff --git a/src/game/level_geo.c b/src/game/level_geo.c -index 4c98e705..abc51213 100644 +index 4c98e70..abc5121 100644 --- a/src/game/level_geo.c +++ b/src/game/level_geo.c @@ -34,12 +34,16 @@ Gfx *geo_envfx_main(s32 callContext, struct GraphNode *node, Mat4 mtxf) { @@ -762,7 +763,7 @@ index 4c98e705..abc51213 100644 } SET_HIGH_U16_OF_32(*params, gAreaUpdateCounter); diff --git a/src/game/object_helpers.c b/src/game/object_helpers.c -index 2cc02248..41a26bfc 100644 +index 22b45b3..109d7f7 100644 --- a/src/game/object_helpers.c +++ b/src/game/object_helpers.c @@ -1554,6 +1554,7 @@ void cur_obj_set_pos_to_home(void) { @@ -774,7 +775,7 @@ index 2cc02248..41a26bfc 100644 void cur_obj_set_pos_to_home_and_stop(void) { diff --git a/src/game/paintings.c b/src/game/paintings.c -index 205a9eac..9583c64e 100644 +index 6cae19c..a304d4a 100644 --- a/src/game/paintings.c +++ b/src/game/paintings.c @@ -189,6 +189,32 @@ struct Painting **sPaintingGroups[] = { @@ -851,7 +852,7 @@ index 205a9eac..9583c64e 100644 // Update the ripple, may automatically reset the painting's state. painting_update_ripple_state(painting); diff --git a/src/game/rendering_graph_node.c b/src/game/rendering_graph_node.c -index 80dbfca4..b083717f 100644 +index d5bf577..71656b4 100644 --- a/src/game/rendering_graph_node.c +++ b/src/game/rendering_graph_node.c @@ -39,6 +39,8 @@ @@ -1009,7 +1010,7 @@ index 80dbfca4..b083717f 100644 gCurGraphNodeCamFrustum = node; geo_process_node_and_siblings(node->fnNode.node.children); -@@ -309,6 +380,39 @@ static void geo_process_switch(struct GraphNodeSwitchCase *node) { +@@ -297,6 +368,39 @@ static void geo_process_switch(struct GraphNodeSwitchCase *node) { } } @@ -1049,7 +1050,7 @@ index 80dbfca4..b083717f 100644 /** * Process a camera node. */ -@@ -316,6 +420,9 @@ static void geo_process_camera(struct GraphNodeCamera *node) { +@@ -304,6 +408,9 @@ static void geo_process_camera(struct GraphNodeCamera *node) { Mat4 cameraTransform; Mtx *rollMtx = alloc_display_list(sizeof(*rollMtx)); Mtx *mtx = alloc_display_list(sizeof(*mtx)); @@ -1059,7 +1060,7 @@ index 80dbfca4..b083717f 100644 if (node->fnNode.func != NULL) { node->fnNode.func(GEO_CONTEXT_RENDER, &node->fnNode.node, gMatStack[gMatStackIndex]); -@@ -326,12 +433,40 @@ static void geo_process_camera(struct GraphNodeCamera *node) { +@@ -314,12 +421,40 @@ static void geo_process_camera(struct GraphNodeCamera *node) { mtxf_lookat(cameraTransform, node->pos, node->focus, node->roll); mtxf_mul(gMatStack[gMatStackIndex + 1], cameraTransform, gMatStack[gMatStackIndex]); @@ -1100,7 +1101,7 @@ index 80dbfca4..b083717f 100644 geo_process_node_and_siblings(node->fnNode.node.children); gCurGraphNodeCamera = NULL; } -@@ -348,13 +483,17 @@ static void geo_process_translation_rotation(struct GraphNodeTranslationRotation +@@ -336,13 +471,17 @@ static void geo_process_translation_rotation(struct GraphNodeTranslationRotation Mat4 mtxf; Vec3f translation; Mtx *mtx = alloc_display_list(sizeof(*mtx)); @@ -1118,7 +1119,7 @@ index 80dbfca4..b083717f 100644 if (node->displayList != NULL) { geo_append_display_list(node->displayList, node->node.flags >> 8); } -@@ -373,13 +512,17 @@ static void geo_process_translation(struct GraphNodeTranslation *node) { +@@ -361,13 +500,17 @@ static void geo_process_translation(struct GraphNodeTranslation *node) { Mat4 mtxf; Vec3f translation; Mtx *mtx = alloc_display_list(sizeof(*mtx)); @@ -1136,7 +1137,7 @@ index 80dbfca4..b083717f 100644 if (node->displayList != NULL) { geo_append_display_list(node->displayList, node->node.flags >> 8); } -@@ -397,12 +540,23 @@ static void geo_process_translation(struct GraphNodeTranslation *node) { +@@ -385,12 +528,23 @@ static void geo_process_translation(struct GraphNodeTranslation *node) { static void geo_process_rotation(struct GraphNodeRotation *node) { Mat4 mtxf; Mtx *mtx = alloc_display_list(sizeof(*mtx)); @@ -1160,7 +1161,7 @@ index 80dbfca4..b083717f 100644 if (node->displayList != NULL) { geo_append_display_list(node->displayList, node->node.flags >> 8); } -@@ -421,12 +575,16 @@ static void geo_process_scale(struct GraphNodeScale *node) { +@@ -409,12 +563,16 @@ static void geo_process_scale(struct GraphNodeScale *node) { UNUSED Mat4 transform; Vec3f scaleVec; Mtx *mtx = alloc_display_list(sizeof(*mtx)); @@ -1177,7 +1178,7 @@ index 80dbfca4..b083717f 100644 if (node->displayList != NULL) { geo_append_display_list(node->displayList, node->node.flags >> 8); } -@@ -445,21 +603,30 @@ static void geo_process_scale(struct GraphNodeScale *node) { +@@ -433,21 +591,30 @@ static void geo_process_scale(struct GraphNodeScale *node) { static void geo_process_billboard(struct GraphNodeBillboard *node) { Vec3f translation; Mtx *mtx = alloc_display_list(sizeof(*mtx)); @@ -1208,7 +1209,7 @@ index 80dbfca4..b083717f 100644 if (node->displayList != NULL) { geo_append_display_list(node->displayList, node->node.flags >> 8); } -@@ -508,13 +675,39 @@ static void geo_process_generated_list(struct GraphNodeGenerated *node) { +@@ -496,13 +663,39 @@ static void geo_process_generated_list(struct GraphNodeGenerated *node) { */ static void geo_process_background(struct GraphNodeBackground *node) { Gfx *list = NULL; @@ -1249,7 +1250,7 @@ index 80dbfca4..b083717f 100644 } else if (gCurGraphNodeMasterList != NULL) { #ifndef F3DEX_GBI_2E Gfx *gfxStart = alloc_display_list(sizeof(Gfx) * 7); -@@ -539,61 +732,81 @@ static void geo_process_background(struct GraphNodeBackground *node) { +@@ -527,61 +720,81 @@ static void geo_process_background(struct GraphNodeBackground *node) { } } @@ -1365,7 +1366,7 @@ index 80dbfca4..b083717f 100644 if (node->displayList != NULL) { geo_append_display_list(node->displayList, node->node.flags >> 8); } -@@ -625,6 +838,17 @@ void geo_set_animation_globals(struct GraphNodeObject_sub *node, s32 hasAnimatio +@@ -613,6 +826,17 @@ void geo_set_animation_globals(struct GraphNodeObject_sub *node, s32 hasAnimatio } gCurrAnimFrame = node->animFrame; @@ -1383,7 +1384,7 @@ index 80dbfca4..b083717f 100644 gCurAnimEnabled = (anim->flags & ANIM_FLAG_5) == 0; gCurrAnimAttribute = segmented_to_virtual((void *) anim->index); gCurAnimData = segmented_to_virtual((void *) anim->values); -@@ -643,8 +867,10 @@ void geo_set_animation_globals(struct GraphNodeObject_sub *node, s32 hasAnimatio +@@ -631,8 +855,10 @@ void geo_set_animation_globals(struct GraphNodeObject_sub *node, s32 hasAnimatio */ static void geo_process_shadow(struct GraphNodeShadow *node) { Gfx *shadowList; @@ -1394,7 +1395,7 @@ index 80dbfca4..b083717f 100644 Vec3f animOffset; f32 objScale; f32 shadowScale; -@@ -652,6 +878,7 @@ static void geo_process_shadow(struct GraphNodeShadow *node) { +@@ -640,6 +866,7 @@ static void geo_process_shadow(struct GraphNodeShadow *node) { f32 cosAng; struct GraphNode *geo; Mtx *mtx; @@ -1402,7 +1403,7 @@ index 80dbfca4..b083717f 100644 if (gCurGraphNodeCamera != NULL && gCurGraphNodeObject != NULL) { if (gCurGraphNodeHeldObject != NULL) { -@@ -690,21 +917,57 @@ static void geo_process_shadow(struct GraphNodeShadow *node) { +@@ -678,21 +905,57 @@ static void geo_process_shadow(struct GraphNodeShadow *node) { } } @@ -1464,7 +1465,7 @@ index 80dbfca4..b083717f 100644 } gMatStackIndex--; } -@@ -803,28 +1066,87 @@ static int obj_is_in_view(struct GraphNodeObject *node, Mat4 matrix) { +@@ -789,31 +1052,101 @@ static int obj_is_in_view(struct GraphNodeObject *node, Mat4 matrix) { return TRUE; } @@ -1500,6 +1501,20 @@ index 80dbfca4..b083717f 100644 + } + mtxf_copy(node->header.gfx.prevThrowMatrix, *node->header.gfx.throwMatrix); + node->header.gfx.prevThrowMatrixTimestamp = gGlobalTimer; + } else if (node->header.gfx.node.flags & GRAPH_RENDER_CYLBOARD) { ++ Vec3f posInterpolated; ++ if (gGlobalTimer == node->header.gfx.prevTimestamp + 1 && ++ gGlobalTimer != node->header.gfx.skipInterpolationTimestamp) { ++ interpolate_vectors(posInterpolated, node->header.gfx.prevPos, node->header.gfx.pos); ++ } else { ++ vec3f_copy(posInterpolated, node->header.gfx.pos); ++ } ++ vec3f_copy(node->header.gfx.prevPos, node->header.gfx.pos); ++ node->header.gfx.prevTimestamp = gGlobalTimer; + mtxf_cylboard(gMatStack[gMatStackIndex + 1], gMatStack[gMatStackIndex], + node->header.gfx.pos, gCurGraphNodeCamera->roll); ++ mtxf_cylboard(gMatStackInterpolated[gMatStackIndex + 1], gMatStackInterpolated[gMatStackIndex], ++ posInterpolated, gCurGraphNodeCamera->roll); } else if (node->header.gfx.node.flags & GRAPH_RENDER_BILLBOARD) { + Vec3f posInterpolated; + if (gGlobalTimer == node->header.gfx.prevTimestamp + 1 && @@ -1552,7 +1567,7 @@ index 80dbfca4..b083717f 100644 node->header.gfx.cameraToObject[0] = gMatStack[gMatStackIndex][3][0]; node->header.gfx.cameraToObject[1] = gMatStack[gMatStackIndex][3][1]; node->header.gfx.cameraToObject[2] = gMatStack[gMatStackIndex][3][2]; -@@ -835,9 +1157,12 @@ static void geo_process_object(struct Object *node) { +@@ -824,9 +1157,12 @@ static void geo_process_object(struct Object *node) { } if (obj_is_in_view(&node->header.gfx, gMatStack[gMatStackIndex])) { Mtx *mtx = alloc_display_list(sizeof(*mtx)); @@ -1565,7 +1580,7 @@ index 80dbfca4..b083717f 100644 if (node->header.gfx.sharedChild != NULL) { gCurGraphNodeObject = (struct GraphNodeObject *) node; node->header.gfx.sharedChild->parent = &node->header.gfx.node; -@@ -848,11 +1173,16 @@ static void geo_process_object(struct Object *node) { +@@ -837,11 +1173,16 @@ static void geo_process_object(struct Object *node) { if (node->header.gfx.node.children != NULL) { geo_process_node_and_siblings(node->header.gfx.node.children); } @@ -1582,7 +1597,7 @@ index 80dbfca4..b083717f 100644 } } -@@ -879,6 +1209,8 @@ void geo_process_held_object(struct GraphNodeHeldObject *node) { +@@ -868,6 +1209,8 @@ void geo_process_held_object(struct GraphNodeHeldObject *node) { Mat4 mat; Vec3f translation; Mtx *mtx = alloc_display_list(sizeof(*mtx)); @@ -1591,7 +1606,7 @@ index 80dbfca4..b083717f 100644 #ifdef F3DEX_GBI_2 gSPLookAt(gDisplayListHead++, &lookAt); -@@ -894,6 +1226,14 @@ void geo_process_held_object(struct GraphNodeHeldObject *node) { +@@ -883,6 +1226,14 @@ void geo_process_held_object(struct GraphNodeHeldObject *node) { translation[1] = node->translation[1] / 4.0f; translation[2] = node->translation[2] / 4.0f; @@ -1606,7 +1621,7 @@ index 80dbfca4..b083717f 100644 mtxf_translate(mat, translation); mtxf_copy(gMatStack[gMatStackIndex + 1], *gCurGraphNodeObject->throwMatrix); gMatStack[gMatStackIndex + 1][3][0] = gMatStack[gMatStackIndex][3][0]; -@@ -902,6 +1242,13 @@ void geo_process_held_object(struct GraphNodeHeldObject *node) { +@@ -891,6 +1242,13 @@ void geo_process_held_object(struct GraphNodeHeldObject *node) { mtxf_mul(gMatStack[gMatStackIndex + 1], mat, gMatStack[gMatStackIndex + 1]); mtxf_scale_vec3f(gMatStack[gMatStackIndex + 1], gMatStack[gMatStackIndex + 1], node->objNode->header.gfx.scale); @@ -1620,7 +1635,7 @@ index 80dbfca4..b083717f 100644 if (node->fnNode.func != NULL) { node->fnNode.func(GEO_CONTEXT_HELD_OBJ, &node->fnNode.node, (struct AllocOnlyPool *) gMatStack[gMatStackIndex + 1]); -@@ -909,12 +1256,15 @@ void geo_process_held_object(struct GraphNodeHeldObject *node) { +@@ -898,12 +1256,15 @@ void geo_process_held_object(struct GraphNodeHeldObject *node) { gMatStackIndex++; mtxf_to_mtx(mtx, gMatStack[gMatStackIndex]); gMatStackFixed[gMatStackIndex] = mtx; @@ -1636,7 +1651,7 @@ index 80dbfca4..b083717f 100644 gCurAnimType = 0; gCurGraphNodeHeldObject = (void *) node; if (node->objNode->header.gfx.unk38.curAnim != NULL) { -@@ -929,6 +1279,7 @@ void geo_process_held_object(struct GraphNodeHeldObject *node) { +@@ -918,6 +1279,7 @@ void geo_process_held_object(struct GraphNodeHeldObject *node) { gCurAnimTranslationMultiplier = gGeoTempState.translationMultiplier; gCurrAnimAttribute = gGeoTempState.attribute; gCurAnimData = gGeoTempState.data; @@ -1644,7 +1659,7 @@ index 80dbfca4..b083717f 100644 gMatStackIndex--; } -@@ -1050,6 +1401,7 @@ void geo_process_root(struct GraphNodeRoot *node, Vp *b, Vp *c, s32 clearColor) +@@ -1039,6 +1401,7 @@ void geo_process_root(struct GraphNodeRoot *node, Vp *b, Vp *c, s32 clearColor) if (node->node.flags & GRAPH_RENDER_ACTIVE) { Mtx *initialMatrix; Vp *viewport = alloc_display_list(sizeof(*viewport)); @@ -1652,7 +1667,7 @@ index 80dbfca4..b083717f 100644 gDisplayListHeap = alloc_only_pool_init(main_pool_available() - sizeof(struct AllocOnlyPool), MEMORY_POOL_LEFT); -@@ -1060,7 +1412,12 @@ void geo_process_root(struct GraphNodeRoot *node, Vp *b, Vp *c, s32 clearColor) +@@ -1049,7 +1412,12 @@ void geo_process_root(struct GraphNodeRoot *node, Vp *b, Vp *c, s32 clearColor) vec3s_set(viewport->vp.vscale, node->width * 4, node->height * 4, 511); if (b != NULL) { clear_frame_buffer(clearColor); @@ -1666,7 +1681,7 @@ index 80dbfca4..b083717f 100644 *viewport = *b; } -@@ -1068,11 +1425,16 @@ void geo_process_root(struct GraphNodeRoot *node, Vp *b, Vp *c, s32 clearColor) +@@ -1057,11 +1425,16 @@ void geo_process_root(struct GraphNodeRoot *node, Vp *b, Vp *c, s32 clearColor) clear_frame_buffer(clearColor); make_viewport_clip_rect(c); } @@ -1685,7 +1700,7 @@ index 80dbfca4..b083717f 100644 G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH); gCurGraphNodeRoot = node; diff --git a/src/game/screen_transition.c b/src/game/screen_transition.c -index 3673a1a8..e65c3bde 100644 +index b49ddaf..d6656af 100644 --- a/src/game/screen_transition.c +++ b/src/game/screen_transition.c @@ -16,6 +16,19 @@ @@ -1721,8 +1736,8 @@ index 3673a1a8..e65c3bde 100644 - return (s16)(result + 0.5);; + return (s16)(result + 0.5); -+} -+ + } + +#else + +s16 calc_tex_transition_radius(s8 fadeTimer, f32 interpolationFraction, s8 transTime, struct WarpTransitionData *transData) { @@ -1732,8 +1747,8 @@ index 3673a1a8..e65c3bde 100644 + f32 result = transData->startTexRadius + radiusTime; + + return (s16)(result + 0.5); - } - ++} ++ +#endif + f32 calc_tex_transition_time(s8 fadeTimer, s8 transTime, struct WarpTransitionData *transData) { @@ -1806,7 +1821,7 @@ index 3673a1a8..e65c3bde 100644 switch (transType) { case WARP_TRANSITION_FADE_FROM_COLOR: diff --git a/src/menu/intro_geo.c b/src/menu/intro_geo.c -index 2d49d062..31cb72fe 100644 +index 37c6752..d823d40 100644 --- a/src/menu/intro_geo.c +++ b/src/menu/intro_geo.c @@ -1,5 +1,6 @@ @@ -1816,7 +1831,7 @@ index 2d49d062..31cb72fe 100644 #include "game/memory.h" #include "game/segment2.h" #include "game/segment7.h" -@@ -68,6 +69,18 @@ s8 gameOverBackgroundTable[] = { +@@ -70,6 +71,18 @@ s8 gameOverBackgroundTable[] = { s8 gameOverBackgroundFlipOrder[] = { 0x00, 0x01, 0x02, 0x03, 0x07, 0x0B, 0x0a, 0x09, 0x08, 0x04, 0x05, 0x06 }; @@ -1835,7 +1850,7 @@ index 2d49d062..31cb72fe 100644 Gfx *geo_title_screen(s32 sp50, struct GraphNode *sp54, UNUSED void *context) { struct GraphNode *graphNode; // sp4c Gfx *displayList; // sp48 -@@ -78,6 +91,8 @@ Gfx *geo_title_screen(s32 sp50, struct GraphNode *sp54, UNUSED void *context) { +@@ -80,6 +93,8 @@ Gfx *geo_title_screen(s32 sp50, struct GraphNode *sp54, UNUSED void *context) { f32 scaleX; // sp34 f32 scaleY; // sp30 f32 scaleZ; // sp2c @@ -1844,7 +1859,7 @@ index 2d49d062..31cb72fe 100644 graphNode = sp54; displayList = NULL; displayListIter = NULL; -@@ -108,7 +123,11 @@ Gfx *geo_title_screen(s32 sp50, struct GraphNode *sp54, UNUSED void *context) { +@@ -110,7 +125,11 @@ Gfx *geo_title_screen(s32 sp50, struct GraphNode *sp54, UNUSED void *context) { scaleY = 0.0f; scaleZ = 0.0f; } @@ -1858,10 +1873,10 @@ index 2d49d062..31cb72fe 100644 gSPDisplayList(displayListIter++, &intro_seg7_dl_0700B3A0); gSPPopMatrix(displayListIter++, G_MTX_MODELVIEW); diff --git a/src/pc/gfx/gfx_dxgi.cpp b/src/pc/gfx/gfx_dxgi.cpp -index 02cdd811..c036e0b7 100644 +index 0467495..fa4eb33 100644 --- a/src/pc/gfx/gfx_dxgi.cpp +++ b/src/pc/gfx/gfx_dxgi.cpp -@@ -34,10 +34,10 @@ +@@ -36,10 +36,10 @@ #ifdef VERSION_EU #define FRAME_INTERVAL_US_NUMERATOR 40000 @@ -1874,70 +1889,41 @@ index 02cdd811..c036e0b7 100644 #endif using namespace Microsoft::WRL; // For ComPtr -diff --git a/src/pc/gfx/gfx_glx.c b/src/pc/gfx/gfx_glx.c -index 97fe4a8b..cd2fa8ff 100644 ---- a/src/pc/gfx/gfx_glx.c -+++ b/src/pc/gfx/gfx_glx.c -@@ -19,10 +19,10 @@ - - #ifdef VERSION_EU - #define FRAME_INTERVAL_US_NUMERATOR 40000 --#define FRAME_INTERVAL_US_DENOMINATOR 1 -+#define FRAME_INTERVAL_US_DENOMINATOR 2 - #else - #define FRAME_INTERVAL_US_NUMERATOR 100000 --#define FRAME_INTERVAL_US_DENOMINATOR 3 -+#define FRAME_INTERVAL_US_DENOMINATOR 6 - #endif - - const struct { diff --git a/src/pc/gfx/gfx_sdl2.c b/src/pc/gfx/gfx_sdl2.c -index 05f1a5ad..bb8ea052 100644 +index 25c9f06..a6461ae 100644 --- a/src/pc/gfx/gfx_sdl2.c +++ b/src/pc/gfx/gfx_sdl2.c -@@ -137,7 +137,7 @@ int test_vsync(void) { - float average = 4.0 * 1000.0 / (end - start); +@@ -53,7 +53,7 @@ static void (*kb_all_keys_up)(void) = NULL; + // whether to use timer for frame control + static bool use_timer = true; + // time between consequtive game frames +-static const int frame_time = 1000 / FRAMERATE; ++static const int frame_time = 1000 / (2 * FRAMERATE); - vsync_enabled = 1; -- if (average > 27 && average < 33) { -+ /*if (average > 27 && average < 33) { + const SDL_Scancode windows_scancode_table[] = { + /* 0 1 2 3 4 5 6 7 */ +@@ -142,7 +142,11 @@ static inline void gfx_sdl_set_vsync(const bool enabled) { + if (enabled) { + // try to detect refresh rate SDL_GL_SetSwapInterval(1); - } else if (average > 57 && average < 63) { - SDL_GL_SetSwapInterval(2); -@@ -147,6 +147,13 @@ int test_vsync(void) { - SDL_GL_SetSwapInterval(4); - } else { - vsync_enabled = 0; -+ }*/ -+ if (average > 57 && average < 63) { -+ SDL_GL_SetSwapInterval(1); -+ } else if (average > 115 && average < 125) { -+ SDL_GL_SetSwapInterval(2); -+ } else { -+ vsync_enabled = 0; - } - } - -@@ -271,8 +278,8 @@ static bool gfx_sdl_start_frame(void) { - } - - static void sync_framerate_with_timer(void) { -- // Number of milliseconds a frame should take (30 fps) -- const Uint32 FRAME_TIME = 1000 / 30; -+ // Number of milliseconds a frame should take (60 fps) -+ const Uint32 FRAME_TIME = 1000 / 60; - static Uint32 last_time; - Uint32 elapsed = SDL_GetTicks() - last_time; - +- const int vblanks = test_vsync(); ++ int vblanks = test_vsync(); ++ if (vblanks & 1) ++ vblanks = 0; // not divisible by 60, fuck that ++ else ++ vblanks /= 2; + if (vblanks) { + printf("determined swap interval: %d\n", vblanks); + SDL_GL_SetSwapInterval(vblanks); diff --git a/src/pc/pc_main.c b/src/pc/pc_main.c -index 4fb25fa2..46cf6653 100644 +index ed6ee74..63679ad 100644 --- a/src/pc/pc_main.c +++ b/src/pc/pc_main.c -@@ -75,6 +75,25 @@ void send_display_list(struct SPTask *spTask) { +@@ -83,6 +83,25 @@ void send_display_list(struct SPTask *spTask) { #define SAMPLES_LOW 528 #endif -+static void patch_interpolations(void) { ++static inline void patch_interpolations(void) { + extern void mtx_patch_interpolated(void); + extern void patch_screen_transition_interpolated(void); + extern void patch_title_screen_scales(void); @@ -1958,16 +1944,16 @@ index 4fb25fa2..46cf6653 100644 + void produce_one_frame(void) { gfx_start_frame(); - game_loop_one_iteration(); -@@ -94,6 +113,11 @@ void produce_one_frame(void) { + +@@ -110,6 +129,11 @@ void produce_one_frame(void) { audio_api->play((u8 *)audio_buffer, 2 * num_audio_samples * 4); - + gfx_end_frame(); -+ ++ + gfx_start_frame(); + patch_interpolations(); + send_display_list(gGfxSPTask); + gfx_end_frame(); } - #ifdef TARGET_WEB + void audio_shutdown(void) { diff --git a/enhancements/README.md b/enhancements/README.md index 23037f22..4d1e13ce 100644 --- a/enhancements/README.md +++ b/enhancements/README.md @@ -10,52 +10,16 @@ to the source code. Likewise, to undo the changes from a patch you applied, run `tools/revert_patch.sh` with the name of the .patch file you wish to undo. -To create your own enhancement patch, switch to the `master` Git -branch, make your changes to the code (but do not commit), then run `tools/create_patch.sh`. Your changes will be stored in the .patch file you specify. +To create your own enhancement patch, switch to the `nightly` Git +branch, make your changes to the code (but do not commit), then run `tools/create_patch.sh`. +Your changes will be stored in the .patch file you specify. The following enhancements are included in this directory: -## 60 FPS - `60fps.patch` +## 60 FPS - `60fps_ex.patch` -This patch is only supported when not targeting N64. It also currently requires a 64-bit platform. If compiled for a 32-bit platform, the game will run out of memory and crash. - -This allows the game to be rendered at 60 FPS instead of 30 FPS by interpolation. +This allows the game to be rendered at 60 FPS instead of 30 FPS by interpolation (game logic still runs at 30 FPS). The Mario head intro is the only exception which is still rendered at 30 FPS. -## Crash Screen - `crash.patch` - -This enhancement provides a crash screen that is displayed when the code throws a hardware exception. This may be useful for diagnosing crashes in game code. - -## Debug Box - `debug_box.patch` - -This allows you to draw 3D boxes for debugging purposes. - -Call the `debug_box` function whenever you want to draw one. `debug_box` by default takes two arguments: a center and bounds vec3f. This will draw a box starting from the point (center - bounds) to (center + bounds). -Use `debug_box_rot` to draw a box rotated in the xz-plane. If you want to draw a box by specifying min and max points, use `debug_box_pos` instead. - -## FPS Counter - `fps.patch` - -This patch provides an in-game FPS counter to measure the frame rate. - -## iQue Player Support - `ique_support.patch` - -This enhancement allows the same ROM to work on both the Nintendo 64 and the iQue Player. - -## Memory Expansion Pak Error Screen - `mem_error_screen.patch` - -Use this patch if your game requires over 4 MB of memory and requires the -Expansion Pak. If the Expansion Pak is not present, an error message will be -shown on startup. - -## Demo Input Recorder - `record_demo.patch` - -This patch allows you to record gameplay demos for the attract screen. It requires the latest nightly versions of Project64, and uses the Project64 JavaScript API to dump the demo input data from RAM and write it to a file. - -Place the `enhancements/RecordDemo.js` file in the `/Scripts/` folder in the Project64 directory. - -In the Scripts window, double click on "RecordDemo" on the list on the left side. - -When this is done, it should turn green which lets you know that it has started. - -When your demo has been recorded, it will be dumped to the newly created `/SM64_DEMOS/` folder within the Project64 directory. +This is the 60fps patch from [sm64-port](https://github.com/sm64-port/sm64-port/tree/master/enhancements) adapted for sm64ex. diff --git a/enhancements/RecordDemo.js b/enhancements/RecordDemo.js deleted file mode 100644 index 9442b804..00000000 --- a/enhancements/RecordDemo.js +++ /dev/null @@ -1,184 +0,0 @@ -/* - * This is a companion file for the record_demo.inc.c enhancement. - * - * You will need the PJ64 javascript API to get this to work, so - * you should download a nightly build from here (Windows only atm): - * https://www.pj64-emu.com/nightly-builds - * - * Place this .js file into the /Scripts/ folder in the PJ64 directory. - * - * In the Scripts window, double click on "RecordDemo" on the list on the left side. - * When this is done, it should turn green which lets you know that it has started. - * - * When your demo has been recorded, it will be dumped to the newly created - * /SM64_DEMOS/ folder within the PJ64 directory. - */ - -var RAM_SIZE = 4 * 1048576 // 4 MB - -// Get a copy of the first 4MB of memory. -var RAM = mem.getblock(0x80000000, RAM_SIZE) - -// Create SM64_DEMOS Directory if it already doesn't exist. -fs.mkdir("SM64_DEMOS/"); - -// string "DEMORECVARS" -var pattern = [0x44, 0x45, 0x4D, 0x4F, 0x52, 0x45, 0x43, 0x56, 0x41, 0x52, 0x53, 0x00] - -var matches = find_matches_fast(pattern) - -if(matches.length > 1) { - console.log('Error: More than 1 instance of "DEMORECVARS" was found. Abort!') -} else if(matches.length < 1) { - console.log('Error: No instance of "DEMORECVARS" was found. Abort!') -} else { - console.clear() - var demoRecVarsLocation = 0x80000000 + matches[0] + 12 - - // Control variables addresses - var gRecordingStatus_vaddr = demoRecVarsLocation + 0 - var gDoneDelay_vaddr = demoRecVarsLocation + 4 - var gNumOfRecordedInputs_vaddr = demoRecVarsLocation + 8 - var gRecordedInputsPtr_vaddr = demoRecVarsLocation + 12 - - console.log('Recording variables were found at address 0x' + demoRecVarsLocation.toString(16)) - console.log('Initialization successful! Press L in-game to ready the demo recording before entering in a level.') - - // This runs every frame that is drawn. - events.ondraw(function() { - var gRecordingStatus = mem.u32[gRecordingStatus_vaddr] - - if(gRecordingStatus == 3) { // gRecordingStatus == DEMOREC_STATUS_STOPPING - var gNumOfRecordedInputs = mem.u32[gNumOfRecordedInputs_vaddr] - - if(gNumOfRecordedInputs < 1) { - console.log('Error: No inputs could be recorded!') - } else { - var gRecordedInputsPtr = mem.u32[gRecordedInputsPtr_vaddr] - - console.log('Recorded ' + gNumOfRecordedInputs + ' demo inputs.') - - // Grab demo data from RAM. - var demo_data = mem.getblock(gRecordedInputsPtr, (gNumOfRecordedInputs + 1) * 4) - - // Create filename with random id added onto it. - var filename = 'SM64_DEMOS/demo_' + get_random_int(0, 0xFFFFFFFF).toString(16) + '.bin' - - // Dump demo data to file. - var file = fs.open(filename, 'wb'); - fs.write(file, demo_data); - fs.close(file); - - console.log('Dumped data to file ' + filename) - } - - // Set status to DEMOREC_STATUS_DONE - mem.u32[gRecordingStatus_vaddr] = 4; - - // Decomp memes - console.log('OK'); - } - }) -} - -function get_random_int(min, max) { - min = Math.ceil(min); - max = Math.floor(max); - return Math.floor(Math.random() * (max - min + 1)) + min; -} - -/* - * Finds a byte pattern that is 4-byte aligned. - * - * The javascript api is pretty slow when reading memory directly, - * so I made this to search a copy of RAM to make things a little faster. - */ -function find_matches_fast(pattern) { - var targetLength = pattern.length - var targetLengthMinusOne = targetLength - 1 - var matches = [] - var matching = 0 - - // Increments by 8 to speed things up. - for(var i = 0; i < RAM_SIZE; i += 8) { - if(RAM[i] == pattern[matching]) - matching++ - else - matching = 0 - if(matching == targetLength) { - matches.push(i - targetLengthMinusOne) - matching = 0 - } - if(matching > 0) { - if(RAM[i + 1] == pattern[matching]) - matching++ - else - matching = 0 - if(matching == targetLength) { - matches.push(i + 1 - targetLengthMinusOne) - matching = 0 - } - if(matching > 1) { - if(RAM[i + 2] == pattern[matching]) - matching++ - else - matching = 0 - if(matching == targetLength) { - matches.push(i + 2 - targetLengthMinusOne) - matching = 0 - } - if(matching > 2) { - if(RAM[i + 3] == pattern[matching]) - matching++ - else - matching = 0 - if(matching == targetLength) { - matches.push(i + 3 - targetLengthMinusOne) - matching = 0 - } - } - } - } - - if(RAM[i + 4] == pattern[matching]) - matching++ - else - matching = 0 - if(matching == targetLength) { - matches.push(i + 4 - targetLengthMinusOne) - matching = 0 - } - if(matching > 0) { - if(RAM[i + 5] == pattern[matching]) - matching++ - else - matching = 0 - if(matching == targetLength) { - matches.push(i + 5 - targetLengthMinusOne) - matching = 0 - } - if(matching > 1) { - if(RAM[i + 6] == pattern[matching]) - matching++ - else - matching = 0 - if(matching == targetLength) { - matches.push(i + 6 - targetLengthMinusOne) - matching = 0 - } - if(matching > 2) { - if(RAM[i + 7] == pattern[matching]) - matching++ - else - matching = 0 - if(matching == targetLength) { - matches.push(i + 7 - targetLengthMinusOne) - matching = 0 - } - } - } - } - } - - return matches -} diff --git a/enhancements/crash.patch b/enhancements/crash.patch deleted file mode 100644 index f0eb61a9..00000000 --- a/enhancements/crash.patch +++ /dev/null @@ -1,486 +0,0 @@ -diff --git a/asm/crash.s b/asm/crash.s -new file mode 100644 -index 00000000..7c272050 ---- /dev/null -+++ b/asm/crash.s -@@ -0,0 +1,153 @@ -+# SM64 Crash Handler -+# See Readme below. -+ -+.include "macros.inc" -+ -+/* --------------------------------------------------------------- -+ * IMPORTANT README: -+ * --------------------------------------------------------------- -+ * Frame buffer emulation is required. To enable it in GlideN64, -+ * check "Emulate frame buffer" and "Render frame buffer to output" -+ * in the "Frame buffer" tab. -+ * -+ * Your emulator's CPU core style should be set to interpreter for best results. -+ * -+ * See the DEBUG_ASSERT macro on how to call the crash screen for -+ * detected exceptions. -+ * -+ */ -+ -+.set noat -+.set noreorder -+.set gp=64 -+ -+.set COP0_CAUSE, $13 -+.set COP0_EPC, $14 -+.set COP0_BADVADDR, $8 -+ -+glabel crashFont -+ .incbin "enhancements/crash_font.bin" -+ .align 4 -+ -+glabel exceptionRegContext -+ .fill 0x108 -+ -+glabel pAssertFile -+ .dword 0 -+glabel nAssertLine -+ .dword 0 -+glabel pAssertExpression -+ .dword 0 -+glabel nAssertStopProgram -+ .dword 0 -+ -+glabel _n64_assert -+ lui $at, %hi(pAssertFile) -+ sw $a0, %lo(pAssertFile)($at) -+ lui $at, %hi(nAssertLine) -+ sw $a1, %lo(nAssertLine)($at) -+ lui $at, %hi(pAssertExpression) -+ sw $a2, %lo(pAssertExpression)($at) -+ lui $at, %hi(nAssertStopProgram) -+ sw $a3, %lo(nAssertStopProgram)($at) -+ beqz $a3, .end_2 -+ nop -+ syscall # trigger crash screen -+.end_2: -+ jr $ra -+ nop -+ -+glabel cop0_get_cause -+ jr $ra -+ mfc0 $v0, COP0_CAUSE -+ -+glabel cop0_get_epc -+ jr $ra -+ mfc0 $v0, COP0_EPC -+ -+glabel cop0_get_badvaddr -+ jr $ra -+ mfc0 $v0, COP0_BADVADDR -+ -+# If the error code field of cop0's cause register is non-zero, -+# draw crash details to the screen and hang -+# -+# If there wasn't an error, continue to the original handler -+ -+glabel __crash_handler_entry -+ mfc0 $k1, COP0_CAUSE -+ andi $k1, $k1, (0x1F << 2) -+ beqzl $k1, .end2 # exit if ExCode is 0 -+ lui $k0, %hi(__osException) -+ la $k0, exceptionRegContext -+ sd $zero, 0x018 ($k0) -+ sd $at, 0x020 ($k0) -+ sd $v0, 0x028 ($k0) -+ sd $v1, 0x030 ($k0) -+ sd $a0, 0x038 ($k0) -+ sd $a1, 0x040 ($k0) -+ sd $a2, 0x048 ($k0) -+ sd $a3, 0x050 ($k0) -+ sd $t0, 0x058 ($k0) -+ sd $t1, 0x060 ($k0) -+ sd $t2, 0x068 ($k0) -+ sd $t3, 0x070 ($k0) -+ sd $t4, 0x078 ($k0) -+ sd $t5, 0x080 ($k0) -+ sd $t6, 0x088 ($k0) -+ sd $t7, 0x090 ($k0) -+ sd $s0, 0x098 ($k0) -+ sd $s1, 0x0A0 ($k0) -+ sd $s2, 0x0A8 ($k0) -+ sd $s3, 0x0B0 ($k0) -+ sd $s4, 0x0B8 ($k0) -+ sd $s5, 0x0C0 ($k0) -+ sd $s6, 0x0C8 ($k0) -+ sd $s7, 0x0D0 ($k0) -+ sd $t8, 0x0D8 ($k0) -+ sd $t9, 0x0E0 ($k0) -+ sd $gp, 0x0E8 ($k0) -+ sd $sp, 0x0F0 ($k0) -+ sd $fp, 0x0F8 ($k0) -+ sd $ra, 0x100 ($k0) -+ # cop unusable exception fired twice on startup so we'll ignore it for now -+ li $t0, (0x0B << 2) -+ beq $k1, $t0, .end -+ nop -+ jal show_crash_screen_and_hang -+ nop -+ .end: -+ ld $at, 0x020 ($k0) -+ ld $v0, 0x028 ($k0) -+ ld $v1, 0x030 ($k0) -+ ld $a0, 0x038 ($k0) -+ ld $a1, 0x040 ($k0) -+ ld $a2, 0x048 ($k0) -+ ld $a3, 0x050 ($k0) -+ ld $t0, 0x058 ($k0) -+ ld $t1, 0x060 ($k0) -+ ld $t2, 0x068 ($k0) -+ ld $t3, 0x070 ($k0) -+ ld $t4, 0x078 ($k0) -+ ld $t5, 0x080 ($k0) -+ ld $t6, 0x088 ($k0) -+ ld $t7, 0x090 ($k0) -+ ld $s0, 0x098 ($k0) -+ ld $s1, 0x0A0 ($k0) -+ ld $s2, 0x0A8 ($k0) -+ ld $s3, 0x0B0 ($k0) -+ ld $s4, 0x0B8 ($k0) -+ ld $s5, 0x0C0 ($k0) -+ ld $s6, 0x0C8 ($k0) -+ ld $s7, 0x0D0 ($k0) -+ ld $t8, 0x0D8 ($k0) -+ ld $t9, 0x0E0 ($k0) -+ ld $gp, 0x0E8 ($k0) -+ ld $sp, 0x0F0 ($k0) -+ ld $fp, 0x0F8 ($k0) -+ ld $ra, 0x100 ($k0) -+ lui $k0, %hi(__osException) -+ .end2: -+ addiu $k0, $k0, %lo(__osException) -+ jr $k0 # run the original handler -+ nop -diff --git a/lib/asm/__osExceptionPreamble.s b/lib/asm/__osExceptionPreamble.s -index 865273d9..f9ce7596 100644 ---- a/lib/asm/__osExceptionPreamble.s -+++ b/lib/asm/__osExceptionPreamble.s -@@ -15,8 +15,8 @@ - .endif - - glabel __osExceptionPreamble -- lui $k0, %hi(__osException) -- addiu $k0, %lo(__osException) -+ lui $k0, %hi(__crash_handler_entry) -+ addiu $k0, %lo(__crash_handler_entry) - jr $k0 - nop - -diff --git a/sm64.ld b/sm64.ld -index e6f5c942..c0feb343 ---- a/sm64.ld -+++ b/sm64.ld -@@ -116,6 +116,7 @@ SECTIONS - BUILD_DIR/src/game/rendering_graph_node.o(.text); - BUILD_DIR/src/game/profiler.o(.text); - BUILD_DIR/asm/decompress.o(.text); -+ BUILD_DIR/asm/crash.o(.text); - BUILD_DIR/src/game/camera.o(.text); - BUILD_DIR/src/game/debug_course.o(.text); - BUILD_DIR/src/game/object_list_processor.o(.text); -diff --git a/src/game/crash.c b/src/game/crash.c -new file mode 100644 -index 00000000..716adfbd ---- /dev/null -+++ b/src/game/crash.c -@@ -0,0 +1,260 @@ -+/* SM64 Crash Handler */ -+ -+#include -+ -+#include "crash.h" -+ -+extern u32 exceptionRegContext[]; -+ -+extern char *pAssertFile; -+extern int nAssertLine; -+extern char *pAssertExpression; -+extern int nAssertStopProgram; -+ -+u16 fbFillColor = 0xFFFF; -+u16 fbShadeColor = 0x0000; -+u16 *fbAddress = NULL; -+ -+extern u8 crashFont[]; -+ -+const char *szErrCodes[] = { -+ "INTERRUPT", -+ "TLB MOD", -+ "UNMAPPED LOAD ADDR", -+ "UNMAPPED STORE ADDR", -+ "BAD LOAD ADDR", -+ "BAD STORE ADDR", -+ "BUS ERR ON INSTR FETCH", -+ "BUS ERR ON LOADSTORE", -+ "SYSCALL", -+ "BREAKPOINT", -+ "UNKNOWN INSTR", -+ "COP UNUSABLE", -+ "ARITHMETIC OVERFLOW", -+ "TRAP EXC", -+ "VIRTUAL COHERENCY INSTR", -+ "FLOAT EXC", -+}; -+ -+const char *szGPRegisters1[] = { "R0", "AT", "V0", "V1", "A0", "A1", "A2", "A3", -+ "T0", "T1", "T2", "T3", "T4", "T5", "T6", NULL }; -+ -+const char *szGPRegisters2[] = { "T7", "S0", "S1", "S2", "S3", "S4", -+ "S5", "S6", "S7", "T8", "T9", /*"K0", "K1",*/ -+ "GP", "SP", "FP", "RA", NULL }; -+ -+int crash_strlen(char *str) { -+ int len = 0; -+ while (*str++) { -+ len++; -+ } -+ return len; -+} -+ -+void show_crash_screen_and_hang(void) { -+ u32 cause; -+ u32 epc; -+ u8 errno; -+ -+ fb_set_address((void *) (*(u32 *) 0xA4400004 | 0x80000000)); // replace me -+ -+ cause = cop0_get_cause(); -+ epc = cop0_get_epc(); -+ -+ errno = (cause >> 2) & 0x1F; -+ -+ if (nAssertStopProgram == 0) { -+ fbFillColor = 0x6253; -+ fb_fill(10, 10, 300, 220); -+ -+ fb_print_str(80, 20, "AN ERROR HAS OCCURRED!"); -+ fb_print_int_hex(80, 30, errno, 8); -+ fb_print_str(95, 30, szErrCodes[errno]); -+ -+ if (errno >= 2 && errno <= 5) { -+ /* -+ 2 UNMAPPED LOAD ADDR -+ 3 UNMAPPED STORE ADDR -+ 4 BAD LOAD ADDR -+ 5 BAD STORE ADDR -+ */ -+ u32 badvaddr = cop0_get_badvaddr(); -+ -+ fb_print_str(145, 50, "VA"); -+ fb_print_int_hex(160, 50, badvaddr, 32); -+ } -+ } else { -+ int afterFileX; -+ int exprBoxWidth; -+ fbFillColor = 0x5263; -+ fb_fill(10, 10, 300, 220); -+ -+ fb_print_str(80, 20, "ASSERTION FAILED!"); -+ -+ afterFileX = fb_print_str(80, 30, pAssertFile); -+ fb_print_str(afterFileX, 30, ":"); -+ fb_print_uint(afterFileX + 5, 30, nAssertLine); -+ -+ exprBoxWidth = (crash_strlen(pAssertExpression) * 5) + 2; -+ fbFillColor = 0x0001; -+ fb_fill(80 - 1, 40 - 1, exprBoxWidth, 10); -+ fb_print_str(80, 40, pAssertExpression); -+ } -+ -+ fb_print_str(80, 50, "PC"); -+ fb_print_int_hex(95, 50, epc, 32); -+ -+ fb_print_gpr_states(80, 70, szGPRegisters1, &exceptionRegContext[6 + 0]); -+ fb_print_gpr_states(145, 70, szGPRegisters2, &exceptionRegContext[6 + 15 * 2]); -+ -+ fb_swap(); -+ osWritebackDCacheAll(); -+ -+ while (1) // hang forever -+ { -+ UNUSED volatile int t = 0; // keep pj64 happy -+ } -+} -+ -+u8 ascii_to_idx(char c) { -+ return c - 0x20; -+} -+ -+void fb_set_address(void *address) { -+ fbAddress = (u16 *) address; -+} -+ -+void fb_swap() { -+ // update VI frame buffer register -+ // todo other registers -+ *(u32 *) (0xA4400004) = (u32) fbAddress & 0x00FFFFFF; -+} -+ -+void fb_fill(int baseX, int baseY, int width, int height) { -+ int y, x; -+ -+ for (y = baseY; y < baseY + height; y++) { -+ for (x = baseX; x < baseX + width; x++) { -+ fbAddress[y * 320 + x] = fbFillColor; -+ } -+ } -+} -+ -+void fb_draw_char(int x, int y, u8 idx) { -+ u16 *out = &fbAddress[y * 320 + x]; -+ const u8 *in = &crashFont[idx * 3]; -+ int nbyte; -+ int nrow; -+ int ncol; -+ -+ for (nbyte = 0; nbyte < 3; nbyte++) { -+ u8 curbyte = in[nbyte]; -+ for (nrow = 0; nrow < 2; nrow++) { -+ for (ncol = 0; ncol < 4; ncol++) { -+ u8 px = curbyte & (1 << (7 - (nrow * 4 + ncol))); -+ if (px != 0) { -+ out[ncol] = fbFillColor; -+ } -+ } -+ out += 320; -+ } -+ } -+} -+ -+void fb_draw_char_shaded(int x, int y, u8 idx) { -+ fbFillColor = 0x0001; -+ fb_draw_char(x - 1, y + 1, idx); -+ -+ fbFillColor = 0xFFFF; -+ fb_draw_char(x, y, idx); -+} -+ -+int fb_print_str(int x, int y, const char *str) { -+ while (1) { -+ int yoffs = 0; -+ u8 idx; -+ char c = *str++; -+ -+ if (c == '\0') { -+ break; -+ } -+ -+ if (c == ' ') { -+ x += 5; -+ continue; -+ } -+ -+ switch (c) { -+ case 'j': -+ case 'g': -+ case 'p': -+ case 'q': -+ case 'y': -+ case 'Q': -+ yoffs = 1; -+ break; -+ case ',': -+ yoffs = 2; -+ break; -+ } -+ -+ idx = ascii_to_idx(c); -+ fb_draw_char_shaded(x, y + yoffs, idx); -+ x += 5; -+ } -+ -+ return x; -+} -+ -+void fb_print_int_hex(int x, int y, u32 value, int nbits) { -+ nbits -= 4; -+ -+ while (nbits >= 0) { -+ int nib = ((value >> nbits) & 0xF); -+ u8 idx; -+ -+ if (nib > 9) { -+ idx = ('A' - 0x20) + (nib - 0xa); -+ } else { -+ idx = ('0' - 0x20) + nib; -+ } -+ -+ fb_draw_char_shaded(x, y, idx); -+ x += 5; -+ -+ nbits -= 4; -+ } -+} -+ -+int fb_print_uint(int x, int y, u32 value) { -+ int nchars = 0; -+ -+ int v = value; -+ int i; -+ while (v /= 10) { -+ nchars++; -+ } -+ -+ x += nchars * 5; -+ -+ for (i = nchars; i >= 0; i--) { -+ fb_draw_char_shaded(x, y, ('0' - 0x20) + (value % 10)); -+ value /= 10; -+ x -= 5; -+ } -+ -+ return (x + nchars * 5); -+} -+ -+void fb_print_gpr_states(int x, int y, const char *regNames[], u32 *regContext) { -+ int i; -+ for (i = 0;; i++) { -+ if (regNames[i] == NULL) { -+ break; -+ } -+ -+ fb_print_str(x, y, regNames[i]); -+ fb_print_int_hex(x + 15, y, regContext[i * 2 + 1], 32); -+ y += 10; -+ } -+} -diff --git a/src/game/crash.h b/src/game/crash.h -new file mode 100644 -index 00000000..1386930d ---- /dev/null -+++ b/src/game/crash.h -@@ -0,0 +1,28 @@ -+#ifndef _CRASH_H_ -+#define _CRASH_H_ -+ -+#include -+ -+#define CRASH_SCREEN_INCLUDED 1 -+ -+extern u32 cop0_get_cause(void); -+extern u32 cop0_get_epc(void); -+extern u32 cop0_get_badvaddr(void); -+ -+extern void _n64_assert(const char* pFile, int nLine, const char *pExpression, int nStopProgram); -+ -+extern u8 __crash_handler_entry[]; -+ -+void show_crash_screen_and_hang(void); -+u8 ascii_to_idx(char c); -+void fb_set_address(void *address); -+void fb_swap(void); -+void fb_fill(int baseX, int baseY, int width, int height); -+void fb_draw_char(int x, int y, u8 idx); -+void fb_draw_char_shaded(int x, int y, u8 idx); -+int fb_print_str(int x, int y, const char *str); -+int fb_print_uint(int x, int y, u32 value); -+void fb_print_int_hex(int x, int y, u32 value, int nbits); -+void fb_print_gpr_states(int x, int y, const char* regStrs[], u32 *regContext); -+ -+#endif /* _CRASH_H_ */ diff --git a/enhancements/crash_font.bin b/enhancements/crash_font.bin deleted file mode 100644 index 15777388..00000000 Binary files a/enhancements/crash_font.bin and /dev/null differ diff --git a/enhancements/debug_box.patch b/enhancements/debug_box.patch deleted file mode 100644 index e02bbf43..00000000 --- a/enhancements/debug_box.patch +++ /dev/null @@ -1,303 +0,0 @@ -diff --git a/src/game/area.c b/src/game/area.c -index 240605d8..88c1a314 100644 ---- a/src/game/area.c -+++ b/src/game/area.c -@@ -19,7 +19,8 @@ - #include "level_update.h" - #include "engine/geo_layout.h" - #include "save_file.h" - #include "level_table.h" -+#include "debug_box.h" - - struct SpawnInfo gPlayerSpawnInfos[1]; - struct GraphNode *D_8033A160[0x100]; -@@ -353,6 +354,8 @@ void render_game(void) { - if (gCurrentArea != NULL && !gWarpTransition.pauseRendering) { - geo_process_root(gCurrentArea->unk04, D_8032CE74, D_8032CE78, gFBSetColor); - -+ render_debug_boxes(); -+ - gSPViewport(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&D_8032CF00)); - - gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, BORDER_HEIGHT, SCREEN_WIDTH, -diff --git a/src/game/debug_box.c b/src/game/debug_box.c -new file mode 100644 -index 00000000..0ee87ec7 ---- /dev/null -+++ b/src/game/debug_box.c -@@ -0,0 +1,244 @@ -+#include -+ -+#include "sm64.h" -+#include "game/game_init.h" -+#include "game/geo_misc.h" -+#include "engine/math_util.h" -+ -+#include "debug_box.h" -+ -+/** -+ * @file debug_box.c -+ * Draws 3D boxes for debugging purposes. -+ * -+ * How to use: -+ * -+ * In render_game() in area.c, add a call to render_debug_boxes(): -+ * -+ * void render_game(void) { -+ * if (gCurrentArea != NULL && !gWarpTransition.pauseRendering) { -+ * geo_process_root(...); -+ * -+ * render_debug_boxes(); // add here -+ * -+ * gSPViewport(...); -+ * gDPSetScissor(...); -+ * //... -+ * -+ * Now just call debug_box() whenever you want to draw one! -+ * -+ * debug_box by default takes two arguments: a center and bounds vec3f. -+ * This will draw a box starting from the point (center - bounds) to (center + bounds). -+ * -+ * Use debug_box_rot to draw a box rotated in the xz-plane. -+ * -+ * If you want to draw a box by specifying min and max points, use debug_box_pos() instead. -+ */ -+ -+/** -+ * Internal struct containing box info -+ */ -+struct DebugBox { -+ Vec3s center; -+ Vec3s bounds; -+ s16 yaw; -+}; -+ -+struct DebugBox *sBoxes[MAX_DEBUG_BOXES]; -+s16 sNumBoxes = 0; -+ -+extern Mat4 gMatStack[32]; //XXX: Hack -+ -+/** -+ * The debug boxes' transparency -+ */ -+#define DBG_BOX_ALPHA 0x7F -+/** -+ * The debug boxes' color -+ */ -+#define DBG_BOX_COL 0xFF, 0x00, 0x00, DBG_BOX_ALPHA -+ -+/** -+ * Sets up the RCP for drawing the boxes -+ */ -+static const Gfx dl_debug_box_begin[] = { -+ gsDPPipeSync(), -+#if DBG_BOX_ALPHA < 0xFF -+ gsDPSetRenderMode(G_RM_ZB_XLU_SURF, G_RM_NOOP2), -+#else -+ gsDPSetRenderMode(G_RM_ZB_OPA_SURF, G_RM_NOOP2), -+#endif -+ gsSPClearGeometryMode(G_LIGHTING | G_CULL_BACK), -+ gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH), -+ gsSPTexture(0, 0, 0, 0, G_OFF), -+ gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), -+ gsSPEndDisplayList(), -+}; -+ -+/** -+ * Actually draws the box -+ */ -+static const Gfx dl_debug_draw_box[] = { -+ gsSP2Triangles( 0, 1, 2, 0x0, 2, 1, 3, 0x0), -+ gsSP2Triangles( 2, 3, 6, 0x0, 6, 3, 7, 0x0), -+ -+ gsSP2Triangles( 4, 0, 2, 0x0, 2, 6, 4, 0x0), -+ gsSP2Triangles( 1, 5, 3, 0x0, 3, 5, 7, 0x0), -+ -+ gsSP2Triangles( 1, 0, 4, 0x0, 1, 4, 5, 0x0), -+ gsSP2Triangles( 5, 4, 6, 0x0, 5, 6, 7, 0x0), -+ -+ gsSPEndDisplayList(), -+}; -+ -+/** -+ * Adds a box to the list to be rendered this frame. -+ * -+ * If there are already MAX_DEBUG_BOXES boxes, does nothing. -+ */ -+static void append_debug_box(Vec3f center, Vec3f bounds, s16 yaw) -+{ -+ if (sNumBoxes >= MAX_DEBUG_BOXES || -+ (sBoxes[sNumBoxes] = mem_pool_alloc(gEffectsMemoryPool, sizeof(struct DebugBox))) == NULL) { -+ return; -+ } -+ -+ vec3f_to_vec3s(sBoxes[sNumBoxes]->center, center); -+ vec3f_to_vec3s(sBoxes[sNumBoxes]->bounds, bounds); -+ -+ sBoxes[sNumBoxes]->yaw = yaw; -+ -+ ++sNumBoxes; -+} -+ -+/** -+ * Draws a debug box from (center - bounds) to (center + bounds) -+ * To draw a rotated box, use debug_box_rot() -+ * -+ * @see debug_box_rot() -+ */ -+void debug_box(Vec3f center, Vec3f bounds) -+{ -+ append_debug_box(center, bounds, 0); -+} -+ -+/** -+ * Draws a debug box from (center - bounds) to (center + bounds), rotating it by `yaw` -+ */ -+void debug_box_rot(Vec3f center, Vec3f bounds, s16 yaw) -+{ -+ append_debug_box(center, bounds, yaw); -+} -+ -+/** -+ * Draws a debug box from pMin to pMax -+ * To draw a rotated box this way, use debug_box_pos_rot() -+ * -+ * @see debug_box_pos_rot() -+ */ -+void debug_box_pos(Vec3f pMin, Vec3f pMax) -+{ -+ debug_box_pos_rot(pMin, pMax, 0); -+} -+ -+/** -+ * Draws a debug box from pMin to pMax, rotating it in the xz-plane by `yaw` -+ */ -+void debug_box_pos_rot(Vec3f pMin, Vec3f pMax, s16 yaw) -+{ -+ Vec3f center, bounds; -+ -+ bounds[0] = pMax[0] - pMin[0] / 2.0f; -+ bounds[1] = pMax[1] - pMin[1] / 2.0f; -+ bounds[2] = pMax[2] - pMin[2] / 2.0f; -+ -+ center[0] = pMin[0] + bounds[0]; -+ center[1] = pMin[1] + bounds[1]; -+ center[2] = pMin[2] + bounds[2]; -+ -+ append_debug_box(center, bounds, yaw); -+} -+ -+static void render_box(struct DebugBox *box) -+{ -+ Vtx *verts = alloc_display_list(8 * sizeof(Vtx)); -+ Mtx *translate; -+ Mtx *rotate; -+ Mtx *translateback; -+ s32 x0 = box->center[0], -+ y0 = box->center[1], -+ z0 = box->center[2]; -+ -+ s32 xb = box->bounds[0], -+ yb = box->bounds[1], -+ zb = box->bounds[2]; -+ -+ if (verts != NULL) { -+ if (box->yaw != 0) { -+ // Translate to the origin, rotate, then translate back, effectively rotating the box about -+ // its center -+ translate = alloc_display_list(sizeof(Mtx)); -+ rotate = alloc_display_list(sizeof(Mtx)); -+ translateback = alloc_display_list(sizeof(Mtx)); -+ -+ guTranslate(translate, box->center[0], box->center[1], box->center[2]); -+ guRotate(rotate, box->yaw / (float)0x10000 * 360.0f, 0, 1.0f, 0); -+ guTranslate(translateback, -box->center[0], -box->center[1], -box->center[2]); -+ -+ gSPMatrix(gDisplayListHead++, translate, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH); -+ gSPMatrix(gDisplayListHead++, rotate, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH); -+ gSPMatrix(gDisplayListHead++, translateback, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH); -+ } -+ -+#define DBG_BOX_VTX(i, x, y, z) make_vertex(verts, i, x, y, z, 0, 0, DBG_BOX_COL) -+ DBG_BOX_VTX(0, x0 - xb, y0 + yb, z0 - zb); -+ DBG_BOX_VTX(1, x0 + xb, y0 + yb, z0 - zb); -+ DBG_BOX_VTX(2, x0 - xb, y0 - yb, z0 - zb); -+ DBG_BOX_VTX(3, x0 + xb, y0 - yb, z0 - zb); -+ DBG_BOX_VTX(4, x0 - xb, y0 + yb, z0 + zb); -+ DBG_BOX_VTX(5, x0 + xb, y0 + yb, z0 + zb); -+ DBG_BOX_VTX(6, x0 - xb, y0 - yb, z0 + zb); -+ DBG_BOX_VTX(7, x0 + xb, y0 - yb, z0 + zb); -+#undef DBG_BOX_VTX -+ -+ gSPVertex(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(verts), 8, 0); -+ -+ gSPDisplayList(gDisplayListHead++, dl_debug_draw_box); -+ -+ if (box->yaw != 0) { -+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); -+ } -+ } -+} -+ -+void render_debug_boxes(void) -+{ -+ s32 i; -+ Mtx *mtx; -+ -+ if (sNumBoxes == 0) { -+ return; -+ } -+ -+ mtx = alloc_display_list(sizeof(Mtx)); -+ if (mtx == NULL) { -+ for (i = 0; i < sNumBoxes; ++i) { -+ mem_pool_free(gEffectsMemoryPool, sBoxes[i]); -+ } -+ sNumBoxes = 0; -+ return; -+ } -+ -+ //XXX: This is hacky. Ths camera's look-at matrix is stored in gMatStack[1], so this is a simple way -+ // of using it without reconstructing the matrix. -+ mtxf_to_mtx(mtx, gMatStack[1]); -+ gSPMatrix(gDisplayListHead++, mtx, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH); -+ gSPDisplayList(gDisplayListHead++, dl_debug_box_begin); -+ -+ for (i = 0; i < sNumBoxes; ++i) { -+ render_box(sBoxes[i]); -+ mem_pool_free(gEffectsMemoryPool, sBoxes[i]); -+ } -+ -+ sNumBoxes = 0; -+} -diff --git a/src/game/debug_box.h b/src/game/debug_box.h -new file mode 100644 -index 00000000..cdb3dc9d ---- /dev/null -+++ b/src/game/debug_box.h -@@ -0,0 +1,25 @@ -+#ifndef _DEBUG_DRAW_CUBE_H -+#define _DEBUG_DRAW_CUBE_H -+ -+/** -+ * @file debug_box.h -+ * Draws debug boxes, see debug_box.inc.c for details -+ */ -+ -+#include "types.h" -+ -+/** -+ * The max amount of debug boxes before debug_box() just returns. -+ * You can set this to something higher like 1000, but things like text will stop rendering. -+ */ -+#define MAX_DEBUG_BOXES 100 -+ -+void debug_box(Vec3f center, Vec3f bounds); -+void debug_box_rot(Vec3f center, Vec3f bounds, s16 yaw); -+ -+void debug_box_pos(Vec3f pMin, Vec3f pMax); -+void debug_box_pos_rot(Vec3f pMin, Vec3f pMax, s16 yaw); -+ -+void render_debug_boxes(void); -+ -+#endif /* _DEBUG_DRAW_CUBE_H */ diff --git a/enhancements/fps.patch b/enhancements/fps.patch deleted file mode 100644 index 9e28d22a..00000000 --- a/enhancements/fps.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/src/game/game_init.c b/src/game/game_init.c -index 0852a141..18c5e8fe 100644 ---- a/src/game/game_init.c -+++ b/src/game/game_init.c -@@ -56,6 +56,47 @@ struct DemoInput *gCurrDemoInput = NULL; // demo input sequence - u16 gDemoInputListID = 0; - struct DemoInput gRecordedDemoInput = { 0 }; // possibly removed in EU. TODO: Check - -+// SDK states that 1 cycle takes about 21.33 nanoseconds -+#define SECONDS_PER_CYCLE 0.00000002133f -+ -+#define FPS_COUNTER_X_POS 24 -+#define FPS_COUNTER_Y_POS 190 -+ -+static OSTime gLastOSTime = 0; -+static float gFrameTime = 0.0f; -+static u16 gFrames = 0; -+static u16 gFPS = 0; -+static u8 gRenderFPS = FALSE; -+ -+static void calculate_frameTime_from_OSTime(OSTime diff) { -+ gFrameTime += diff * SECONDS_PER_CYCLE; -+ gFrames++; -+} -+ -+static void render_fps(void) { -+ // Toggle rendering framerate with the L button. -+ if (gPlayer1Controller->buttonPressed & L_TRIG) { -+ gRenderFPS ^= 1; -+ } -+ -+ if (gRenderFPS) { -+ OSTime newTime = osGetTime(); -+ -+ calculate_frameTime_from_OSTime(newTime - gLastOSTime); -+ -+ // If frame time is longer or equal to a second, update FPS counter. -+ if (gFrameTime >= 1.0f) { -+ gFPS = gFrames; -+ gFrames = 0; -+ gFrameTime -= 1.0f; -+ } -+ -+ print_text_fmt_int(FPS_COUNTER_X_POS, FPS_COUNTER_Y_POS, "FPS %d", gFPS); -+ -+ gLastOSTime = newTime; -+ } -+} -+ - /** - * Initializes the Reality Display Processor (RDP). - * This function initializes settings such as texture filtering mode, -@@ -614,5 +655,7 @@ void thread5_game_loop(UNUSED void *arg) { - // amount of free space remaining. - print_text_fmt_int(180, 20, "BUF %d", gGfxPoolEnd - (u8 *) gDisplayListHead); - } -+ -+ render_fps(); - } - } diff --git a/enhancements/ique_support.patch b/enhancements/ique_support.patch deleted file mode 100644 index f52b9b16..00000000 --- a/enhancements/ique_support.patch +++ /dev/null @@ -1,312 +0,0 @@ -diff --git a/include/PR/console_type.h b/include/PR/console_type.h -new file mode 100644 -index 00000000..e60550ab ---- /dev/null -+++ b/include/PR/console_type.h -@@ -0,0 +1,7 @@ -+enum ConsoleType { -+ CONSOLE_N64, -+ CONSOLE_IQUE -+}; -+ -+extern enum ConsoleType gConsoleType; -+extern enum ConsoleType get_console_type(void); -diff --git a/lib/asm/skGetId.s b/lib/asm/skGetId.s -new file mode 100644 -index 00000000..8fb4c449 ---- /dev/null -+++ b/lib/asm/skGetId.s -@@ -0,0 +1,18 @@ -+# Code by stuckpixel -+ -+.set noreorder -+.set gp=64 -+ -+.include "macros.inc" -+ -+glabel skGetId -+ li $v0, 0 -+ li $t0, 0xA4300014 -+ lw $t1, 0x00($t0) -+ nop -+ jr $ra -+ nop -+ nop -+ nop -+ nop -+ nop -diff --git a/lib/src/__osViSwapContext.c b/lib/src/__osViSwapContext.c -index d7741994..9aced7cf 100644 ---- a/lib/src/__osViSwapContext.c -+++ b/lib/src/__osViSwapContext.c -@@ -52,7 +52,9 @@ void __osViSwapContext() { - HW_REG(VI_INTR_REG, u32) = s0->fldRegs[field].vIntr; - HW_REG(VI_X_SCALE_REG, u32) = s1->unk20; - HW_REG(VI_Y_SCALE_REG, u32) = s1->unk2c; -- HW_REG(VI_CONTROL_REG, u32) = s1->features; -+ /* Make sure bit 13 is cleared. Otherwise, graphics will be corrupted on -+ * iQue Player. This has no effect on N64. */ -+ HW_REG(VI_CONTROL_REG, u32) = s1->features & ~(1 << 13); - D_80334914 = D_80334910; - D_80334910 = s1; - *D_80334914 = *D_80334910; -diff --git a/lib/src/consoleType.c b/lib/src/consoleType.c -new file mode 100644 -index 00000000..ef08d1ef ---- /dev/null -+++ b/lib/src/consoleType.c -@@ -0,0 +1,12 @@ -+#include "libultra_internal.h" -+#include -+ -+enum ConsoleType gConsoleType; -+ -+void skGetId(u32 *out); -+ -+enum ConsoleType get_console_type(void) { -+ u32 id = 0; -+ skGetId(&id); -+ return (id == 0) ? CONSOLE_N64 : CONSOLE_IQUE; -+} -diff --git a/lib/src/osEepromProbe.c b/lib/src/osEepromProbe.c -index d550b846..bbaf2bcc 100644 ---- a/lib/src/osEepromProbe.c -+++ b/lib/src/osEepromProbe.c -@@ -1,4 +1,5 @@ - #include "libultra_internal.h" -+#include - - // TODO: merge with osEepromWrite - typedef struct { -@@ -13,11 +14,23 @@ s32 osEepromProbe(OSMesgQueue *mq) { - unkStruct sp18; - - __osSiGetAccess(); -- status = __osEepStatus(mq, &sp18); -- if (status == 0 && (sp18.unk00 & 0x8000) != 0) { -- status = 1; -- } else { -- status = 0; -+ if (gConsoleType == CONSOLE_N64) { -+ status = __osEepStatus(mq, &sp18); -+ if (status == 0 && (sp18.unk00 & 0x8000) != 0) { -+ status = 1; -+ } else { -+ status = 0; -+ } -+ } else if (gConsoleType == CONSOLE_IQUE) { -+ s32 __osBbEepromSize = * (s32*) 0x80000360; -+ -+ if (__osBbEepromSize == 0x200) { -+ status = 1; -+ } -+ -+ if (__osBbEepromSize == 0x800) { -+ status = 2; -+ } - } - __osSiRelAccess(); - return status; -diff --git a/lib/src/osEepromRead.c b/lib/src/osEepromRead.c -index ea784b2c..116dae2d 100644 ---- a/lib/src/osEepromRead.c -+++ b/lib/src/osEepromRead.c -@@ -1,4 +1,5 @@ - #include "libultra_internal.h" -+#include - - extern u8 _osLastSentSiCmd; - -@@ -42,33 +43,44 @@ s32 osEepromRead(OSMesgQueue *mq, u8 address, u8 *buffer) { - return -1; - } - __osSiGetAccess(); -- sp34 = __osEepStatus(mq, &sp28); -- if (sp34 != 0 || sp28.unk00 != 0x8000) { -+ if (gConsoleType == CONSOLE_N64) { -+ sp34 = __osEepStatus(mq, &sp28); -+ if (sp34 != 0 || sp28.unk00 != 0x8000) { - -- return 8; -- } -- while (sp28.unk02 & 0x80) { -- __osEepStatus(mq, &sp28); -- } -- __osPackEepReadData(address); -- sp34 = __osSiRawStartDma(OS_WRITE, &D_80365E00); -- osRecvMesg(mq, NULL, OS_MESG_BLOCK); -- for (sp30 = 0; sp30 < 0x10; sp30++) { -- (D_80365E00)[sp30] = 255; -- } -- D_80365E3C = 0; -- sp34 = __osSiRawStartDma(OS_READ, D_80365E00); -- _osLastSentSiCmd = 4; -- osRecvMesg(mq, NULL, OS_MESG_BLOCK); -- for (sp30 = 0; sp30 < 4; sp30++) { -- sp2c++; -- } -- sp20 = *(unkStruct2 *) sp2c; -- sp34 = (sp20.unk01 & 0xc0) >> 4; -- if (sp34 == 0) { -- for (sp30 = 0; sp30 < 8; sp30++) { -- *buffer++ = ((u8 *) &sp20.unk04)[sp30]; -+ return 8; -+ } -+ while (sp28.unk02 & 0x80) { -+ __osEepStatus(mq, &sp28); -+ } -+ __osPackEepReadData(address); -+ sp34 = __osSiRawStartDma(OS_WRITE, &D_80365E00); -+ osRecvMesg(mq, NULL, OS_MESG_BLOCK); -+ for (sp30 = 0; sp30 < 0x10; sp30++) { -+ (D_80365E00)[sp30] = 255; - } -+ D_80365E3C = 0; -+ sp34 = __osSiRawStartDma(OS_READ, D_80365E00); -+ _osLastSentSiCmd = 4; -+ osRecvMesg(mq, NULL, OS_MESG_BLOCK); -+ for (sp30 = 0; sp30 < 4; sp30++) { -+ sp2c++; -+ } -+ sp20 = *(unkStruct2 *) sp2c; -+ sp34 = (sp20.unk01 & 0xc0) >> 4; -+ if (sp34 == 0) { -+ for (sp30 = 0; sp30 < 8; sp30++) { -+ *buffer++ = ((u8 *) &sp20.unk04)[sp30]; -+ } -+ } -+ } else if (gConsoleType == CONSOLE_IQUE) { -+ u8 *__osBbEepromAddress = * (u8**) 0x8000035C; -+ s32 i; -+ -+ for (i = 0; i < 8; i++) { -+ buffer[i] = __osBbEepromAddress[(address << 3) + i]; -+ } -+ -+ sp34 = 0; - } - __osSiRelAccess(); - return sp34; -diff --git a/lib/src/osEepromWrite.c b/lib/src/osEepromWrite.c -index 1a86477b..52a23e5e 100644 ---- a/lib/src/osEepromWrite.c -+++ b/lib/src/osEepromWrite.c -@@ -1,5 +1,6 @@ - #include "libultra_internal.h" - #include "osContInternal.h" -+#include - - #ifndef AVOID_UB - ALIGNED8 u32 D_80365E00[15]; -@@ -52,36 +53,47 @@ s32 osEepromWrite(OSMesgQueue *mq, u8 address, u8 *buffer) { - } - - __osSiGetAccess(); -- sp34 = __osEepStatus(mq, &sp1c); -+ if (gConsoleType == CONSOLE_N64) { -+ sp34 = __osEepStatus(mq, &sp1c); - -- if (sp34 != 0 || sp1c.unk00 != 0x8000) { -- return 8; -- } -+ if (sp34 != 0 || sp1c.unk00 != 0x8000) { -+ return 8; -+ } - -- while (sp1c.unk02 & 0x80) { -- __osEepStatus(mq, &sp1c); -- } -+ while (sp1c.unk02 & 0x80) { -+ __osEepStatus(mq, &sp1c); -+ } - -- __osPackEepWriteData(address, buffer); -+ __osPackEepWriteData(address, buffer); - -- sp34 = __osSiRawStartDma(OS_WRITE, &D_80365E00); -- osRecvMesg(mq, NULL, OS_MESG_BLOCK); -+ sp34 = __osSiRawStartDma(OS_WRITE, &D_80365E00); -+ osRecvMesg(mq, NULL, OS_MESG_BLOCK); - -- for (sp30 = 0; sp30 < 0x10; sp30++) { -- (D_80365E00)[sp30] = 255; -- } -+ for (sp30 = 0; sp30 < 0x10; sp30++) { -+ (D_80365E00)[sp30] = 255; -+ } - -- D_80365E3C = 0; -- sp34 = __osSiRawStartDma(OS_READ, D_80365E00); -- _osLastSentSiCmd = 5; -- osRecvMesg(mq, NULL, OS_MESG_BLOCK); -+ D_80365E3C = 0; -+ sp34 = __osSiRawStartDma(OS_READ, D_80365E00); -+ _osLastSentSiCmd = 5; -+ osRecvMesg(mq, NULL, OS_MESG_BLOCK); - -- for (sp30 = 0; sp30 < 4; sp30++) { -- sp2c++; -- } -+ for (sp30 = 0; sp30 < 4; sp30++) { -+ sp2c++; -+ } -+ -+ sp20 = *(unkStruct2 *) sp2c; -+ sp34 = (sp20.unk01 & 0xc0) >> 4; -+ } else if (gConsoleType == CONSOLE_N64) { -+ u8 *__osBbEepromAddress = * (u8**) 0x8000035C; -+ s32 i; - -- sp20 = *(unkStruct2 *) sp2c; -- sp34 = (sp20.unk01 & 0xc0) >> 4; -+ for (i = 0; i < 8; i++) { -+ __osBbEepromAddress[(address << 3) + i] = buffer[i]; -+ } -+ -+ sp34 = 0; -+ } - __osSiRelAccess(); - return sp34; - } -diff --git a/lib/src/osInitialize.c b/lib/src/osInitialize.c -index 3cbca8ea..20723b2f 100644 ---- a/lib/src/osInitialize.c -+++ b/lib/src/osInitialize.c -@@ -1,6 +1,7 @@ - #include "libultra_internal.h" - #include "hardware.h" - #include -+#include - - #define PIF_ADDR_START (void *) 0x1FC007FC - -@@ -46,6 +47,7 @@ void osInitialize(void) { - UNUSED u32 eu_sp30; - #endif - UNUSED u32 sp2c; -+ gConsoleType = get_console_type(); - D_80365CD0 = TRUE; - __osSetSR(__osGetSR() | 0x20000000); - __osSetFpcCsr(0x01000800); -diff --git a/sm64.ld b/sm64.ld -index 3275819f..6f97698f 100755 ---- a/sm64.ld -+++ b/sm64.ld -@@ -261,6 +261,8 @@ SECTIONS - BUILD_DIR/libultra.a:func_802F7140.o(.text) - BUILD_DIR/libultra.a:func_802F71A0.o(.text) - BUILD_DIR/libultra.a:func_802F71F0.o(.text) -+ BUILD_DIR/libultra.a:consoleType.o(.text) -+ BUILD_DIR/libultra.a:skGetId.o(.text) - BUILD_DIR/lib/rsp.o(.text); - #else - BUILD_DIR/src/game*.o(.text); -@@ -371,6 +373,8 @@ SECTIONS - BUILD_DIR/libultra.a:__osGetCause.o(.text); - BUILD_DIR/libultra.a:__osAtomicDec.o(.text); - BUILD_DIR/libultra.a:guLookAtRef.o(.text); /* Fast3DEX2 only */ -+ BUILD_DIR/libultra.a:consoleType.o(.text); -+ BUILD_DIR/libultra.a:skGetId.o(.text); - BUILD_DIR/lib/rsp.o(.text); - #endif - diff --git a/enhancements/mem_error_screen.patch b/enhancements/mem_error_screen.patch deleted file mode 100644 index 87d995d6..00000000 --- a/enhancements/mem_error_screen.patch +++ /dev/null @@ -1,298 +0,0 @@ -diff --git a/Makefile b/Makefile -index 88c8dbbe..f60df04f 100644 ---- a/Makefile -+++ b/Makefile -@@ -382,6 +382,7 @@ $(BUILD_DIR)/include/text_strings.h: $(BUILD_DIR)/include/text_menu_strings.h - $(BUILD_DIR)/src/menu/file_select.o: $(BUILD_DIR)/include/text_strings.h - $(BUILD_DIR)/src/menu/star_select.o: $(BUILD_DIR)/include/text_strings.h - $(BUILD_DIR)/src/game/ingame_menu.o: $(BUILD_DIR)/include/text_strings.h -+$(BUILD_DIR)/src/game/mem_error_screen.o: $(BUILD_DIR)/include/text_strings.h - - ################################################################ - # TEXTURE GENERATION # -diff --git a/include/segments.h b/include/segments.h -index c98040a8..eeecb4f6 100644 ---- a/include/segments.h -+++ b/include/segments.h -@@ -1,6 +1,9 @@ - #ifndef _SEGMENTS_H - #define _SEGMENTS_H - -+/* Use expansion pack RAM */ -+#define USE_EXT_RAM 1 -+ - /* - * Memory addresses for segments. Ideally, this header file would not be - * needed, and the addresses would be defined in sm64.ld and linker-inserted -diff --git a/include/text_strings.h.in b/include/text_strings.h.in -index 4e36eb96..7aadf0cb 100644 ---- a/include/text_strings.h.in -+++ b/include/text_strings.h.in -@@ -25,6 +25,11 @@ - #define TEXT_PAUSE _("PAUSE") // Pause text, Castle Courses - #define TEXT_HUD_CONGRATULATIONS _("CONGRATULATIONS") // Course Complete Text, Bowser Courses - -+// Memory Expansion Error Screen -+#define TEXT_CONSOLE_8MB _("If you're using an N64 console, then you will need to buy an\nExpansion Pak to play this ROM hack.") -+#define TEXT_PJ64 _("If you are using PJ64 1.6, go to:\nOptions > Settings > Rom Settings Tab > Memory Size\nthen select 8 MB from the drop-down box.") -+#define TEXT_PJ64_2 _("If you are using PJ64 2.X, go to:\nOptions > Settings > Config: > Memory Size, select 8 MB") -+ - #if defined(VERSION_JP) || defined(VERSION_SH) - - /** -diff --git a/levels/entry.c b/levels/entry.c -index 015eeb6b..cc010ca1 100644 ---- a/levels/entry.c -+++ b/levels/entry.c -@@ -15,3 +15,12 @@ const LevelScript level_script_entry[] = { - EXECUTE(/*seg*/ 0x14, /*script*/ _introSegmentRomStart, /*scriptEnd*/ _introSegmentRomEnd, /*entry*/ level_intro_entry_1), - JUMP(/*target*/ level_script_entry), - }; -+ -+const LevelScript level_script_entry_error_screen[] = { -+ INIT_LEVEL(), -+ SLEEP(/*frames*/ 2), -+ BLACKOUT(/*active*/ FALSE), -+ SET_REG(/*value*/ 0), -+ EXECUTE(/*seg*/ 0x14, /*script*/ _introSegmentRomStart, /*scriptEnd*/ _introSegmentRomEnd, /*entry*/ level_intro_entry_error_screen), -+ JUMP(/*target*/ level_script_entry_error_screen), -+}; -diff --git a/levels/intro/geo.c b/levels/intro/geo.c -index 8ac70024..72766f3f 100644 ---- a/levels/intro/geo.c -+++ b/levels/intro/geo.c -@@ -15,6 +15,24 @@ - - #include "levels/intro/header.h" - -+const GeoLayout intro_geo_error_screen[] = { -+ GEO_NODE_SCREEN_AREA(0, SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2), -+ GEO_OPEN_NODE(), -+ GEO_ZBUFFER(0), -+ GEO_OPEN_NODE(), -+ GEO_NODE_ORTHO(100), -+ GEO_OPEN_NODE(), -+ GEO_BACKGROUND_COLOR(0x0001), -+ GEO_CLOSE_NODE(), -+ GEO_CLOSE_NODE(), -+ GEO_ZBUFFER(0), -+ GEO_OPEN_NODE(), -+ GEO_ASM(0, geo18_display_error_message), -+ GEO_CLOSE_NODE(), -+ GEO_CLOSE_NODE(), -+ GEO_END(), -+}; -+ - // 0x0E0002D0 - const GeoLayout intro_geo_0002D0[] = { - GEO_NODE_SCREEN_AREA(0, SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2), -diff --git a/levels/intro/header.h b/levels/intro/header.h -index e0f6292d..8f77fb26 100644 ---- a/levels/intro/header.h -+++ b/levels/intro/header.h -@@ -26,4 +26,8 @@ extern const LevelScript script_intro_L3[]; - extern const LevelScript script_intro_L4[]; - extern const LevelScript script_intro_L5[]; - -+extern const GeoLayout intro_geo_error_screen[]; -+extern const LevelScript level_intro_entry_error_screen[]; -+extern Gfx *geo18_display_error_message(u32 run, UNUSED struct GraphNode *sp44, UNUSED u32 sp48); -+ - #endif -diff --git a/levels/intro/script.c b/levels/intro/script.c -index 4975dbb2..5ee6c688 100644 ---- a/levels/intro/script.c -+++ b/levels/intro/script.c -@@ -18,6 +18,21 @@ - #include "make_const_nonconst.h" - #include "levels/intro/header.h" - -+const LevelScript level_intro_entry_error_screen[] = { -+ INIT_LEVEL(), -+ FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd), -+ LOAD_MIO0(/*seg*/ 0x07, _intro_segment_7SegmentRomStart, _intro_segment_7SegmentRomEnd), -+ ALLOC_LEVEL_POOL(), -+ -+ AREA(/*index*/ 1, intro_geo_error_screen), -+ END_AREA(), -+ -+ FREE_LEVEL_POOL(), -+ LOAD_AREA(/*area*/ 1), -+ SLEEP(/*frames*/ 32767), -+ EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_error_screen), -+}; -+ - const LevelScript level_intro_entry_1[] = { - INIT_LEVEL(), - FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd), -diff --git a/src/engine/level_script.h b/src/engine/level_script.h -index 89bfb4ed..0ea607c5 100644 ---- a/src/engine/level_script.h -+++ b/src/engine/level_script.h -@@ -4,5 +4,6 @@ - struct LevelCommand *level_script_execute(struct LevelCommand *cmd); - - extern u8 level_script_entry[]; -+extern u8 level_script_entry_error_screen[]; - - #endif /* _LEVEL_SCRIPT_H */ -diff --git a/src/game/main.c b/src/game/main.c -index a3afffee..8b05fcf1 100644 ---- a/src/game/main.c -+++ b/src/game/main.c -@@ -12,6 +12,7 @@ - #include "segments.h" - #include "main.h" - #include "thread6.h" -+#include "mem_error_screen.h" - - // Message IDs - #define MESG_SP_COMPLETE 100 -@@ -125,6 +126,10 @@ void alloc_pool(void) { - void *start = (void *) SEG_POOL_START; - void *end = (void *) SEG_POOL_END; - -+ // Detect memory size -+ if (does_pool_end_lie_out_of_bounds(end)) -+ end = (void *)SEG_POOL_END_4MB; -+ - main_pool_init(start, end); - gEffectsMemoryPool = mem_pool_init(0x4000, MEMORY_POOL_LEFT); - } -@@ -330,7 +335,10 @@ void thread3_main(UNUSED void *arg) { - create_thread(&gSoundThread, 4, thread4_sound, NULL, gThread4Stack + 0x2000, 20); - osStartThread(&gSoundThread); - -- create_thread(&gGameLoopThread, 5, thread5_game_loop, NULL, gThread5Stack + 0x2000, 10); -+ if (!gNotEnoughMemory) -+ create_thread(&gGameLoopThread, 5, thread5_game_loop, NULL, gThread5Stack + 0x2000, 10); -+ else -+ create_thread(&gGameLoopThread, 5, thread5_mem_error_message_loop, NULL, gThread5Stack + 0x2000, 10); - osStartThread(&gGameLoopThread); - - while (1) { -diff --git a/src/game/mem_error_screen.c b/src/game/mem_error_screen.c -new file mode 100644 -index 00000000..81efaf91 ---- /dev/null -+++ b/src/game/mem_error_screen.c -@@ -0,0 +1,104 @@ -+/* clang-format off */ -+/* -+ * mem_error_screen.inc.c -+ * -+ * This enhancement should be used for ROM hacks that require the expansion pak. -+ * -+ */ -+/* clang-format on */ -+ -+#include -+#include "segments.h" -+#include "text_strings.h" -+#include "game_init.h" -+#include "main.h" -+#include "print.h" -+#include "ingame_menu.h" -+#include "segment2.h" -+#include "../engine/level_script.h" -+ -+// Ensure that USE_EXT_RAM is defined. -+#ifndef USE_EXT_RAM -+#error You have to define USE_EXT_RAM in 'include/segments.h' -+#endif -+ -+// Require 8 MB of RAM, even if the pool doesn't go into extended memory. -+// Change the '8' to whatever MB limit you want. -+// Note: only special emulators allow for RAM sizes above 8 MB. -+#define REQUIRED_MIN_MEM_SIZE 1048576 * 8 -+ -+u8 gNotEnoughMemory = FALSE; -+u8 gDelayForErrorMessage = 0; -+ -+u8 does_pool_end_lie_out_of_bounds(void *end) { -+ u32 endPhy = ((u32) end) & 0x1FFFFFFF; -+ u32 memSize = *((u32 *) 0x80000318); -+ -+ if (endPhy > memSize) { -+ gNotEnoughMemory = TRUE; -+ return TRUE; -+ } else { -+ if (memSize < REQUIRED_MIN_MEM_SIZE) { -+ gNotEnoughMemory = TRUE; -+ } -+ return FALSE; -+ } -+} -+ -+// If you're using an N64 console, then you will need to buy an\nexpansion pak to play this ROM hack. -+u8 text_console_8mb[] = { TEXT_CONSOLE_8MB }; -+ -+// If you are using PJ64 1.6, go to: Options ► Settings ► Rom Settings Tab ► Memory Size then select 8 -+// MB from the drop-down box. -+u8 text_pj64[] = { TEXT_PJ64 }; -+ -+// If you are using PJ64 2.X, go to: Options ► Settings ► Config: ► Memory Size, select 8 MB -+u8 text_pj64_2[] = { TEXT_PJ64_2 }; -+ -+Gfx *geo18_display_error_message(u32 run, UNUSED struct GraphNode *sp44, UNUSED u32 sp48) { -+ if (run) { -+ if (gDelayForErrorMessage > 0) { -+ // Draw color text title. -+ print_text(10, 210, "ERROR Need more memory"); -+ -+ // Init generic text rendering -+ create_dl_ortho_matrix(); -+ gSPDisplayList(gDisplayListHead++, -+ dl_ia_text_begin); // Init rendering stuff for generic text -+ -+ // Set text color to white -+ gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255); -+ -+ print_generic_string(8, 170, text_console_8mb); -+ print_generic_string(8, 120, text_pj64); -+ print_generic_string(8, 54, text_pj64_2); -+ -+ // Cleanup -+ gSPDisplayList(gDisplayListHead++, -+ dl_ia_text_end); // Reset back to default render settings. -+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); -+ } else { -+ gDelayForErrorMessage += 1; -+ } -+ } -+ -+ return 0; -+} -+ -+// Basic main loop for the error screen. Note that controllers are not enabled here. -+void thread5_mem_error_message_loop(UNUSED void *arg) { -+ struct LevelCommand *addr; -+ -+ setup_game_memory(); -+ set_vblank_handler(2, &gGameVblankHandler, &gGameVblankQueue, (OSMesg) 1); -+ -+ addr = segmented_to_virtual(level_script_entry_error_screen); -+ -+ rendering_init(); -+ -+ while (1) { -+ config_gfx_pool(); -+ addr = level_script_execute(addr); -+ display_and_vsync(); -+ } -+} -\ No newline at end of file -diff --git a/src/game/mem_error_screen.h b/src/game/mem_error_screen.h -new file mode 100644 -index 00000000..9fbff34c ---- /dev/null -+++ b/src/game/mem_error_screen.h -@@ -0,0 +1,8 @@ -+#ifndef MEM_ERROR_SCREEN_H -+#define MEM_ERROR_SCREEN_H -+ -+extern u8 gNotEnoughMemory; -+void thread5_mem_error_message_loop(UNUSED void *arg); -+u8 does_pool_end_lie_out_of_bounds(void *end); -+ -+#endif diff --git a/enhancements/record_demo.patch b/enhancements/record_demo.patch deleted file mode 100644 index 5d2c25de..00000000 --- a/enhancements/record_demo.patch +++ /dev/null @@ -1,185 +0,0 @@ -diff --git a/src/game/game_init.c b/src/game/game_init.c -index a4302124..5ffbf3ed 100644 ---- a/src/game/game_init.c -+++ b/src/game/game_init.c -@@ -11,6 +11,7 @@ - #include "game_init.h" - #include "main.h" - #include "memory.h" -+#include "object_list_processor.h" - #include "profiler.h" - #include "save_file.h" - #include "seq_ids.h" -@@ -335,6 +336,45 @@ void display_and_vsync(void) { - gGlobalTimer++; - } - -+/* -+ * This enhancement allows you to record gameplay demos for the mario head screen. -+ * -+ * Note: -+ * This enhancement does require the lastest versions of PJ64 from the nightly builds, -+ * because it uses the javascript API to automatically dump the demo files from RAM -+ * once the demo is completed. See enhancements/RecordDemo.js for more info -+ * -+*/ -+ -+#include "../src/game/mario.h" -+ -+#define DEMOREC_STATUS_NOT_RECORDING 0 -+#define DEMOREC_STATUS_PREPARING 1 -+#define DEMOREC_STATUS_RECORDING 2 -+#define DEMOREC_STATUS_STOPPING 3 -+#define DEMOREC_STATUS_DONE 4 -+ -+#define DEMOREC_PRINT_X 10 -+#define DEMOREC_PRINT_Y 10 -+ -+#define DEMOREC_DONE_DELAY 60 // Show "DONE" message for 2 seconds. -+ -+#define DEMOREC_MAX_INPUTS 1025 // Max number of recorded inputs. -+ -+/* -+ DO NOT REMOVE, MODIFY, OR MAKE A COPY OF THIS EXACT STRING! -+ This is here so that the js dump script can find the control variables easily. -+*/ -+char gDemoRecTag[] = "DEMORECVARS"; -+ -+// Control variables. It is easier if they are each 4 byte aligned, which is why they are u32. -+u32 gRecordingStatus = DEMOREC_STATUS_NOT_RECORDING; -+u32 gDoneDelay = 0; -+u32 gNumOfRecordedInputs = 0; -+struct DemoInput gRecordedInputs[DEMOREC_MAX_INPUTS]; -+struct DemoInput* gRecordedInputsPtr = (struct DemoInput*)gRecordedInputs; -+struct DemoInput gRecordedDemoInputCopy; -+ - // this function records distinct inputs over a 255-frame interval to RAM locations and was likely - // used to record the demo sequences seen in the final game. This function is unused. - static void record_demo(void) { -@@ -368,6 +408,118 @@ static void record_demo(void) { - gRecordedDemoInput.timer++; - } - -+void record_new_demo_input(void) { -+ if(gRecordedDemoInput.timer == 1 && gRecordedDemoInputCopy.timer > 0) { -+ gRecordedInputs[gNumOfRecordedInputs].timer = gRecordedDemoInputCopy.timer; -+ gRecordedInputs[gNumOfRecordedInputs + 1].timer = 0; -+ gRecordedInputs[gNumOfRecordedInputs].rawStickX = gRecordedDemoInputCopy.rawStickX; -+ gRecordedInputs[gNumOfRecordedInputs + 1].rawStickX = gRecordedDemoInputCopy.rawStickX; -+ gRecordedInputs[gNumOfRecordedInputs].rawStickY = gRecordedDemoInputCopy.rawStickY; -+ gRecordedInputs[gNumOfRecordedInputs + 1].rawStickY = gRecordedDemoInputCopy.rawStickY; -+ gRecordedInputs[gNumOfRecordedInputs].buttonMask = gRecordedDemoInputCopy.buttonMask; -+ gRecordedInputs[gNumOfRecordedInputs + 1].buttonMask = gRecordedDemoInputCopy.buttonMask; -+ gNumOfRecordedInputs++; -+ } -+} -+ -+// Self explanitory -+void copy_gRecordedDemoInput(void) { -+ gRecordedDemoInputCopy.timer = gRecordedDemoInput.timer; -+ gRecordedDemoInputCopy.rawStickX = gRecordedDemoInput.rawStickX; -+ gRecordedDemoInputCopy.rawStickY = gRecordedDemoInput.rawStickY; -+ gRecordedDemoInputCopy.buttonMask = gRecordedDemoInput.buttonMask; -+} -+ -+// Runs when the demo is recording. -+void recording(void) { -+ -+ // Force-stop when someone makes too many inputs. -+ if(gNumOfRecordedInputs + 1 > DEMOREC_MAX_INPUTS) { -+ gRecordingStatus = DEMOREC_STATUS_STOPPING; -+ return; -+ } -+ -+ copy_gRecordedDemoInput(); -+ record_demo(); // Defined in game.c -+ record_new_demo_input(); -+} -+ -+// Makes sure the last demo input is zeroed out, to make it look more clean. -+void record_cleanup(void) { -+ gRecordedInputs[gNumOfRecordedInputs].timer = 0; -+ gRecordedInputs[gNumOfRecordedInputs].rawStickX = 0; -+ gRecordedInputs[gNumOfRecordedInputs].rawStickY = 0; -+ gRecordedInputs[gNumOfRecordedInputs].buttonMask = 0; -+ -+ // Make sure the done delay is reset before moving to DONE status. -+ gDoneDelay = 0; -+} -+ -+void record_run(void) { -+ switch(gRecordingStatus) { -+ case DEMOREC_STATUS_NOT_RECORDING: -+ break; -+ case DEMOREC_STATUS_PREPARING: -+ if(gMarioObject != NULL && gCurrLevelNum >= 5) { // If the game is in an active level -+ gRecordingStatus = DEMOREC_STATUS_RECORDING; -+ -+ // A bit of a hack, but it works. -+ gNumOfRecordedInputs = 1; -+ gRecordedInputs[0].timer = gCurrLevelNum; -+ gRecordedInputs[0].rawStickX = 0; -+ gRecordedInputs[0].rawStickY = 0; -+ gRecordedInputs[0].buttonMask = 0; -+ } -+ break; -+ case DEMOREC_STATUS_RECORDING: -+ recording(); -+ break; -+ case DEMOREC_STATUS_DONE: -+ if(gDoneDelay > DEMOREC_DONE_DELAY) -+ gRecordingStatus = DEMOREC_STATUS_NOT_RECORDING; -+ else -+ gDoneDelay++; -+ break; -+ } -+} -+ -+// Prints the status on the bottom-left side of the screen in colorful text. -+void print_status(void) { -+ switch(gRecordingStatus) { -+ case DEMOREC_STATUS_PREPARING: -+ print_text(DEMOREC_PRINT_X, DEMOREC_PRINT_Y, "READY"); -+ break; -+ case DEMOREC_STATUS_RECORDING: -+ print_text(DEMOREC_PRINT_X, DEMOREC_PRINT_Y, "REC"); -+ break; -+ case DEMOREC_STATUS_STOPPING: -+ print_text(DEMOREC_PRINT_X, DEMOREC_PRINT_Y, "WAIT"); -+ break; -+ case DEMOREC_STATUS_DONE: -+ print_text(DEMOREC_PRINT_X, DEMOREC_PRINT_Y, "DONE"); -+ break; -+ } -+} -+ -+// Main function that should be called from thread5_game_loop() -+void recordingDemo(void) { -+ // Mario needs to enter directly into a level and not from a warp, -+ // so the debug level select is used for that. -+ gDebugLevelSelect = TRUE; -+ -+ if(gPlayer1Controller->buttonPressed & L_TRIG) { -+ if(gRecordingStatus == DEMOREC_STATUS_NOT_RECORDING) { -+ gRecordingStatus = DEMOREC_STATUS_PREPARING; -+ } else if (gRecordingStatus == DEMOREC_STATUS_RECORDING) { -+ gRecordingStatus = DEMOREC_STATUS_STOPPING; -+ record_cleanup(); -+ } -+ } -+ -+ record_run(); -+ print_status(); -+} -+ - // take the updated controller struct and calculate - // the new x, y, and distance floats. - void adjust_analog_stick(struct Controller *controller) { -@@ -623,6 +775,7 @@ void thread5_game_loop(UNUSED void *arg) { - audio_game_loop_tick(); - config_gfx_pool(); - read_controller_inputs(); -+ recordingDemo(); - addr = level_script_execute(addr); - display_and_vsync(); - diff --git a/include/GL/eglew.h b/include/GL/eglew.h new file mode 100644 index 00000000..46701479 --- /dev/null +++ b/include/GL/eglew.h @@ -0,0 +1,2618 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart +** 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 __eglew_h__ +#define __eglew_h__ +#define __EGLEW_H__ + +#ifdef __eglext_h_ +#error eglext.h included before eglew.h +#endif + +#if defined(__egl_h_) +#error egl.h included before eglew.h +#endif + +#define __eglext_h_ + +#define __egl_h_ + +#ifndef EGLAPIENTRY +#define EGLAPIENTRY +#endif +#ifndef EGLAPI +#define EGLAPI extern +#endif + +/* EGL Types */ +#include + +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int32_t EGLint; + +typedef unsigned int EGLBoolean; +typedef void *EGLDisplay; +typedef void *EGLConfig; +typedef void *EGLSurface; +typedef void *EGLContext; +typedef void (*__eglMustCastToProperFunctionPointerType)(void); + +typedef unsigned int EGLenum; +typedef void *EGLClientBuffer; + +typedef void *EGLSync; +typedef intptr_t EGLAttrib; +typedef khronos_utime_nanoseconds_t EGLTime; +typedef void *EGLImage; + +typedef void *EGLSyncKHR; +typedef intptr_t EGLAttribKHR; +typedef void *EGLLabelKHR; +typedef void *EGLObjectKHR; +typedef void (EGLAPIENTRY *EGLDEBUGPROCKHR)(EGLenum error,const char *command,EGLint messageType,EGLLabelKHR threadLabel,EGLLabelKHR objectLabel,const char* message); +typedef khronos_utime_nanoseconds_t EGLTimeKHR; +typedef void *EGLImageKHR; +typedef void *EGLStreamKHR; +typedef khronos_uint64_t EGLuint64KHR; +typedef int EGLNativeFileDescriptorKHR; +typedef khronos_ssize_t EGLsizeiANDROID; +typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize); +typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize); +typedef void *EGLDeviceEXT; +typedef void *EGLOutputLayerEXT; +typedef void *EGLOutputPortEXT; +typedef void *EGLSyncNV; +typedef khronos_utime_nanoseconds_t EGLTimeNV; +typedef khronos_utime_nanoseconds_t EGLuint64NV; +typedef khronos_stime_nanoseconds_t EGLnsecsANDROID; + +struct EGLClientPixmapHI; + +#define EGL_DONT_CARE ((EGLint)-1) + +#define EGL_NO_CONTEXT ((EGLContext)0) +#define EGL_NO_DISPLAY ((EGLDisplay)0) +#define EGL_NO_IMAGE ((EGLImage)0) +#define EGL_NO_SURFACE ((EGLSurface)0) +#define EGL_NO_SYNC ((EGLSync)0) + +#define EGL_UNKNOWN ((EGLint)-1) + +#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) + +EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname); +/* ---------------------------- EGL_VERSION_1_0 ---------------------------- */ + +#ifndef EGL_VERSION_1_0 +#define EGL_VERSION_1_0 1 + +#define EGL_FALSE 0 +#define EGL_PBUFFER_BIT 0x0001 +#define EGL_TRUE 1 +#define EGL_PIXMAP_BIT 0x0002 +#define EGL_WINDOW_BIT 0x0004 +#define EGL_SUCCESS 0x3000 +#define EGL_NOT_INITIALIZED 0x3001 +#define EGL_BAD_ACCESS 0x3002 +#define EGL_BAD_ALLOC 0x3003 +#define EGL_BAD_ATTRIBUTE 0x3004 +#define EGL_BAD_CONFIG 0x3005 +#define EGL_BAD_CONTEXT 0x3006 +#define EGL_BAD_CURRENT_SURFACE 0x3007 +#define EGL_BAD_DISPLAY 0x3008 +#define EGL_BAD_MATCH 0x3009 +#define EGL_BAD_NATIVE_PIXMAP 0x300A +#define EGL_BAD_NATIVE_WINDOW 0x300B +#define EGL_BAD_PARAMETER 0x300C +#define EGL_BAD_SURFACE 0x300D +#define EGL_BUFFER_SIZE 0x3020 +#define EGL_ALPHA_SIZE 0x3021 +#define EGL_BLUE_SIZE 0x3022 +#define EGL_GREEN_SIZE 0x3023 +#define EGL_RED_SIZE 0x3024 +#define EGL_DEPTH_SIZE 0x3025 +#define EGL_STENCIL_SIZE 0x3026 +#define EGL_CONFIG_CAVEAT 0x3027 +#define EGL_CONFIG_ID 0x3028 +#define EGL_LEVEL 0x3029 +#define EGL_MAX_PBUFFER_HEIGHT 0x302A +#define EGL_MAX_PBUFFER_PIXELS 0x302B +#define EGL_MAX_PBUFFER_WIDTH 0x302C +#define EGL_NATIVE_RENDERABLE 0x302D +#define EGL_NATIVE_VISUAL_ID 0x302E +#define EGL_NATIVE_VISUAL_TYPE 0x302F +#define EGL_SAMPLES 0x3031 +#define EGL_SAMPLE_BUFFERS 0x3032 +#define EGL_SURFACE_TYPE 0x3033 +#define EGL_TRANSPARENT_TYPE 0x3034 +#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 +#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 +#define EGL_TRANSPARENT_RED_VALUE 0x3037 +#define EGL_NONE 0x3038 +#define EGL_SLOW_CONFIG 0x3050 +#define EGL_NON_CONFORMANT_CONFIG 0x3051 +#define EGL_TRANSPARENT_RGB 0x3052 +#define EGL_VENDOR 0x3053 +#define EGL_VERSION 0x3054 +#define EGL_EXTENSIONS 0x3055 +#define EGL_HEIGHT 0x3056 +#define EGL_WIDTH 0x3057 +#define EGL_LARGEST_PBUFFER 0x3058 +#define EGL_DRAW 0x3059 +#define EGL_READ 0x305A +#define EGL_CORE_NATIVE_ENGINE 0x305B + +typedef EGLBoolean ( * PFNEGLCHOOSECONFIGPROC) (EGLDisplay dpy, const EGLint * attrib_list, EGLConfig * configs, EGLint config_size, EGLint * num_config); +typedef EGLBoolean ( * PFNEGLCOPYBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); +typedef EGLContext ( * PFNEGLCREATECONTEXTPROC) (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEPBUFFERSURFACEPROC) (EGLDisplay dpy, EGLConfig config, const EGLint * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx); +typedef EGLBoolean ( * PFNEGLDESTROYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface); +typedef EGLBoolean ( * PFNEGLGETCONFIGATTRIBPROC) (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint * value); +typedef EGLBoolean ( * PFNEGLGETCONFIGSPROC) (EGLDisplay dpy, EGLConfig * configs, EGLint config_size, EGLint * num_config); +typedef EGLDisplay ( * PFNEGLGETCURRENTDISPLAYPROC) ( void ); +typedef EGLSurface ( * PFNEGLGETCURRENTSURFACEPROC) (EGLint readdraw); +typedef EGLDisplay ( * PFNEGLGETDISPLAYPROC) (EGLNativeDisplayType display_id); +typedef EGLint ( * PFNEGLGETERRORPROC) ( void ); +typedef EGLBoolean ( * PFNEGLINITIALIZEPROC) (EGLDisplay dpy, EGLint * major, EGLint * minor); +typedef EGLBoolean ( * PFNEGLMAKECURRENTPROC) (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +typedef EGLBoolean ( * PFNEGLQUERYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint * value); +typedef const char * ( * PFNEGLQUERYSTRINGPROC) (EGLDisplay dpy, EGLint name); +typedef EGLBoolean ( * PFNEGLQUERYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint * value); +typedef EGLBoolean ( * PFNEGLSWAPBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface); +typedef EGLBoolean ( * PFNEGLTERMINATEPROC) (EGLDisplay dpy); +typedef EGLBoolean ( * PFNEGLWAITGLPROC) ( void ); +typedef EGLBoolean ( * PFNEGLWAITNATIVEPROC) (EGLint engine); + +#define eglChooseConfig EGLEW_GET_FUN(__eglewChooseConfig) +#define eglCopyBuffers EGLEW_GET_FUN(__eglewCopyBuffers) +#define eglCreateContext EGLEW_GET_FUN(__eglewCreateContext) +#define eglCreatePbufferSurface EGLEW_GET_FUN(__eglewCreatePbufferSurface) +#define eglCreatePixmapSurface EGLEW_GET_FUN(__eglewCreatePixmapSurface) +#define eglCreateWindowSurface EGLEW_GET_FUN(__eglewCreateWindowSurface) +#define eglDestroyContext EGLEW_GET_FUN(__eglewDestroyContext) +#define eglDestroySurface EGLEW_GET_FUN(__eglewDestroySurface) +#define eglGetConfigAttrib EGLEW_GET_FUN(__eglewGetConfigAttrib) +#define eglGetConfigs EGLEW_GET_FUN(__eglewGetConfigs) +#define eglGetCurrentDisplay EGLEW_GET_FUN(__eglewGetCurrentDisplay) +#define eglGetCurrentSurface EGLEW_GET_FUN(__eglewGetCurrentSurface) +#define eglGetDisplay EGLEW_GET_FUN(__eglewGetDisplay) +#define eglGetError EGLEW_GET_FUN(__eglewGetError) +#define eglInitialize EGLEW_GET_FUN(__eglewInitialize) +#define eglMakeCurrent EGLEW_GET_FUN(__eglewMakeCurrent) +#define eglQueryContext EGLEW_GET_FUN(__eglewQueryContext) +#define eglQueryString EGLEW_GET_FUN(__eglewQueryString) +#define eglQuerySurface EGLEW_GET_FUN(__eglewQuerySurface) +#define eglSwapBuffers EGLEW_GET_FUN(__eglewSwapBuffers) +#define eglTerminate EGLEW_GET_FUN(__eglewTerminate) +#define eglWaitGL EGLEW_GET_FUN(__eglewWaitGL) +#define eglWaitNative EGLEW_GET_FUN(__eglewWaitNative) + +#define EGLEW_VERSION_1_0 EGLEW_GET_VAR(__EGLEW_VERSION_1_0) + +#endif /* EGL_VERSION_1_0 */ + +/* ---------------------------- EGL_VERSION_1_1 ---------------------------- */ + +#ifndef EGL_VERSION_1_1 +#define EGL_VERSION_1_1 1 + +#define EGL_CONTEXT_LOST 0x300E +#define EGL_BIND_TO_TEXTURE_RGB 0x3039 +#define EGL_BIND_TO_TEXTURE_RGBA 0x303A +#define EGL_MIN_SWAP_INTERVAL 0x303B +#define EGL_MAX_SWAP_INTERVAL 0x303C +#define EGL_NO_TEXTURE 0x305C +#define EGL_TEXTURE_RGB 0x305D +#define EGL_TEXTURE_RGBA 0x305E +#define EGL_TEXTURE_2D 0x305F +#define EGL_TEXTURE_FORMAT 0x3080 +#define EGL_TEXTURE_TARGET 0x3081 +#define EGL_MIPMAP_TEXTURE 0x3082 +#define EGL_MIPMAP_LEVEL 0x3083 +#define EGL_BACK_BUFFER 0x3084 + +typedef EGLBoolean ( * PFNEGLBINDTEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +typedef EGLBoolean ( * PFNEGLRELEASETEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +typedef EGLBoolean ( * PFNEGLSURFACEATTRIBPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); +typedef EGLBoolean ( * PFNEGLSWAPINTERVALPROC) (EGLDisplay dpy, EGLint interval); + +#define eglBindTexImage EGLEW_GET_FUN(__eglewBindTexImage) +#define eglReleaseTexImage EGLEW_GET_FUN(__eglewReleaseTexImage) +#define eglSurfaceAttrib EGLEW_GET_FUN(__eglewSurfaceAttrib) +#define eglSwapInterval EGLEW_GET_FUN(__eglewSwapInterval) + +#define EGLEW_VERSION_1_1 EGLEW_GET_VAR(__EGLEW_VERSION_1_1) + +#endif /* EGL_VERSION_1_1 */ + +/* ---------------------------- EGL_VERSION_1_2 ---------------------------- */ + +#ifndef EGL_VERSION_1_2 +#define EGL_VERSION_1_2 1 + +#define EGL_OPENGL_ES_BIT 0x0001 +#define EGL_OPENVG_BIT 0x0002 +#define EGL_LUMINANCE_SIZE 0x303D +#define EGL_ALPHA_MASK_SIZE 0x303E +#define EGL_COLOR_BUFFER_TYPE 0x303F +#define EGL_RENDERABLE_TYPE 0x3040 +#define EGL_SINGLE_BUFFER 0x3085 +#define EGL_RENDER_BUFFER 0x3086 +#define EGL_COLORSPACE 0x3087 +#define EGL_ALPHA_FORMAT 0x3088 +#define EGL_COLORSPACE_LINEAR 0x308A +#define EGL_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_ALPHA_FORMAT_PRE 0x308C +#define EGL_CLIENT_APIS 0x308D +#define EGL_RGB_BUFFER 0x308E +#define EGL_LUMINANCE_BUFFER 0x308F +#define EGL_HORIZONTAL_RESOLUTION 0x3090 +#define EGL_VERTICAL_RESOLUTION 0x3091 +#define EGL_PIXEL_ASPECT_RATIO 0x3092 +#define EGL_SWAP_BEHAVIOR 0x3093 +#define EGL_BUFFER_PRESERVED 0x3094 +#define EGL_BUFFER_DESTROYED 0x3095 +#define EGL_OPENVG_IMAGE 0x3096 +#define EGL_CONTEXT_CLIENT_TYPE 0x3097 +#define EGL_OPENGL_ES_API 0x30A0 +#define EGL_OPENVG_API 0x30A1 +#define EGL_DISPLAY_SCALING 10000 + +typedef EGLBoolean ( * PFNEGLBINDAPIPROC) (EGLenum api); +typedef EGLSurface ( * PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC) (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint * attrib_list); +typedef EGLenum ( * PFNEGLQUERYAPIPROC) ( void ); +typedef EGLBoolean ( * PFNEGLRELEASETHREADPROC) ( void ); +typedef EGLBoolean ( * PFNEGLWAITCLIENTPROC) ( void ); + +#define eglBindAPI EGLEW_GET_FUN(__eglewBindAPI) +#define eglCreatePbufferFromClientBuffer EGLEW_GET_FUN(__eglewCreatePbufferFromClientBuffer) +#define eglQueryAPI EGLEW_GET_FUN(__eglewQueryAPI) +#define eglReleaseThread EGLEW_GET_FUN(__eglewReleaseThread) +#define eglWaitClient EGLEW_GET_FUN(__eglewWaitClient) + +#define EGLEW_VERSION_1_2 EGLEW_GET_VAR(__EGLEW_VERSION_1_2) + +#endif /* EGL_VERSION_1_2 */ + +/* ---------------------------- EGL_VERSION_1_3 ---------------------------- */ + +#ifndef EGL_VERSION_1_3 +#define EGL_VERSION_1_3 1 + +#define EGL_OPENGL_ES2_BIT 0x0004 +#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 +#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 +#define EGL_MATCH_NATIVE_PIXMAP 0x3041 +#define EGL_CONFORMANT 0x3042 +#define EGL_VG_COLORSPACE 0x3087 +#define EGL_VG_ALPHA_FORMAT 0x3088 +#define EGL_VG_COLORSPACE_LINEAR 0x308A +#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_VG_ALPHA_FORMAT_PRE 0x308C +#define EGL_CONTEXT_CLIENT_VERSION 0x3098 + +#define EGLEW_VERSION_1_3 EGLEW_GET_VAR(__EGLEW_VERSION_1_3) + +#endif /* EGL_VERSION_1_3 */ + +/* ---------------------------- EGL_VERSION_1_4 ---------------------------- */ + +#ifndef EGL_VERSION_1_4 +#define EGL_VERSION_1_4 1 + +#define EGL_OPENGL_BIT 0x0008 +#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 +#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 +#define EGL_MULTISAMPLE_RESOLVE 0x3099 +#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A +#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B +#define EGL_OPENGL_API 0x30A2 + +typedef EGLContext ( * PFNEGLGETCURRENTCONTEXTPROC) ( void ); + +#define eglGetCurrentContext EGLEW_GET_FUN(__eglewGetCurrentContext) + +#define EGLEW_VERSION_1_4 EGLEW_GET_VAR(__EGLEW_VERSION_1_4) + +#endif /* EGL_VERSION_1_4 */ + +/* ---------------------------- EGL_VERSION_1_5 ---------------------------- */ + +#ifndef EGL_VERSION_1_5 +#define EGL_VERSION_1_5 1 + +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001 +#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define EGL_OPENGL_ES3_BIT 0x00000040 +#define EGL_GL_COLORSPACE_SRGB 0x3089 +#define EGL_GL_COLORSPACE_LINEAR 0x308A +#define EGL_CONTEXT_MAJOR_VERSION 0x3098 +#define EGL_CL_EVENT_HANDLE 0x309C +#define EGL_GL_COLORSPACE 0x309D +#define EGL_GL_TEXTURE_2D 0x30B1 +#define EGL_GL_TEXTURE_3D 0x30B2 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 +#define EGL_GL_RENDERBUFFER 0x30B9 +#define EGL_GL_TEXTURE_LEVEL 0x30BC +#define EGL_GL_TEXTURE_ZOFFSET 0x30BD +#define EGL_IMAGE_PRESERVED 0x30D2 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0 +#define EGL_SYNC_STATUS 0x30F1 +#define EGL_SIGNALED 0x30F2 +#define EGL_UNSIGNALED 0x30F3 +#define EGL_TIMEOUT_EXPIRED 0x30F5 +#define EGL_CONDITION_SATISFIED 0x30F6 +#define EGL_SYNC_TYPE 0x30F7 +#define EGL_SYNC_CONDITION 0x30F8 +#define EGL_SYNC_FENCE 0x30F9 +#define EGL_CONTEXT_MINOR_VERSION 0x30FB +#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD +#define EGL_SYNC_CL_EVENT 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF +#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2 +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD +#define EGL_NO_RESET_NOTIFICATION 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF +#define EGL_FOREVER 0xFFFFFFFFFFFFFFFF + +typedef EGLint ( * PFNEGLCLIENTWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); +typedef EGLImage ( * PFNEGLCREATEIMAGEPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void * native_pixmap, const EGLAttrib * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEPLATFORMWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void * native_window, const EGLAttrib * attrib_list); +typedef EGLSync ( * PFNEGLCREATESYNCPROC) (EGLDisplay dpy, EGLenum type, const EGLAttrib * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYIMAGEPROC) (EGLDisplay dpy, EGLImage image); +typedef EGLBoolean ( * PFNEGLDESTROYSYNCPROC) (EGLDisplay dpy, EGLSync sync); +typedef EGLDisplay ( * PFNEGLGETPLATFORMDISPLAYPROC) (EGLenum platform, void * native_display, const EGLAttrib * attrib_list); +typedef EGLBoolean ( * PFNEGLGETSYNCATTRIBPROC) (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib * value); +typedef EGLBoolean ( * PFNEGLWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags); + +#define eglClientWaitSync EGLEW_GET_FUN(__eglewClientWaitSync) +#define eglCreateImage EGLEW_GET_FUN(__eglewCreateImage) +#define eglCreatePlatformPixmapSurface EGLEW_GET_FUN(__eglewCreatePlatformPixmapSurface) +#define eglCreatePlatformWindowSurface EGLEW_GET_FUN(__eglewCreatePlatformWindowSurface) +#define eglCreateSync EGLEW_GET_FUN(__eglewCreateSync) +#define eglDestroyImage EGLEW_GET_FUN(__eglewDestroyImage) +#define eglDestroySync EGLEW_GET_FUN(__eglewDestroySync) +#define eglGetPlatformDisplay EGLEW_GET_FUN(__eglewGetPlatformDisplay) +#define eglGetSyncAttrib EGLEW_GET_FUN(__eglewGetSyncAttrib) +#define eglWaitSync EGLEW_GET_FUN(__eglewWaitSync) + +#define EGLEW_VERSION_1_5 EGLEW_GET_VAR(__EGLEW_VERSION_1_5) + +#endif /* EGL_VERSION_1_5 */ + +/* ------------------------- EGL_ANDROID_blob_cache ------------------------ */ + +#ifndef EGL_ANDROID_blob_cache +#define EGL_ANDROID_blob_cache 1 + +typedef void ( * PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); + +#define eglSetBlobCacheFuncsANDROID EGLEW_GET_FUN(__eglewSetBlobCacheFuncsANDROID) + +#define EGLEW_ANDROID_blob_cache EGLEW_GET_VAR(__EGLEW_ANDROID_blob_cache) + +#endif /* EGL_ANDROID_blob_cache */ + +/* ---------------- EGL_ANDROID_create_native_client_buffer ---------------- */ + +#ifndef EGL_ANDROID_create_native_client_buffer +#define EGL_ANDROID_create_native_client_buffer 1 + +#define EGL_NATIVE_BUFFER_USAGE_PROTECTED_BIT_ANDROID 0x00000001 +#define EGL_NATIVE_BUFFER_USAGE_RENDERBUFFER_BIT_ANDROID 0x00000002 +#define EGL_NATIVE_BUFFER_USAGE_TEXTURE_BIT_ANDROID 0x00000004 +#define EGL_NATIVE_BUFFER_USAGE_ANDROID 0x3143 + +typedef EGLClientBuffer ( * PFNEGLCREATENATIVECLIENTBUFFERANDROIDPROC) (const EGLint * attrib_list); + +#define eglCreateNativeClientBufferANDROID EGLEW_GET_FUN(__eglewCreateNativeClientBufferANDROID) + +#define EGLEW_ANDROID_create_native_client_buffer EGLEW_GET_VAR(__EGLEW_ANDROID_create_native_client_buffer) + +#endif /* EGL_ANDROID_create_native_client_buffer */ + +/* --------------------- EGL_ANDROID_framebuffer_target -------------------- */ + +#ifndef EGL_ANDROID_framebuffer_target +#define EGL_ANDROID_framebuffer_target 1 + +#define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147 + +#define EGLEW_ANDROID_framebuffer_target EGLEW_GET_VAR(__EGLEW_ANDROID_framebuffer_target) + +#endif /* EGL_ANDROID_framebuffer_target */ + +/* ----------------- EGL_ANDROID_front_buffer_auto_refresh ----------------- */ + +#ifndef EGL_ANDROID_front_buffer_auto_refresh +#define EGL_ANDROID_front_buffer_auto_refresh 1 + +#define EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID 0x314C + +#define EGLEW_ANDROID_front_buffer_auto_refresh EGLEW_GET_VAR(__EGLEW_ANDROID_front_buffer_auto_refresh) + +#endif /* EGL_ANDROID_front_buffer_auto_refresh */ + +/* -------------------- EGL_ANDROID_image_native_buffer -------------------- */ + +#ifndef EGL_ANDROID_image_native_buffer +#define EGL_ANDROID_image_native_buffer 1 + +#define EGL_NATIVE_BUFFER_ANDROID 0x3140 + +#define EGLEW_ANDROID_image_native_buffer EGLEW_GET_VAR(__EGLEW_ANDROID_image_native_buffer) + +#endif /* EGL_ANDROID_image_native_buffer */ + +/* --------------------- EGL_ANDROID_native_fence_sync --------------------- */ + +#ifndef EGL_ANDROID_native_fence_sync +#define EGL_ANDROID_native_fence_sync 1 + +#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144 +#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145 +#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146 + +typedef EGLint ( * PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync); + +#define eglDupNativeFenceFDANDROID EGLEW_GET_FUN(__eglewDupNativeFenceFDANDROID) + +#define EGLEW_ANDROID_native_fence_sync EGLEW_GET_VAR(__EGLEW_ANDROID_native_fence_sync) + +#endif /* EGL_ANDROID_native_fence_sync */ + +/* --------------------- EGL_ANDROID_presentation_time --------------------- */ + +#ifndef EGL_ANDROID_presentation_time +#define EGL_ANDROID_presentation_time 1 + +typedef EGLBoolean ( * PFNEGLPRESENTATIONTIMEANDROIDPROC) (EGLDisplay dpy, EGLSurface surface, EGLnsecsANDROID time); + +#define eglPresentationTimeANDROID EGLEW_GET_FUN(__eglewPresentationTimeANDROID) + +#define EGLEW_ANDROID_presentation_time EGLEW_GET_VAR(__EGLEW_ANDROID_presentation_time) + +#endif /* EGL_ANDROID_presentation_time */ + +/* ------------------------- EGL_ANDROID_recordable ------------------------ */ + +#ifndef EGL_ANDROID_recordable +#define EGL_ANDROID_recordable 1 + +#define EGL_RECORDABLE_ANDROID 0x3142 + +#define EGLEW_ANDROID_recordable EGLEW_GET_VAR(__EGLEW_ANDROID_recordable) + +#endif /* EGL_ANDROID_recordable */ + +/* ---------------- EGL_ANGLE_d3d_share_handle_client_buffer --------------- */ + +#ifndef EGL_ANGLE_d3d_share_handle_client_buffer +#define EGL_ANGLE_d3d_share_handle_client_buffer 1 + +#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 + +#define EGLEW_ANGLE_d3d_share_handle_client_buffer EGLEW_GET_VAR(__EGLEW_ANGLE_d3d_share_handle_client_buffer) + +#endif /* EGL_ANGLE_d3d_share_handle_client_buffer */ + +/* -------------------------- EGL_ANGLE_device_d3d ------------------------- */ + +#ifndef EGL_ANGLE_device_d3d +#define EGL_ANGLE_device_d3d 1 + +#define EGL_D3D9_DEVICE_ANGLE 0x33A0 +#define EGL_D3D11_DEVICE_ANGLE 0x33A1 + +#define EGLEW_ANGLE_device_d3d EGLEW_GET_VAR(__EGLEW_ANGLE_device_d3d) + +#endif /* EGL_ANGLE_device_d3d */ + +/* -------------------- EGL_ANGLE_query_surface_pointer -------------------- */ + +#ifndef EGL_ANGLE_query_surface_pointer +#define EGL_ANGLE_query_surface_pointer 1 + +typedef EGLBoolean ( * PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void ** value); + +#define eglQuerySurfacePointerANGLE EGLEW_GET_FUN(__eglewQuerySurfacePointerANGLE) + +#define EGLEW_ANGLE_query_surface_pointer EGLEW_GET_VAR(__EGLEW_ANGLE_query_surface_pointer) + +#endif /* EGL_ANGLE_query_surface_pointer */ + +/* ------------- EGL_ANGLE_surface_d3d_texture_2d_share_handle ------------- */ + +#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle +#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 + +#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 + +#define EGLEW_ANGLE_surface_d3d_texture_2d_share_handle EGLEW_GET_VAR(__EGLEW_ANGLE_surface_d3d_texture_2d_share_handle) + +#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */ + +/* ---------------------- EGL_ANGLE_window_fixed_size ---------------------- */ + +#ifndef EGL_ANGLE_window_fixed_size +#define EGL_ANGLE_window_fixed_size 1 + +#define EGL_FIXED_SIZE_ANGLE 0x3201 + +#define EGLEW_ANGLE_window_fixed_size EGLEW_GET_VAR(__EGLEW_ANGLE_window_fixed_size) + +#endif /* EGL_ANGLE_window_fixed_size */ + +/* --------------------- EGL_ARM_implicit_external_sync -------------------- */ + +#ifndef EGL_ARM_implicit_external_sync +#define EGL_ARM_implicit_external_sync 1 + +#define EGL_SYNC_PRIOR_COMMANDS_IMPLICIT_EXTERNAL_ARM 0x328A + +#define EGLEW_ARM_implicit_external_sync EGLEW_GET_VAR(__EGLEW_ARM_implicit_external_sync) + +#endif /* EGL_ARM_implicit_external_sync */ + +/* ------------------- EGL_ARM_pixmap_multisample_discard ------------------ */ + +#ifndef EGL_ARM_pixmap_multisample_discard +#define EGL_ARM_pixmap_multisample_discard 1 + +#define EGL_DISCARD_SAMPLES_ARM 0x3286 + +#define EGLEW_ARM_pixmap_multisample_discard EGLEW_GET_VAR(__EGLEW_ARM_pixmap_multisample_discard) + +#endif /* EGL_ARM_pixmap_multisample_discard */ + +/* --------------------------- EGL_EXT_buffer_age -------------------------- */ + +#ifndef EGL_EXT_buffer_age +#define EGL_EXT_buffer_age 1 + +#define EGL_BUFFER_AGE_EXT 0x313D + +#define EGLEW_EXT_buffer_age EGLEW_GET_VAR(__EGLEW_EXT_buffer_age) + +#endif /* EGL_EXT_buffer_age */ + +/* ----------------------- EGL_EXT_client_extensions ----------------------- */ + +#ifndef EGL_EXT_client_extensions +#define EGL_EXT_client_extensions 1 + +#define EGLEW_EXT_client_extensions EGLEW_GET_VAR(__EGLEW_EXT_client_extensions) + +#endif /* EGL_EXT_client_extensions */ + +/* ------------------- EGL_EXT_create_context_robustness ------------------- */ + +#ifndef EGL_EXT_create_context_robustness +#define EGL_EXT_create_context_robustness 1 + +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138 +#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF + +#define EGLEW_EXT_create_context_robustness EGLEW_GET_VAR(__EGLEW_EXT_create_context_robustness) + +#endif /* EGL_EXT_create_context_robustness */ + +/* -------------------------- EGL_EXT_device_base -------------------------- */ + +#ifndef EGL_EXT_device_base +#define EGL_EXT_device_base 1 + +#define EGL_BAD_DEVICE_EXT 0x322B +#define EGL_DEVICE_EXT 0x322C + +#define EGLEW_EXT_device_base EGLEW_GET_VAR(__EGLEW_EXT_device_base) + +#endif /* EGL_EXT_device_base */ + +/* --------------------------- EGL_EXT_device_drm -------------------------- */ + +#ifndef EGL_EXT_device_drm +#define EGL_EXT_device_drm 1 + +#define EGL_DRM_DEVICE_FILE_EXT 0x3233 + +#define EGLEW_EXT_device_drm EGLEW_GET_VAR(__EGLEW_EXT_device_drm) + +#endif /* EGL_EXT_device_drm */ + +/* ----------------------- EGL_EXT_device_enumeration ---------------------- */ + +#ifndef EGL_EXT_device_enumeration +#define EGL_EXT_device_enumeration 1 + +typedef EGLBoolean ( * PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT * devices, EGLint * num_devices); + +#define eglQueryDevicesEXT EGLEW_GET_FUN(__eglewQueryDevicesEXT) + +#define EGLEW_EXT_device_enumeration EGLEW_GET_VAR(__EGLEW_EXT_device_enumeration) + +#endif /* EGL_EXT_device_enumeration */ + +/* ------------------------- EGL_EXT_device_openwf ------------------------- */ + +#ifndef EGL_EXT_device_openwf +#define EGL_EXT_device_openwf 1 + +#define EGL_OPENWF_DEVICE_ID_EXT 0x3237 + +#define EGLEW_EXT_device_openwf EGLEW_GET_VAR(__EGLEW_EXT_device_openwf) + +#endif /* EGL_EXT_device_openwf */ + +/* -------------------------- EGL_EXT_device_query ------------------------- */ + +#ifndef EGL_EXT_device_query +#define EGL_EXT_device_query 1 + +#define EGL_BAD_DEVICE_EXT 0x322B +#define EGL_DEVICE_EXT 0x322C + +typedef EGLBoolean ( * PFNEGLQUERYDEVICEATTRIBEXTPROC) (EGLDeviceEXT device, EGLint attribute, EGLAttrib * value); +typedef const char * ( * PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name); +typedef EGLBoolean ( * PFNEGLQUERYDISPLAYATTRIBEXTPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib * value); + +#define eglQueryDeviceAttribEXT EGLEW_GET_FUN(__eglewQueryDeviceAttribEXT) +#define eglQueryDeviceStringEXT EGLEW_GET_FUN(__eglewQueryDeviceStringEXT) +#define eglQueryDisplayAttribEXT EGLEW_GET_FUN(__eglewQueryDisplayAttribEXT) + +#define EGLEW_EXT_device_query EGLEW_GET_VAR(__EGLEW_EXT_device_query) + +#endif /* EGL_EXT_device_query */ + +/* ------------------ EGL_EXT_gl_colorspace_bt2020_linear ------------------ */ + +#ifndef EGL_EXT_gl_colorspace_bt2020_linear +#define EGL_EXT_gl_colorspace_bt2020_linear 1 + +#define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F + +#define EGLEW_EXT_gl_colorspace_bt2020_linear EGLEW_GET_VAR(__EGLEW_EXT_gl_colorspace_bt2020_linear) + +#endif /* EGL_EXT_gl_colorspace_bt2020_linear */ + +/* -------------------- EGL_EXT_gl_colorspace_bt2020_pq -------------------- */ + +#ifndef EGL_EXT_gl_colorspace_bt2020_pq +#define EGL_EXT_gl_colorspace_bt2020_pq 1 + +#define EGL_GL_COLORSPACE_BT2020_PQ_EXT 0x3340 + +#define EGLEW_EXT_gl_colorspace_bt2020_pq EGLEW_GET_VAR(__EGLEW_EXT_gl_colorspace_bt2020_pq) + +#endif /* EGL_EXT_gl_colorspace_bt2020_pq */ + +/* ------------------- EGL_EXT_gl_colorspace_scrgb_linear ------------------ */ + +#ifndef EGL_EXT_gl_colorspace_scrgb_linear +#define EGL_EXT_gl_colorspace_scrgb_linear 1 + +#define EGL_GL_COLORSPACE_SCRGB_LINEAR_EXT 0x3350 + +#define EGLEW_EXT_gl_colorspace_scrgb_linear EGLEW_GET_VAR(__EGLEW_EXT_gl_colorspace_scrgb_linear) + +#endif /* EGL_EXT_gl_colorspace_scrgb_linear */ + +/* ---------------------- EGL_EXT_image_dma_buf_import --------------------- */ + +#ifndef EGL_EXT_image_dma_buf_import +#define EGL_EXT_image_dma_buf_import 1 + +#define EGL_LINUX_DMA_BUF_EXT 0x3270 +#define EGL_LINUX_DRM_FOURCC_EXT 0x3271 +#define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 +#define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 +#define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274 +#define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275 +#define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276 +#define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277 +#define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 +#define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 +#define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A +#define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B +#define EGL_SAMPLE_RANGE_HINT_EXT 0x327C +#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D +#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E +#define EGL_ITU_REC601_EXT 0x327F +#define EGL_ITU_REC709_EXT 0x3280 +#define EGL_ITU_REC2020_EXT 0x3281 +#define EGL_YUV_FULL_RANGE_EXT 0x3282 +#define EGL_YUV_NARROW_RANGE_EXT 0x3283 +#define EGL_YUV_CHROMA_SITING_0_EXT 0x3284 +#define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285 + +#define EGLEW_EXT_image_dma_buf_import EGLEW_GET_VAR(__EGLEW_EXT_image_dma_buf_import) + +#endif /* EGL_EXT_image_dma_buf_import */ + +/* ----------------- EGL_EXT_image_dma_buf_import_modifiers ---------------- */ + +#ifndef EGL_EXT_image_dma_buf_import_modifiers +#define EGL_EXT_image_dma_buf_import_modifiers 1 + +#define EGL_DMA_BUF_PLANE3_FD_EXT 0x3440 +#define EGL_DMA_BUF_PLANE3_OFFSET_EXT 0x3441 +#define EGL_DMA_BUF_PLANE3_PITCH_EXT 0x3442 +#define EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT 0x3443 +#define EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT 0x3444 +#define EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT 0x3445 +#define EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT 0x3446 +#define EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT 0x3447 +#define EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT 0x3448 +#define EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT 0x3449 +#define EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT 0x344A + +typedef EGLBoolean ( * PFNEGLQUERYDMABUFFORMATSEXTPROC) (EGLDisplay dpy, EGLint max_formats, EGLint *formats, EGLint *num_formats); +typedef EGLBoolean ( * PFNEGLQUERYDMABUFMODIFIERSEXTPROC) (EGLDisplay dpy, EGLint format, EGLint max_modifiers, EGLuint64KHR *modifiers, EGLBoolean *external_only, EGLint *num_modifiers); + +#define eglQueryDmaBufFormatsEXT EGLEW_GET_FUN(__eglewQueryDmaBufFormatsEXT) +#define eglQueryDmaBufModifiersEXT EGLEW_GET_FUN(__eglewQueryDmaBufModifiersEXT) + +#define EGLEW_EXT_image_dma_buf_import_modifiers EGLEW_GET_VAR(__EGLEW_EXT_image_dma_buf_import_modifiers) + +#endif /* EGL_EXT_image_dma_buf_import_modifiers */ + +/* ------------------------ EGL_EXT_multiview_window ----------------------- */ + +#ifndef EGL_EXT_multiview_window +#define EGL_EXT_multiview_window 1 + +#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134 + +#define EGLEW_EXT_multiview_window EGLEW_GET_VAR(__EGLEW_EXT_multiview_window) + +#endif /* EGL_EXT_multiview_window */ + +/* -------------------------- EGL_EXT_output_base -------------------------- */ + +#ifndef EGL_EXT_output_base +#define EGL_EXT_output_base 1 + +#define EGL_BAD_OUTPUT_LAYER_EXT 0x322D +#define EGL_BAD_OUTPUT_PORT_EXT 0x322E +#define EGL_SWAP_INTERVAL_EXT 0x322F + +typedef EGLBoolean ( * PFNEGLGETOUTPUTLAYERSEXTPROC) (EGLDisplay dpy, const EGLAttrib * attrib_list, EGLOutputLayerEXT * layers, EGLint max_layers, EGLint * num_layers); +typedef EGLBoolean ( * PFNEGLGETOUTPUTPORTSEXTPROC) (EGLDisplay dpy, const EGLAttrib * attrib_list, EGLOutputPortEXT * ports, EGLint max_ports, EGLint * num_ports); +typedef EGLBoolean ( * PFNEGLOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); +typedef EGLBoolean ( * PFNEGLOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); +typedef EGLBoolean ( * PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib * value); +typedef const char * ( * PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); +typedef EGLBoolean ( * PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib * value); +typedef const char * ( * PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); + +#define eglGetOutputLayersEXT EGLEW_GET_FUN(__eglewGetOutputLayersEXT) +#define eglGetOutputPortsEXT EGLEW_GET_FUN(__eglewGetOutputPortsEXT) +#define eglOutputLayerAttribEXT EGLEW_GET_FUN(__eglewOutputLayerAttribEXT) +#define eglOutputPortAttribEXT EGLEW_GET_FUN(__eglewOutputPortAttribEXT) +#define eglQueryOutputLayerAttribEXT EGLEW_GET_FUN(__eglewQueryOutputLayerAttribEXT) +#define eglQueryOutputLayerStringEXT EGLEW_GET_FUN(__eglewQueryOutputLayerStringEXT) +#define eglQueryOutputPortAttribEXT EGLEW_GET_FUN(__eglewQueryOutputPortAttribEXT) +#define eglQueryOutputPortStringEXT EGLEW_GET_FUN(__eglewQueryOutputPortStringEXT) + +#define EGLEW_EXT_output_base EGLEW_GET_VAR(__EGLEW_EXT_output_base) + +#endif /* EGL_EXT_output_base */ + +/* --------------------------- EGL_EXT_output_drm -------------------------- */ + +#ifndef EGL_EXT_output_drm +#define EGL_EXT_output_drm 1 + +#define EGL_DRM_CRTC_EXT 0x3234 +#define EGL_DRM_PLANE_EXT 0x3235 +#define EGL_DRM_CONNECTOR_EXT 0x3236 + +#define EGLEW_EXT_output_drm EGLEW_GET_VAR(__EGLEW_EXT_output_drm) + +#endif /* EGL_EXT_output_drm */ + +/* ------------------------- EGL_EXT_output_openwf ------------------------- */ + +#ifndef EGL_EXT_output_openwf +#define EGL_EXT_output_openwf 1 + +#define EGL_OPENWF_PIPELINE_ID_EXT 0x3238 +#define EGL_OPENWF_PORT_ID_EXT 0x3239 + +#define EGLEW_EXT_output_openwf EGLEW_GET_VAR(__EGLEW_EXT_output_openwf) + +#endif /* EGL_EXT_output_openwf */ + +/* ----------------------- EGL_EXT_pixel_format_float ---------------------- */ + +#ifndef EGL_EXT_pixel_format_float +#define EGL_EXT_pixel_format_float 1 + +#define EGL_COLOR_COMPONENT_TYPE_EXT 0x3339 +#define EGL_COLOR_COMPONENT_TYPE_FIXED_EXT 0x333A +#define EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT 0x333B + +#define EGLEW_EXT_pixel_format_float EGLEW_GET_VAR(__EGLEW_EXT_pixel_format_float) + +#endif /* EGL_EXT_pixel_format_float */ + +/* ------------------------- EGL_EXT_platform_base ------------------------- */ + +#ifndef EGL_EXT_platform_base +#define EGL_EXT_platform_base 1 + +typedef EGLSurface ( * PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void * native_pixmap, const EGLint * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void * native_window, const EGLint * attrib_list); +typedef EGLDisplay ( * PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void * native_display, const EGLint * attrib_list); + +#define eglCreatePlatformPixmapSurfaceEXT EGLEW_GET_FUN(__eglewCreatePlatformPixmapSurfaceEXT) +#define eglCreatePlatformWindowSurfaceEXT EGLEW_GET_FUN(__eglewCreatePlatformWindowSurfaceEXT) +#define eglGetPlatformDisplayEXT EGLEW_GET_FUN(__eglewGetPlatformDisplayEXT) + +#define EGLEW_EXT_platform_base EGLEW_GET_VAR(__EGLEW_EXT_platform_base) + +#endif /* EGL_EXT_platform_base */ + +/* ------------------------ EGL_EXT_platform_device ------------------------ */ + +#ifndef EGL_EXT_platform_device +#define EGL_EXT_platform_device 1 + +#define EGL_PLATFORM_DEVICE_EXT 0x313F + +#define EGLEW_EXT_platform_device EGLEW_GET_VAR(__EGLEW_EXT_platform_device) + +#endif /* EGL_EXT_platform_device */ + +/* ------------------------ EGL_EXT_platform_wayland ----------------------- */ + +#ifndef EGL_EXT_platform_wayland +#define EGL_EXT_platform_wayland 1 + +#define EGL_PLATFORM_WAYLAND_EXT 0x31D8 + +#define EGLEW_EXT_platform_wayland EGLEW_GET_VAR(__EGLEW_EXT_platform_wayland) + +#endif /* EGL_EXT_platform_wayland */ + +/* -------------------------- EGL_EXT_platform_x11 ------------------------- */ + +#ifndef EGL_EXT_platform_x11 +#define EGL_EXT_platform_x11 1 + +#define EGL_PLATFORM_X11_EXT 0x31D5 +#define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6 + +#define EGLEW_EXT_platform_x11 EGLEW_GET_VAR(__EGLEW_EXT_platform_x11) + +#endif /* EGL_EXT_platform_x11 */ + +/* ----------------------- EGL_EXT_protected_content ----------------------- */ + +#ifndef EGL_EXT_protected_content +#define EGL_EXT_protected_content 1 + +#define EGL_PROTECTED_CONTENT_EXT 0x32C0 + +#define EGLEW_EXT_protected_content EGLEW_GET_VAR(__EGLEW_EXT_protected_content) + +#endif /* EGL_EXT_protected_content */ + +/* ----------------------- EGL_EXT_protected_surface ----------------------- */ + +#ifndef EGL_EXT_protected_surface +#define EGL_EXT_protected_surface 1 + +#define EGL_PROTECTED_CONTENT_EXT 0x32C0 + +#define EGLEW_EXT_protected_surface EGLEW_GET_VAR(__EGLEW_EXT_protected_surface) + +#endif /* EGL_EXT_protected_surface */ + +/* ------------------- EGL_EXT_stream_consumer_egloutput ------------------- */ + +#ifndef EGL_EXT_stream_consumer_egloutput +#define EGL_EXT_stream_consumer_egloutput 1 + +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); + +#define eglStreamConsumerOutputEXT EGLEW_GET_FUN(__eglewStreamConsumerOutputEXT) + +#define EGLEW_EXT_stream_consumer_egloutput EGLEW_GET_VAR(__EGLEW_EXT_stream_consumer_egloutput) + +#endif /* EGL_EXT_stream_consumer_egloutput */ + +/* ------------------- EGL_EXT_surface_SMPTE2086_metadata ------------------ */ + +#ifndef EGL_EXT_surface_SMPTE2086_metadata +#define EGL_EXT_surface_SMPTE2086_metadata 1 + +#define EGL_SMPTE2086_DISPLAY_PRIMARY_RX_EXT 0x3341 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_RY_EXT 0x3342 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_GX_EXT 0x3343 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_GY_EXT 0x3344 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_BX_EXT 0x3345 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_BY_EXT 0x3346 +#define EGL_SMPTE2086_WHITE_POINT_X_EXT 0x3347 +#define EGL_SMPTE2086_WHITE_POINT_Y_EXT 0x3348 +#define EGL_SMPTE2086_MAX_LUMINANCE_EXT 0x3349 +#define EGL_SMPTE2086_MIN_LUMINANCE_EXT 0x334A + +#define EGLEW_EXT_surface_SMPTE2086_metadata EGLEW_GET_VAR(__EGLEW_EXT_surface_SMPTE2086_metadata) + +#endif /* EGL_EXT_surface_SMPTE2086_metadata */ + +/* -------------------- EGL_EXT_swap_buffers_with_damage ------------------- */ + +#ifndef EGL_EXT_swap_buffers_with_damage +#define EGL_EXT_swap_buffers_with_damage 1 + +typedef EGLBoolean ( * PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint * rects, EGLint n_rects); + +#define eglSwapBuffersWithDamageEXT EGLEW_GET_FUN(__eglewSwapBuffersWithDamageEXT) + +#define EGLEW_EXT_swap_buffers_with_damage EGLEW_GET_VAR(__EGLEW_EXT_swap_buffers_with_damage) + +#endif /* EGL_EXT_swap_buffers_with_damage */ + +/* -------------------------- EGL_EXT_yuv_surface -------------------------- */ + +#ifndef EGL_EXT_yuv_surface +#define EGL_EXT_yuv_surface 1 + +#define EGL_YUV_BUFFER_EXT 0x3300 +#define EGL_YUV_ORDER_EXT 0x3301 +#define EGL_YUV_ORDER_YUV_EXT 0x3302 +#define EGL_YUV_ORDER_YVU_EXT 0x3303 +#define EGL_YUV_ORDER_YUYV_EXT 0x3304 +#define EGL_YUV_ORDER_UYVY_EXT 0x3305 +#define EGL_YUV_ORDER_YVYU_EXT 0x3306 +#define EGL_YUV_ORDER_VYUY_EXT 0x3307 +#define EGL_YUV_ORDER_AYUV_EXT 0x3308 +#define EGL_YUV_CSC_STANDARD_EXT 0x330A +#define EGL_YUV_CSC_STANDARD_601_EXT 0x330B +#define EGL_YUV_CSC_STANDARD_709_EXT 0x330C +#define EGL_YUV_CSC_STANDARD_2020_EXT 0x330D +#define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 +#define EGL_YUV_SUBSAMPLE_EXT 0x3312 +#define EGL_YUV_SUBSAMPLE_4_2_0_EXT 0x3313 +#define EGL_YUV_SUBSAMPLE_4_2_2_EXT 0x3314 +#define EGL_YUV_SUBSAMPLE_4_4_4_EXT 0x3315 +#define EGL_YUV_DEPTH_RANGE_EXT 0x3317 +#define EGL_YUV_DEPTH_RANGE_LIMITED_EXT 0x3318 +#define EGL_YUV_DEPTH_RANGE_FULL_EXT 0x3319 +#define EGL_YUV_PLANE_BPP_EXT 0x331A +#define EGL_YUV_PLANE_BPP_0_EXT 0x331B +#define EGL_YUV_PLANE_BPP_8_EXT 0x331C +#define EGL_YUV_PLANE_BPP_10_EXT 0x331D + +#define EGLEW_EXT_yuv_surface EGLEW_GET_VAR(__EGLEW_EXT_yuv_surface) + +#endif /* EGL_EXT_yuv_surface */ + +/* -------------------------- EGL_HI_clientpixmap -------------------------- */ + +#ifndef EGL_HI_clientpixmap +#define EGL_HI_clientpixmap 1 + +#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 + +typedef EGLSurface ( * PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI * pixmap); + +#define eglCreatePixmapSurfaceHI EGLEW_GET_FUN(__eglewCreatePixmapSurfaceHI) + +#define EGLEW_HI_clientpixmap EGLEW_GET_VAR(__EGLEW_HI_clientpixmap) + +#endif /* EGL_HI_clientpixmap */ + +/* -------------------------- EGL_HI_colorformats -------------------------- */ + +#ifndef EGL_HI_colorformats +#define EGL_HI_colorformats 1 + +#define EGL_COLOR_FORMAT_HI 0x8F70 +#define EGL_COLOR_RGB_HI 0x8F71 +#define EGL_COLOR_RGBA_HI 0x8F72 +#define EGL_COLOR_ARGB_HI 0x8F73 + +#define EGLEW_HI_colorformats EGLEW_GET_VAR(__EGLEW_HI_colorformats) + +#endif /* EGL_HI_colorformats */ + +/* ------------------------ EGL_IMG_context_priority ----------------------- */ + +#ifndef EGL_IMG_context_priority +#define EGL_IMG_context_priority 1 + +#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 +#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 +#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 +#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 + +#define EGLEW_IMG_context_priority EGLEW_GET_VAR(__EGLEW_IMG_context_priority) + +#endif /* EGL_IMG_context_priority */ + +/* ---------------------- EGL_IMG_image_plane_attribs ---------------------- */ + +#ifndef EGL_IMG_image_plane_attribs +#define EGL_IMG_image_plane_attribs 1 + +#define EGL_NATIVE_BUFFER_MULTIPLANE_SEPARATE_IMG 0x3105 +#define EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG 0x3106 + +#define EGLEW_IMG_image_plane_attribs EGLEW_GET_VAR(__EGLEW_IMG_image_plane_attribs) + +#endif /* EGL_IMG_image_plane_attribs */ + +/* ---------------------------- EGL_KHR_cl_event --------------------------- */ + +#ifndef EGL_KHR_cl_event +#define EGL_KHR_cl_event 1 + +#define EGL_CL_EVENT_HANDLE_KHR 0x309C +#define EGL_SYNC_CL_EVENT_KHR 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF + +#define EGLEW_KHR_cl_event EGLEW_GET_VAR(__EGLEW_KHR_cl_event) + +#endif /* EGL_KHR_cl_event */ + +/* --------------------------- EGL_KHR_cl_event2 --------------------------- */ + +#ifndef EGL_KHR_cl_event2 +#define EGL_KHR_cl_event2 1 + +#define EGL_CL_EVENT_HANDLE_KHR 0x309C +#define EGL_SYNC_CL_EVENT_KHR 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF + +typedef EGLSyncKHR ( * PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR * attrib_list); + +#define eglCreateSync64KHR EGLEW_GET_FUN(__eglewCreateSync64KHR) + +#define EGLEW_KHR_cl_event2 EGLEW_GET_VAR(__EGLEW_KHR_cl_event2) + +#endif /* EGL_KHR_cl_event2 */ + +/* ----------------- EGL_KHR_client_get_all_proc_addresses ----------------- */ + +#ifndef EGL_KHR_client_get_all_proc_addresses +#define EGL_KHR_client_get_all_proc_addresses 1 + +#define EGLEW_KHR_client_get_all_proc_addresses EGLEW_GET_VAR(__EGLEW_KHR_client_get_all_proc_addresses) + +#endif /* EGL_KHR_client_get_all_proc_addresses */ + +/* ------------------------- EGL_KHR_config_attribs ------------------------ */ + +#ifndef EGL_KHR_config_attribs +#define EGL_KHR_config_attribs 1 + +#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 +#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 +#define EGL_CONFORMANT_KHR 0x3042 + +#define EGLEW_KHR_config_attribs EGLEW_GET_VAR(__EGLEW_KHR_config_attribs) + +#endif /* EGL_KHR_config_attribs */ + +/* --------------------- EGL_KHR_context_flush_control --------------------- */ + +#ifndef EGL_KHR_context_flush_control +#define EGL_KHR_context_flush_control 1 + +#define EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR 0 +#define EGL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x2097 +#define EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x2098 + +#define EGLEW_KHR_context_flush_control EGLEW_GET_VAR(__EGLEW_KHR_context_flush_control) + +#endif /* EGL_KHR_context_flush_control */ + +/* ------------------------- EGL_KHR_create_context ------------------------ */ + +#ifndef EGL_KHR_create_context +#define EGL_KHR_create_context 1 + +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 +#define EGL_OPENGL_ES3_BIT 0x00000040 +#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 +#define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098 +#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB +#define EGL_CONTEXT_FLAGS_KHR 0x30FC +#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD +#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF + +#define EGLEW_KHR_create_context EGLEW_GET_VAR(__EGLEW_KHR_create_context) + +#endif /* EGL_KHR_create_context */ + +/* -------------------- EGL_KHR_create_context_no_error -------------------- */ + +#ifndef EGL_KHR_create_context_no_error +#define EGL_KHR_create_context_no_error 1 + +#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31B3 + +#define EGLEW_KHR_create_context_no_error EGLEW_GET_VAR(__EGLEW_KHR_create_context_no_error) + +#endif /* EGL_KHR_create_context_no_error */ + +/* ----------------------------- EGL_KHR_debug ----------------------------- */ + +#ifndef EGL_KHR_debug +#define EGL_KHR_debug 1 + +#define EGL_OBJECT_THREAD_KHR 0x33B0 +#define EGL_OBJECT_DISPLAY_KHR 0x33B1 +#define EGL_OBJECT_CONTEXT_KHR 0x33B2 +#define EGL_OBJECT_SURFACE_KHR 0x33B3 +#define EGL_OBJECT_IMAGE_KHR 0x33B4 +#define EGL_OBJECT_SYNC_KHR 0x33B5 +#define EGL_OBJECT_STREAM_KHR 0x33B6 +#define EGL_DEBUG_CALLBACK_KHR 0x33B8 +#define EGL_DEBUG_MSG_CRITICAL_KHR 0x33B9 +#define EGL_DEBUG_MSG_ERROR_KHR 0x33BA +#define EGL_DEBUG_MSG_WARN_KHR 0x33BB +#define EGL_DEBUG_MSG_INFO_KHR 0x33BC + +typedef EGLint ( * PFNEGLDEBUGMESSAGECONTROLKHRPROC) (EGLDEBUGPROCKHR callback, const EGLAttrib * attrib_list); +typedef EGLint ( * PFNEGLLABELOBJECTKHRPROC) (EGLDisplay display, EGLenum objectType, EGLObjectKHR object, EGLLabelKHR label); +typedef EGLBoolean ( * PFNEGLQUERYDEBUGKHRPROC) (EGLint attribute, EGLAttrib * value); + +#define eglDebugMessageControlKHR EGLEW_GET_FUN(__eglewDebugMessageControlKHR) +#define eglLabelObjectKHR EGLEW_GET_FUN(__eglewLabelObjectKHR) +#define eglQueryDebugKHR EGLEW_GET_FUN(__eglewQueryDebugKHR) + +#define EGLEW_KHR_debug EGLEW_GET_VAR(__EGLEW_KHR_debug) + +#endif /* EGL_KHR_debug */ + +/* --------------------------- EGL_KHR_fence_sync -------------------------- */ + +#ifndef EGL_KHR_fence_sync +#define EGL_KHR_fence_sync 1 + +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 +#define EGL_SYNC_CONDITION_KHR 0x30F8 +#define EGL_SYNC_FENCE_KHR 0x30F9 + +#define EGLEW_KHR_fence_sync EGLEW_GET_VAR(__EGLEW_KHR_fence_sync) + +#endif /* EGL_KHR_fence_sync */ + +/* --------------------- EGL_KHR_get_all_proc_addresses -------------------- */ + +#ifndef EGL_KHR_get_all_proc_addresses +#define EGL_KHR_get_all_proc_addresses 1 + +#define EGLEW_KHR_get_all_proc_addresses EGLEW_GET_VAR(__EGLEW_KHR_get_all_proc_addresses) + +#endif /* EGL_KHR_get_all_proc_addresses */ + +/* ------------------------- EGL_KHR_gl_colorspace ------------------------- */ + +#ifndef EGL_KHR_gl_colorspace +#define EGL_KHR_gl_colorspace 1 + +#define EGL_GL_COLORSPACE_SRGB_KHR 0x3089 +#define EGL_GL_COLORSPACE_LINEAR_KHR 0x308A +#define EGL_GL_COLORSPACE_KHR 0x309D + +#define EGLEW_KHR_gl_colorspace EGLEW_GET_VAR(__EGLEW_KHR_gl_colorspace) + +#endif /* EGL_KHR_gl_colorspace */ + +/* --------------------- EGL_KHR_gl_renderbuffer_image --------------------- */ + +#ifndef EGL_KHR_gl_renderbuffer_image +#define EGL_KHR_gl_renderbuffer_image 1 + +#define EGL_GL_RENDERBUFFER_KHR 0x30B9 + +#define EGLEW_KHR_gl_renderbuffer_image EGLEW_GET_VAR(__EGLEW_KHR_gl_renderbuffer_image) + +#endif /* EGL_KHR_gl_renderbuffer_image */ + +/* ---------------------- EGL_KHR_gl_texture_2D_image ---------------------- */ + +#ifndef EGL_KHR_gl_texture_2D_image +#define EGL_KHR_gl_texture_2D_image 1 + +#define EGL_GL_TEXTURE_2D_KHR 0x30B1 +#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC + +#define EGLEW_KHR_gl_texture_2D_image EGLEW_GET_VAR(__EGLEW_KHR_gl_texture_2D_image) + +#endif /* EGL_KHR_gl_texture_2D_image */ + +/* ---------------------- EGL_KHR_gl_texture_3D_image ---------------------- */ + +#ifndef EGL_KHR_gl_texture_3D_image +#define EGL_KHR_gl_texture_3D_image 1 + +#define EGL_GL_TEXTURE_3D_KHR 0x30B2 +#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD + +#define EGLEW_KHR_gl_texture_3D_image EGLEW_GET_VAR(__EGLEW_KHR_gl_texture_3D_image) + +#endif /* EGL_KHR_gl_texture_3D_image */ + +/* -------------------- EGL_KHR_gl_texture_cubemap_image ------------------- */ + +#ifndef EGL_KHR_gl_texture_cubemap_image +#define EGL_KHR_gl_texture_cubemap_image 1 + +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 + +#define EGLEW_KHR_gl_texture_cubemap_image EGLEW_GET_VAR(__EGLEW_KHR_gl_texture_cubemap_image) + +#endif /* EGL_KHR_gl_texture_cubemap_image */ + +/* ----------------------------- EGL_KHR_image ----------------------------- */ + +#ifndef EGL_KHR_image +#define EGL_KHR_image 1 + +#define EGL_NATIVE_PIXMAP_KHR 0x30B0 + +typedef EGLImageKHR ( * PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); + +#define eglCreateImageKHR EGLEW_GET_FUN(__eglewCreateImageKHR) +#define eglDestroyImageKHR EGLEW_GET_FUN(__eglewDestroyImageKHR) + +#define EGLEW_KHR_image EGLEW_GET_VAR(__EGLEW_KHR_image) + +#endif /* EGL_KHR_image */ + +/* --------------------------- EGL_KHR_image_base -------------------------- */ + +#ifndef EGL_KHR_image_base +#define EGL_KHR_image_base 1 + +#define EGL_IMAGE_PRESERVED_KHR 0x30D2 + +#define EGLEW_KHR_image_base EGLEW_GET_VAR(__EGLEW_KHR_image_base) + +#endif /* EGL_KHR_image_base */ + +/* -------------------------- EGL_KHR_image_pixmap ------------------------- */ + +#ifndef EGL_KHR_image_pixmap +#define EGL_KHR_image_pixmap 1 + +#define EGL_NATIVE_PIXMAP_KHR 0x30B0 + +#define EGLEW_KHR_image_pixmap EGLEW_GET_VAR(__EGLEW_KHR_image_pixmap) + +#endif /* EGL_KHR_image_pixmap */ + +/* -------------------------- EGL_KHR_lock_surface ------------------------- */ + +#ifndef EGL_KHR_lock_surface +#define EGL_KHR_lock_surface 1 + +#define EGL_READ_SURFACE_BIT_KHR 0x0001 +#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 +#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 +#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 +#define EGL_MATCH_FORMAT_KHR 0x3043 +#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 +#define EGL_FORMAT_RGB_565_KHR 0x30C1 +#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 +#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 +#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 +#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 +#define EGL_BITMAP_POINTER_KHR 0x30C6 +#define EGL_BITMAP_PITCH_KHR 0x30C7 +#define EGL_BITMAP_ORIGIN_KHR 0x30C8 +#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 +#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA +#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB +#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC +#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD +#define EGL_LOWER_LEFT_KHR 0x30CE +#define EGL_UPPER_LEFT_KHR 0x30CF + +typedef EGLBoolean ( * PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface); + +#define eglLockSurfaceKHR EGLEW_GET_FUN(__eglewLockSurfaceKHR) +#define eglUnlockSurfaceKHR EGLEW_GET_FUN(__eglewUnlockSurfaceKHR) + +#define EGLEW_KHR_lock_surface EGLEW_GET_VAR(__EGLEW_KHR_lock_surface) + +#endif /* EGL_KHR_lock_surface */ + +/* ------------------------- EGL_KHR_lock_surface2 ------------------------- */ + +#ifndef EGL_KHR_lock_surface2 +#define EGL_KHR_lock_surface2 1 + +#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 + +#define EGLEW_KHR_lock_surface2 EGLEW_GET_VAR(__EGLEW_KHR_lock_surface2) + +#endif /* EGL_KHR_lock_surface2 */ + +/* ------------------------- EGL_KHR_lock_surface3 ------------------------- */ + +#ifndef EGL_KHR_lock_surface3 +#define EGL_KHR_lock_surface3 1 + +#define EGL_READ_SURFACE_BIT_KHR 0x0001 +#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 +#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 +#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 +#define EGL_MATCH_FORMAT_KHR 0x3043 +#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 +#define EGL_FORMAT_RGB_565_KHR 0x30C1 +#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 +#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 +#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 +#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 +#define EGL_BITMAP_POINTER_KHR 0x30C6 +#define EGL_BITMAP_PITCH_KHR 0x30C7 +#define EGL_BITMAP_ORIGIN_KHR 0x30C8 +#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 +#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA +#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB +#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC +#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD +#define EGL_LOWER_LEFT_KHR 0x30CE +#define EGL_UPPER_LEFT_KHR 0x30CF +#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 + +typedef EGLBoolean ( * PFNEGLQUERYSURFACE64KHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR * value); + +#define eglQuerySurface64KHR EGLEW_GET_FUN(__eglewQuerySurface64KHR) + +#define EGLEW_KHR_lock_surface3 EGLEW_GET_VAR(__EGLEW_KHR_lock_surface3) + +#endif /* EGL_KHR_lock_surface3 */ + +/* --------------------- EGL_KHR_mutable_render_buffer --------------------- */ + +#ifndef EGL_KHR_mutable_render_buffer +#define EGL_KHR_mutable_render_buffer 1 + +#define EGL_MUTABLE_RENDER_BUFFER_BIT_KHR 0x1000 + +#define EGLEW_KHR_mutable_render_buffer EGLEW_GET_VAR(__EGLEW_KHR_mutable_render_buffer) + +#endif /* EGL_KHR_mutable_render_buffer */ + +/* ----------------------- EGL_KHR_no_config_context ----------------------- */ + +#ifndef EGL_KHR_no_config_context +#define EGL_KHR_no_config_context 1 + +#define EGLEW_KHR_no_config_context EGLEW_GET_VAR(__EGLEW_KHR_no_config_context) + +#endif /* EGL_KHR_no_config_context */ + +/* ------------------------- EGL_KHR_partial_update ------------------------ */ + +#ifndef EGL_KHR_partial_update +#define EGL_KHR_partial_update 1 + +#define EGL_BUFFER_AGE_KHR 0x313D + +typedef EGLBoolean ( * PFNEGLSETDAMAGEREGIONKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint * rects, EGLint n_rects); + +#define eglSetDamageRegionKHR EGLEW_GET_FUN(__eglewSetDamageRegionKHR) + +#define EGLEW_KHR_partial_update EGLEW_GET_VAR(__EGLEW_KHR_partial_update) + +#endif /* EGL_KHR_partial_update */ + +/* ------------------------ EGL_KHR_platform_android ----------------------- */ + +#ifndef EGL_KHR_platform_android +#define EGL_KHR_platform_android 1 + +#define EGL_PLATFORM_ANDROID_KHR 0x3141 + +#define EGLEW_KHR_platform_android EGLEW_GET_VAR(__EGLEW_KHR_platform_android) + +#endif /* EGL_KHR_platform_android */ + +/* -------------------------- EGL_KHR_platform_gbm ------------------------- */ + +#ifndef EGL_KHR_platform_gbm +#define EGL_KHR_platform_gbm 1 + +#define EGL_PLATFORM_GBM_KHR 0x31D7 + +#define EGLEW_KHR_platform_gbm EGLEW_GET_VAR(__EGLEW_KHR_platform_gbm) + +#endif /* EGL_KHR_platform_gbm */ + +/* ------------------------ EGL_KHR_platform_wayland ----------------------- */ + +#ifndef EGL_KHR_platform_wayland +#define EGL_KHR_platform_wayland 1 + +#define EGL_PLATFORM_WAYLAND_KHR 0x31D8 + +#define EGLEW_KHR_platform_wayland EGLEW_GET_VAR(__EGLEW_KHR_platform_wayland) + +#endif /* EGL_KHR_platform_wayland */ + +/* -------------------------- EGL_KHR_platform_x11 ------------------------- */ + +#ifndef EGL_KHR_platform_x11 +#define EGL_KHR_platform_x11 1 + +#define EGL_PLATFORM_X11_KHR 0x31D5 +#define EGL_PLATFORM_X11_SCREEN_KHR 0x31D6 + +#define EGLEW_KHR_platform_x11 EGLEW_GET_VAR(__EGLEW_KHR_platform_x11) + +#endif /* EGL_KHR_platform_x11 */ + +/* ------------------------- EGL_KHR_reusable_sync ------------------------- */ + +#ifndef EGL_KHR_reusable_sync +#define EGL_KHR_reusable_sync 1 + +#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 +#define EGL_SYNC_STATUS_KHR 0x30F1 +#define EGL_SIGNALED_KHR 0x30F2 +#define EGL_UNSIGNALED_KHR 0x30F3 +#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 +#define EGL_CONDITION_SATISFIED_KHR 0x30F6 +#define EGL_SYNC_TYPE_KHR 0x30F7 +#define EGL_SYNC_REUSABLE_KHR 0x30FA +#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFF + +typedef EGLint ( * PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); +typedef EGLSyncKHR ( * PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); +typedef EGLBoolean ( * PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint * value); +typedef EGLBoolean ( * PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); + +#define eglClientWaitSyncKHR EGLEW_GET_FUN(__eglewClientWaitSyncKHR) +#define eglCreateSyncKHR EGLEW_GET_FUN(__eglewCreateSyncKHR) +#define eglDestroySyncKHR EGLEW_GET_FUN(__eglewDestroySyncKHR) +#define eglGetSyncAttribKHR EGLEW_GET_FUN(__eglewGetSyncAttribKHR) +#define eglSignalSyncKHR EGLEW_GET_FUN(__eglewSignalSyncKHR) + +#define EGLEW_KHR_reusable_sync EGLEW_GET_VAR(__EGLEW_KHR_reusable_sync) + +#endif /* EGL_KHR_reusable_sync */ + +/* ----------------------------- EGL_KHR_stream ---------------------------- */ + +#ifndef EGL_KHR_stream +#define EGL_KHR_stream 1 + +#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 +#define EGL_PRODUCER_FRAME_KHR 0x3212 +#define EGL_CONSUMER_FRAME_KHR 0x3213 +#define EGL_STREAM_STATE_KHR 0x3214 +#define EGL_STREAM_STATE_CREATED_KHR 0x3215 +#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 +#define EGL_STREAM_STATE_EMPTY_KHR 0x3217 +#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218 +#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219 +#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A +#define EGL_BAD_STREAM_KHR 0x321B +#define EGL_BAD_STATE_KHR 0x321C + +typedef EGLStreamKHR ( * PFNEGLCREATESTREAMKHRPROC) (EGLDisplay dpy, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean ( * PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint * value); +typedef EGLBoolean ( * PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR * value); +typedef EGLBoolean ( * PFNEGLSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); + +#define eglCreateStreamKHR EGLEW_GET_FUN(__eglewCreateStreamKHR) +#define eglDestroyStreamKHR EGLEW_GET_FUN(__eglewDestroyStreamKHR) +#define eglQueryStreamKHR EGLEW_GET_FUN(__eglewQueryStreamKHR) +#define eglQueryStreamu64KHR EGLEW_GET_FUN(__eglewQueryStreamu64KHR) +#define eglStreamAttribKHR EGLEW_GET_FUN(__eglewStreamAttribKHR) + +#define EGLEW_KHR_stream EGLEW_GET_VAR(__EGLEW_KHR_stream) + +#endif /* EGL_KHR_stream */ + +/* ------------------------- EGL_KHR_stream_attrib ------------------------- */ + +#ifndef EGL_KHR_stream_attrib +#define EGL_KHR_stream_attrib 1 + +#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 +#define EGL_STREAM_STATE_KHR 0x3214 +#define EGL_STREAM_STATE_CREATED_KHR 0x3215 +#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 + +typedef EGLStreamKHR ( * PFNEGLCREATESTREAMATTRIBKHRPROC) (EGLDisplay dpy, const EGLAttrib * attrib_list); +typedef EGLBoolean ( * PFNEGLQUERYSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib * value); +typedef EGLBoolean ( * PFNEGLSETSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib value); +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERACQUIREATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib * attrib_list); +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERRELEASEATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib * attrib_list); + +#define eglCreateStreamAttribKHR EGLEW_GET_FUN(__eglewCreateStreamAttribKHR) +#define eglQueryStreamAttribKHR EGLEW_GET_FUN(__eglewQueryStreamAttribKHR) +#define eglSetStreamAttribKHR EGLEW_GET_FUN(__eglewSetStreamAttribKHR) +#define eglStreamConsumerAcquireAttribKHR EGLEW_GET_FUN(__eglewStreamConsumerAcquireAttribKHR) +#define eglStreamConsumerReleaseAttribKHR EGLEW_GET_FUN(__eglewStreamConsumerReleaseAttribKHR) + +#define EGLEW_KHR_stream_attrib EGLEW_GET_VAR(__EGLEW_KHR_stream_attrib) + +#endif /* EGL_KHR_stream_attrib */ + +/* ------------------- EGL_KHR_stream_consumer_gltexture ------------------- */ + +#ifndef EGL_KHR_stream_consumer_gltexture +#define EGL_KHR_stream_consumer_gltexture 1 + +#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E + +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); + +#define eglStreamConsumerAcquireKHR EGLEW_GET_FUN(__eglewStreamConsumerAcquireKHR) +#define eglStreamConsumerGLTextureExternalKHR EGLEW_GET_FUN(__eglewStreamConsumerGLTextureExternalKHR) +#define eglStreamConsumerReleaseKHR EGLEW_GET_FUN(__eglewStreamConsumerReleaseKHR) + +#define EGLEW_KHR_stream_consumer_gltexture EGLEW_GET_VAR(__EGLEW_KHR_stream_consumer_gltexture) + +#endif /* EGL_KHR_stream_consumer_gltexture */ + +/* -------------------- EGL_KHR_stream_cross_process_fd -------------------- */ + +#ifndef EGL_KHR_stream_cross_process_fd +#define EGL_KHR_stream_cross_process_fd 1 + +typedef EGLStreamKHR ( * PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); +typedef EGLNativeFileDescriptorKHR ( * PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); + +#define eglCreateStreamFromFileDescriptorKHR EGLEW_GET_FUN(__eglewCreateStreamFromFileDescriptorKHR) +#define eglGetStreamFileDescriptorKHR EGLEW_GET_FUN(__eglewGetStreamFileDescriptorKHR) + +#define EGLEW_KHR_stream_cross_process_fd EGLEW_GET_VAR(__EGLEW_KHR_stream_cross_process_fd) + +#endif /* EGL_KHR_stream_cross_process_fd */ + +/* -------------------------- EGL_KHR_stream_fifo -------------------------- */ + +#ifndef EGL_KHR_stream_fifo +#define EGL_KHR_stream_fifo 1 + +#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC +#define EGL_STREAM_TIME_NOW_KHR 0x31FD +#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE +#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF + +typedef EGLBoolean ( * PFNEGLQUERYSTREAMTIMEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR * value); + +#define eglQueryStreamTimeKHR EGLEW_GET_FUN(__eglewQueryStreamTimeKHR) + +#define EGLEW_KHR_stream_fifo EGLEW_GET_VAR(__EGLEW_KHR_stream_fifo) + +#endif /* EGL_KHR_stream_fifo */ + +/* ----------------- EGL_KHR_stream_producer_aldatalocator ----------------- */ + +#ifndef EGL_KHR_stream_producer_aldatalocator +#define EGL_KHR_stream_producer_aldatalocator 1 + +#define EGLEW_KHR_stream_producer_aldatalocator EGLEW_GET_VAR(__EGLEW_KHR_stream_producer_aldatalocator) + +#endif /* EGL_KHR_stream_producer_aldatalocator */ + +/* ------------------- EGL_KHR_stream_producer_eglsurface ------------------ */ + +#ifndef EGL_KHR_stream_producer_eglsurface +#define EGL_KHR_stream_producer_eglsurface 1 + +#define EGL_STREAM_BIT_KHR 0x0800 + +typedef EGLSurface ( * PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint * attrib_list); + +#define eglCreateStreamProducerSurfaceKHR EGLEW_GET_FUN(__eglewCreateStreamProducerSurfaceKHR) + +#define EGLEW_KHR_stream_producer_eglsurface EGLEW_GET_VAR(__EGLEW_KHR_stream_producer_eglsurface) + +#endif /* EGL_KHR_stream_producer_eglsurface */ + +/* ---------------------- EGL_KHR_surfaceless_context ---------------------- */ + +#ifndef EGL_KHR_surfaceless_context +#define EGL_KHR_surfaceless_context 1 + +#define EGLEW_KHR_surfaceless_context EGLEW_GET_VAR(__EGLEW_KHR_surfaceless_context) + +#endif /* EGL_KHR_surfaceless_context */ + +/* -------------------- EGL_KHR_swap_buffers_with_damage ------------------- */ + +#ifndef EGL_KHR_swap_buffers_with_damage +#define EGL_KHR_swap_buffers_with_damage 1 + +typedef EGLBoolean ( * PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint * rects, EGLint n_rects); + +#define eglSwapBuffersWithDamageKHR EGLEW_GET_FUN(__eglewSwapBuffersWithDamageKHR) + +#define EGLEW_KHR_swap_buffers_with_damage EGLEW_GET_VAR(__EGLEW_KHR_swap_buffers_with_damage) + +#endif /* EGL_KHR_swap_buffers_with_damage */ + +/* ------------------------ EGL_KHR_vg_parent_image ------------------------ */ + +#ifndef EGL_KHR_vg_parent_image +#define EGL_KHR_vg_parent_image 1 + +#define EGL_VG_PARENT_IMAGE_KHR 0x30BA + +#define EGLEW_KHR_vg_parent_image EGLEW_GET_VAR(__EGLEW_KHR_vg_parent_image) + +#endif /* EGL_KHR_vg_parent_image */ + +/* --------------------------- EGL_KHR_wait_sync --------------------------- */ + +#ifndef EGL_KHR_wait_sync +#define EGL_KHR_wait_sync 1 + +typedef EGLint ( * PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); + +#define eglWaitSyncKHR EGLEW_GET_FUN(__eglewWaitSyncKHR) + +#define EGLEW_KHR_wait_sync EGLEW_GET_VAR(__EGLEW_KHR_wait_sync) + +#endif /* EGL_KHR_wait_sync */ + +/* --------------------------- EGL_MESA_drm_image -------------------------- */ + +#ifndef EGL_MESA_drm_image +#define EGL_MESA_drm_image 1 + +#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 +#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 +#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 +#define EGL_DRM_BUFFER_USE_MESA 0x31D1 +#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 +#define EGL_DRM_BUFFER_MESA 0x31D3 +#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 + +typedef EGLImageKHR ( * PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint * name, EGLint * handle, EGLint * stride); + +#define eglCreateDRMImageMESA EGLEW_GET_FUN(__eglewCreateDRMImageMESA) +#define eglExportDRMImageMESA EGLEW_GET_FUN(__eglewExportDRMImageMESA) + +#define EGLEW_MESA_drm_image EGLEW_GET_VAR(__EGLEW_MESA_drm_image) + +#endif /* EGL_MESA_drm_image */ + +/* --------------------- EGL_MESA_image_dma_buf_export --------------------- */ + +#ifndef EGL_MESA_image_dma_buf_export +#define EGL_MESA_image_dma_buf_export 1 + +typedef EGLBoolean ( * PFNEGLEXPORTDMABUFIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int * fds, EGLint * strides, EGLint * offsets); +typedef EGLBoolean ( * PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int * fourcc, int * num_planes, EGLuint64KHR * modifiers); + +#define eglExportDMABUFImageMESA EGLEW_GET_FUN(__eglewExportDMABUFImageMESA) +#define eglExportDMABUFImageQueryMESA EGLEW_GET_FUN(__eglewExportDMABUFImageQueryMESA) + +#define EGLEW_MESA_image_dma_buf_export EGLEW_GET_VAR(__EGLEW_MESA_image_dma_buf_export) + +#endif /* EGL_MESA_image_dma_buf_export */ + +/* ------------------------- EGL_MESA_platform_gbm ------------------------- */ + +#ifndef EGL_MESA_platform_gbm +#define EGL_MESA_platform_gbm 1 + +#define EGL_PLATFORM_GBM_MESA 0x31D7 + +#define EGLEW_MESA_platform_gbm EGLEW_GET_VAR(__EGLEW_MESA_platform_gbm) + +#endif /* EGL_MESA_platform_gbm */ + +/* --------------------- EGL_MESA_platform_surfaceless --------------------- */ + +#ifndef EGL_MESA_platform_surfaceless +#define EGL_MESA_platform_surfaceless 1 + +#define EGL_PLATFORM_SURFACELESS_MESA 0x31DD + +#define EGLEW_MESA_platform_surfaceless EGLEW_GET_VAR(__EGLEW_MESA_platform_surfaceless) + +#endif /* EGL_MESA_platform_surfaceless */ + +/* -------------------------- EGL_NOK_swap_region -------------------------- */ + +#ifndef EGL_NOK_swap_region +#define EGL_NOK_swap_region 1 + +typedef EGLBoolean ( * PFNEGLSWAPBUFFERSREGIONNOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint * rects); + +#define eglSwapBuffersRegionNOK EGLEW_GET_FUN(__eglewSwapBuffersRegionNOK) + +#define EGLEW_NOK_swap_region EGLEW_GET_VAR(__EGLEW_NOK_swap_region) + +#endif /* EGL_NOK_swap_region */ + +/* -------------------------- EGL_NOK_swap_region2 ------------------------- */ + +#ifndef EGL_NOK_swap_region2 +#define EGL_NOK_swap_region2 1 + +typedef EGLBoolean ( * PFNEGLSWAPBUFFERSREGION2NOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint * rects); + +#define eglSwapBuffersRegion2NOK EGLEW_GET_FUN(__eglewSwapBuffersRegion2NOK) + +#define EGLEW_NOK_swap_region2 EGLEW_GET_VAR(__EGLEW_NOK_swap_region2) + +#endif /* EGL_NOK_swap_region2 */ + +/* ---------------------- EGL_NOK_texture_from_pixmap ---------------------- */ + +#ifndef EGL_NOK_texture_from_pixmap +#define EGL_NOK_texture_from_pixmap 1 + +#define EGL_Y_INVERTED_NOK 0x307F + +#define EGLEW_NOK_texture_from_pixmap EGLEW_GET_VAR(__EGLEW_NOK_texture_from_pixmap) + +#endif /* EGL_NOK_texture_from_pixmap */ + +/* ------------------------ EGL_NV_3dvision_surface ------------------------ */ + +#ifndef EGL_NV_3dvision_surface +#define EGL_NV_3dvision_surface 1 + +#define EGL_AUTO_STEREO_NV 0x3136 + +#define EGLEW_NV_3dvision_surface EGLEW_GET_VAR(__EGLEW_NV_3dvision_surface) + +#endif /* EGL_NV_3dvision_surface */ + +/* ------------------------- EGL_NV_coverage_sample ------------------------ */ + +#ifndef EGL_NV_coverage_sample +#define EGL_NV_coverage_sample 1 + +#define EGL_COVERAGE_BUFFERS_NV 0x30E0 +#define EGL_COVERAGE_SAMPLES_NV 0x30E1 + +#define EGLEW_NV_coverage_sample EGLEW_GET_VAR(__EGLEW_NV_coverage_sample) + +#endif /* EGL_NV_coverage_sample */ + +/* --------------------- EGL_NV_coverage_sample_resolve -------------------- */ + +#ifndef EGL_NV_coverage_sample_resolve +#define EGL_NV_coverage_sample_resolve 1 + +#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131 +#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132 +#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133 + +#define EGLEW_NV_coverage_sample_resolve EGLEW_GET_VAR(__EGLEW_NV_coverage_sample_resolve) + +#endif /* EGL_NV_coverage_sample_resolve */ + +/* --------------------------- EGL_NV_cuda_event --------------------------- */ + +#ifndef EGL_NV_cuda_event +#define EGL_NV_cuda_event 1 + +#define EGL_CUDA_EVENT_HANDLE_NV 0x323B +#define EGL_SYNC_CUDA_EVENT_NV 0x323C +#define EGL_SYNC_CUDA_EVENT_COMPLETE_NV 0x323D + +#define EGLEW_NV_cuda_event EGLEW_GET_VAR(__EGLEW_NV_cuda_event) + +#endif /* EGL_NV_cuda_event */ + +/* ------------------------- EGL_NV_depth_nonlinear ------------------------ */ + +#ifndef EGL_NV_depth_nonlinear +#define EGL_NV_depth_nonlinear 1 + +#define EGL_DEPTH_ENCODING_NONE_NV 0 +#define EGL_DEPTH_ENCODING_NV 0x30E2 +#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 + +#define EGLEW_NV_depth_nonlinear EGLEW_GET_VAR(__EGLEW_NV_depth_nonlinear) + +#endif /* EGL_NV_depth_nonlinear */ + +/* --------------------------- EGL_NV_device_cuda -------------------------- */ + +#ifndef EGL_NV_device_cuda +#define EGL_NV_device_cuda 1 + +#define EGL_CUDA_DEVICE_NV 0x323A + +#define EGLEW_NV_device_cuda EGLEW_GET_VAR(__EGLEW_NV_device_cuda) + +#endif /* EGL_NV_device_cuda */ + +/* -------------------------- EGL_NV_native_query -------------------------- */ + +#ifndef EGL_NV_native_query +#define EGL_NV_native_query 1 + +typedef EGLBoolean ( * PFNEGLQUERYNATIVEDISPLAYNVPROC) (EGLDisplay dpy, EGLNativeDisplayType * display_id); +typedef EGLBoolean ( * PFNEGLQUERYNATIVEPIXMAPNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType * pixmap); +typedef EGLBoolean ( * PFNEGLQUERYNATIVEWINDOWNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType * window); + +#define eglQueryNativeDisplayNV EGLEW_GET_FUN(__eglewQueryNativeDisplayNV) +#define eglQueryNativePixmapNV EGLEW_GET_FUN(__eglewQueryNativePixmapNV) +#define eglQueryNativeWindowNV EGLEW_GET_FUN(__eglewQueryNativeWindowNV) + +#define EGLEW_NV_native_query EGLEW_GET_VAR(__EGLEW_NV_native_query) + +#endif /* EGL_NV_native_query */ + +/* ---------------------- EGL_NV_post_convert_rounding --------------------- */ + +#ifndef EGL_NV_post_convert_rounding +#define EGL_NV_post_convert_rounding 1 + +#define EGLEW_NV_post_convert_rounding EGLEW_GET_VAR(__EGLEW_NV_post_convert_rounding) + +#endif /* EGL_NV_post_convert_rounding */ + +/* ------------------------- EGL_NV_post_sub_buffer ------------------------ */ + +#ifndef EGL_NV_post_sub_buffer +#define EGL_NV_post_sub_buffer 1 + +#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE + +typedef EGLBoolean ( * PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); + +#define eglPostSubBufferNV EGLEW_GET_FUN(__eglewPostSubBufferNV) + +#define EGLEW_NV_post_sub_buffer EGLEW_GET_VAR(__EGLEW_NV_post_sub_buffer) + +#endif /* EGL_NV_post_sub_buffer */ + +/* ------------------ EGL_NV_robustness_video_memory_purge ----------------- */ + +#ifndef EGL_NV_robustness_video_memory_purge +#define EGL_NV_robustness_video_memory_purge 1 + +#define EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C + +#define EGLEW_NV_robustness_video_memory_purge EGLEW_GET_VAR(__EGLEW_NV_robustness_video_memory_purge) + +#endif /* EGL_NV_robustness_video_memory_purge */ + +/* ------------------ EGL_NV_stream_consumer_gltexture_yuv ----------------- */ + +#ifndef EGL_NV_stream_consumer_gltexture_yuv +#define EGL_NV_stream_consumer_gltexture_yuv 1 + +#define EGL_YUV_BUFFER_EXT 0x3300 +#define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 +#define EGL_YUV_PLANE0_TEXTURE_UNIT_NV 0x332C +#define EGL_YUV_PLANE1_TEXTURE_UNIT_NV 0x332D +#define EGL_YUV_PLANE2_TEXTURE_UNIT_NV 0x332E + +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALATTRIBSNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLAttrib *attrib_list); + +#define eglStreamConsumerGLTextureExternalAttribsNV EGLEW_GET_FUN(__eglewStreamConsumerGLTextureExternalAttribsNV) + +#define EGLEW_NV_stream_consumer_gltexture_yuv EGLEW_GET_VAR(__EGLEW_NV_stream_consumer_gltexture_yuv) + +#endif /* EGL_NV_stream_consumer_gltexture_yuv */ + +/* ---------------------- EGL_NV_stream_cross_display ---------------------- */ + +#ifndef EGL_NV_stream_cross_display +#define EGL_NV_stream_cross_display 1 + +#define EGL_STREAM_CROSS_DISPLAY_NV 0x334E + +#define EGLEW_NV_stream_cross_display EGLEW_GET_VAR(__EGLEW_NV_stream_cross_display) + +#endif /* EGL_NV_stream_cross_display */ + +/* ----------------------- EGL_NV_stream_cross_object ---------------------- */ + +#ifndef EGL_NV_stream_cross_object +#define EGL_NV_stream_cross_object 1 + +#define EGL_STREAM_CROSS_OBJECT_NV 0x334D + +#define EGLEW_NV_stream_cross_object EGLEW_GET_VAR(__EGLEW_NV_stream_cross_object) + +#endif /* EGL_NV_stream_cross_object */ + +/* --------------------- EGL_NV_stream_cross_partition --------------------- */ + +#ifndef EGL_NV_stream_cross_partition +#define EGL_NV_stream_cross_partition 1 + +#define EGL_STREAM_CROSS_PARTITION_NV 0x323F + +#define EGLEW_NV_stream_cross_partition EGLEW_GET_VAR(__EGLEW_NV_stream_cross_partition) + +#endif /* EGL_NV_stream_cross_partition */ + +/* ---------------------- EGL_NV_stream_cross_process ---------------------- */ + +#ifndef EGL_NV_stream_cross_process +#define EGL_NV_stream_cross_process 1 + +#define EGL_STREAM_CROSS_PROCESS_NV 0x3245 + +#define EGLEW_NV_stream_cross_process EGLEW_GET_VAR(__EGLEW_NV_stream_cross_process) + +#endif /* EGL_NV_stream_cross_process */ + +/* ----------------------- EGL_NV_stream_cross_system ---------------------- */ + +#ifndef EGL_NV_stream_cross_system +#define EGL_NV_stream_cross_system 1 + +#define EGL_STREAM_CROSS_SYSTEM_NV 0x334F + +#define EGLEW_NV_stream_cross_system EGLEW_GET_VAR(__EGLEW_NV_stream_cross_system) + +#endif /* EGL_NV_stream_cross_system */ + +/* ------------------------ EGL_NV_stream_fifo_next ------------------------ */ + +#ifndef EGL_NV_stream_fifo_next +#define EGL_NV_stream_fifo_next 1 + +#define EGL_PENDING_FRAME_NV 0x3329 +#define EGL_STREAM_TIME_PENDING_NV 0x332A + +#define EGLEW_NV_stream_fifo_next EGLEW_GET_VAR(__EGLEW_NV_stream_fifo_next) + +#endif /* EGL_NV_stream_fifo_next */ + +/* --------------------- EGL_NV_stream_fifo_synchronous -------------------- */ + +#ifndef EGL_NV_stream_fifo_synchronous +#define EGL_NV_stream_fifo_synchronous 1 + +#define EGL_STREAM_FIFO_SYNCHRONOUS_NV 0x3336 + +#define EGLEW_NV_stream_fifo_synchronous EGLEW_GET_VAR(__EGLEW_NV_stream_fifo_synchronous) + +#endif /* EGL_NV_stream_fifo_synchronous */ + +/* ----------------------- EGL_NV_stream_frame_limits ---------------------- */ + +#ifndef EGL_NV_stream_frame_limits +#define EGL_NV_stream_frame_limits 1 + +#define EGL_PRODUCER_MAX_FRAME_HINT_NV 0x3337 +#define EGL_CONSUMER_MAX_FRAME_HINT_NV 0x3338 + +#define EGLEW_NV_stream_frame_limits EGLEW_GET_VAR(__EGLEW_NV_stream_frame_limits) + +#endif /* EGL_NV_stream_frame_limits */ + +/* ------------------------- EGL_NV_stream_metadata ------------------------ */ + +#ifndef EGL_NV_stream_metadata +#define EGL_NV_stream_metadata 1 + +#define EGL_MAX_STREAM_METADATA_BLOCKS_NV 0x3250 +#define EGL_MAX_STREAM_METADATA_BLOCK_SIZE_NV 0x3251 +#define EGL_MAX_STREAM_METADATA_TOTAL_SIZE_NV 0x3252 +#define EGL_PRODUCER_METADATA_NV 0x3253 +#define EGL_CONSUMER_METADATA_NV 0x3254 +#define EGL_METADATA0_SIZE_NV 0x3255 +#define EGL_METADATA1_SIZE_NV 0x3256 +#define EGL_METADATA2_SIZE_NV 0x3257 +#define EGL_METADATA3_SIZE_NV 0x3258 +#define EGL_METADATA0_TYPE_NV 0x3259 +#define EGL_METADATA1_TYPE_NV 0x325A +#define EGL_METADATA2_TYPE_NV 0x325B +#define EGL_METADATA3_TYPE_NV 0x325C +#define EGL_PENDING_METADATA_NV 0x3328 + +typedef EGLBoolean ( * PFNEGLQUERYDISPLAYATTRIBNVPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib * value); +typedef EGLBoolean ( * PFNEGLQUERYSTREAMMETADATANVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum name, EGLint n, EGLint offset, EGLint size, void * data); +typedef EGLBoolean ( * PFNEGLSETSTREAMMETADATANVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint n, EGLint offset, EGLint size, const void * data); + +#define eglQueryDisplayAttribNV EGLEW_GET_FUN(__eglewQueryDisplayAttribNV) +#define eglQueryStreamMetadataNV EGLEW_GET_FUN(__eglewQueryStreamMetadataNV) +#define eglSetStreamMetadataNV EGLEW_GET_FUN(__eglewSetStreamMetadataNV) + +#define EGLEW_NV_stream_metadata EGLEW_GET_VAR(__EGLEW_NV_stream_metadata) + +#endif /* EGL_NV_stream_metadata */ + +/* -------------------------- EGL_NV_stream_remote ------------------------- */ + +#ifndef EGL_NV_stream_remote +#define EGL_NV_stream_remote 1 + +#define EGL_STREAM_STATE_INITIALIZING_NV 0x3240 +#define EGL_STREAM_TYPE_NV 0x3241 +#define EGL_STREAM_PROTOCOL_NV 0x3242 +#define EGL_STREAM_ENDPOINT_NV 0x3243 +#define EGL_STREAM_LOCAL_NV 0x3244 +#define EGL_STREAM_PROTOCOL_FD_NV 0x3246 +#define EGL_STREAM_PRODUCER_NV 0x3247 +#define EGL_STREAM_CONSUMER_NV 0x3248 + +#define EGLEW_NV_stream_remote EGLEW_GET_VAR(__EGLEW_NV_stream_remote) + +#endif /* EGL_NV_stream_remote */ + +/* -------------------------- EGL_NV_stream_reset -------------------------- */ + +#ifndef EGL_NV_stream_reset +#define EGL_NV_stream_reset 1 + +#define EGL_SUPPORT_RESET_NV 0x3334 +#define EGL_SUPPORT_REUSE_NV 0x3335 + +typedef EGLBoolean ( * PFNEGLRESETSTREAMNVPROC) (EGLDisplay dpy, EGLStreamKHR stream); + +#define eglResetStreamNV EGLEW_GET_FUN(__eglewResetStreamNV) + +#define EGLEW_NV_stream_reset EGLEW_GET_VAR(__EGLEW_NV_stream_reset) + +#endif /* EGL_NV_stream_reset */ + +/* -------------------------- EGL_NV_stream_socket ------------------------- */ + +#ifndef EGL_NV_stream_socket +#define EGL_NV_stream_socket 1 + +#define EGL_STREAM_PROTOCOL_SOCKET_NV 0x324B +#define EGL_SOCKET_HANDLE_NV 0x324C +#define EGL_SOCKET_TYPE_NV 0x324D + +#define EGLEW_NV_stream_socket EGLEW_GET_VAR(__EGLEW_NV_stream_socket) + +#endif /* EGL_NV_stream_socket */ + +/* ----------------------- EGL_NV_stream_socket_inet ----------------------- */ + +#ifndef EGL_NV_stream_socket_inet +#define EGL_NV_stream_socket_inet 1 + +#define EGL_SOCKET_TYPE_INET_NV 0x324F + +#define EGLEW_NV_stream_socket_inet EGLEW_GET_VAR(__EGLEW_NV_stream_socket_inet) + +#endif /* EGL_NV_stream_socket_inet */ + +/* ----------------------- EGL_NV_stream_socket_unix ----------------------- */ + +#ifndef EGL_NV_stream_socket_unix +#define EGL_NV_stream_socket_unix 1 + +#define EGL_SOCKET_TYPE_UNIX_NV 0x324E + +#define EGLEW_NV_stream_socket_unix EGLEW_GET_VAR(__EGLEW_NV_stream_socket_unix) + +#endif /* EGL_NV_stream_socket_unix */ + +/* --------------------------- EGL_NV_stream_sync -------------------------- */ + +#ifndef EGL_NV_stream_sync +#define EGL_NV_stream_sync 1 + +#define EGL_SYNC_TYPE_KHR 0x30F7 +#define EGL_SYNC_NEW_FRAME_NV 0x321F + +typedef EGLSyncKHR ( * PFNEGLCREATESTREAMSYNCNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint * attrib_list); + +#define eglCreateStreamSyncNV EGLEW_GET_FUN(__eglewCreateStreamSyncNV) + +#define EGLEW_NV_stream_sync EGLEW_GET_VAR(__EGLEW_NV_stream_sync) + +#endif /* EGL_NV_stream_sync */ + +/* ------------------------------ EGL_NV_sync ------------------------------ */ + +#ifndef EGL_NV_sync +#define EGL_NV_sync 1 + +#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 +#define EGL_SYNC_STATUS_NV 0x30E7 +#define EGL_SIGNALED_NV 0x30E8 +#define EGL_UNSIGNALED_NV 0x30E9 +#define EGL_ALREADY_SIGNALED_NV 0x30EA +#define EGL_TIMEOUT_EXPIRED_NV 0x30EB +#define EGL_CONDITION_SATISFIED_NV 0x30EC +#define EGL_SYNC_TYPE_NV 0x30ED +#define EGL_SYNC_CONDITION_NV 0x30EE +#define EGL_SYNC_FENCE_NV 0x30EF +#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFF + +typedef EGLint ( * PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); +typedef EGLSyncNV ( * PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); +typedef EGLBoolean ( * PFNEGLFENCENVPROC) (EGLSyncNV sync); +typedef EGLBoolean ( * PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint * value); +typedef EGLBoolean ( * PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); + +#define eglClientWaitSyncNV EGLEW_GET_FUN(__eglewClientWaitSyncNV) +#define eglCreateFenceSyncNV EGLEW_GET_FUN(__eglewCreateFenceSyncNV) +#define eglDestroySyncNV EGLEW_GET_FUN(__eglewDestroySyncNV) +#define eglFenceNV EGLEW_GET_FUN(__eglewFenceNV) +#define eglGetSyncAttribNV EGLEW_GET_FUN(__eglewGetSyncAttribNV) +#define eglSignalSyncNV EGLEW_GET_FUN(__eglewSignalSyncNV) + +#define EGLEW_NV_sync EGLEW_GET_VAR(__EGLEW_NV_sync) + +#endif /* EGL_NV_sync */ + +/* --------------------------- EGL_NV_system_time -------------------------- */ + +#ifndef EGL_NV_system_time +#define EGL_NV_system_time 1 + +typedef EGLuint64NV ( * PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) ( void ); +typedef EGLuint64NV ( * PFNEGLGETSYSTEMTIMENVPROC) ( void ); + +#define eglGetSystemTimeFrequencyNV EGLEW_GET_FUN(__eglewGetSystemTimeFrequencyNV) +#define eglGetSystemTimeNV EGLEW_GET_FUN(__eglewGetSystemTimeNV) + +#define EGLEW_NV_system_time EGLEW_GET_VAR(__EGLEW_NV_system_time) + +#endif /* EGL_NV_system_time */ + +/* --------------------- EGL_TIZEN_image_native_buffer --------------------- */ + +#ifndef EGL_TIZEN_image_native_buffer +#define EGL_TIZEN_image_native_buffer 1 + +#define EGL_NATIVE_BUFFER_TIZEN 0x32A0 + +#define EGLEW_TIZEN_image_native_buffer EGLEW_GET_VAR(__EGLEW_TIZEN_image_native_buffer) + +#endif /* EGL_TIZEN_image_native_buffer */ + +/* --------------------- EGL_TIZEN_image_native_surface -------------------- */ + +#ifndef EGL_TIZEN_image_native_surface +#define EGL_TIZEN_image_native_surface 1 + +#define EGL_NATIVE_SURFACE_TIZEN 0x32A1 + +#define EGLEW_TIZEN_image_native_surface EGLEW_GET_VAR(__EGLEW_TIZEN_image_native_surface) + +#endif /* EGL_TIZEN_image_native_surface */ + +/* ------------------------------------------------------------------------- */ + +#define EGLEW_FUN_EXPORT GLEW_FUN_EXPORT +#define EGLEW_VAR_EXPORT GLEW_VAR_EXPORT + +EGLEW_FUN_EXPORT PFNEGLCHOOSECONFIGPROC __eglewChooseConfig; +EGLEW_FUN_EXPORT PFNEGLCOPYBUFFERSPROC __eglewCopyBuffers; +EGLEW_FUN_EXPORT PFNEGLCREATECONTEXTPROC __eglewCreateContext; +EGLEW_FUN_EXPORT PFNEGLCREATEPBUFFERSURFACEPROC __eglewCreatePbufferSurface; +EGLEW_FUN_EXPORT PFNEGLCREATEPIXMAPSURFACEPROC __eglewCreatePixmapSurface; +EGLEW_FUN_EXPORT PFNEGLCREATEWINDOWSURFACEPROC __eglewCreateWindowSurface; +EGLEW_FUN_EXPORT PFNEGLDESTROYCONTEXTPROC __eglewDestroyContext; +EGLEW_FUN_EXPORT PFNEGLDESTROYSURFACEPROC __eglewDestroySurface; +EGLEW_FUN_EXPORT PFNEGLGETCONFIGATTRIBPROC __eglewGetConfigAttrib; +EGLEW_FUN_EXPORT PFNEGLGETCONFIGSPROC __eglewGetConfigs; +EGLEW_FUN_EXPORT PFNEGLGETCURRENTDISPLAYPROC __eglewGetCurrentDisplay; +EGLEW_FUN_EXPORT PFNEGLGETCURRENTSURFACEPROC __eglewGetCurrentSurface; +EGLEW_FUN_EXPORT PFNEGLGETDISPLAYPROC __eglewGetDisplay; +EGLEW_FUN_EXPORT PFNEGLGETERRORPROC __eglewGetError; +EGLEW_FUN_EXPORT PFNEGLINITIALIZEPROC __eglewInitialize; +EGLEW_FUN_EXPORT PFNEGLMAKECURRENTPROC __eglewMakeCurrent; +EGLEW_FUN_EXPORT PFNEGLQUERYCONTEXTPROC __eglewQueryContext; +EGLEW_FUN_EXPORT PFNEGLQUERYSTRINGPROC __eglewQueryString; +EGLEW_FUN_EXPORT PFNEGLQUERYSURFACEPROC __eglewQuerySurface; +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSPROC __eglewSwapBuffers; +EGLEW_FUN_EXPORT PFNEGLTERMINATEPROC __eglewTerminate; +EGLEW_FUN_EXPORT PFNEGLWAITGLPROC __eglewWaitGL; +EGLEW_FUN_EXPORT PFNEGLWAITNATIVEPROC __eglewWaitNative; + +EGLEW_FUN_EXPORT PFNEGLBINDTEXIMAGEPROC __eglewBindTexImage; +EGLEW_FUN_EXPORT PFNEGLRELEASETEXIMAGEPROC __eglewReleaseTexImage; +EGLEW_FUN_EXPORT PFNEGLSURFACEATTRIBPROC __eglewSurfaceAttrib; +EGLEW_FUN_EXPORT PFNEGLSWAPINTERVALPROC __eglewSwapInterval; + +EGLEW_FUN_EXPORT PFNEGLBINDAPIPROC __eglewBindAPI; +EGLEW_FUN_EXPORT PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC __eglewCreatePbufferFromClientBuffer; +EGLEW_FUN_EXPORT PFNEGLQUERYAPIPROC __eglewQueryAPI; +EGLEW_FUN_EXPORT PFNEGLRELEASETHREADPROC __eglewReleaseThread; +EGLEW_FUN_EXPORT PFNEGLWAITCLIENTPROC __eglewWaitClient; + +EGLEW_FUN_EXPORT PFNEGLGETCURRENTCONTEXTPROC __eglewGetCurrentContext; + +EGLEW_FUN_EXPORT PFNEGLCLIENTWAITSYNCPROC __eglewClientWaitSync; +EGLEW_FUN_EXPORT PFNEGLCREATEIMAGEPROC __eglewCreateImage; +EGLEW_FUN_EXPORT PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC __eglewCreatePlatformPixmapSurface; +EGLEW_FUN_EXPORT PFNEGLCREATEPLATFORMWINDOWSURFACEPROC __eglewCreatePlatformWindowSurface; +EGLEW_FUN_EXPORT PFNEGLCREATESYNCPROC __eglewCreateSync; +EGLEW_FUN_EXPORT PFNEGLDESTROYIMAGEPROC __eglewDestroyImage; +EGLEW_FUN_EXPORT PFNEGLDESTROYSYNCPROC __eglewDestroySync; +EGLEW_FUN_EXPORT PFNEGLGETPLATFORMDISPLAYPROC __eglewGetPlatformDisplay; +EGLEW_FUN_EXPORT PFNEGLGETSYNCATTRIBPROC __eglewGetSyncAttrib; +EGLEW_FUN_EXPORT PFNEGLWAITSYNCPROC __eglewWaitSync; + +EGLEW_FUN_EXPORT PFNEGLSETBLOBCACHEFUNCSANDROIDPROC __eglewSetBlobCacheFuncsANDROID; + +EGLEW_FUN_EXPORT PFNEGLCREATENATIVECLIENTBUFFERANDROIDPROC __eglewCreateNativeClientBufferANDROID; + +EGLEW_FUN_EXPORT PFNEGLDUPNATIVEFENCEFDANDROIDPROC __eglewDupNativeFenceFDANDROID; + +EGLEW_FUN_EXPORT PFNEGLPRESENTATIONTIMEANDROIDPROC __eglewPresentationTimeANDROID; + +EGLEW_FUN_EXPORT PFNEGLQUERYSURFACEPOINTERANGLEPROC __eglewQuerySurfacePointerANGLE; + +EGLEW_FUN_EXPORT PFNEGLQUERYDEVICESEXTPROC __eglewQueryDevicesEXT; + +EGLEW_FUN_EXPORT PFNEGLQUERYDEVICEATTRIBEXTPROC __eglewQueryDeviceAttribEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYDEVICESTRINGEXTPROC __eglewQueryDeviceStringEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYDISPLAYATTRIBEXTPROC __eglewQueryDisplayAttribEXT; + +EGLEW_FUN_EXPORT PFNEGLQUERYDMABUFFORMATSEXTPROC __eglewQueryDmaBufFormatsEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYDMABUFMODIFIERSEXTPROC __eglewQueryDmaBufModifiersEXT; + +EGLEW_FUN_EXPORT PFNEGLGETOUTPUTLAYERSEXTPROC __eglewGetOutputLayersEXT; +EGLEW_FUN_EXPORT PFNEGLGETOUTPUTPORTSEXTPROC __eglewGetOutputPortsEXT; +EGLEW_FUN_EXPORT PFNEGLOUTPUTLAYERATTRIBEXTPROC __eglewOutputLayerAttribEXT; +EGLEW_FUN_EXPORT PFNEGLOUTPUTPORTATTRIBEXTPROC __eglewOutputPortAttribEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC __eglewQueryOutputLayerAttribEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC __eglewQueryOutputLayerStringEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC __eglewQueryOutputPortAttribEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC __eglewQueryOutputPortStringEXT; + +EGLEW_FUN_EXPORT PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC __eglewCreatePlatformPixmapSurfaceEXT; +EGLEW_FUN_EXPORT PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC __eglewCreatePlatformWindowSurfaceEXT; +EGLEW_FUN_EXPORT PFNEGLGETPLATFORMDISPLAYEXTPROC __eglewGetPlatformDisplayEXT; + +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMEROUTPUTEXTPROC __eglewStreamConsumerOutputEXT; + +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC __eglewSwapBuffersWithDamageEXT; + +EGLEW_FUN_EXPORT PFNEGLCREATEPIXMAPSURFACEHIPROC __eglewCreatePixmapSurfaceHI; + +EGLEW_FUN_EXPORT PFNEGLCREATESYNC64KHRPROC __eglewCreateSync64KHR; + +EGLEW_FUN_EXPORT PFNEGLDEBUGMESSAGECONTROLKHRPROC __eglewDebugMessageControlKHR; +EGLEW_FUN_EXPORT PFNEGLLABELOBJECTKHRPROC __eglewLabelObjectKHR; +EGLEW_FUN_EXPORT PFNEGLQUERYDEBUGKHRPROC __eglewQueryDebugKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATEIMAGEKHRPROC __eglewCreateImageKHR; +EGLEW_FUN_EXPORT PFNEGLDESTROYIMAGEKHRPROC __eglewDestroyImageKHR; + +EGLEW_FUN_EXPORT PFNEGLLOCKSURFACEKHRPROC __eglewLockSurfaceKHR; +EGLEW_FUN_EXPORT PFNEGLUNLOCKSURFACEKHRPROC __eglewUnlockSurfaceKHR; + +EGLEW_FUN_EXPORT PFNEGLQUERYSURFACE64KHRPROC __eglewQuerySurface64KHR; + +EGLEW_FUN_EXPORT PFNEGLSETDAMAGEREGIONKHRPROC __eglewSetDamageRegionKHR; + +EGLEW_FUN_EXPORT PFNEGLCLIENTWAITSYNCKHRPROC __eglewClientWaitSyncKHR; +EGLEW_FUN_EXPORT PFNEGLCREATESYNCKHRPROC __eglewCreateSyncKHR; +EGLEW_FUN_EXPORT PFNEGLDESTROYSYNCKHRPROC __eglewDestroySyncKHR; +EGLEW_FUN_EXPORT PFNEGLGETSYNCATTRIBKHRPROC __eglewGetSyncAttribKHR; +EGLEW_FUN_EXPORT PFNEGLSIGNALSYNCKHRPROC __eglewSignalSyncKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMKHRPROC __eglewCreateStreamKHR; +EGLEW_FUN_EXPORT PFNEGLDESTROYSTREAMKHRPROC __eglewDestroyStreamKHR; +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMKHRPROC __eglewQueryStreamKHR; +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMU64KHRPROC __eglewQueryStreamu64KHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMATTRIBKHRPROC __eglewStreamAttribKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMATTRIBKHRPROC __eglewCreateStreamAttribKHR; +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMATTRIBKHRPROC __eglewQueryStreamAttribKHR; +EGLEW_FUN_EXPORT PFNEGLSETSTREAMATTRIBKHRPROC __eglewSetStreamAttribKHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERACQUIREATTRIBKHRPROC __eglewStreamConsumerAcquireAttribKHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERRELEASEATTRIBKHRPROC __eglewStreamConsumerReleaseAttribKHR; + +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERACQUIREKHRPROC __eglewStreamConsumerAcquireKHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC __eglewStreamConsumerGLTextureExternalKHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERRELEASEKHRPROC __eglewStreamConsumerReleaseKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC __eglewCreateStreamFromFileDescriptorKHR; +EGLEW_FUN_EXPORT PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC __eglewGetStreamFileDescriptorKHR; + +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMTIMEKHRPROC __eglewQueryStreamTimeKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC __eglewCreateStreamProducerSurfaceKHR; + +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC __eglewSwapBuffersWithDamageKHR; + +EGLEW_FUN_EXPORT PFNEGLWAITSYNCKHRPROC __eglewWaitSyncKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATEDRMIMAGEMESAPROC __eglewCreateDRMImageMESA; +EGLEW_FUN_EXPORT PFNEGLEXPORTDRMIMAGEMESAPROC __eglewExportDRMImageMESA; + +EGLEW_FUN_EXPORT PFNEGLEXPORTDMABUFIMAGEMESAPROC __eglewExportDMABUFImageMESA; +EGLEW_FUN_EXPORT PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC __eglewExportDMABUFImageQueryMESA; + +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSREGIONNOKPROC __eglewSwapBuffersRegionNOK; + +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSREGION2NOKPROC __eglewSwapBuffersRegion2NOK; + +EGLEW_FUN_EXPORT PFNEGLQUERYNATIVEDISPLAYNVPROC __eglewQueryNativeDisplayNV; +EGLEW_FUN_EXPORT PFNEGLQUERYNATIVEPIXMAPNVPROC __eglewQueryNativePixmapNV; +EGLEW_FUN_EXPORT PFNEGLQUERYNATIVEWINDOWNVPROC __eglewQueryNativeWindowNV; + +EGLEW_FUN_EXPORT PFNEGLPOSTSUBBUFFERNVPROC __eglewPostSubBufferNV; + +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALATTRIBSNVPROC __eglewStreamConsumerGLTextureExternalAttribsNV; + +EGLEW_FUN_EXPORT PFNEGLQUERYDISPLAYATTRIBNVPROC __eglewQueryDisplayAttribNV; +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMMETADATANVPROC __eglewQueryStreamMetadataNV; +EGLEW_FUN_EXPORT PFNEGLSETSTREAMMETADATANVPROC __eglewSetStreamMetadataNV; + +EGLEW_FUN_EXPORT PFNEGLRESETSTREAMNVPROC __eglewResetStreamNV; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMSYNCNVPROC __eglewCreateStreamSyncNV; + +EGLEW_FUN_EXPORT PFNEGLCLIENTWAITSYNCNVPROC __eglewClientWaitSyncNV; +EGLEW_FUN_EXPORT PFNEGLCREATEFENCESYNCNVPROC __eglewCreateFenceSyncNV; +EGLEW_FUN_EXPORT PFNEGLDESTROYSYNCNVPROC __eglewDestroySyncNV; +EGLEW_FUN_EXPORT PFNEGLFENCENVPROC __eglewFenceNV; +EGLEW_FUN_EXPORT PFNEGLGETSYNCATTRIBNVPROC __eglewGetSyncAttribNV; +EGLEW_FUN_EXPORT PFNEGLSIGNALSYNCNVPROC __eglewSignalSyncNV; + +EGLEW_FUN_EXPORT PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC __eglewGetSystemTimeFrequencyNV; +EGLEW_FUN_EXPORT PFNEGLGETSYSTEMTIMENVPROC __eglewGetSystemTimeNV; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_0; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_1; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_2; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_3; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_4; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_5; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_blob_cache; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_create_native_client_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_framebuffer_target; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_front_buffer_auto_refresh; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_image_native_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_native_fence_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_presentation_time; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_recordable; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_d3d_share_handle_client_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_device_d3d; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_query_surface_pointer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_surface_d3d_texture_2d_share_handle; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_window_fixed_size; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ARM_implicit_external_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ARM_pixmap_multisample_discard; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_buffer_age; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_client_extensions; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_create_context_robustness; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_base; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_drm; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_enumeration; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_openwf; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_query; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_gl_colorspace_bt2020_linear; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_gl_colorspace_bt2020_pq; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_gl_colorspace_scrgb_linear; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_image_dma_buf_import; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_image_dma_buf_import_modifiers; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_multiview_window; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_output_base; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_output_drm; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_output_openwf; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_pixel_format_float; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_platform_base; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_platform_device; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_platform_wayland; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_platform_x11; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_protected_content; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_protected_surface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_stream_consumer_egloutput; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_surface_SMPTE2086_metadata; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_swap_buffers_with_damage; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_yuv_surface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_HI_clientpixmap; +EGLEW_VAR_EXPORT GLboolean __EGLEW_HI_colorformats; +EGLEW_VAR_EXPORT GLboolean __EGLEW_IMG_context_priority; +EGLEW_VAR_EXPORT GLboolean __EGLEW_IMG_image_plane_attribs; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_cl_event; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_cl_event2; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_client_get_all_proc_addresses; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_config_attribs; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_context_flush_control; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_create_context; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_create_context_no_error; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_debug; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_fence_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_get_all_proc_addresses; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_colorspace; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_renderbuffer_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_texture_2D_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_texture_3D_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_texture_cubemap_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_image_base; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_image_pixmap; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_lock_surface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_lock_surface2; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_lock_surface3; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_mutable_render_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_no_config_context; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_partial_update; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_platform_android; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_platform_gbm; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_platform_wayland; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_platform_x11; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_reusable_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_attrib; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_consumer_gltexture; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_cross_process_fd; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_fifo; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_producer_aldatalocator; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_producer_eglsurface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_surfaceless_context; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_swap_buffers_with_damage; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_vg_parent_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_wait_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_MESA_drm_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_MESA_image_dma_buf_export; +EGLEW_VAR_EXPORT GLboolean __EGLEW_MESA_platform_gbm; +EGLEW_VAR_EXPORT GLboolean __EGLEW_MESA_platform_surfaceless; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NOK_swap_region; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NOK_swap_region2; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NOK_texture_from_pixmap; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_3dvision_surface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_coverage_sample; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_coverage_sample_resolve; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_cuda_event; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_depth_nonlinear; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_device_cuda; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_native_query; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_post_convert_rounding; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_post_sub_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_robustness_video_memory_purge; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_consumer_gltexture_yuv; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_display; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_object; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_partition; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_process; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_system; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_fifo_next; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_fifo_synchronous; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_frame_limits; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_metadata; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_remote; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_reset; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_socket; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_socket_inet; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_socket_unix; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_system_time; +EGLEW_VAR_EXPORT GLboolean __EGLEW_TIZEN_image_native_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_TIZEN_image_native_surface; +/* ------------------------------------------------------------------------ */ + +GLEWAPI GLenum GLEWAPIENTRY eglewInit (EGLDisplay display); +GLEWAPI GLboolean GLEWAPIENTRY eglewIsSupported (const char *name); + +#define EGLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define EGLEW_GET_FUN(x) x + +GLEWAPI GLboolean GLEWAPIENTRY eglewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#endif /* __eglew_h__ */ diff --git a/include/GL/glew.h b/include/GL/glew.h new file mode 100644 index 00000000..b5b6987f --- /dev/null +++ b/include/GL/glew.h @@ -0,0 +1,23686 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart +** 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(_GL_H) || defined(__X_GL_H) +#error gl.h included before glew.h +#endif +#if defined(__gl2_h_) +#error gl2.h included before glew.h +#endif +#if defined(__gltypes_h_) +#error gltypes.h included before glew.h +#endif +#if defined(__REGAL_H__) +#error Regal.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 __gl2_h_ +#define __GL_H__ +#define _GL_H +#define __gltypes_h_ +#define __REGAL_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. + */ +/* and */ +#ifdef APIENTRY +# ifndef GLAPIENTRY +# define GLAPIENTRY APIENTRY +# endif +# ifndef GLEWAPIENTRY +# define GLEWAPIENTRY APIENTRY +# endif +#else +#define GLEW_APIENTRY_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) || (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) +# define APIENTRY __stdcall +# ifndef GLAPIENTRY +# define GLAPIENTRY __stdcall +# endif +# ifndef GLEWAPIENTRY +# define GLEWAPIENTRY __stdcall +# endif +# 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 + +/* + * 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 */ +/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ + +#if (defined(__sgi) || defined(__sun)) && !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 + +#endif /* _WIN32 */ + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY +#endif + +#define GLEW_VAR_EXPORT GLEWAPI +#define GLEW_FUN_EXPORT GLEWAPI + +#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 void *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 void *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 void *indices); +GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); +GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const void *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, void* *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, void *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 void *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 void *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 void *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, void *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 void *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 void *pixels); +GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *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 void *pixels); +GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *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 void *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 ---------------------------------- */ + +#ifndef GLEW_NO_GLU +# ifdef __APPLE__ +# include +# if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) +# define GLEW_NO_GLU +# endif +# endif +#endif + +#ifndef GLEW_NO_GLU +/* this is where we can safely include GLU */ +# if defined(__APPLE__) && defined(__MACH__) +# include +# else +# include +# endif +#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_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 void *indices); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *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 void *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 void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *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 void *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, void *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 void *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, const GLint *first, const GLsizei *count, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const* indices, GLsizei drawcount); +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 void *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_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_SRC1_RGB GL_SOURCE1_RGB +#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 void* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void* 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, void** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void* 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 void* (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 modeRGB, GLenum modeAlpha); +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 index); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +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 index, GLenum pname, void** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint* params); +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 *const* string, const GLint* length); +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +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 void* 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_CLIP_DISTANCE0 GL_CLIP_PLANE0 +#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 +#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 +#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 +#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 +#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 +#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB +#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES +#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_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_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 id, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint colorNumber, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawBuffer, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawBuffer, const GLint* value); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawBuffer, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum cap, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum cap, GLuint index); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum pname, GLuint index, GLboolean* data); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar* name); +typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum cap, GLuint index); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void*pointer); + +#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 mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalFormat, GLuint buffer); + +#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 target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum value, GLint64 * data); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum pname, GLuint index, GLint64 * data); + +#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_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_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#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_VERSION_4_2 ---------------------------- */ + +#ifndef GL_VERSION_4_2 +#define GL_VERSION_4_2 1 + +#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 +#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F +#define GL_COPY_READ_BUFFER_BINDING 0x8F36 +#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37 + +#define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2) + +#endif /* GL_VERSION_4_2 */ + +/* ----------------------------- GL_VERSION_4_3 ---------------------------- */ + +#ifndef GL_VERSION_4_3 +#define GL_VERSION_4_3 1 + +#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 +#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E + +#define GLEW_VERSION_4_3 GLEW_GET_VAR(__GLEW_VERSION_4_3) + +#endif /* GL_VERSION_4_3 */ + +/* ----------------------------- GL_VERSION_4_4 ---------------------------- */ + +#ifndef GL_VERSION_4_4 +#define GL_VERSION_4_4 1 + +#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 +#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 +#define GL_TEXTURE_BUFFER_BINDING 0x8C2A + +#define GLEW_VERSION_4_4 GLEW_GET_VAR(__GLEW_VERSION_4_4) + +#endif /* GL_VERSION_4_4 */ + +/* ----------------------------- GL_VERSION_4_5 ---------------------------- */ + +#ifndef GL_VERSION_4_5 +#define GL_VERSION_4_5 1 + +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004 + +typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEPROC) (GLenum tex, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); + +#define glGetGraphicsResetStatus GLEW_GET_FUN(__glewGetGraphicsResetStatus) +#define glGetnCompressedTexImage GLEW_GET_FUN(__glewGetnCompressedTexImage) +#define glGetnTexImage GLEW_GET_FUN(__glewGetnTexImage) +#define glGetnUniformdv GLEW_GET_FUN(__glewGetnUniformdv) + +#define GLEW_VERSION_4_5 GLEW_GET_VAR(__GLEW_VERSION_4_5) + +#endif /* GL_VERSION_4_5 */ + +/* ----------------------------- GL_VERSION_4_6 ---------------------------- */ + +#ifndef GL_VERSION_4_6 +#define GL_VERSION_4_6 1 + +#define GL_CONTEXT_FLAG_NO_ERROR_BIT 0x00000008 +#define GL_PARAMETER_BUFFER 0x80EE +#define GL_PARAMETER_BUFFER_BINDING 0x80EF +#define GL_TRANSFORM_FEEDBACK_OVERFLOW 0x82EC +#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW 0x82ED +#define GL_VERTICES_SUBMITTED 0x82EE +#define GL_PRIMITIVES_SUBMITTED 0x82EF +#define GL_VERTEX_SHADER_INVOCATIONS 0x82F0 +#define GL_TESS_CONTROL_SHADER_PATCHES 0x82F1 +#define GL_TESS_EVALUATION_SHADER_INVOCATIONS 0x82F2 +#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED 0x82F3 +#define GL_FRAGMENT_SHADER_INVOCATIONS 0x82F4 +#define GL_COMPUTE_SHADER_INVOCATIONS 0x82F5 +#define GL_CLIPPING_INPUT_PRIMITIVES 0x82F6 +#define GL_CLIPPING_OUTPUT_PRIMITIVES 0x82F7 +#define GL_TEXTURE_MAX_ANISOTROPY 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF +#define GL_POLYGON_OFFSET_CLAMP 0x8E1B +#define GL_SHADER_BINARY_FORMAT_SPIR_V 0x9551 +#define GL_SPIR_V_BINARY 0x9552 +#define GL_SPIR_V_EXTENSIONS 0x9553 +#define GL_NUM_SPIR_V_EXTENSIONS 0x9554 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC) (GLenum mode, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLSPECIALIZESHADERPROC) (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue); + +#define glMultiDrawArraysIndirectCount GLEW_GET_FUN(__glewMultiDrawArraysIndirectCount) +#define glMultiDrawElementsIndirectCount GLEW_GET_FUN(__glewMultiDrawElementsIndirectCount) +#define glSpecializeShader GLEW_GET_FUN(__glewSpecializeShader) + +#define GLEW_VERSION_4_6 GLEW_GET_VAR(__GLEW_VERSION_4_6) + +#endif /* GL_VERSION_4_6 */ + +/* -------------------------- 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_blend_minmax_factor ---------------------- */ + +#ifndef GL_AMD_blend_minmax_factor +#define GL_AMD_blend_minmax_factor 1 + +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D + +#define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor) + +#endif /* GL_AMD_blend_minmax_factor */ + +/* --------------------- GL_AMD_compressed_3DC_texture --------------------- */ + +#ifndef GL_AMD_compressed_3DC_texture +#define GL_AMD_compressed_3DC_texture 1 + +#define GL_3DC_X_AMD 0x87F9 +#define GL_3DC_XY_AMD 0x87FA + +#define GLEW_AMD_compressed_3DC_texture GLEW_GET_VAR(__GLEW_AMD_compressed_3DC_texture) + +#endif /* GL_AMD_compressed_3DC_texture */ + +/* --------------------- GL_AMD_compressed_ATC_texture --------------------- */ + +#ifndef GL_AMD_compressed_ATC_texture +#define GL_AMD_compressed_ATC_texture 1 + +#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE +#define GL_ATC_RGB_AMD 0x8C92 +#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 + +#define GLEW_AMD_compressed_ATC_texture GLEW_GET_VAR(__GLEW_AMD_compressed_ATC_texture) + +#endif /* GL_AMD_compressed_ATC_texture */ + +/* ----------------------- 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 (GLAPIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, void* 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 GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* 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_framebuffer_sample_positions ------------------ */ + +#ifndef GL_AMD_framebuffer_sample_positions +#define GL_AMD_framebuffer_sample_positions 1 + +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F +#define GL_PIXELS_PER_SAMPLE_PATTERN_X_AMD 0x91AE +#define GL_PIXELS_PER_SAMPLE_PATTERN_Y_AMD 0x91AF +#define GL_ALL_PIXELS_AMD 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC) (GLenum target, GLuint numsamples, GLuint pixelindex, const GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC) (GLenum target, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC) (GLuint framebuffer, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC) (GLuint framebuffer, GLuint numsamples, GLuint pixelindex, const GLfloat* values); + +#define glFramebufferSamplePositionsfvAMD GLEW_GET_FUN(__glewFramebufferSamplePositionsfvAMD) +#define glGetFramebufferParameterfvAMD GLEW_GET_FUN(__glewGetFramebufferParameterfvAMD) +#define glGetNamedFramebufferParameterfvAMD GLEW_GET_FUN(__glewGetNamedFramebufferParameterfvAMD) +#define glNamedFramebufferSamplePositionsfvAMD GLEW_GET_FUN(__glewNamedFramebufferSamplePositionsfvAMD) + +#define GLEW_AMD_framebuffer_sample_positions GLEW_GET_VAR(__GLEW_AMD_framebuffer_sample_positions) + +#endif /* GL_AMD_framebuffer_sample_positions */ + +/* --------------------------- GL_AMD_gcn_shader --------------------------- */ + +#ifndef GL_AMD_gcn_shader +#define GL_AMD_gcn_shader 1 + +#define GLEW_AMD_gcn_shader GLEW_GET_VAR(__GLEW_AMD_gcn_shader) + +#endif /* GL_AMD_gcn_shader */ + +/* ---------------------- GL_AMD_gpu_shader_half_float --------------------- */ + +#ifndef GL_AMD_gpu_shader_half_float +#define GL_AMD_gpu_shader_half_float 1 + +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB +#define GL_FLOAT16_MAT2_AMD 0x91C5 +#define GL_FLOAT16_MAT3_AMD 0x91C6 +#define GL_FLOAT16_MAT4_AMD 0x91C7 +#define GL_FLOAT16_MAT2x3_AMD 0x91C8 +#define GL_FLOAT16_MAT2x4_AMD 0x91C9 +#define GL_FLOAT16_MAT3x2_AMD 0x91CA +#define GL_FLOAT16_MAT3x4_AMD 0x91CB +#define GL_FLOAT16_MAT4x2_AMD 0x91CC +#define GL_FLOAT16_MAT4x3_AMD 0x91CD + +#define GLEW_AMD_gpu_shader_half_float GLEW_GET_VAR(__GLEW_AMD_gpu_shader_half_float) + +#endif /* GL_AMD_gpu_shader_half_float */ + +/* ------------------------ GL_AMD_gpu_shader_int16 ------------------------ */ + +#ifndef GL_AMD_gpu_shader_int16 +#define GL_AMD_gpu_shader_int16 1 + +#define GLEW_AMD_gpu_shader_int16 GLEW_GET_VAR(__GLEW_AMD_gpu_shader_int16) + +#endif /* GL_AMD_gpu_shader_int16 */ + +/* ------------------------ GL_AMD_gpu_shader_int64 ------------------------ */ + +#ifndef GL_AMD_gpu_shader_int64 +#define GL_AMD_gpu_shader_int64 1 + +#define GLEW_AMD_gpu_shader_int64 GLEW_GET_VAR(__GLEW_AMD_gpu_shader_int64) + +#endif /* GL_AMD_gpu_shader_int64 */ + +/* ---------------------- GL_AMD_interleaved_elements ---------------------- */ + +#ifndef GL_AMD_interleaved_elements +#define GL_AMD_interleaved_elements 1 + +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RG8UI 0x8238 +#define GL_RG16UI 0x823A +#define GL_RGBA8UI 0x8D7C +#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 +#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); + +#define glVertexAttribParameteriAMD GLEW_GET_FUN(__glewVertexAttribParameteriAMD) + +#define GLEW_AMD_interleaved_elements GLEW_GET_VAR(__GLEW_AMD_interleaved_elements) + +#endif /* GL_AMD_interleaved_elements */ + +/* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */ + +#ifndef GL_AMD_multi_draw_indirect +#define GL_AMD_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD) +#define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD) + +#define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect) + +#endif /* GL_AMD_multi_draw_indirect */ + +/* ------------------------- 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_occlusion_query_event --------------------- */ + +#ifndef GL_AMD_occlusion_query_event +#define GL_AMD_occlusion_query_event 1 + +#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 +#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 +#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 +#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 +#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F +#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param); + +#define glQueryObjectParameteruiAMD GLEW_GET_FUN(__glewQueryObjectParameteruiAMD) + +#define GLEW_AMD_occlusion_query_event GLEW_GET_VAR(__GLEW_AMD_occlusion_query_event) + +#endif /* GL_AMD_occlusion_query_event */ + +/* ----------------------- GL_AMD_performance_monitor ---------------------- */ + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 + +#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, GLchar *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, GLchar *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_pinned_memory ------------------------- */ + +#ifndef GL_AMD_pinned_memory +#define GL_AMD_pinned_memory 1 + +#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 + +#define GLEW_AMD_pinned_memory GLEW_GET_VAR(__GLEW_AMD_pinned_memory) + +#endif /* GL_AMD_pinned_memory */ + +/* ----------------------- GL_AMD_program_binary_Z400 ---------------------- */ + +#ifndef GL_AMD_program_binary_Z400 +#define GL_AMD_program_binary_Z400 1 + +#define GL_Z400_BINARY_AMD 0x8740 + +#define GLEW_AMD_program_binary_Z400 GLEW_GET_VAR(__GLEW_AMD_program_binary_Z400) + +#endif /* GL_AMD_program_binary_Z400 */ + +/* ----------------------- GL_AMD_query_buffer_object ---------------------- */ + +#ifndef GL_AMD_query_buffer_object +#define GL_AMD_query_buffer_object 1 + +#define GL_QUERY_BUFFER_AMD 0x9192 +#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 +#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 + +#define GLEW_AMD_query_buffer_object GLEW_GET_VAR(__GLEW_AMD_query_buffer_object) + +#endif /* GL_AMD_query_buffer_object */ + +/* ------------------------ GL_AMD_sample_positions ------------------------ */ + +#ifndef GL_AMD_sample_positions +#define GL_AMD_sample_positions 1 + +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F + +typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val); + +#define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD) + +#define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions) + +#endif /* GL_AMD_sample_positions */ + +/* ------------------ 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 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_atomic_counter_ops ------------------- */ + +#ifndef GL_AMD_shader_atomic_counter_ops +#define GL_AMD_shader_atomic_counter_ops 1 + +#define GLEW_AMD_shader_atomic_counter_ops GLEW_GET_VAR(__GLEW_AMD_shader_atomic_counter_ops) + +#endif /* GL_AMD_shader_atomic_counter_ops */ + +/* -------------------------- GL_AMD_shader_ballot ------------------------- */ + +#ifndef GL_AMD_shader_ballot +#define GL_AMD_shader_ballot 1 + +#define GLEW_AMD_shader_ballot GLEW_GET_VAR(__GLEW_AMD_shader_ballot) + +#endif /* GL_AMD_shader_ballot */ + +/* ---------------- GL_AMD_shader_explicit_vertex_parameter ---------------- */ + +#ifndef GL_AMD_shader_explicit_vertex_parameter +#define GL_AMD_shader_explicit_vertex_parameter 1 + +#define GLEW_AMD_shader_explicit_vertex_parameter GLEW_GET_VAR(__GLEW_AMD_shader_explicit_vertex_parameter) + +#endif /* GL_AMD_shader_explicit_vertex_parameter */ + +/* ---------------------- 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_shader_stencil_value_export ------------------ */ + +#ifndef GL_AMD_shader_stencil_value_export +#define GL_AMD_shader_stencil_value_export 1 + +#define GLEW_AMD_shader_stencil_value_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_value_export) + +#endif /* GL_AMD_shader_stencil_value_export */ + +/* ---------------------- GL_AMD_shader_trinary_minmax --------------------- */ + +#ifndef GL_AMD_shader_trinary_minmax +#define GL_AMD_shader_trinary_minmax 1 + +#define GLEW_AMD_shader_trinary_minmax GLEW_GET_VAR(__GLEW_AMD_shader_trinary_minmax) + +#endif /* GL_AMD_shader_trinary_minmax */ + +/* ------------------------- GL_AMD_sparse_texture ------------------------- */ + +#ifndef GL_AMD_sparse_texture +#define GL_AMD_sparse_texture 1 + +#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 +#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A +#define GL_MIN_SPARSE_LEVEL_AMD 0x919B +#define GL_MIN_LOD_WARNING_AMD 0x919C + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); + +#define glTexStorageSparseAMD GLEW_GET_FUN(__glewTexStorageSparseAMD) +#define glTextureStorageSparseAMD GLEW_GET_FUN(__glewTextureStorageSparseAMD) + +#define GLEW_AMD_sparse_texture GLEW_GET_VAR(__GLEW_AMD_sparse_texture) + +#endif /* GL_AMD_sparse_texture */ + +/* ------------------- GL_AMD_stencil_operation_extended ------------------- */ + +#ifndef GL_AMD_stencil_operation_extended +#define GL_AMD_stencil_operation_extended 1 + +#define GL_SET_AMD 0x874A +#define GL_REPLACE_VALUE_AMD 0x874B +#define GL_STENCIL_OP_VALUE_AMD 0x874C +#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D + +typedef void (GLAPIENTRY * PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); + +#define glStencilOpValueAMD GLEW_GET_FUN(__glewStencilOpValueAMD) + +#define GLEW_AMD_stencil_operation_extended GLEW_GET_VAR(__GLEW_AMD_stencil_operation_extended) + +#endif /* GL_AMD_stencil_operation_extended */ + +/* --------------------- GL_AMD_texture_gather_bias_lod -------------------- */ + +#ifndef GL_AMD_texture_gather_bias_lod +#define GL_AMD_texture_gather_bias_lod 1 + +#define GLEW_AMD_texture_gather_bias_lod GLEW_GET_VAR(__GLEW_AMD_texture_gather_bias_lod) + +#endif /* GL_AMD_texture_gather_bias_lod */ + +/* ------------------------ 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_transform_feedback4 ---------------------- */ + +#ifndef GL_AMD_transform_feedback4 +#define GL_AMD_transform_feedback4 1 + +#define GL_STREAM_RASTERIZATION_AMD 0x91A0 + +#define GLEW_AMD_transform_feedback4 GLEW_GET_VAR(__GLEW_AMD_transform_feedback4) + +#endif /* GL_AMD_transform_feedback4 */ + +/* ----------------------- GL_AMD_vertex_shader_layer ---------------------- */ + +#ifndef GL_AMD_vertex_shader_layer +#define GL_AMD_vertex_shader_layer 1 + +#define GLEW_AMD_vertex_shader_layer GLEW_GET_VAR(__GLEW_AMD_vertex_shader_layer) + +#endif /* GL_AMD_vertex_shader_layer */ + +/* -------------------- 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_AMD_vertex_shader_viewport_index ------------------ */ + +#ifndef GL_AMD_vertex_shader_viewport_index +#define GL_AMD_vertex_shader_viewport_index 1 + +#define GLEW_AMD_vertex_shader_viewport_index GLEW_GET_VAR(__GLEW_AMD_vertex_shader_viewport_index) + +#endif /* GL_AMD_vertex_shader_viewport_index */ + +/* -------------------- GL_ANDROID_extension_pack_es31a -------------------- */ + +#ifndef GL_ANDROID_extension_pack_es31a +#define GL_ANDROID_extension_pack_es31a 1 + +#define GLEW_ANDROID_extension_pack_es31a GLEW_GET_VAR(__GLEW_ANDROID_extension_pack_es31a) + +#endif /* GL_ANDROID_extension_pack_es31a */ + +/* ------------------------- GL_ANGLE_depth_texture ------------------------ */ + +#ifndef GL_ANGLE_depth_texture +#define GL_ANGLE_depth_texture 1 + +#define GLEW_ANGLE_depth_texture GLEW_GET_VAR(__GLEW_ANGLE_depth_texture) + +#endif /* GL_ANGLE_depth_texture */ + +/* ----------------------- GL_ANGLE_framebuffer_blit ----------------------- */ + +#ifndef GL_ANGLE_framebuffer_blit +#define GL_ANGLE_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferANGLE GLEW_GET_FUN(__glewBlitFramebufferANGLE) + +#define GLEW_ANGLE_framebuffer_blit GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_blit) + +#endif /* GL_ANGLE_framebuffer_blit */ + +/* -------------------- GL_ANGLE_framebuffer_multisample ------------------- */ + +#ifndef GL_ANGLE_framebuffer_multisample +#define GL_ANGLE_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 +#define GL_MAX_SAMPLES_ANGLE 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleANGLE GLEW_GET_FUN(__glewRenderbufferStorageMultisampleANGLE) + +#define GLEW_ANGLE_framebuffer_multisample GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_multisample) + +#endif /* GL_ANGLE_framebuffer_multisample */ + +/* ----------------------- GL_ANGLE_instanced_arrays ----------------------- */ + +#ifndef GL_ANGLE_instanced_arrays +#define GL_ANGLE_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedANGLE GLEW_GET_FUN(__glewDrawArraysInstancedANGLE) +#define glDrawElementsInstancedANGLE GLEW_GET_FUN(__glewDrawElementsInstancedANGLE) +#define glVertexAttribDivisorANGLE GLEW_GET_FUN(__glewVertexAttribDivisorANGLE) + +#define GLEW_ANGLE_instanced_arrays GLEW_GET_VAR(__GLEW_ANGLE_instanced_arrays) + +#endif /* GL_ANGLE_instanced_arrays */ + +/* -------------------- GL_ANGLE_pack_reverse_row_order -------------------- */ + +#ifndef GL_ANGLE_pack_reverse_row_order +#define GL_ANGLE_pack_reverse_row_order 1 + +#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 + +#define GLEW_ANGLE_pack_reverse_row_order GLEW_GET_VAR(__GLEW_ANGLE_pack_reverse_row_order) + +#endif /* GL_ANGLE_pack_reverse_row_order */ + +/* ------------------------ GL_ANGLE_program_binary ------------------------ */ + +#ifndef GL_ANGLE_program_binary +#define GL_ANGLE_program_binary 1 + +#define GL_PROGRAM_BINARY_ANGLE 0x93A6 + +#define GLEW_ANGLE_program_binary GLEW_GET_VAR(__GLEW_ANGLE_program_binary) + +#endif /* GL_ANGLE_program_binary */ + +/* ------------------- GL_ANGLE_texture_compression_dxt1 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt1 +#define GL_ANGLE_texture_compression_dxt1 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt1) + +#endif /* GL_ANGLE_texture_compression_dxt1 */ + +/* ------------------- GL_ANGLE_texture_compression_dxt3 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt3 +#define GL_ANGLE_texture_compression_dxt3 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt3 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt3) + +#endif /* GL_ANGLE_texture_compression_dxt3 */ + +/* ------------------- GL_ANGLE_texture_compression_dxt5 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt5 +#define GL_ANGLE_texture_compression_dxt5 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt5 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt5) + +#endif /* GL_ANGLE_texture_compression_dxt5 */ + +/* ------------------------- GL_ANGLE_texture_usage ------------------------ */ + +#ifndef GL_ANGLE_texture_usage +#define GL_ANGLE_texture_usage 1 + +#define GL_TEXTURE_USAGE_ANGLE 0x93A2 +#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 + +#define GLEW_ANGLE_texture_usage GLEW_GET_VAR(__GLEW_ANGLE_texture_usage) + +#endif /* GL_ANGLE_texture_usage */ + +/* -------------------------- GL_ANGLE_timer_query ------------------------- */ + +#ifndef GL_ANGLE_timer_query +#define GL_ANGLE_timer_query 1 + +#define GL_QUERY_COUNTER_BITS_ANGLE 0x8864 +#define GL_CURRENT_QUERY_ANGLE 0x8865 +#define GL_QUERY_RESULT_ANGLE 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ANGLE 0x8867 +#define GL_TIME_ELAPSED_ANGLE 0x88BF +#define GL_TIMESTAMP_ANGLE 0x8E28 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYANGLEPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESANGLEPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYANGLEPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESANGLEPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VANGLEPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVANGLEPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VANGLEPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVANGLEPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVANGLEPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYANGLEPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERANGLEPROC) (GLuint id, GLenum target); + +#define glBeginQueryANGLE GLEW_GET_FUN(__glewBeginQueryANGLE) +#define glDeleteQueriesANGLE GLEW_GET_FUN(__glewDeleteQueriesANGLE) +#define glEndQueryANGLE GLEW_GET_FUN(__glewEndQueryANGLE) +#define glGenQueriesANGLE GLEW_GET_FUN(__glewGenQueriesANGLE) +#define glGetQueryObjecti64vANGLE GLEW_GET_FUN(__glewGetQueryObjecti64vANGLE) +#define glGetQueryObjectivANGLE GLEW_GET_FUN(__glewGetQueryObjectivANGLE) +#define glGetQueryObjectui64vANGLE GLEW_GET_FUN(__glewGetQueryObjectui64vANGLE) +#define glGetQueryObjectuivANGLE GLEW_GET_FUN(__glewGetQueryObjectuivANGLE) +#define glGetQueryivANGLE GLEW_GET_FUN(__glewGetQueryivANGLE) +#define glIsQueryANGLE GLEW_GET_FUN(__glewIsQueryANGLE) +#define glQueryCounterANGLE GLEW_GET_FUN(__glewQueryCounterANGLE) + +#define GLEW_ANGLE_timer_query GLEW_GET_VAR(__GLEW_ANGLE_timer_query) + +#endif /* GL_ANGLE_timer_query */ + +/* ------------------- GL_ANGLE_translated_shader_source ------------------- */ + +#ifndef GL_ANGLE_translated_shader_source +#define GL_ANGLE_translated_shader_source 1 + +#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 + +typedef void (GLAPIENTRY * PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); + +#define glGetTranslatedShaderSourceANGLE GLEW_GET_FUN(__glewGetTranslatedShaderSourceANGLE) + +#define GLEW_ANGLE_translated_shader_source GLEW_GET_VAR(__GLEW_ANGLE_translated_shader_source) + +#endif /* GL_ANGLE_translated_shader_source */ + +/* ----------------------- 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_clip_distance ------------------------ */ + +#ifndef GL_APPLE_clip_distance +#define GL_APPLE_clip_distance 1 + +#define GL_MAX_CLIP_DISTANCES_APPLE 0x0D32 +#define GL_CLIP_DISTANCE0_APPLE 0x3000 +#define GL_CLIP_DISTANCE1_APPLE 0x3001 +#define GL_CLIP_DISTANCE2_APPLE 0x3002 +#define GL_CLIP_DISTANCE3_APPLE 0x3003 +#define GL_CLIP_DISTANCE4_APPLE 0x3004 +#define GL_CLIP_DISTANCE5_APPLE 0x3005 +#define GL_CLIP_DISTANCE6_APPLE 0x3006 +#define GL_CLIP_DISTANCE7_APPLE 0x3007 + +#define GLEW_APPLE_clip_distance GLEW_GET_VAR(__GLEW_APPLE_clip_distance) + +#endif /* GL_APPLE_clip_distance */ + +/* ------------------- GL_APPLE_color_buffer_packed_float ------------------ */ + +#ifndef GL_APPLE_color_buffer_packed_float +#define GL_APPLE_color_buffer_packed_float 1 + +#define GLEW_APPLE_color_buffer_packed_float GLEW_GET_VAR(__GLEW_APPLE_color_buffer_packed_float) + +#endif /* GL_APPLE_color_buffer_packed_float */ + +/* ---------------------- GL_APPLE_copy_texture_levels --------------------- */ + +#ifndef GL_APPLE_copy_texture_levels +#define GL_APPLE_copy_texture_levels 1 + +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); + +#define glCopyTextureLevelsAPPLE GLEW_GET_FUN(__glewCopyTextureLevelsAPPLE) + +#define GLEW_APPLE_copy_texture_levels GLEW_GET_VAR(__GLEW_APPLE_copy_texture_levels) + +#endif /* GL_APPLE_copy_texture_levels */ + +/* ------------------------- 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_framebuffer_multisample ------------------- */ + +#ifndef GL_APPLE_framebuffer_multisample +#define GL_APPLE_framebuffer_multisample 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA +#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 +#define GL_MAX_SAMPLES_APPLE 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); + +#define glRenderbufferStorageMultisampleAPPLE GLEW_GET_FUN(__glewRenderbufferStorageMultisampleAPPLE) +#define glResolveMultisampleFramebufferAPPLE GLEW_GET_FUN(__glewResolveMultisampleFramebufferAPPLE) + +#define GLEW_APPLE_framebuffer_multisample GLEW_GET_VAR(__GLEW_APPLE_framebuffer_multisample) + +#endif /* GL_APPLE_framebuffer_multisample */ + +/* ----------------------- 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 GL_RGB_RAW_422_APPLE 0x8A51 + +#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_sync ----------------------------- */ + +#ifndef GL_APPLE_sync +#define GL_APPLE_sync 1 + +#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 +#define GL_SYNC_OBJECT_APPLE 0x8A53 +#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 +#define GL_OBJECT_TYPE_APPLE 0x9112 +#define GL_SYNC_CONDITION_APPLE 0x9113 +#define GL_SYNC_STATUS_APPLE 0x9114 +#define GL_SYNC_FLAGS_APPLE 0x9115 +#define GL_SYNC_FENCE_APPLE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 +#define GL_UNSIGNALED_APPLE 0x9118 +#define GL_SIGNALED_APPLE 0x9119 +#define GL_ALREADY_SIGNALED_APPLE 0x911A +#define GL_TIMEOUT_EXPIRED_APPLE 0x911B +#define GL_CONDITION_SATISFIED_APPLE 0x911C +#define GL_WAIT_FAILED_APPLE 0x911D +#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull + +typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync GLsync, GLbitfield flags, GLuint64 timeout); +typedef void (GLAPIENTRY * PFNGLDELETESYNCAPPLEPROC) (GLsync GLsync); +typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETSYNCIVAPPLEPROC) (GLsync GLsync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); +typedef GLboolean (GLAPIENTRY * PFNGLISSYNCAPPLEPROC) (GLsync GLsync); +typedef void (GLAPIENTRY * PFNGLWAITSYNCAPPLEPROC) (GLsync GLsync, GLbitfield flags, GLuint64 timeout); + +#define glClientWaitSyncAPPLE GLEW_GET_FUN(__glewClientWaitSyncAPPLE) +#define glDeleteSyncAPPLE GLEW_GET_FUN(__glewDeleteSyncAPPLE) +#define glFenceSyncAPPLE GLEW_GET_FUN(__glewFenceSyncAPPLE) +#define glGetInteger64vAPPLE GLEW_GET_FUN(__glewGetInteger64vAPPLE) +#define glGetSyncivAPPLE GLEW_GET_FUN(__glewGetSyncivAPPLE) +#define glIsSyncAPPLE GLEW_GET_FUN(__glewIsSyncAPPLE) +#define glWaitSyncAPPLE GLEW_GET_FUN(__glewWaitSyncAPPLE) + +#define GLEW_APPLE_sync GLEW_GET_VAR(__GLEW_APPLE_sync) + +#endif /* GL_APPLE_sync */ + +/* -------------------- GL_APPLE_texture_2D_limited_npot ------------------- */ + +#ifndef GL_APPLE_texture_2D_limited_npot +#define GL_APPLE_texture_2D_limited_npot 1 + +#define GLEW_APPLE_texture_2D_limited_npot GLEW_GET_VAR(__GLEW_APPLE_texture_2D_limited_npot) + +#endif /* GL_APPLE_texture_2D_limited_npot */ + +/* -------------------- GL_APPLE_texture_format_BGRA8888 ------------------- */ + +#ifndef GL_APPLE_texture_format_BGRA8888 +#define GL_APPLE_texture_format_BGRA8888 1 + +#define GL_BGRA_EXT 0x80E1 +#define GL_BGRA8_EXT 0x93A1 + +#define GLEW_APPLE_texture_format_BGRA8888 GLEW_GET_VAR(__GLEW_APPLE_texture_format_BGRA8888) + +#endif /* GL_APPLE_texture_format_BGRA8888 */ + +/* ----------------------- GL_APPLE_texture_max_level ---------------------- */ + +#ifndef GL_APPLE_texture_max_level +#define GL_APPLE_texture_max_level 1 + +#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D + +#define GLEW_APPLE_texture_max_level GLEW_GET_VAR(__GLEW_APPLE_texture_max_level) + +#endif /* GL_APPLE_texture_max_level */ + +/* --------------------- GL_APPLE_texture_packed_float --------------------- */ + +#ifndef GL_APPLE_texture_packed_float +#define GL_APPLE_texture_packed_float 1 + +#define GL_R11F_G11F_B10F_APPLE 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_APPLE 0x8C3B +#define GL_RGB9_E5_APPLE 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_APPLE 0x8C3E + +#define GLEW_APPLE_texture_packed_float GLEW_GET_VAR(__GLEW_APPLE_texture_packed_float) + +#endif /* GL_APPLE_texture_packed_float */ + +/* ------------------------- 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, void **params); +typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, void *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 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_RGB565 0x8D62 +#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 int GLfixed; + +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 void*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_ES3_1_compatibility ---------------------- */ + +#ifndef GL_ARB_ES3_1_compatibility +#define GL_ARB_ES3_1_compatibility 1 + +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers); + +#define glMemoryBarrierByRegion GLEW_GET_FUN(__glewMemoryBarrierByRegion) + +#define GLEW_ARB_ES3_1_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_1_compatibility) + +#endif /* GL_ARB_ES3_1_compatibility */ + +/* ----------------------- GL_ARB_ES3_2_compatibility ---------------------- */ + +#ifndef GL_ARB_ES3_2_compatibility +#define GL_ARB_ES3_2_compatibility 1 + +#define GL_PRIMITIVE_BOUNDING_BOX_ARB 0x92BE +#define GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB 0x9381 +#define GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 0x9382 + +typedef void (GLAPIENTRY * PFNGLPRIMITIVEBOUNDINGBOXARBPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); + +#define glPrimitiveBoundingBoxARB GLEW_GET_FUN(__glewPrimitiveBoundingBoxARB) + +#define GLEW_ARB_ES3_2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_2_compatibility) + +#endif /* GL_ARB_ES3_2_compatibility */ + +/* ------------------------ GL_ARB_ES3_compatibility ----------------------- */ + +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 + +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 + +#define GLEW_ARB_ES3_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_compatibility) + +#endif /* GL_ARB_ES3_compatibility */ + +/* ------------------------ GL_ARB_arrays_of_arrays ------------------------ */ + +#ifndef GL_ARB_arrays_of_arrays +#define GL_ARB_arrays_of_arrays 1 + +#define GLEW_ARB_arrays_of_arrays GLEW_GET_VAR(__GLEW_ARB_arrays_of_arrays) + +#endif /* GL_ARB_arrays_of_arrays */ + +/* -------------------------- GL_ARB_base_instance ------------------------- */ + +#ifndef GL_ARB_base_instance +#define GL_ARB_base_instance 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); + +#define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance) +#define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance) +#define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance) + +#define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance) + +#endif /* GL_ARB_base_instance */ + +/* ------------------------ GL_ARB_bindless_texture ------------------------ */ + +#ifndef GL_ARB_bindless_texture +#define GL_ARB_bindless_texture 1 + +#define GL_UNSIGNED_INT64_ARB 0x140F + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT* v); + +#define glGetImageHandleARB GLEW_GET_FUN(__glewGetImageHandleARB) +#define glGetTextureHandleARB GLEW_GET_FUN(__glewGetTextureHandleARB) +#define glGetTextureSamplerHandleARB GLEW_GET_FUN(__glewGetTextureSamplerHandleARB) +#define glGetVertexAttribLui64vARB GLEW_GET_FUN(__glewGetVertexAttribLui64vARB) +#define glIsImageHandleResidentARB GLEW_GET_FUN(__glewIsImageHandleResidentARB) +#define glIsTextureHandleResidentARB GLEW_GET_FUN(__glewIsTextureHandleResidentARB) +#define glMakeImageHandleNonResidentARB GLEW_GET_FUN(__glewMakeImageHandleNonResidentARB) +#define glMakeImageHandleResidentARB GLEW_GET_FUN(__glewMakeImageHandleResidentARB) +#define glMakeTextureHandleNonResidentARB GLEW_GET_FUN(__glewMakeTextureHandleNonResidentARB) +#define glMakeTextureHandleResidentARB GLEW_GET_FUN(__glewMakeTextureHandleResidentARB) +#define glProgramUniformHandleui64ARB GLEW_GET_FUN(__glewProgramUniformHandleui64ARB) +#define glProgramUniformHandleui64vARB GLEW_GET_FUN(__glewProgramUniformHandleui64vARB) +#define glUniformHandleui64ARB GLEW_GET_FUN(__glewUniformHandleui64ARB) +#define glUniformHandleui64vARB GLEW_GET_FUN(__glewUniformHandleui64vARB) +#define glVertexAttribL1ui64ARB GLEW_GET_FUN(__glewVertexAttribL1ui64ARB) +#define glVertexAttribL1ui64vARB GLEW_GET_FUN(__glewVertexAttribL1ui64vARB) + +#define GLEW_ARB_bindless_texture GLEW_GET_VAR(__GLEW_ARB_bindless_texture) + +#endif /* GL_ARB_bindless_texture */ + +/* ----------------------- 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 GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar * 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_buffer_storage ------------------------- */ + +#ifndef GL_ARB_buffer_storage +#define GL_ARB_buffer_storage 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_PERSISTENT_BIT 0x00000040 +#define GL_MAP_COHERENT_BIT 0x00000080 +#define GL_DYNAMIC_STORAGE_BIT 0x0100 +#define GL_CLIENT_STORAGE_BIT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F +#define GL_BUFFER_STORAGE_FLAGS 0x8220 + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); + +#define glBufferStorage GLEW_GET_FUN(__glewBufferStorage) + +#define GLEW_ARB_buffer_storage GLEW_GET_VAR(__GLEW_ARB_buffer_storage) + +#endif /* GL_ARB_buffer_storage */ + +/* ---------------------------- 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_clear_buffer_object ---------------------- */ + +#ifndef GL_ARB_clear_buffer_object +#define GL_ARB_clear_buffer_object 1 + +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); + +#define glClearBufferData GLEW_GET_FUN(__glewClearBufferData) +#define glClearBufferSubData GLEW_GET_FUN(__glewClearBufferSubData) +#define glClearNamedBufferDataEXT GLEW_GET_FUN(__glewClearNamedBufferDataEXT) +#define glClearNamedBufferSubDataEXT GLEW_GET_FUN(__glewClearNamedBufferSubDataEXT) + +#define GLEW_ARB_clear_buffer_object GLEW_GET_VAR(__GLEW_ARB_clear_buffer_object) + +#endif /* GL_ARB_clear_buffer_object */ + +/* -------------------------- GL_ARB_clear_texture ------------------------- */ + +#ifndef GL_ARB_clear_texture +#define GL_ARB_clear_texture 1 + +#define GL_CLEAR_TEXTURE 0x9365 + +typedef void (GLAPIENTRY * PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); + +#define glClearTexImage GLEW_GET_FUN(__glewClearTexImage) +#define glClearTexSubImage GLEW_GET_FUN(__glewClearTexSubImage) + +#define GLEW_ARB_clear_texture GLEW_GET_VAR(__GLEW_ARB_clear_texture) + +#endif /* GL_ARB_clear_texture */ + +/* -------------------------- GL_ARB_clip_control -------------------------- */ + +#ifndef GL_ARB_clip_control +#define GL_ARB_clip_control 1 + +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_CLIP_ORIGIN 0x935C +#define GL_CLIP_DEPTH_MODE 0x935D +#define GL_NEGATIVE_ONE_TO_ONE 0x935E +#define GL_ZERO_TO_ONE 0x935F + +typedef void (GLAPIENTRY * PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth); + +#define glClipControl GLEW_GET_FUN(__glewClipControl) + +#define GLEW_ARB_clip_control GLEW_GET_VAR(__GLEW_ARB_clip_control) + +#endif /* GL_ARB_clip_control */ + +/* ----------------------- 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_compressed_texture_pixel_storage ---------------- */ + +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 + +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E + +#define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage) + +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +/* ------------------------- GL_ARB_compute_shader ------------------------- */ + +#ifndef GL_ARB_compute_shader +#define GL_ARB_compute_shader 1 + +#define GL_COMPUTE_SHADER_BIT 0x00000020 +#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 +#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 +#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 +#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 +#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 +#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 +#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB +#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED +#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE +#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF +#define GL_COMPUTE_SHADER 0x91B9 +#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB +#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC +#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD +#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE +#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); + +#define glDispatchCompute GLEW_GET_FUN(__glewDispatchCompute) +#define glDispatchComputeIndirect GLEW_GET_FUN(__glewDispatchComputeIndirect) + +#define GLEW_ARB_compute_shader GLEW_GET_VAR(__GLEW_ARB_compute_shader) + +#endif /* GL_ARB_compute_shader */ + +/* ------------------- GL_ARB_compute_variable_group_size ------------------ */ + +#ifndef GL_ARB_compute_variable_group_size +#define GL_ARB_compute_variable_group_size 1 + +#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB +#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF +#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 +#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); + +#define glDispatchComputeGroupSizeARB GLEW_GET_FUN(__glewDispatchComputeGroupSizeARB) + +#define GLEW_ARB_compute_variable_group_size GLEW_GET_VAR(__GLEW_ARB_compute_variable_group_size) + +#endif /* GL_ARB_compute_variable_group_size */ + +/* ------------------- GL_ARB_conditional_render_inverted ------------------ */ + +#ifndef GL_ARB_conditional_render_inverted +#define GL_ARB_conditional_render_inverted 1 + +#define GL_QUERY_WAIT_INVERTED 0x8E17 +#define GL_QUERY_NO_WAIT_INVERTED 0x8E18 +#define GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19 +#define GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A + +#define GLEW_ARB_conditional_render_inverted GLEW_GET_VAR(__GLEW_ARB_conditional_render_inverted) + +#endif /* GL_ARB_conditional_render_inverted */ + +/* ----------------------- GL_ARB_conservative_depth ----------------------- */ + +#ifndef GL_ARB_conservative_depth +#define GL_ARB_conservative_depth 1 + +#define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth) + +#endif /* GL_ARB_conservative_depth */ + +/* --------------------------- 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_copy_image --------------------------- */ + +#ifndef GL_ARB_copy_image +#define GL_ARB_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATAPROC) (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 srcWidth, GLsizei srcHeight, GLsizei srcDepth); + +#define glCopyImageSubData GLEW_GET_FUN(__glewCopyImageSubData) + +#define GLEW_ARB_copy_image GLEW_GET_VAR(__GLEW_ARB_copy_image) + +#endif /* GL_ARB_copy_image */ + +/* -------------------------- GL_ARB_cull_distance ------------------------- */ + +#ifndef GL_ARB_cull_distance +#define GL_ARB_cull_distance 1 + +#define GL_MAX_CULL_DISTANCES 0x82F9 +#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA + +#define GLEW_ARB_cull_distance GLEW_GET_VAR(__GLEW_ARB_cull_distance) + +#endif /* GL_ARB_cull_distance */ + +/* -------------------------- 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 (GLAPIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const 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 GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* 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_derivative_control ----------------------- */ + +#ifndef GL_ARB_derivative_control +#define GL_ARB_derivative_control 1 + +#define GLEW_ARB_derivative_control GLEW_GET_VAR(__GLEW_ARB_derivative_control) + +#endif /* GL_ARB_derivative_control */ + +/* ----------------------- GL_ARB_direct_state_access ---------------------- */ + +#ifndef GL_ARB_direct_state_access +#define GL_ARB_direct_state_access 1 + +#define GL_TEXTURE_TARGET 0x1006 +#define GL_QUERY_TARGET 0x82EA + +typedef void (GLAPIENTRY * PFNGLBINDTEXTUREUNITPROC) (GLuint unit, GLuint texture); +typedef void (GLAPIENTRY * PFNGLBLITNAMEDFRAMEBUFFERPROC) (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC) (GLuint framebuffer, GLenum target); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERFIPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERFVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint* value); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOPYNAMEDBUFFERSUBDATAPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCREATEBUFFERSPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLCREATEFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLCREATEPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLCREATEQUERIESPROC) (GLenum target, GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLCREATERENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLCREATESAMPLERSPROC) (GLsizei n, GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLCREATETEXTURESPROC) (GLenum target, GLsizei n, GLuint* textures); +typedef void (GLAPIENTRY * PFNGLCREATETRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLCREATEVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLsizei bufSize, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERI64VPROC) (GLuint buffer, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVPROC) (GLuint buffer, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC) (GLuint framebuffer, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC) (GLuint renderbuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTI64VPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTIVPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTUI64VPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTUIVPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVPROC) (GLuint texture, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVPROC) (GLuint texture, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64* param); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKIVPROC) (GLuint xfb, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINDEXED64IVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint64* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINDEXEDIVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYIVPROC) (GLuint vaobj, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments); +typedef void (GLAPIENTRY * PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERPROC) (GLuint buffer, GLenum access); +typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC) (GLuint framebuffer, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERPROC) (GLuint texture, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEPROC) (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFPROC) (GLuint texture, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIPROC) (GLuint texture, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC) (GLuint xfb, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC) (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFERPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBBINDINGPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBIFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBLFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYBINDINGDIVISORPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYELEMENTBUFFERPROC) (GLuint vaobj, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBUFFERPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBUFFERSPROC) (GLuint vaobj, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); + +#define glBindTextureUnit GLEW_GET_FUN(__glewBindTextureUnit) +#define glBlitNamedFramebuffer GLEW_GET_FUN(__glewBlitNamedFramebuffer) +#define glCheckNamedFramebufferStatus GLEW_GET_FUN(__glewCheckNamedFramebufferStatus) +#define glClearNamedBufferData GLEW_GET_FUN(__glewClearNamedBufferData) +#define glClearNamedBufferSubData GLEW_GET_FUN(__glewClearNamedBufferSubData) +#define glClearNamedFramebufferfi GLEW_GET_FUN(__glewClearNamedFramebufferfi) +#define glClearNamedFramebufferfv GLEW_GET_FUN(__glewClearNamedFramebufferfv) +#define glClearNamedFramebufferiv GLEW_GET_FUN(__glewClearNamedFramebufferiv) +#define glClearNamedFramebufferuiv GLEW_GET_FUN(__glewClearNamedFramebufferuiv) +#define glCompressedTextureSubImage1D GLEW_GET_FUN(__glewCompressedTextureSubImage1D) +#define glCompressedTextureSubImage2D GLEW_GET_FUN(__glewCompressedTextureSubImage2D) +#define glCompressedTextureSubImage3D GLEW_GET_FUN(__glewCompressedTextureSubImage3D) +#define glCopyNamedBufferSubData GLEW_GET_FUN(__glewCopyNamedBufferSubData) +#define glCopyTextureSubImage1D GLEW_GET_FUN(__glewCopyTextureSubImage1D) +#define glCopyTextureSubImage2D GLEW_GET_FUN(__glewCopyTextureSubImage2D) +#define glCopyTextureSubImage3D GLEW_GET_FUN(__glewCopyTextureSubImage3D) +#define glCreateBuffers GLEW_GET_FUN(__glewCreateBuffers) +#define glCreateFramebuffers GLEW_GET_FUN(__glewCreateFramebuffers) +#define glCreateProgramPipelines GLEW_GET_FUN(__glewCreateProgramPipelines) +#define glCreateQueries GLEW_GET_FUN(__glewCreateQueries) +#define glCreateRenderbuffers GLEW_GET_FUN(__glewCreateRenderbuffers) +#define glCreateSamplers GLEW_GET_FUN(__glewCreateSamplers) +#define glCreateTextures GLEW_GET_FUN(__glewCreateTextures) +#define glCreateTransformFeedbacks GLEW_GET_FUN(__glewCreateTransformFeedbacks) +#define glCreateVertexArrays GLEW_GET_FUN(__glewCreateVertexArrays) +#define glDisableVertexArrayAttrib GLEW_GET_FUN(__glewDisableVertexArrayAttrib) +#define glEnableVertexArrayAttrib GLEW_GET_FUN(__glewEnableVertexArrayAttrib) +#define glFlushMappedNamedBufferRange GLEW_GET_FUN(__glewFlushMappedNamedBufferRange) +#define glGenerateTextureMipmap GLEW_GET_FUN(__glewGenerateTextureMipmap) +#define glGetCompressedTextureImage GLEW_GET_FUN(__glewGetCompressedTextureImage) +#define glGetNamedBufferParameteri64v GLEW_GET_FUN(__glewGetNamedBufferParameteri64v) +#define glGetNamedBufferParameteriv GLEW_GET_FUN(__glewGetNamedBufferParameteriv) +#define glGetNamedBufferPointerv GLEW_GET_FUN(__glewGetNamedBufferPointerv) +#define glGetNamedBufferSubData GLEW_GET_FUN(__glewGetNamedBufferSubData) +#define glGetNamedFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameteriv) +#define glGetNamedFramebufferParameteriv GLEW_GET_FUN(__glewGetNamedFramebufferParameteriv) +#define glGetNamedRenderbufferParameteriv GLEW_GET_FUN(__glewGetNamedRenderbufferParameteriv) +#define glGetQueryBufferObjecti64v GLEW_GET_FUN(__glewGetQueryBufferObjecti64v) +#define glGetQueryBufferObjectiv GLEW_GET_FUN(__glewGetQueryBufferObjectiv) +#define glGetQueryBufferObjectui64v GLEW_GET_FUN(__glewGetQueryBufferObjectui64v) +#define glGetQueryBufferObjectuiv GLEW_GET_FUN(__glewGetQueryBufferObjectuiv) +#define glGetTextureImage GLEW_GET_FUN(__glewGetTextureImage) +#define glGetTextureLevelParameterfv GLEW_GET_FUN(__glewGetTextureLevelParameterfv) +#define glGetTextureLevelParameteriv GLEW_GET_FUN(__glewGetTextureLevelParameteriv) +#define glGetTextureParameterIiv GLEW_GET_FUN(__glewGetTextureParameterIiv) +#define glGetTextureParameterIuiv GLEW_GET_FUN(__glewGetTextureParameterIuiv) +#define glGetTextureParameterfv GLEW_GET_FUN(__glewGetTextureParameterfv) +#define glGetTextureParameteriv GLEW_GET_FUN(__glewGetTextureParameteriv) +#define glGetTransformFeedbacki64_v GLEW_GET_FUN(__glewGetTransformFeedbacki64_v) +#define glGetTransformFeedbacki_v GLEW_GET_FUN(__glewGetTransformFeedbacki_v) +#define glGetTransformFeedbackiv GLEW_GET_FUN(__glewGetTransformFeedbackiv) +#define glGetVertexArrayIndexed64iv GLEW_GET_FUN(__glewGetVertexArrayIndexed64iv) +#define glGetVertexArrayIndexediv GLEW_GET_FUN(__glewGetVertexArrayIndexediv) +#define glGetVertexArrayiv GLEW_GET_FUN(__glewGetVertexArrayiv) +#define glInvalidateNamedFramebufferData GLEW_GET_FUN(__glewInvalidateNamedFramebufferData) +#define glInvalidateNamedFramebufferSubData GLEW_GET_FUN(__glewInvalidateNamedFramebufferSubData) +#define glMapNamedBuffer GLEW_GET_FUN(__glewMapNamedBuffer) +#define glMapNamedBufferRange GLEW_GET_FUN(__glewMapNamedBufferRange) +#define glNamedBufferData GLEW_GET_FUN(__glewNamedBufferData) +#define glNamedBufferStorage GLEW_GET_FUN(__glewNamedBufferStorage) +#define glNamedBufferSubData GLEW_GET_FUN(__glewNamedBufferSubData) +#define glNamedFramebufferDrawBuffer GLEW_GET_FUN(__glewNamedFramebufferDrawBuffer) +#define glNamedFramebufferDrawBuffers GLEW_GET_FUN(__glewNamedFramebufferDrawBuffers) +#define glNamedFramebufferParameteri GLEW_GET_FUN(__glewNamedFramebufferParameteri) +#define glNamedFramebufferReadBuffer GLEW_GET_FUN(__glewNamedFramebufferReadBuffer) +#define glNamedFramebufferRenderbuffer GLEW_GET_FUN(__glewNamedFramebufferRenderbuffer) +#define glNamedFramebufferTexture GLEW_GET_FUN(__glewNamedFramebufferTexture) +#define glNamedFramebufferTextureLayer GLEW_GET_FUN(__glewNamedFramebufferTextureLayer) +#define glNamedRenderbufferStorage GLEW_GET_FUN(__glewNamedRenderbufferStorage) +#define glNamedRenderbufferStorageMultisample GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisample) +#define glTextureBuffer GLEW_GET_FUN(__glewTextureBuffer) +#define glTextureBufferRange GLEW_GET_FUN(__glewTextureBufferRange) +#define glTextureParameterIiv GLEW_GET_FUN(__glewTextureParameterIiv) +#define glTextureParameterIuiv GLEW_GET_FUN(__glewTextureParameterIuiv) +#define glTextureParameterf GLEW_GET_FUN(__glewTextureParameterf) +#define glTextureParameterfv GLEW_GET_FUN(__glewTextureParameterfv) +#define glTextureParameteri GLEW_GET_FUN(__glewTextureParameteri) +#define glTextureParameteriv GLEW_GET_FUN(__glewTextureParameteriv) +#define glTextureStorage1D GLEW_GET_FUN(__glewTextureStorage1D) +#define glTextureStorage2D GLEW_GET_FUN(__glewTextureStorage2D) +#define glTextureStorage2DMultisample GLEW_GET_FUN(__glewTextureStorage2DMultisample) +#define glTextureStorage3D GLEW_GET_FUN(__glewTextureStorage3D) +#define glTextureStorage3DMultisample GLEW_GET_FUN(__glewTextureStorage3DMultisample) +#define glTextureSubImage1D GLEW_GET_FUN(__glewTextureSubImage1D) +#define glTextureSubImage2D GLEW_GET_FUN(__glewTextureSubImage2D) +#define glTextureSubImage3D GLEW_GET_FUN(__glewTextureSubImage3D) +#define glTransformFeedbackBufferBase GLEW_GET_FUN(__glewTransformFeedbackBufferBase) +#define glTransformFeedbackBufferRange GLEW_GET_FUN(__glewTransformFeedbackBufferRange) +#define glUnmapNamedBuffer GLEW_GET_FUN(__glewUnmapNamedBuffer) +#define glVertexArrayAttribBinding GLEW_GET_FUN(__glewVertexArrayAttribBinding) +#define glVertexArrayAttribFormat GLEW_GET_FUN(__glewVertexArrayAttribFormat) +#define glVertexArrayAttribIFormat GLEW_GET_FUN(__glewVertexArrayAttribIFormat) +#define glVertexArrayAttribLFormat GLEW_GET_FUN(__glewVertexArrayAttribLFormat) +#define glVertexArrayBindingDivisor GLEW_GET_FUN(__glewVertexArrayBindingDivisor) +#define glVertexArrayElementBuffer GLEW_GET_FUN(__glewVertexArrayElementBuffer) +#define glVertexArrayVertexBuffer GLEW_GET_FUN(__glewVertexArrayVertexBuffer) +#define glVertexArrayVertexBuffers GLEW_GET_FUN(__glewVertexArrayVertexBuffers) + +#define GLEW_ARB_direct_state_access GLEW_GET_VAR(__GLEW_ARB_direct_state_access) + +#endif /* GL_ARB_direct_state_access */ + +/* -------------------------- 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, void**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 + +#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced) + +#endif /* GL_ARB_draw_instanced */ + +/* ------------------------ GL_ARB_enhanced_layouts ------------------------ */ + +#ifndef GL_ARB_enhanced_layouts +#define GL_ARB_enhanced_layouts 1 + +#define GL_LOCATION_COMPONENT 0x934A +#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B +#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C + +#define GLEW_ARB_enhanced_layouts GLEW_GET_VAR(__GLEW_ARB_enhanced_layouts) + +#endif /* GL_ARB_enhanced_layouts */ + +/* -------------------- 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_explicit_uniform_location ------------------- */ + +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 + +#define GL_MAX_UNIFORM_LOCATIONS 0x826E + +#define GLEW_ARB_explicit_uniform_location GLEW_GET_VAR(__GLEW_ARB_explicit_uniform_location) + +#endif /* GL_ARB_explicit_uniform_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_layer_viewport -------------------- */ + +#ifndef GL_ARB_fragment_layer_viewport +#define GL_ARB_fragment_layer_viewport 1 + +#define GLEW_ARB_fragment_layer_viewport GLEW_GET_VAR(__GLEW_ARB_fragment_layer_viewport) + +#endif /* GL_ARB_fragment_layer_viewport */ + +/* ------------------------ 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_fragment_shader_interlock ------------------- */ + +#ifndef GL_ARB_fragment_shader_interlock +#define GL_ARB_fragment_shader_interlock 1 + +#define GLEW_ARB_fragment_shader_interlock GLEW_GET_VAR(__GLEW_ARB_fragment_shader_interlock) + +#endif /* GL_ARB_fragment_shader_interlock */ + +/* ------------------- GL_ARB_framebuffer_no_attachments ------------------- */ + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_ARB_framebuffer_no_attachments 1 + +#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 +#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 +#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 +#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 +#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 +#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 +#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 +#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); + +#define glFramebufferParameteri GLEW_GET_FUN(__glewFramebufferParameteri) +#define glGetFramebufferParameteriv GLEW_GET_FUN(__glewGetFramebufferParameteriv) +#define glGetNamedFramebufferParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferParameterivEXT) +#define glNamedFramebufferParameteriEXT GLEW_GET_FUN(__glewNamedFramebufferParameteriEXT) + +#define GLEW_ARB_framebuffer_no_attachments GLEW_GET_VAR(__GLEW_ARB_framebuffer_no_attachments) + +#endif /* GL_ARB_framebuffer_no_attachments */ + +/* ----------------------- 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, void*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_get_texture_sub_image --------------------- */ + +#ifndef GL_ARB_get_texture_sub_image +#define GL_ARB_get_texture_sub_image 1 + +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels); + +#define glGetCompressedTextureSubImage GLEW_GET_FUN(__glewGetCompressedTextureSubImage) +#define glGetTextureSubImage GLEW_GET_FUN(__glewGetTextureSubImage) + +#define GLEW_ARB_get_texture_sub_image GLEW_GET_VAR(__GLEW_ARB_get_texture_sub_image) + +#endif /* GL_ARB_get_texture_sub_image */ + +/* ---------------------------- GL_ARB_gl_spirv ---------------------------- */ + +#ifndef GL_ARB_gl_spirv +#define GL_ARB_gl_spirv 1 + +#define GL_SHADER_BINARY_FORMAT_SPIR_V_ARB 0x9551 +#define GL_SPIR_V_BINARY_ARB 0x9552 + +typedef void (GLAPIENTRY * PFNGLSPECIALIZESHADERARBPROC) (GLuint shader, const GLchar* pEntryPoint, GLuint numSpecializationConstants, const GLuint* pConstantIndex, const GLuint* pConstantValue); + +#define glSpecializeShaderARB GLEW_GET_FUN(__glewSpecializeShaderARB) + +#define GLEW_ARB_gl_spirv GLEW_GET_VAR(__GLEW_ARB_gl_spirv) + +#endif /* GL_ARB_gl_spirv */ + +/* --------------------------- 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 * 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 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_gpu_shader_int64 ------------------------ */ + +#ifndef GL_ARB_gpu_shader_int64 +#define GL_ARB_gpu_shader_int64 1 + +#define GL_INT64_ARB 0x140E +#define GL_UNSIGNED_INT64_ARB 0x140F +#define GL_INT64_VEC2_ARB 0x8FE9 +#define GL_INT64_VEC3_ARB 0x8FEA +#define GL_INT64_VEC4_ARB 0x8FEB +#define GL_UNSIGNED_INT64_VEC2_ARB 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_ARB 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_ARB 0x8FF7 + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VARBPROC) (GLuint program, GLint location, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64ARBPROC) (GLuint program, GLint location, GLint64 x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64ARBPROC) (GLuint program, GLint location, GLuint64 x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64ARBPROC) (GLint location, GLint64 x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64ARBPROC) (GLint location, GLuint64 x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64ARBPROC) (GLint location, GLint64 x, GLint64 y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); + +#define glGetUniformi64vARB GLEW_GET_FUN(__glewGetUniformi64vARB) +#define glGetUniformui64vARB GLEW_GET_FUN(__glewGetUniformui64vARB) +#define glGetnUniformi64vARB GLEW_GET_FUN(__glewGetnUniformi64vARB) +#define glGetnUniformui64vARB GLEW_GET_FUN(__glewGetnUniformui64vARB) +#define glProgramUniform1i64ARB GLEW_GET_FUN(__glewProgramUniform1i64ARB) +#define glProgramUniform1i64vARB GLEW_GET_FUN(__glewProgramUniform1i64vARB) +#define glProgramUniform1ui64ARB GLEW_GET_FUN(__glewProgramUniform1ui64ARB) +#define glProgramUniform1ui64vARB GLEW_GET_FUN(__glewProgramUniform1ui64vARB) +#define glProgramUniform2i64ARB GLEW_GET_FUN(__glewProgramUniform2i64ARB) +#define glProgramUniform2i64vARB GLEW_GET_FUN(__glewProgramUniform2i64vARB) +#define glProgramUniform2ui64ARB GLEW_GET_FUN(__glewProgramUniform2ui64ARB) +#define glProgramUniform2ui64vARB GLEW_GET_FUN(__glewProgramUniform2ui64vARB) +#define glProgramUniform3i64ARB GLEW_GET_FUN(__glewProgramUniform3i64ARB) +#define glProgramUniform3i64vARB GLEW_GET_FUN(__glewProgramUniform3i64vARB) +#define glProgramUniform3ui64ARB GLEW_GET_FUN(__glewProgramUniform3ui64ARB) +#define glProgramUniform3ui64vARB GLEW_GET_FUN(__glewProgramUniform3ui64vARB) +#define glProgramUniform4i64ARB GLEW_GET_FUN(__glewProgramUniform4i64ARB) +#define glProgramUniform4i64vARB GLEW_GET_FUN(__glewProgramUniform4i64vARB) +#define glProgramUniform4ui64ARB GLEW_GET_FUN(__glewProgramUniform4ui64ARB) +#define glProgramUniform4ui64vARB GLEW_GET_FUN(__glewProgramUniform4ui64vARB) +#define glUniform1i64ARB GLEW_GET_FUN(__glewUniform1i64ARB) +#define glUniform1i64vARB GLEW_GET_FUN(__glewUniform1i64vARB) +#define glUniform1ui64ARB GLEW_GET_FUN(__glewUniform1ui64ARB) +#define glUniform1ui64vARB GLEW_GET_FUN(__glewUniform1ui64vARB) +#define glUniform2i64ARB GLEW_GET_FUN(__glewUniform2i64ARB) +#define glUniform2i64vARB GLEW_GET_FUN(__glewUniform2i64vARB) +#define glUniform2ui64ARB GLEW_GET_FUN(__glewUniform2ui64ARB) +#define glUniform2ui64vARB GLEW_GET_FUN(__glewUniform2ui64vARB) +#define glUniform3i64ARB GLEW_GET_FUN(__glewUniform3i64ARB) +#define glUniform3i64vARB GLEW_GET_FUN(__glewUniform3i64vARB) +#define glUniform3ui64ARB GLEW_GET_FUN(__glewUniform3ui64ARB) +#define glUniform3ui64vARB GLEW_GET_FUN(__glewUniform3ui64vARB) +#define glUniform4i64ARB GLEW_GET_FUN(__glewUniform4i64ARB) +#define glUniform4i64vARB GLEW_GET_FUN(__glewUniform4i64vARB) +#define glUniform4ui64ARB GLEW_GET_FUN(__glewUniform4ui64ARB) +#define glUniform4ui64vARB GLEW_GET_FUN(__glewUniform4ui64vARB) + +#define GLEW_ARB_gpu_shader_int64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_int64) + +#endif /* GL_ARB_gpu_shader_int64 */ + +/* ------------------------ 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 void *data); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *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 void *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *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, void *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, void *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, void *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, void *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, void *row, void *column, void *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 void *row, const void *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_indirect_parameters ---------------------- */ + +#ifndef GL_ARB_indirect_parameters +#define GL_ARB_indirect_parameters 1 + +#define GL_PARAMETER_BUFFER_ARB 0x80EE +#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); + +#define glMultiDrawArraysIndirectCountARB GLEW_GET_FUN(__glewMultiDrawArraysIndirectCountARB) +#define glMultiDrawElementsIndirectCountARB GLEW_GET_FUN(__glewMultiDrawElementsIndirectCountARB) + +#define GLEW_ARB_indirect_parameters GLEW_GET_VAR(__GLEW_ARB_indirect_parameters) + +#endif /* GL_ARB_indirect_parameters */ + +/* ------------------------ 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 * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB) +#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB) +#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_internalformat_query ---------------------- */ + +#ifndef GL_ARB_internalformat_query +#define GL_ARB_internalformat_query 1 + +#define GL_NUM_SAMPLE_COUNTS 0x9380 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); + +#define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ) + +#define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query) + +#endif /* GL_ARB_internalformat_query */ + +/* ---------------------- GL_ARB_internalformat_query2 --------------------- */ + +#ifndef GL_ARB_internalformat_query2 +#define GL_ARB_internalformat_query2 1 + +#define GL_INTERNALFORMAT_SUPPORTED 0x826F +#define GL_INTERNALFORMAT_PREFERRED 0x8270 +#define GL_INTERNALFORMAT_RED_SIZE 0x8271 +#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 +#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 +#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 +#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 +#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 +#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 +#define GL_INTERNALFORMAT_RED_TYPE 0x8278 +#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 +#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A +#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B +#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C +#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D +#define GL_MAX_WIDTH 0x827E +#define GL_MAX_HEIGHT 0x827F +#define GL_MAX_DEPTH 0x8280 +#define GL_MAX_LAYERS 0x8281 +#define GL_MAX_COMBINED_DIMENSIONS 0x8282 +#define GL_COLOR_COMPONENTS 0x8283 +#define GL_DEPTH_COMPONENTS 0x8284 +#define GL_STENCIL_COMPONENTS 0x8285 +#define GL_COLOR_RENDERABLE 0x8286 +#define GL_DEPTH_RENDERABLE 0x8287 +#define GL_STENCIL_RENDERABLE 0x8288 +#define GL_FRAMEBUFFER_RENDERABLE 0x8289 +#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A +#define GL_FRAMEBUFFER_BLEND 0x828B +#define GL_READ_PIXELS 0x828C +#define GL_READ_PIXELS_FORMAT 0x828D +#define GL_READ_PIXELS_TYPE 0x828E +#define GL_TEXTURE_IMAGE_FORMAT 0x828F +#define GL_TEXTURE_IMAGE_TYPE 0x8290 +#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 +#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 +#define GL_MIPMAP 0x8293 +#define GL_MANUAL_GENERATE_MIPMAP 0x8294 +#define GL_AUTO_GENERATE_MIPMAP 0x8295 +#define GL_COLOR_ENCODING 0x8296 +#define GL_SRGB_READ 0x8297 +#define GL_SRGB_WRITE 0x8298 +#define GL_SRGB_DECODE_ARB 0x8299 +#define GL_FILTER 0x829A +#define GL_VERTEX_TEXTURE 0x829B +#define GL_TESS_CONTROL_TEXTURE 0x829C +#define GL_TESS_EVALUATION_TEXTURE 0x829D +#define GL_GEOMETRY_TEXTURE 0x829E +#define GL_FRAGMENT_TEXTURE 0x829F +#define GL_COMPUTE_TEXTURE 0x82A0 +#define GL_TEXTURE_SHADOW 0x82A1 +#define GL_TEXTURE_GATHER 0x82A2 +#define GL_TEXTURE_GATHER_SHADOW 0x82A3 +#define GL_SHADER_IMAGE_LOAD 0x82A4 +#define GL_SHADER_IMAGE_STORE 0x82A5 +#define GL_SHADER_IMAGE_ATOMIC 0x82A6 +#define GL_IMAGE_TEXEL_SIZE 0x82A7 +#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 +#define GL_IMAGE_PIXEL_FORMAT 0x82A9 +#define GL_IMAGE_PIXEL_TYPE 0x82AA +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF +#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 +#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 +#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 +#define GL_CLEAR_BUFFER 0x82B4 +#define GL_TEXTURE_VIEW 0x82B5 +#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 +#define GL_FULL_SUPPORT 0x82B7 +#define GL_CAVEAT_SUPPORT 0x82B8 +#define GL_IMAGE_CLASS_4_X_32 0x82B9 +#define GL_IMAGE_CLASS_2_X_32 0x82BA +#define GL_IMAGE_CLASS_1_X_32 0x82BB +#define GL_IMAGE_CLASS_4_X_16 0x82BC +#define GL_IMAGE_CLASS_2_X_16 0x82BD +#define GL_IMAGE_CLASS_1_X_16 0x82BE +#define GL_IMAGE_CLASS_4_X_8 0x82BF +#define GL_IMAGE_CLASS_2_X_8 0x82C0 +#define GL_IMAGE_CLASS_1_X_8 0x82C1 +#define GL_IMAGE_CLASS_11_11_10 0x82C2 +#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 +#define GL_VIEW_CLASS_128_BITS 0x82C4 +#define GL_VIEW_CLASS_96_BITS 0x82C5 +#define GL_VIEW_CLASS_64_BITS 0x82C6 +#define GL_VIEW_CLASS_48_BITS 0x82C7 +#define GL_VIEW_CLASS_32_BITS 0x82C8 +#define GL_VIEW_CLASS_24_BITS 0x82C9 +#define GL_VIEW_CLASS_16_BITS 0x82CA +#define GL_VIEW_CLASS_8_BITS 0x82CB +#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC +#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD +#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE +#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF +#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 +#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 +#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 +#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); + +#define glGetInternalformati64v GLEW_GET_FUN(__glewGetInternalformati64v) + +#define GLEW_ARB_internalformat_query2 GLEW_GET_VAR(__GLEW_ARB_internalformat_query2) + +#endif /* GL_ARB_internalformat_query2 */ + +/* ----------------------- GL_ARB_invalidate_subdata ----------------------- */ + +#ifndef GL_ARB_invalidate_subdata +#define GL_ARB_invalidate_subdata 1 + +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); +typedef void (GLAPIENTRY * PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); + +#define glInvalidateBufferData GLEW_GET_FUN(__glewInvalidateBufferData) +#define glInvalidateBufferSubData GLEW_GET_FUN(__glewInvalidateBufferSubData) +#define glInvalidateFramebuffer GLEW_GET_FUN(__glewInvalidateFramebuffer) +#define glInvalidateSubFramebuffer GLEW_GET_FUN(__glewInvalidateSubFramebuffer) +#define glInvalidateTexImage GLEW_GET_FUN(__glewInvalidateTexImage) +#define glInvalidateTexSubImage GLEW_GET_FUN(__glewInvalidateTexSubImage) + +#define GLEW_ARB_invalidate_subdata GLEW_GET_VAR(__GLEW_ARB_invalidate_subdata) + +#endif /* GL_ARB_invalidate_subdata */ + +/* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */ + +#ifndef GL_ARB_map_buffer_alignment +#define GL_ARB_map_buffer_alignment 1 + +#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC + +#define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment) + +#endif /* GL_ARB_map_buffer_alignment */ + +/* ------------------------ 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 void * (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, void *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_multi_bind --------------------------- */ + +#ifndef GL_ARB_multi_bind +#define GL_ARB_multi_bind 1 + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizeiptr *sizes); +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); + +#define glBindBuffersBase GLEW_GET_FUN(__glewBindBuffersBase) +#define glBindBuffersRange GLEW_GET_FUN(__glewBindBuffersRange) +#define glBindImageTextures GLEW_GET_FUN(__glewBindImageTextures) +#define glBindSamplers GLEW_GET_FUN(__glewBindSamplers) +#define glBindTextures GLEW_GET_FUN(__glewBindTextures) +#define glBindVertexBuffers GLEW_GET_FUN(__glewBindVertexBuffers) + +#define GLEW_ARB_multi_bind GLEW_GET_VAR(__GLEW_ARB_multi_bind) + +#endif /* GL_ARB_multi_bind */ + +/* ----------------------- GL_ARB_multi_draw_indirect ---------------------- */ + +#ifndef GL_ARB_multi_draw_indirect +#define GL_ARB_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirect GLEW_GET_FUN(__glewMultiDrawArraysIndirect) +#define glMultiDrawElementsIndirect GLEW_GET_FUN(__glewMultiDrawElementsIndirect) + +#define GLEW_ARB_multi_draw_indirect GLEW_GET_VAR(__GLEW_ARB_multi_draw_indirect) + +#endif /* GL_ARB_multi_draw_indirect */ + +/* --------------------------- 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_parallel_shader_compile -------------------- */ + +#ifndef GL_ARB_parallel_shader_compile +#define GL_ARB_parallel_shader_compile 1 + +#define GL_MAX_SHADER_COMPILER_THREADS_ARB 0x91B0 +#define GL_COMPLETION_STATUS_ARB 0x91B1 + +typedef void (GLAPIENTRY * PFNGLMAXSHADERCOMPILERTHREADSARBPROC) (GLuint count); + +#define glMaxShaderCompilerThreadsARB GLEW_GET_FUN(__glewMaxShaderCompilerThreadsARB) + +#define GLEW_ARB_parallel_shader_compile GLEW_GET_VAR(__GLEW_ARB_parallel_shader_compile) + +#endif /* GL_ARB_parallel_shader_compile */ + +/* -------------------- GL_ARB_pipeline_statistics_query ------------------- */ + +#ifndef GL_ARB_pipeline_statistics_query +#define GL_ARB_pipeline_statistics_query 1 + +#define GL_VERTICES_SUBMITTED_ARB 0x82EE +#define GL_PRIMITIVES_SUBMITTED_ARB 0x82EF +#define GL_VERTEX_SHADER_INVOCATIONS_ARB 0x82F0 +#define GL_TESS_CONTROL_SHADER_PATCHES_ARB 0x82F1 +#define GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB 0x82F2 +#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB 0x82F3 +#define GL_FRAGMENT_SHADER_INVOCATIONS_ARB 0x82F4 +#define GL_COMPUTE_SHADER_INVOCATIONS_ARB 0x82F5 +#define GL_CLIPPING_INPUT_PRIMITIVES_ARB 0x82F6 +#define GL_CLIPPING_OUTPUT_PRIMITIVES_ARB 0x82F7 +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F + +#define GLEW_ARB_pipeline_statistics_query GLEW_GET_VAR(__GLEW_ARB_pipeline_statistics_query) + +#endif /* GL_ARB_pipeline_statistics_query */ + +/* ----------------------- 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_polygon_offset_clamp ---------------------- */ + +#ifndef GL_ARB_polygon_offset_clamp +#define GL_ARB_polygon_offset_clamp 1 + +#define GL_POLYGON_OFFSET_CLAMP 0x8E1B + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETCLAMPPROC) (GLfloat factor, GLfloat units, GLfloat clamp); + +#define glPolygonOffsetClamp GLEW_GET_FUN(__glewPolygonOffsetClamp) + +#define GLEW_ARB_polygon_offset_clamp GLEW_GET_VAR(__GLEW_ARB_polygon_offset_clamp) + +#endif /* GL_ARB_polygon_offset_clamp */ + +/* ----------------------- GL_ARB_post_depth_coverage ---------------------- */ + +#ifndef GL_ARB_post_depth_coverage +#define GL_ARB_post_depth_coverage 1 + +#define GLEW_ARB_post_depth_coverage GLEW_GET_VAR(__GLEW_ARB_post_depth_coverage) + +#endif /* GL_ARB_post_depth_coverage */ + +/* --------------------- GL_ARB_program_interface_query -------------------- */ + +#ifndef GL_ARB_program_interface_query +#define GL_ARB_program_interface_query 1 + +#define GL_UNIFORM 0x92E1 +#define GL_UNIFORM_BLOCK 0x92E2 +#define GL_PROGRAM_INPUT 0x92E3 +#define GL_PROGRAM_OUTPUT 0x92E4 +#define GL_BUFFER_VARIABLE 0x92E5 +#define GL_SHADER_STORAGE_BLOCK 0x92E6 +#define GL_IS_PER_PATCH 0x92E7 +#define GL_VERTEX_SUBROUTINE 0x92E8 +#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 +#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA +#define GL_GEOMETRY_SUBROUTINE 0x92EB +#define GL_FRAGMENT_SUBROUTINE 0x92EC +#define GL_COMPUTE_SUBROUTINE 0x92ED +#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE +#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF +#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 +#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 +#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 +#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 +#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 +#define GL_ACTIVE_RESOURCES 0x92F5 +#define GL_MAX_NAME_LENGTH 0x92F6 +#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 +#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 +#define GL_NAME_LENGTH 0x92F9 +#define GL_TYPE 0x92FA +#define GL_ARRAY_SIZE 0x92FB +#define GL_OFFSET 0x92FC +#define GL_BLOCK_INDEX 0x92FD +#define GL_ARRAY_STRIDE 0x92FE +#define GL_MATRIX_STRIDE 0x92FF +#define GL_IS_ROW_MAJOR 0x9300 +#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 +#define GL_BUFFER_BINDING 0x9302 +#define GL_BUFFER_DATA_SIZE 0x9303 +#define GL_NUM_ACTIVE_VARIABLES 0x9304 +#define GL_ACTIVE_VARIABLES 0x9305 +#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 +#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 +#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A +#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B +#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C +#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D +#define GL_LOCATION 0x930E +#define GL_LOCATION_INDEX 0x930F + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint* params); +typedef GLuint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params); + +#define glGetProgramInterfaceiv GLEW_GET_FUN(__glewGetProgramInterfaceiv) +#define glGetProgramResourceIndex GLEW_GET_FUN(__glewGetProgramResourceIndex) +#define glGetProgramResourceLocation GLEW_GET_FUN(__glewGetProgramResourceLocation) +#define glGetProgramResourceLocationIndex GLEW_GET_FUN(__glewGetProgramResourceLocationIndex) +#define glGetProgramResourceName GLEW_GET_FUN(__glewGetProgramResourceName) +#define glGetProgramResourceiv GLEW_GET_FUN(__glewGetProgramResourceiv) + +#define GLEW_ARB_program_interface_query GLEW_GET_VAR(__GLEW_ARB_program_interface_query) + +#endif /* GL_ARB_program_interface_query */ + +/* ------------------------ 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_query_buffer_object ---------------------- */ + +#ifndef GL_ARB_query_buffer_object +#define GL_ARB_query_buffer_object 1 + +#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 +#define GL_QUERY_BUFFER 0x9192 +#define GL_QUERY_BUFFER_BINDING 0x9193 +#define GL_QUERY_RESULT_NO_WAIT 0x9194 + +#define GLEW_ARB_query_buffer_object GLEW_GET_VAR(__GLEW_ARB_query_buffer_object) + +#endif /* GL_ARB_query_buffer_object */ + +/* ------------------ GL_ARB_robust_buffer_access_behavior ----------------- */ + +#ifndef GL_ARB_robust_buffer_access_behavior +#define GL_ARB_robust_buffer_access_behavior 1 + +#define GLEW_ARB_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_ARB_robust_buffer_access_behavior) + +#endif /* GL_ARB_robust_buffer_access_behavior */ + +/* --------------------------- 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 GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +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, void*column, void*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 glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB) +#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_robustness_application_isolation ---------------- */ + +#ifndef GL_ARB_robustness_application_isolation +#define GL_ARB_robustness_application_isolation 1 + +#define GLEW_ARB_robustness_application_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_application_isolation) + +#endif /* GL_ARB_robustness_application_isolation */ + +/* ---------------- GL_ARB_robustness_share_group_isolation ---------------- */ + +#ifndef GL_ARB_robustness_share_group_isolation +#define GL_ARB_robustness_share_group_isolation 1 + +#define GLEW_ARB_robustness_share_group_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_share_group_isolation) + +#endif /* GL_ARB_robustness_share_group_isolation */ + +/* ------------------------ GL_ARB_sample_locations ------------------------ */ + +#ifndef GL_ARB_sample_locations +#define GL_ARB_sample_locations 1 + +#define GL_SAMPLE_LOCATION_ARB 0x8E50 +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); + +#define glFramebufferSampleLocationsfvARB GLEW_GET_FUN(__glewFramebufferSampleLocationsfvARB) +#define glNamedFramebufferSampleLocationsfvARB GLEW_GET_FUN(__glewNamedFramebufferSampleLocationsfvARB) + +#define GLEW_ARB_sample_locations GLEW_GET_VAR(__GLEW_ARB_sample_locations) + +#endif /* GL_ARB_sample_locations */ + +/* ------------------------- 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_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_ARB_seamless_cubemap_per_texture +#define GL_ARB_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_ARB_seamless_cubemap_per_texture) + +#endif /* GL_ARB_seamless_cubemap_per_texture */ + +/* --------------------- 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 GLchar * const * 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, GLchar *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_atomic_counter_ops ------------------- */ + +#ifndef GL_ARB_shader_atomic_counter_ops +#define GL_ARB_shader_atomic_counter_ops 1 + +#define GLEW_ARB_shader_atomic_counter_ops GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counter_ops) + +#endif /* GL_ARB_shader_atomic_counter_ops */ + +/* --------------------- GL_ARB_shader_atomic_counters --------------------- */ + +#ifndef GL_ARB_shader_atomic_counters +#define GL_ARB_shader_atomic_counters 1 + +#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 +#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 +#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 +#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 +#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB +#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF +#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 +#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 +#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 +#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 +#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 +#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 +#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB +#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC + +typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); + +#define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv) + +#define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters) + +#endif /* GL_ARB_shader_atomic_counters */ + +/* -------------------------- GL_ARB_shader_ballot ------------------------- */ + +#ifndef GL_ARB_shader_ballot +#define GL_ARB_shader_ballot 1 + +#define GLEW_ARB_shader_ballot GLEW_GET_VAR(__GLEW_ARB_shader_ballot) + +#endif /* GL_ARB_shader_ballot */ + +/* ----------------------- 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_clock -------------------------- */ + +#ifndef GL_ARB_shader_clock +#define GL_ARB_shader_clock 1 + +#define GLEW_ARB_shader_clock GLEW_GET_VAR(__GLEW_ARB_shader_clock) + +#endif /* GL_ARB_shader_clock */ + +/* --------------------- GL_ARB_shader_draw_parameters --------------------- */ + +#ifndef GL_ARB_shader_draw_parameters +#define GL_ARB_shader_draw_parameters 1 + +#define GLEW_ARB_shader_draw_parameters GLEW_GET_VAR(__GLEW_ARB_shader_draw_parameters) + +#endif /* GL_ARB_shader_draw_parameters */ + +/* ------------------------ GL_ARB_shader_group_vote ----------------------- */ + +#ifndef GL_ARB_shader_group_vote +#define GL_ARB_shader_group_vote 1 + +#define GLEW_ARB_shader_group_vote GLEW_GET_VAR(__GLEW_ARB_shader_group_vote) + +#endif /* GL_ARB_shader_group_vote */ + +/* --------------------- GL_ARB_shader_image_load_store -------------------- */ + +#ifndef GL_ARB_shader_image_load_store +#define GL_ARB_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 +#define GL_COMMAND_BARRIER_BIT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 +#define GL_MAX_IMAGE_UNITS 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 +#define GL_IMAGE_BINDING_NAME 0x8F3A +#define GL_IMAGE_BINDING_LEVEL 0x8F3B +#define GL_IMAGE_BINDING_LAYERED 0x8F3C +#define GL_IMAGE_BINDING_LAYER 0x8F3D +#define GL_IMAGE_BINDING_ACCESS 0x8F3E +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C +#define GL_MAX_IMAGE_SAMPLES 0x906D +#define GL_IMAGE_BINDING_FORMAT 0x906E +#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 +#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD +#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE +#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_ALL_BARRIER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); + +#define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture) +#define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier) + +#define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store) + +#endif /* GL_ARB_shader_image_load_store */ + +/* ------------------------ GL_ARB_shader_image_size ----------------------- */ + +#ifndef GL_ARB_shader_image_size +#define GL_ARB_shader_image_size 1 + +#define GLEW_ARB_shader_image_size GLEW_GET_VAR(__GLEW_ARB_shader_image_size) + +#endif /* GL_ARB_shader_image_size */ + +/* ------------------------- 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_storage_buffer_object ------------------ */ + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_ARB_shader_storage_buffer_object 1 + +#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 +#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 +#define GL_SHADER_STORAGE_BUFFER 0x90D2 +#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 +#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 +#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 +#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 +#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA +#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB +#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC +#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD +#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE +#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF + +typedef void (GLAPIENTRY * PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); + +#define glShaderStorageBlockBinding GLEW_GET_FUN(__glewShaderStorageBlockBinding) + +#define GLEW_ARB_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_ARB_shader_storage_buffer_object) + +#endif /* GL_ARB_shader_storage_buffer_object */ + +/* ------------------------ 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, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *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 GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar* 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_image_samples ------------------ */ + +#ifndef GL_ARB_shader_texture_image_samples +#define GL_ARB_shader_texture_image_samples 1 + +#define GLEW_ARB_shader_texture_image_samples GLEW_GET_VAR(__GLEW_ARB_shader_texture_image_samples) + +#endif /* GL_ARB_shader_texture_image_samples */ + +/* ----------------------- 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_shader_viewport_layer_array ------------------ */ + +#ifndef GL_ARB_shader_viewport_layer_array +#define GL_ARB_shader_viewport_layer_array 1 + +#define GLEW_ARB_shader_viewport_layer_array GLEW_GET_VAR(__GLEW_ARB_shader_viewport_layer_array) + +#endif /* GL_ARB_shader_viewport_layer_array */ + +/* ---------------------- 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_420pack -------------------- */ + +#ifndef GL_ARB_shading_language_420pack +#define GL_ARB_shading_language_420pack 1 + +#define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack) + +#endif /* GL_ARB_shading_language_420pack */ + +/* -------------------- 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 GLchar* const *path, const GLint *length); +typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar* name, GLenum pname, GLint *params); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *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_shading_language_packing -------------------- */ + +#ifndef GL_ARB_shading_language_packing +#define GL_ARB_shading_language_packing 1 + +#define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing) + +#endif /* GL_ARB_shading_language_packing */ + +/* ----------------------------- 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_sparse_buffer ------------------------- */ + +#ifndef GL_ARB_sparse_buffer +#define GL_ARB_sparse_buffer 1 + +#define GL_SPARSE_STORAGE_BIT_ARB 0x0400 +#define GL_SPARSE_BUFFER_PAGE_SIZE_ARB 0x82F8 + +typedef void (GLAPIENTRY * PFNGLBUFFERPAGECOMMITMENTARBPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit); + +#define glBufferPageCommitmentARB GLEW_GET_FUN(__glewBufferPageCommitmentARB) + +#define GLEW_ARB_sparse_buffer GLEW_GET_VAR(__GLEW_ARB_sparse_buffer) + +#endif /* GL_ARB_sparse_buffer */ + +/* ------------------------- GL_ARB_sparse_texture ------------------------- */ + +#ifndef GL_ARB_sparse_texture +#define GL_ARB_sparse_texture 1 + +#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A +#define GL_TEXTURE_SPARSE_ARB 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 +#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 +#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA + +typedef void (GLAPIENTRY * PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); + +#define glTexPageCommitmentARB GLEW_GET_FUN(__glewTexPageCommitmentARB) + +#define GLEW_ARB_sparse_texture GLEW_GET_VAR(__GLEW_ARB_sparse_texture) + +#endif /* GL_ARB_sparse_texture */ + +/* ------------------------- GL_ARB_sparse_texture2 ------------------------ */ + +#ifndef GL_ARB_sparse_texture2 +#define GL_ARB_sparse_texture2 1 + +#define GLEW_ARB_sparse_texture2 GLEW_GET_VAR(__GLEW_ARB_sparse_texture2) + +#endif /* GL_ARB_sparse_texture2 */ + +/* ---------------------- GL_ARB_sparse_texture_clamp ---------------------- */ + +#ifndef GL_ARB_sparse_texture_clamp +#define GL_ARB_sparse_texture_clamp 1 + +#define GLEW_ARB_sparse_texture_clamp GLEW_GET_VAR(__GLEW_ARB_sparse_texture_clamp) + +#endif /* GL_ARB_sparse_texture_clamp */ + +/* ------------------------ GL_ARB_spirv_extensions ------------------------ */ + +#ifndef GL_ARB_spirv_extensions +#define GL_ARB_spirv_extensions 1 + +#define GL_SPIR_V_EXTENSIONS 0x9553 +#define GL_NUM_SPIR_V_EXTENSIONS 0x9554 + +#define GLEW_ARB_spirv_extensions GLEW_GET_VAR(__GLEW_ARB_spirv_extensions) + +#endif /* GL_ARB_spirv_extensions */ + +/* ------------------------ GL_ARB_stencil_texturing ----------------------- */ + +#ifndef GL_ARB_stencil_texturing +#define GL_ARB_stencil_texturing 1 + +#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA + +#define GLEW_ARB_stencil_texturing GLEW_GET_VAR(__GLEW_ARB_stencil_texturing) + +#endif /* GL_ARB_stencil_texturing */ + +/* ------------------------------ 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 0xFFFFFFFFFFFFFFFFull + +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_barrier ------------------------ */ + +#ifndef GL_ARB_texture_barrier +#define GL_ARB_texture_barrier 1 + +typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERPROC) (void); + +#define glTextureBarrier GLEW_GET_FUN(__glewTextureBarrier) + +#define GLEW_ARB_texture_barrier GLEW_GET_VAR(__GLEW_ARB_texture_barrier) + +#endif /* GL_ARB_texture_barrier */ + +/* ---------------------- 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_buffer_range ---------------------- */ + +#ifndef GL_ARB_texture_buffer_range +#define GL_ARB_texture_buffer_range 1 + +#define GL_TEXTURE_BUFFER_OFFSET 0x919D +#define GL_TEXTURE_BUFFER_SIZE 0x919E +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); + +#define glTexBufferRange GLEW_GET_FUN(__glewTexBufferRange) +#define glTextureBufferRangeEXT GLEW_GET_FUN(__glewTextureBufferRangeEXT) + +#define GLEW_ARB_texture_buffer_range GLEW_GET_VAR(__GLEW_ARB_texture_buffer_range) + +#endif /* GL_ARB_texture_buffer_range */ + +/* ----------------------- 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_filter_anisotropic ------------------- */ + +#ifndef GL_ARB_texture_filter_anisotropic +#define GL_ARB_texture_filter_anisotropic 1 + +#define GL_TEXTURE_MAX_ANISOTROPY 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF + +#define GLEW_ARB_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_ARB_texture_filter_anisotropic) + +#endif /* GL_ARB_texture_filter_anisotropic */ + +/* ---------------------- GL_ARB_texture_filter_minmax --------------------- */ + +#ifndef GL_ARB_texture_filter_minmax +#define GL_ARB_texture_filter_minmax 1 + +#define GL_TEXTURE_REDUCTION_MODE_ARB 0x9366 +#define GL_WEIGHTED_AVERAGE_ARB 0x9367 + +#define GLEW_ARB_texture_filter_minmax GLEW_GET_VAR(__GLEW_ARB_texture_filter_minmax) + +#endif /* GL_ARB_texture_filter_minmax */ + +/* -------------------------- 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_mirror_clamp_to_edge ------------------ */ + +#ifndef GL_ARB_texture_mirror_clamp_to_edge +#define GL_ARB_texture_mirror_clamp_to_edge 1 + +#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 + +#define GLEW_ARB_texture_mirror_clamp_to_edge GLEW_GET_VAR(__GLEW_ARB_texture_mirror_clamp_to_edge) + +#endif /* GL_ARB_texture_mirror_clamp_to_edge */ + +/* --------------------- 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, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum 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_levels ---------------------- */ + +#ifndef GL_ARB_texture_query_levels +#define GL_ARB_texture_query_levels 1 + +#define GLEW_ARB_texture_query_levels GLEW_GET_VAR(__GLEW_ARB_texture_query_levels) + +#endif /* GL_ARB_texture_query_levels */ + +/* ------------------------ 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_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_stencil8 ------------------------ */ + +#ifndef GL_ARB_texture_stencil8 +#define GL_ARB_texture_stencil8 1 + +#define GL_STENCIL_INDEX 0x1901 +#define GL_STENCIL_INDEX8 0x8D48 + +#define GLEW_ARB_texture_stencil8 GLEW_GET_VAR(__GLEW_ARB_texture_stencil8) + +#endif /* GL_ARB_texture_stencil8 */ + +/* ------------------------- GL_ARB_texture_storage ------------------------ */ + +#ifndef GL_ARB_texture_storage +#define GL_ARB_texture_storage 1 + +#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + +#define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D) +#define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D) +#define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D) + +#define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage) + +#endif /* GL_ARB_texture_storage */ + +/* ------------------- GL_ARB_texture_storage_multisample ------------------ */ + +#ifndef GL_ARB_texture_storage_multisample +#define GL_ARB_texture_storage_multisample 1 + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glTexStorage2DMultisample GLEW_GET_FUN(__glewTexStorage2DMultisample) +#define glTexStorage3DMultisample GLEW_GET_FUN(__glewTexStorage3DMultisample) +#define glTextureStorage2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage2DMultisampleEXT) +#define glTextureStorage3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage3DMultisampleEXT) + +#define GLEW_ARB_texture_storage_multisample GLEW_GET_VAR(__GLEW_ARB_texture_storage_multisample) + +#endif /* GL_ARB_texture_storage_multisample */ + +/* ------------------------- 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_texture_view -------------------------- */ + +#ifndef GL_ARB_texture_view +#define GL_ARB_texture_view 1 + +#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + +typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); + +#define glTextureView GLEW_GET_FUN(__glewTextureView) + +#define GLEW_ARB_texture_view GLEW_GET_VAR(__GLEW_ARB_texture_view) + +#endif /* GL_ARB_texture_view */ + +/* --------------------------- 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_transform_feedback_instanced ------------------ */ + +#ifndef GL_ARB_transform_feedback_instanced +#define GL_ARB_transform_feedback_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); + +#define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced) +#define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced) + +#define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced) + +#endif /* GL_ARB_transform_feedback_instanced */ + +/* ---------------- GL_ARB_transform_feedback_overflow_query --------------- */ + +#ifndef GL_ARB_transform_feedback_overflow_query +#define GL_ARB_transform_feedback_overflow_query 1 + +#define GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB 0x82EC +#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB 0x82ED + +#define GLEW_ARB_transform_feedback_overflow_query GLEW_GET_VAR(__GLEW_ARB_transform_feedback_overflow_query) + +#endif /* GL_ARB_transform_feedback_overflow_query */ + +/* ------------------------ 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 0xFFFFFFFFu + +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, GLchar* 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, GLchar* 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 GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* const * 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 + +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_attrib_binding --------------------- */ + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 + +#define GL_VERTEX_ATTRIB_BINDING 0x82D4 +#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 +#define GL_VERTEX_BINDING_DIVISOR 0x82D6 +#define GL_VERTEX_BINDING_OFFSET 0x82D7 +#define GL_VERTEX_BINDING_STRIDE 0x82D8 +#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 +#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA +#define GL_VERTEX_BINDING_BUFFER 0x8F4F + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); + +#define glBindVertexBuffer GLEW_GET_FUN(__glewBindVertexBuffer) +#define glVertexArrayBindVertexBufferEXT GLEW_GET_FUN(__glewVertexArrayBindVertexBufferEXT) +#define glVertexArrayVertexAttribBindingEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribBindingEXT) +#define glVertexArrayVertexAttribFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribFormatEXT) +#define glVertexArrayVertexAttribIFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIFormatEXT) +#define glVertexArrayVertexAttribLFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLFormatEXT) +#define glVertexArrayVertexBindingDivisorEXT GLEW_GET_FUN(__glewVertexArrayVertexBindingDivisorEXT) +#define glVertexAttribBinding GLEW_GET_FUN(__glewVertexAttribBinding) +#define glVertexAttribFormat GLEW_GET_FUN(__glewVertexAttribFormat) +#define glVertexAttribIFormat GLEW_GET_FUN(__glewVertexAttribIFormat) +#define glVertexAttribLFormat GLEW_GET_FUN(__glewVertexAttribLFormat) +#define glVertexBindingDivisor GLEW_GET_FUN(__glewVertexBindingDivisor) + +#define GLEW_ARB_vertex_attrib_binding GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_binding) + +#endif /* GL_ARB_vertex_attrib_binding */ + +/* -------------------------- 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, void *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 void *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *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, void** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void * (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, void** 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_10f_11f_11f_rev ------------------ */ + +#ifndef GL_ARB_vertex_type_10f_11f_11f_rev +#define GL_ARB_vertex_type_10f_11f_11f_rev 1 + +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B + +#define GLEW_ARB_vertex_type_10f_11f_11f_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_10f_11f_11f_rev) + +#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ + +/* ------------------- 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_ARM_mali_program_binary ---------------------- */ + +#ifndef GL_ARM_mali_program_binary +#define GL_ARM_mali_program_binary 1 + +#define GL_MALI_PROGRAM_BINARY_ARM 0x8F61 + +#define GLEW_ARM_mali_program_binary GLEW_GET_VAR(__GLEW_ARM_mali_program_binary) + +#endif /* GL_ARM_mali_program_binary */ + +/* ----------------------- GL_ARM_mali_shader_binary ----------------------- */ + +#ifndef GL_ARM_mali_shader_binary +#define GL_ARM_mali_shader_binary 1 + +#define GL_MALI_SHADER_BINARY_ARM 0x8F60 + +#define GLEW_ARM_mali_shader_binary GLEW_GET_VAR(__GLEW_ARM_mali_shader_binary) + +#endif /* GL_ARM_mali_shader_binary */ + +/* ------------------------------ GL_ARM_rgba8 ----------------------------- */ + +#ifndef GL_ARM_rgba8 +#define GL_ARM_rgba8 1 + +#define GL_RGBA8_OES 0x8058 + +#define GLEW_ARM_rgba8 GLEW_GET_VAR(__GLEW_ARM_rgba8) + +#endif /* GL_ARM_rgba8 */ + +/* -------------------- GL_ARM_shader_framebuffer_fetch -------------------- */ + +#ifndef GL_ARM_shader_framebuffer_fetch +#define GL_ARM_shader_framebuffer_fetch 1 + +#define GL_FETCH_PER_SAMPLE_ARM 0x8F65 +#define GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM 0x8F66 + +#define GLEW_ARM_shader_framebuffer_fetch GLEW_GET_VAR(__GLEW_ARM_shader_framebuffer_fetch) + +#endif /* GL_ARM_shader_framebuffer_fetch */ + +/* ------------- GL_ARM_shader_framebuffer_fetch_depth_stencil ------------- */ + +#ifndef GL_ARM_shader_framebuffer_fetch_depth_stencil +#define GL_ARM_shader_framebuffer_fetch_depth_stencil 1 + +#define GLEW_ARM_shader_framebuffer_fetch_depth_stencil GLEW_GET_VAR(__GLEW_ARM_shader_framebuffer_fetch_depth_stencil) + +#endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */ + +/* ------------------------- 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_2X_BIT_ATI 0x00000001 +#define GL_RED_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_BLUE_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(__glewPNTrianglesfATI) +#define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI) + +#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 *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); + +#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 glVertexStream1dATI GLEW_GET_FUN(__glewVertexStream1dATI) +#define glVertexStream1dvATI GLEW_GET_FUN(__glewVertexStream1dvATI) +#define glVertexStream1fATI GLEW_GET_FUN(__glewVertexStream1fATI) +#define glVertexStream1fvATI GLEW_GET_FUN(__glewVertexStream1fvATI) +#define glVertexStream1iATI GLEW_GET_FUN(__glewVertexStream1iATI) +#define glVertexStream1ivATI GLEW_GET_FUN(__glewVertexStream1ivATI) +#define glVertexStream1sATI GLEW_GET_FUN(__glewVertexStream1sATI) +#define glVertexStream1svATI GLEW_GET_FUN(__glewVertexStream1svATI) +#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_EGL_KHR_context_flush_control ------------------- */ + +#ifndef GL_EGL_KHR_context_flush_control +#define GL_EGL_KHR_context_flush_control 1 + +#define GLEW_EGL_KHR_context_flush_control GLEW_GET_VAR(__GLEW_EGL_KHR_context_flush_control) + +#endif /* GL_EGL_KHR_context_flush_control */ + +/* ---------------- GL_EGL_NV_robustness_video_memory_purge ---------------- */ + +#ifndef GL_EGL_NV_robustness_video_memory_purge +#define GL_EGL_NV_robustness_video_memory_purge 1 + +#define GL_EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C +#define GL_PURGED_CONTEXT_RESET_NV 0x92BB + +#define GLEW_EGL_NV_robustness_video_memory_purge GLEW_GET_VAR(__GLEW_EGL_NV_robustness_video_memory_purge) + +#endif /* GL_EGL_NV_robustness_video_memory_purge */ + +/* --------------------------- 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_EGL_image_array ------------------------ */ + +#ifndef GL_EXT_EGL_image_array +#define GL_EXT_EGL_image_array 1 + +#define GLEW_EXT_EGL_image_array GLEW_GET_VAR(__GLEW_EXT_EGL_image_array) + +#endif /* GL_EXT_EGL_image_array */ + +/* --------------------------- GL_EXT_YUV_target --------------------------- */ + +#ifndef GL_EXT_YUV_target +#define GL_EXT_YUV_target 1 + +#define GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT 0x8BE7 + +#define GLEW_EXT_YUV_target GLEW_GET_VAR(__GLEW_EXT_YUV_target) + +#endif /* GL_EXT_YUV_target */ + +/* ------------------------------ 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_base_instance ------------------------- */ + +#ifndef GL_EXT_base_instance +#define GL_EXT_base_instance 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); + +#define glDrawArraysInstancedBaseInstanceEXT GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstanceEXT) +#define glDrawElementsInstancedBaseInstanceEXT GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstanceEXT) +#define glDrawElementsInstancedBaseVertexBaseInstanceEXT GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstanceEXT) + +#define GLEW_EXT_base_instance GLEW_GET_VAR(__GLEW_EXT_base_instance) + +#endif /* GL_EXT_base_instance */ + +/* ------------------------------ 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_extended ---------------------- */ + +#ifndef GL_EXT_blend_func_extended +#define GL_EXT_blend_func_extended 1 + +#define GL_SRC_ALPHA_SATURATE_EXT 0x0308 +#define GL_SRC1_ALPHA_EXT 0x8589 +#define GL_SRC1_COLOR_EXT 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR_EXT 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA_EXT 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT 0x88FC +#define GL_LOCATION_INDEX_EXT 0x930F + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXEXTPROC) (GLuint program, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC) (GLuint program, GLenum programInterface, const GLchar* name); + +#define glBindFragDataLocationIndexedEXT GLEW_GET_FUN(__glewBindFragDataLocationIndexedEXT) +#define glGetFragDataIndexEXT GLEW_GET_FUN(__glewGetFragDataIndexEXT) +#define glGetProgramResourceLocationIndexEXT GLEW_GET_FUN(__glewGetProgramResourceLocationIndexEXT) + +#define GLEW_EXT_blend_func_extended GLEW_GET_VAR(__GLEW_EXT_blend_func_extended) + +#endif /* GL_EXT_blend_func_extended */ + +/* ----------------------- 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_buffer_storage ------------------------- */ + +#ifndef GL_EXT_buffer_storage +#define GL_EXT_buffer_storage 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_PERSISTENT_BIT_EXT 0x0040 +#define GL_MAP_COHERENT_BIT_EXT 0x0080 +#define GL_DYNAMIC_STORAGE_BIT_EXT 0x0100 +#define GL_CLIENT_STORAGE_BIT_EXT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT_EXT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE_EXT 0x821F +#define GL_BUFFER_STORAGE_FLAGS_EXT 0x8220 + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEEXTPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); + +#define glBufferStorageEXT GLEW_GET_FUN(__glewBufferStorageEXT) +#define glNamedBufferStorageEXT GLEW_GET_FUN(__glewNamedBufferStorageEXT) + +#define GLEW_EXT_buffer_storage GLEW_GET_VAR(__GLEW_EXT_buffer_storage) + +#endif /* GL_EXT_buffer_storage */ + +/* -------------------------- GL_EXT_clear_texture ------------------------- */ + +#ifndef GL_EXT_clear_texture +#define GL_EXT_clear_texture 1 + +typedef void (GLAPIENTRY * PFNGLCLEARTEXIMAGEEXTPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARTEXSUBIMAGEEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); + +#define glClearTexImageEXT GLEW_GET_FUN(__glewClearTexImageEXT) +#define glClearTexSubImageEXT GLEW_GET_FUN(__glewClearTexSubImageEXT) + +#define GLEW_EXT_clear_texture GLEW_GET_VAR(__GLEW_EXT_clear_texture) + +#endif /* GL_EXT_clear_texture */ + +/* ----------------------- GL_EXT_clip_cull_distance ----------------------- */ + +#ifndef GL_EXT_clip_cull_distance +#define GL_EXT_clip_cull_distance 1 + +#define GL_MAX_CLIP_DISTANCES_EXT 0x0D32 +#define GL_CLIP_DISTANCE0_EXT 0x3000 +#define GL_CLIP_DISTANCE1_EXT 0x3001 +#define GL_CLIP_DISTANCE2_EXT 0x3002 +#define GL_CLIP_DISTANCE3_EXT 0x3003 +#define GL_CLIP_DISTANCE4_EXT 0x3004 +#define GL_CLIP_DISTANCE5_EXT 0x3005 +#define GL_CLIP_DISTANCE6_EXT 0x3006 +#define GL_CLIP_DISTANCE7_EXT 0x3007 +#define GL_MAX_CULL_DISTANCES_EXT 0x82F9 +#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT 0x82FA + +#define GLEW_EXT_clip_cull_distance GLEW_GET_VAR(__GLEW_EXT_clip_cull_distance) + +#endif /* GL_EXT_clip_cull_distance */ + +/* ------------------------ 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_buffer_float ----------------------- */ + +#ifndef GL_EXT_color_buffer_float +#define GL_EXT_color_buffer_float 1 + +#define GLEW_EXT_color_buffer_float GLEW_GET_VAR(__GLEW_EXT_color_buffer_float) + +#endif /* GL_EXT_color_buffer_float */ + +/* --------------------- GL_EXT_color_buffer_half_float -------------------- */ + +#ifndef GL_EXT_color_buffer_half_float +#define GL_EXT_color_buffer_half_float 1 + +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211 +#define GL_R16F_EXT 0x822D +#define GL_RG16F_EXT 0x822F +#define GL_RGBA16F_EXT 0x881A +#define GL_RGB16F_EXT 0x881B +#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17 + +#define GLEW_EXT_color_buffer_half_float GLEW_GET_VAR(__GLEW_EXT_color_buffer_half_float) + +#endif /* GL_EXT_color_buffer_half_float */ + +/* ------------------------- 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_compressed_ETC1_RGB8_sub_texture ---------------- */ + +#ifndef GL_EXT_compressed_ETC1_RGB8_sub_texture +#define GL_EXT_compressed_ETC1_RGB8_sub_texture 1 + +#define GLEW_EXT_compressed_ETC1_RGB8_sub_texture GLEW_GET_VAR(__GLEW_EXT_compressed_ETC1_RGB8_sub_texture) + +#endif /* GL_EXT_compressed_ETC1_RGB8_sub_texture */ + +/* ----------------------- GL_EXT_conservative_depth ----------------------- */ + +#ifndef GL_EXT_conservative_depth +#define GL_EXT_conservative_depth 1 + +#define GLEW_EXT_conservative_depth GLEW_GET_VAR(__GLEW_EXT_conservative_depth) + +#endif /* GL_EXT_conservative_depth */ + +/* --------------------------- 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_image --------------------------- */ + +#ifndef GL_EXT_copy_image +#define GL_EXT_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATAEXTPROC) (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 srcWidth, GLsizei srcHeight, GLsizei srcDepth); + +#define glCopyImageSubDataEXT GLEW_GET_FUN(__glewCopyImageSubDataEXT) + +#define GLEW_EXT_copy_image GLEW_GET_VAR(__GLEW_EXT_copy_image) + +#endif /* GL_EXT_copy_image */ + +/* -------------------------- 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_debug_label -------------------------- */ + +#ifndef GL_EXT_debug_label +#define GL_EXT_debug_label 1 + +#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F +#define GL_PROGRAM_OBJECT_EXT 0x8B40 +#define GL_SHADER_OBJECT_EXT 0x8B48 +#define GL_BUFFER_OBJECT_EXT 0x9151 +#define GL_QUERY_OBJECT_EXT 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 + +typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar* label); + +#define glGetObjectLabelEXT GLEW_GET_FUN(__glewGetObjectLabelEXT) +#define glLabelObjectEXT GLEW_GET_FUN(__glewLabelObjectEXT) + +#define GLEW_EXT_debug_label GLEW_GET_VAR(__GLEW_EXT_debug_label) + +#endif /* GL_EXT_debug_label */ + +/* -------------------------- GL_EXT_debug_marker -------------------------- */ + +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 + +typedef void (GLAPIENTRY * PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar* marker); +typedef void (GLAPIENTRY * PFNGLPOPGROUPMARKEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar* marker); + +#define glInsertEventMarkerEXT GLEW_GET_FUN(__glewInsertEventMarkerEXT) +#define glPopGroupMarkerEXT GLEW_GET_FUN(__glewPopGroupMarkerEXT) +#define glPushGroupMarkerEXT GLEW_GET_FUN(__glewPushGroupMarkerEXT) + +#define GLEW_EXT_debug_marker GLEW_GET_VAR(__GLEW_EXT_debug_marker) + +#endif /* GL_EXT_debug_marker */ + +/* ------------------------ 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, void** params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, void** 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, void** param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, void** param); +typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef void * (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 * PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC) (GLuint vaobj, GLuint index, GLuint divisor); +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 glVertexArrayVertexAttribDivisorEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribDivisorEXT) +#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_discard_framebuffer ---------------------- */ + +#ifndef GL_EXT_discard_framebuffer +#define GL_EXT_discard_framebuffer 1 + +#define GL_COLOR_EXT 0x1800 +#define GL_DEPTH_EXT 0x1801 +#define GL_STENCIL_EXT 0x1802 + +typedef void (GLAPIENTRY * PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); + +#define glDiscardFramebufferEXT GLEW_GET_FUN(__glewDiscardFramebufferEXT) + +#define GLEW_EXT_discard_framebuffer GLEW_GET_VAR(__GLEW_EXT_discard_framebuffer) + +#endif /* GL_EXT_discard_framebuffer */ + +/* -------------------------- GL_EXT_draw_buffers -------------------------- */ + +#ifndef GL_EXT_draw_buffers +#define GL_EXT_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_EXT 0x8824 +#define GL_DRAW_BUFFER0_EXT 0x8825 +#define GL_DRAW_BUFFER1_EXT 0x8826 +#define GL_DRAW_BUFFER2_EXT 0x8827 +#define GL_DRAW_BUFFER3_EXT 0x8828 +#define GL_DRAW_BUFFER4_EXT 0x8829 +#define GL_DRAW_BUFFER5_EXT 0x882A +#define GL_DRAW_BUFFER6_EXT 0x882B +#define GL_DRAW_BUFFER7_EXT 0x882C +#define GL_DRAW_BUFFER8_EXT 0x882D +#define GL_DRAW_BUFFER9_EXT 0x882E +#define GL_DRAW_BUFFER10_EXT 0x882F +#define GL_DRAW_BUFFER11_EXT 0x8830 +#define GL_DRAW_BUFFER12_EXT 0x8831 +#define GL_DRAW_BUFFER13_EXT 0x8832 +#define GL_DRAW_BUFFER14_EXT 0x8833 +#define GL_DRAW_BUFFER15_EXT 0x8834 +#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 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersEXT GLEW_GET_FUN(__glewDrawBuffersEXT) + +#define GLEW_EXT_draw_buffers GLEW_GET_VAR(__GLEW_EXT_draw_buffers) + +#endif /* GL_EXT_draw_buffers */ + +/* -------------------------- 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_buffers_indexed ---------------------- */ + +#ifndef GL_EXT_draw_buffers_indexed +#define GL_EXT_draw_buffers_indexed 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIEXTPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIEXTPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIEXTPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIEXTPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLCOLORMASKIEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (GLAPIENTRY * PFNGLDISABLEIEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEIEXTPROC) (GLenum target, GLuint index); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIEXTPROC) (GLenum target, GLuint index); + +#define glBlendEquationSeparateiEXT GLEW_GET_FUN(__glewBlendEquationSeparateiEXT) +#define glBlendEquationiEXT GLEW_GET_FUN(__glewBlendEquationiEXT) +#define glBlendFuncSeparateiEXT GLEW_GET_FUN(__glewBlendFuncSeparateiEXT) +#define glBlendFunciEXT GLEW_GET_FUN(__glewBlendFunciEXT) +#define glColorMaskiEXT GLEW_GET_FUN(__glewColorMaskiEXT) +#define glDisableiEXT GLEW_GET_FUN(__glewDisableiEXT) +#define glEnableiEXT GLEW_GET_FUN(__glewEnableiEXT) +#define glIsEnablediEXT GLEW_GET_FUN(__glewIsEnablediEXT) + +#define GLEW_EXT_draw_buffers_indexed GLEW_GET_VAR(__GLEW_EXT_draw_buffers_indexed) + +#endif /* GL_EXT_draw_buffers_indexed */ + +/* -------------------- GL_EXT_draw_elements_base_vertex ------------------- */ + +#ifndef GL_EXT_draw_elements_base_vertex +#define GL_EXT_draw_elements_base_vertex 1 + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei* count, GLenum type, const void *const *indices, GLsizei primcount, const GLint *basevertex); + +#define glDrawElementsBaseVertexEXT GLEW_GET_FUN(__glewDrawElementsBaseVertexEXT) +#define glDrawElementsInstancedBaseVertexEXT GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexEXT) +#define glDrawRangeElementsBaseVertexEXT GLEW_GET_FUN(__glewDrawRangeElementsBaseVertexEXT) +#define glMultiDrawElementsBaseVertexEXT GLEW_GET_FUN(__glewMultiDrawElementsBaseVertexEXT) + +#define GLEW_EXT_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_EXT_draw_elements_base_vertex) + +#endif /* GL_EXT_draw_elements_base_vertex */ + +/* ------------------------- 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 void *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 void *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_external_buffer ------------------------ */ + +#ifndef GL_EXT_external_buffer +#define GL_EXT_external_buffer 1 + +typedef void* GLeglClientBufferEXT; + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEEXTERNALEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); + +#define glBufferStorageExternalEXT GLEW_GET_FUN(__glewBufferStorageExternalEXT) +#define glNamedBufferStorageExternalEXT GLEW_GET_FUN(__glewNamedBufferStorageExternalEXT) + +#define GLEW_EXT_external_buffer GLEW_GET_VAR(__GLEW_EXT_external_buffer) + +#endif /* GL_EXT_external_buffer */ + +/* --------------------------- GL_EXT_float_blend -------------------------- */ + +#ifndef GL_EXT_float_blend +#define GL_EXT_float_blend 1 + +#define GLEW_EXT_float_blend GLEW_GET_VAR(__GLEW_EXT_float_blend) + +#endif /* GL_EXT_float_blend */ + +/* ---------------------------- 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 void *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_frag_depth --------------------------- */ + +#ifndef GL_EXT_frag_depth +#define GL_EXT_frag_depth 1 + +#define GLEW_EXT_frag_depth GLEW_GET_VAR(__GLEW_EXT_frag_depth) + +#endif /* GL_EXT_frag_depth */ + +/* ------------------------ 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_multisample_blit_scaled -------------- */ + +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_EXT_framebuffer_multisample_blit_scaled 1 + +#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB + +#define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled) + +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + +/* ----------------------- 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_point_size ---------------------- */ + +#ifndef GL_EXT_geometry_point_size +#define GL_EXT_geometry_point_size 1 + +#define GL_GEOMETRY_SHADER_BIT_EXT 0x00000004 +#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_LAYER_PROVOKING_VERTEX_EXT 0x825E +#define GL_UNDEFINED_VERTEX_EXT 0x8260 +#define GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F +#define GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916 +#define GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917 +#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#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 +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5 +#define GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312 +#define GL_MAX_FRAMEBUFFER_LAYERS_EXT 0x9317 + +#define GLEW_EXT_geometry_point_size GLEW_GET_VAR(__GLEW_EXT_geometry_point_size) + +#endif /* GL_EXT_geometry_point_size */ + +/* ------------------------- GL_EXT_geometry_shader ------------------------ */ + +#ifndef GL_EXT_geometry_shader +#define GL_EXT_geometry_shader 1 + +#define GL_GEOMETRY_SHADER_BIT_EXT 0x00000004 +#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_LAYER_PROVOKING_VERTEX_EXT 0x825E +#define GL_UNDEFINED_VERTEX_EXT 0x8260 +#define GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F +#define GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916 +#define GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917 +#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#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 +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5 +#define GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312 +#define GL_MAX_FRAMEBUFFER_LAYERS_EXT 0x9317 + +#define GLEW_EXT_geometry_shader GLEW_GET_VAR(__GLEW_EXT_geometry_shader) + +#endif /* GL_EXT_geometry_shader */ + +/* ------------------------ 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 * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT) +#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT) +#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 void *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_gpu_shader5 -------------------------- */ + +#ifndef GL_EXT_gpu_shader5 +#define GL_EXT_gpu_shader5 1 + +#define GLEW_EXT_gpu_shader5 GLEW_GET_VAR(__GLEW_EXT_gpu_shader5) + +#endif /* GL_EXT_gpu_shader5 */ + +/* ---------------------------- 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_instanced_arrays ------------------------ */ + +#ifndef GL_EXT_instanced_arrays +#define GL_EXT_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_EXT 0x88FE + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisorEXT GLEW_GET_FUN(__glewVertexAttribDivisorEXT) + +#define GLEW_EXT_instanced_arrays GLEW_GET_VAR(__GLEW_EXT_instanced_arrays) + +#endif /* GL_EXT_instanced_arrays */ + +/* -------------------------- 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 + +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_map_buffer_range ------------------------ */ + +#ifndef GL_EXT_map_buffer_range +#define GL_EXT_map_buffer_range 1 + +#define GL_MAP_READ_BIT_EXT 0x0001 +#define GL_MAP_WRITE_BIT_EXT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 + +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef void * (GLAPIENTRY * PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + +#define glFlushMappedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedBufferRangeEXT) +#define glMapBufferRangeEXT GLEW_GET_FUN(__glewMapBufferRangeEXT) + +#define GLEW_EXT_map_buffer_range GLEW_GET_VAR(__GLEW_EXT_map_buffer_range) + +#endif /* GL_EXT_map_buffer_range */ + +/* -------------------------- GL_EXT_memory_object ------------------------- */ + +#ifndef GL_EXT_memory_object +#define GL_EXT_memory_object 1 + +#define GL_UUID_SIZE_EXT 16 +#define GL_TEXTURE_TILING_EXT 0x9580 +#define GL_DEDICATED_MEMORY_OBJECT_EXT 0x9581 +#define GL_NUM_TILING_TYPES_EXT 0x9582 +#define GL_TILING_TYPES_EXT 0x9583 +#define GL_OPTIMAL_TILING_EXT 0x9584 +#define GL_LINEAR_TILING_EXT 0x9585 +#define GL_LAYOUT_GENERAL_EXT 0x958D +#define GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E +#define GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F +#define GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590 +#define GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591 +#define GL_LAYOUT_TRANSFER_SRC_EXT 0x9592 +#define GL_LAYOUT_TRANSFER_DST_EXT 0x9593 +#define GL_NUM_DEVICE_UUIDS_EXT 0x9596 +#define GL_DEVICE_UUID_EXT 0x9597 +#define GL_DRIVER_UUID_EXT 0x9598 +#define GL_PROTECTED_MEMORY_OBJECT_EXT 0x959B + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEMEMEXTPROC) (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLCREATEMEMORYOBJECTSEXTPROC) (GLsizei n, GLuint* memoryObjects); +typedef void (GLAPIENTRY * PFNGLDELETEMEMORYOBJECTSEXTPROC) (GLsizei n, const GLuint* memoryObjects); +typedef void (GLAPIENTRY * PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETUNSIGNEDBYTEI_VEXTPROC) (GLenum target, GLuint index, GLubyte* data); +typedef void (GLAPIENTRY * PFNGLGETUNSIGNEDBYTEVEXTPROC) (GLenum pname, GLubyte* data); +typedef GLboolean (GLAPIENTRY * PFNGLISMEMORYOBJECTEXTPROC) (GLuint memoryObject); +typedef void (GLAPIENTRY * PFNGLMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC) (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM1DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM2DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM3DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); + +#define glBufferStorageMemEXT GLEW_GET_FUN(__glewBufferStorageMemEXT) +#define glCreateMemoryObjectsEXT GLEW_GET_FUN(__glewCreateMemoryObjectsEXT) +#define glDeleteMemoryObjectsEXT GLEW_GET_FUN(__glewDeleteMemoryObjectsEXT) +#define glGetMemoryObjectParameterivEXT GLEW_GET_FUN(__glewGetMemoryObjectParameterivEXT) +#define glGetUnsignedBytei_vEXT GLEW_GET_FUN(__glewGetUnsignedBytei_vEXT) +#define glGetUnsignedBytevEXT GLEW_GET_FUN(__glewGetUnsignedBytevEXT) +#define glIsMemoryObjectEXT GLEW_GET_FUN(__glewIsMemoryObjectEXT) +#define glMemoryObjectParameterivEXT GLEW_GET_FUN(__glewMemoryObjectParameterivEXT) +#define glNamedBufferStorageMemEXT GLEW_GET_FUN(__glewNamedBufferStorageMemEXT) +#define glTexStorageMem1DEXT GLEW_GET_FUN(__glewTexStorageMem1DEXT) +#define glTexStorageMem2DEXT GLEW_GET_FUN(__glewTexStorageMem2DEXT) +#define glTexStorageMem2DMultisampleEXT GLEW_GET_FUN(__glewTexStorageMem2DMultisampleEXT) +#define glTexStorageMem3DEXT GLEW_GET_FUN(__glewTexStorageMem3DEXT) +#define glTexStorageMem3DMultisampleEXT GLEW_GET_FUN(__glewTexStorageMem3DMultisampleEXT) +#define glTextureStorageMem1DEXT GLEW_GET_FUN(__glewTextureStorageMem1DEXT) +#define glTextureStorageMem2DEXT GLEW_GET_FUN(__glewTextureStorageMem2DEXT) +#define glTextureStorageMem2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorageMem2DMultisampleEXT) +#define glTextureStorageMem3DEXT GLEW_GET_FUN(__glewTextureStorageMem3DEXT) +#define glTextureStorageMem3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorageMem3DMultisampleEXT) + +#define GLEW_EXT_memory_object GLEW_GET_VAR(__GLEW_EXT_memory_object) + +#endif /* GL_EXT_memory_object */ + +/* ------------------------ GL_EXT_memory_object_fd ------------------------ */ + +#ifndef GL_EXT_memory_object_fd +#define GL_EXT_memory_object_fd 1 + +#define GL_HANDLE_TYPE_OPAQUE_FD_EXT 0x9586 + +typedef void (GLAPIENTRY * PFNGLIMPORTMEMORYFDEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, GLint fd); + +#define glImportMemoryFdEXT GLEW_GET_FUN(__glewImportMemoryFdEXT) + +#define GLEW_EXT_memory_object_fd GLEW_GET_VAR(__GLEW_EXT_memory_object_fd) + +#endif /* GL_EXT_memory_object_fd */ + +/* ----------------------- GL_EXT_memory_object_win32 ---------------------- */ + +#ifndef GL_EXT_memory_object_win32 +#define GL_EXT_memory_object_win32 1 + +#define GL_LUID_SIZE_EXT 8 +#define GL_HANDLE_TYPE_OPAQUE_WIN32_EXT 0x9587 +#define GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT 0x9588 +#define GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT 0x9589 +#define GL_HANDLE_TYPE_D3D12_RESOURCE_EXT 0x958A +#define GL_HANDLE_TYPE_D3D11_IMAGE_EXT 0x958B +#define GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT 0x958C +#define GL_HANDLE_TYPE_D3D12_FENCE_EXT 0x9594 +#define GL_D3D12_FENCE_VALUE_EXT 0x9595 +#define GL_DEVICE_LUID_EXT 0x9599 +#define GL_DEVICE_NODE_MASK_EXT 0x959A + +typedef void (GLAPIENTRY * PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, void *handle); +typedef void (GLAPIENTRY * PFNGLIMPORTMEMORYWIN32NAMEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, const void *name); + +#define glImportMemoryWin32HandleEXT GLEW_GET_FUN(__glewImportMemoryWin32HandleEXT) +#define glImportMemoryWin32NameEXT GLEW_GET_FUN(__glewImportMemoryWin32NameEXT) + +#define GLEW_EXT_memory_object_win32 GLEW_GET_VAR(__GLEW_EXT_memory_object_win32) + +#endif /* GL_EXT_memory_object_win32 */ + +/* ------------------------- 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 void *const *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_multi_draw_indirect ---------------------- */ + +#ifndef GL_EXT_multi_draw_indirect +#define GL_EXT_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); + +#define glMultiDrawArraysIndirectEXT GLEW_GET_FUN(__glewMultiDrawArraysIndirectEXT) +#define glMultiDrawElementsIndirectEXT GLEW_GET_FUN(__glewMultiDrawElementsIndirectEXT) + +#define GLEW_EXT_multi_draw_indirect GLEW_GET_VAR(__GLEW_EXT_multi_draw_indirect) + +#endif /* GL_EXT_multi_draw_indirect */ + +/* ------------------------ GL_EXT_multiple_textures ----------------------- */ + +#ifndef GL_EXT_multiple_textures +#define GL_EXT_multiple_textures 1 + +#define GLEW_EXT_multiple_textures GLEW_GET_VAR(__GLEW_EXT_multiple_textures) + +#endif /* GL_EXT_multiple_textures */ + +/* --------------------------- 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_multisample_compatibility ------------------- */ + +#ifndef GL_EXT_multisample_compatibility +#define GL_EXT_multisample_compatibility 1 + +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F + +#define GLEW_EXT_multisample_compatibility GLEW_GET_VAR(__GLEW_EXT_multisample_compatibility) + +#endif /* GL_EXT_multisample_compatibility */ + +/* ----------------- GL_EXT_multisampled_render_to_texture ----------------- */ + +#ifndef GL_EXT_multisampled_render_to_texture +#define GL_EXT_multisampled_render_to_texture 1 + +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); + +#define glFramebufferTexture2DMultisampleEXT GLEW_GET_FUN(__glewFramebufferTexture2DMultisampleEXT) + +#define GLEW_EXT_multisampled_render_to_texture GLEW_GET_VAR(__GLEW_EXT_multisampled_render_to_texture) + +#endif /* GL_EXT_multisampled_render_to_texture */ + +/* ----------------- GL_EXT_multisampled_render_to_texture2 ---------------- */ + +#ifndef GL_EXT_multisampled_render_to_texture2 +#define GL_EXT_multisampled_render_to_texture2 1 + +#define GLEW_EXT_multisampled_render_to_texture2 GLEW_GET_VAR(__GLEW_EXT_multisampled_render_to_texture2) + +#endif /* GL_EXT_multisampled_render_to_texture2 */ + +/* --------------------- GL_EXT_multiview_draw_buffers --------------------- */ + +#ifndef GL_EXT_multiview_draw_buffers +#define GL_EXT_multiview_draw_buffers 1 + +#define GL_DRAW_BUFFER_EXT 0x0C01 +#define GL_READ_BUFFER_EXT 0x0C02 +#define GL_COLOR_ATTACHMENT_EXT 0x90F0 +#define GL_MULTIVIEW_EXT 0x90F1 +#define GL_MAX_MULTIVIEW_BUFFERS_EXT 0x90F2 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum* location, const GLint *indices); +typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint* data); +typedef void (GLAPIENTRY * PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index); + +#define glDrawBuffersIndexedEXT GLEW_GET_FUN(__glewDrawBuffersIndexedEXT) +#define glGetIntegeri_vEXT GLEW_GET_FUN(__glewGetIntegeri_vEXT) +#define glReadBufferIndexedEXT GLEW_GET_FUN(__glewReadBufferIndexedEXT) + +#define GLEW_EXT_multiview_draw_buffers GLEW_GET_VAR(__GLEW_EXT_multiview_draw_buffers) + +#endif /* GL_EXT_multiview_draw_buffers */ + +/* ---------------------- 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_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_polygon_offset_clamp ---------------------- */ + +#ifndef GL_EXT_polygon_offset_clamp +#define GL_EXT_polygon_offset_clamp 1 + +#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETCLAMPEXTPROC) (GLfloat factor, GLfloat units, GLfloat clamp); + +#define glPolygonOffsetClampEXT GLEW_GET_FUN(__glewPolygonOffsetClampEXT) + +#define GLEW_EXT_polygon_offset_clamp GLEW_GET_VAR(__GLEW_EXT_polygon_offset_clamp) + +#endif /* GL_EXT_polygon_offset_clamp */ + +/* ----------------------- GL_EXT_post_depth_coverage ---------------------- */ + +#ifndef GL_EXT_post_depth_coverage +#define GL_EXT_post_depth_coverage 1 + +#define GLEW_EXT_post_depth_coverage GLEW_GET_VAR(__GLEW_EXT_post_depth_coverage) + +#endif /* GL_EXT_post_depth_coverage */ + +/* ------------------------ 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_pvrtc_sRGB --------------------------- */ + +#ifndef GL_EXT_pvrtc_sRGB +#define GL_EXT_pvrtc_sRGB 1 + +#define GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54 +#define GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55 +#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56 +#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57 + +#define GLEW_EXT_pvrtc_sRGB GLEW_GET_VAR(__GLEW_EXT_pvrtc_sRGB) + +#endif /* GL_EXT_pvrtc_sRGB */ + +/* ----------------------- GL_EXT_raster_multisample ----------------------- */ + +#ifndef GL_EXT_raster_multisample +#define GL_EXT_raster_multisample 1 + +#define GL_COLOR_SAMPLES_NV 0x8E20 +#define GL_RASTER_MULTISAMPLE_EXT 0x9327 +#define GL_RASTER_SAMPLES_EXT 0x9328 +#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 +#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A +#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B +#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C +#define GL_DEPTH_SAMPLES_NV 0x932D +#define GL_STENCIL_SAMPLES_NV 0x932E +#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F +#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 +#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 +#define GL_COVERAGE_MODULATION_NV 0x9332 +#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 + +typedef void (GLAPIENTRY * PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); +typedef void (GLAPIENTRY * PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufsize, GLfloat* v); +typedef void (GLAPIENTRY * PFNGLRASTERSAMPLESEXTPROC) (GLuint samples, GLboolean fixedsamplelocations); + +#define glCoverageModulationNV GLEW_GET_FUN(__glewCoverageModulationNV) +#define glCoverageModulationTableNV GLEW_GET_FUN(__glewCoverageModulationTableNV) +#define glGetCoverageModulationTableNV GLEW_GET_FUN(__glewGetCoverageModulationTableNV) +#define glRasterSamplesEXT GLEW_GET_FUN(__glewRasterSamplesEXT) + +#define GLEW_EXT_raster_multisample GLEW_GET_VAR(__GLEW_EXT_raster_multisample) + +#endif /* GL_EXT_raster_multisample */ + +/* ------------------------ GL_EXT_read_format_bgra ------------------------ */ + +#ifndef GL_EXT_read_format_bgra +#define GL_EXT_read_format_bgra 1 + +#define GL_BGRA_EXT 0x80E1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 + +#define GLEW_EXT_read_format_bgra GLEW_GET_VAR(__GLEW_EXT_read_format_bgra) + +#endif /* GL_EXT_read_format_bgra */ + +/* -------------------------- GL_EXT_render_snorm -------------------------- */ + +#ifndef GL_EXT_render_snorm +#define GL_EXT_render_snorm 1 + +#define GL_BYTE 0x1400 +#define GL_SHORT 0x1402 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM_EXT 0x8F98 +#define GL_RG16_SNORM_EXT 0x8F99 +#define GL_RGBA16_SNORM_EXT 0x8F9B + +#define GLEW_EXT_render_snorm GLEW_GET_VAR(__GLEW_EXT_render_snorm) + +#endif /* GL_EXT_render_snorm */ + +/* ------------------------- 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_sRGB ------------------------------ */ + +#ifndef GL_EXT_sRGB +#define GL_EXT_sRGB 1 + +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210 +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 + +#define GLEW_EXT_sRGB GLEW_GET_VAR(__GLEW_EXT_sRGB) + +#endif /* GL_EXT_sRGB */ + +/* ----------------------- GL_EXT_sRGB_write_control ----------------------- */ + +#ifndef GL_EXT_sRGB_write_control +#define GL_EXT_sRGB_write_control 1 + +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 + +#define GLEW_EXT_sRGB_write_control GLEW_GET_VAR(__GLEW_EXT_sRGB_write_control) + +#endif /* GL_EXT_sRGB_write_control */ + +/* -------------------------- 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 void *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_semaphore --------------------------- */ + +#ifndef GL_EXT_semaphore +#define GL_EXT_semaphore 1 + +typedef void (GLAPIENTRY * PFNGLDELETESEMAPHORESEXTPROC) (GLsizei n, const GLuint* semaphores); +typedef void (GLAPIENTRY * PFNGLGENSEMAPHORESEXTPROC) (GLsizei n, GLuint* semaphores); +typedef void (GLAPIENTRY * PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, GLuint64* params); +typedef GLboolean (GLAPIENTRY * PFNGLISSEMAPHOREEXTPROC) (GLuint semaphore); +typedef void (GLAPIENTRY * PFNGLSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, const GLuint64* params); +typedef void (GLAPIENTRY * PFNGLSIGNALSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint* buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); +typedef void (GLAPIENTRY * PFNGLWAITSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint* buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); + +#define glDeleteSemaphoresEXT GLEW_GET_FUN(__glewDeleteSemaphoresEXT) +#define glGenSemaphoresEXT GLEW_GET_FUN(__glewGenSemaphoresEXT) +#define glGetSemaphoreParameterui64vEXT GLEW_GET_FUN(__glewGetSemaphoreParameterui64vEXT) +#define glIsSemaphoreEXT GLEW_GET_FUN(__glewIsSemaphoreEXT) +#define glSemaphoreParameterui64vEXT GLEW_GET_FUN(__glewSemaphoreParameterui64vEXT) +#define glSignalSemaphoreEXT GLEW_GET_FUN(__glewSignalSemaphoreEXT) +#define glWaitSemaphoreEXT GLEW_GET_FUN(__glewWaitSemaphoreEXT) + +#define GLEW_EXT_semaphore GLEW_GET_VAR(__GLEW_EXT_semaphore) + +#endif /* GL_EXT_semaphore */ + +/* -------------------------- GL_EXT_semaphore_fd -------------------------- */ + +#ifndef GL_EXT_semaphore_fd +#define GL_EXT_semaphore_fd 1 + +typedef void (GLAPIENTRY * PFNGLIMPORTSEMAPHOREFDEXTPROC) (GLuint semaphore, GLenum handleType, GLint fd); + +#define glImportSemaphoreFdEXT GLEW_GET_FUN(__glewImportSemaphoreFdEXT) + +#define GLEW_EXT_semaphore_fd GLEW_GET_VAR(__GLEW_EXT_semaphore_fd) + +#endif /* GL_EXT_semaphore_fd */ + +/* ------------------------- GL_EXT_semaphore_win32 ------------------------ */ + +#ifndef GL_EXT_semaphore_win32 +#define GL_EXT_semaphore_win32 1 + +typedef void (GLAPIENTRY * PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC) (GLuint semaphore, GLenum handleType, void *handle); +typedef void (GLAPIENTRY * PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC) (GLuint semaphore, GLenum handleType, const void *name); + +#define glImportSemaphoreWin32HandleEXT GLEW_GET_FUN(__glewImportSemaphoreWin32HandleEXT) +#define glImportSemaphoreWin32NameEXT GLEW_GET_FUN(__glewImportSemaphoreWin32NameEXT) + +#define GLEW_EXT_semaphore_win32 GLEW_GET_VAR(__GLEW_EXT_semaphore_win32) + +#endif /* GL_EXT_semaphore_win32 */ + +/* --------------------- 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 GLchar* 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_framebuffer_fetch -------------------- */ + +#ifndef GL_EXT_shader_framebuffer_fetch +#define GL_EXT_shader_framebuffer_fetch 1 + +#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 + +#define GLEW_EXT_shader_framebuffer_fetch GLEW_GET_VAR(__GLEW_EXT_shader_framebuffer_fetch) + +#endif /* GL_EXT_shader_framebuffer_fetch */ + +/* ------------------------ GL_EXT_shader_group_vote ----------------------- */ + +#ifndef GL_EXT_shader_group_vote +#define GL_EXT_shader_group_vote 1 + +#define GLEW_EXT_shader_group_vote GLEW_GET_VAR(__GLEW_EXT_shader_group_vote) + +#endif /* GL_EXT_shader_group_vote */ + +/* ------------------- GL_EXT_shader_image_load_formatted ------------------ */ + +#ifndef GL_EXT_shader_image_load_formatted +#define GL_EXT_shader_image_load_formatted 1 + +#define GLEW_EXT_shader_image_load_formatted GLEW_GET_VAR(__GLEW_EXT_shader_image_load_formatted) + +#endif /* GL_EXT_shader_image_load_formatted */ + +/* --------------------- 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_shader_implicit_conversions ------------------ */ + +#ifndef GL_EXT_shader_implicit_conversions +#define GL_EXT_shader_implicit_conversions 1 + +#define GLEW_EXT_shader_implicit_conversions GLEW_GET_VAR(__GLEW_EXT_shader_implicit_conversions) + +#endif /* GL_EXT_shader_implicit_conversions */ + +/* ----------------------- GL_EXT_shader_integer_mix ----------------------- */ + +#ifndef GL_EXT_shader_integer_mix +#define GL_EXT_shader_integer_mix 1 + +#define GLEW_EXT_shader_integer_mix GLEW_GET_VAR(__GLEW_EXT_shader_integer_mix) + +#endif /* GL_EXT_shader_integer_mix */ + +/* ------------------------ GL_EXT_shader_io_blocks ------------------------ */ + +#ifndef GL_EXT_shader_io_blocks +#define GL_EXT_shader_io_blocks 1 + +#define GLEW_EXT_shader_io_blocks GLEW_GET_VAR(__GLEW_EXT_shader_io_blocks) + +#endif /* GL_EXT_shader_io_blocks */ + +/* ------------- GL_EXT_shader_non_constant_global_initializers ------------ */ + +#ifndef GL_EXT_shader_non_constant_global_initializers +#define GL_EXT_shader_non_constant_global_initializers 1 + +#define GLEW_EXT_shader_non_constant_global_initializers GLEW_GET_VAR(__GLEW_EXT_shader_non_constant_global_initializers) + +#endif /* GL_EXT_shader_non_constant_global_initializers */ + +/* ------------------- GL_EXT_shader_pixel_local_storage ------------------- */ + +#ifndef GL_EXT_shader_pixel_local_storage +#define GL_EXT_shader_pixel_local_storage 1 + +#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63 +#define GL_SHADER_PIXEL_LOCAL_STORAGE_EXT 0x8F64 +#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_SIZE_EXT 0x8F67 + +#define GLEW_EXT_shader_pixel_local_storage GLEW_GET_VAR(__GLEW_EXT_shader_pixel_local_storage) + +#endif /* GL_EXT_shader_pixel_local_storage */ + +/* ------------------- GL_EXT_shader_pixel_local_storage2 ------------------ */ + +#ifndef GL_EXT_shader_pixel_local_storage2 +#define GL_EXT_shader_pixel_local_storage2 1 + +#define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_FAST_SIZE_EXT 0x9650 +#define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_SIZE_EXT 0x9651 +#define GL_FRAMEBUFFER_INCOMPLETE_INSUFFICIENT_SHADER_COMBINED_LOCAL_STORAGE_EXT 0x9652 + +typedef void (GLAPIENTRY * PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC) (GLsizei offset, GLsizei n, const GLuint* values); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target, GLsizei size); +typedef GLsizei (GLAPIENTRY * PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target); + +#define glClearPixelLocalStorageuiEXT GLEW_GET_FUN(__glewClearPixelLocalStorageuiEXT) +#define glFramebufferPixelLocalStorageSizeEXT GLEW_GET_FUN(__glewFramebufferPixelLocalStorageSizeEXT) +#define glGetFramebufferPixelLocalStorageSizeEXT GLEW_GET_FUN(__glewGetFramebufferPixelLocalStorageSizeEXT) + +#define GLEW_EXT_shader_pixel_local_storage2 GLEW_GET_VAR(__GLEW_EXT_shader_pixel_local_storage2) + +#endif /* GL_EXT_shader_pixel_local_storage2 */ + +/* ----------------------- GL_EXT_shader_texture_lod ----------------------- */ + +#ifndef GL_EXT_shader_texture_lod +#define GL_EXT_shader_texture_lod 1 + +#define GLEW_EXT_shader_texture_lod GLEW_GET_VAR(__GLEW_EXT_shader_texture_lod) + +#endif /* GL_EXT_shader_texture_lod */ + +/* -------------------------- 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_shadow_samplers ------------------------ */ + +#ifndef GL_EXT_shadow_samplers +#define GL_EXT_shadow_samplers 1 + +#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C +#define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D +#define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E +#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62 + +#define GLEW_EXT_shadow_samplers GLEW_GET_VAR(__GLEW_EXT_shadow_samplers) + +#endif /* GL_EXT_shadow_samplers */ + +/* --------------------- 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_sparse_texture ------------------------- */ + +#ifndef GL_EXT_sparse_texture +#define GL_EXT_sparse_texture 1 + +#define GL_TEXTURE_2D 0x0DE1 +#define GL_TEXTURE_3D 0x806F +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_TEXTURE_CUBE_MAP_ARRAY_OES 0x9009 +#define GL_VIRTUAL_PAGE_SIZE_X_EXT 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_EXT 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_EXT 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_EXT 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_EXT 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_EXT 0x919A +#define GL_TEXTURE_SPARSE_EXT 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_EXT 0x91A7 +#define GL_NUM_VIRTUAL_PAGE_SIZES_EXT 0x91A8 +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_EXT 0x91A9 +#define GL_NUM_SPARSE_LEVELS_EXT 0x91AA + +typedef void (GLAPIENTRY * PFNGLTEXPAGECOMMITMENTEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +typedef void (GLAPIENTRY * PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); + +#define glTexPageCommitmentEXT GLEW_GET_FUN(__glewTexPageCommitmentEXT) +#define glTexturePageCommitmentEXT GLEW_GET_FUN(__glewTexturePageCommitmentEXT) + +#define GLEW_EXT_sparse_texture GLEW_GET_VAR(__GLEW_EXT_sparse_texture) + +#endif /* GL_EXT_sparse_texture */ + +/* ------------------------- GL_EXT_sparse_texture2 ------------------------ */ + +#ifndef GL_EXT_sparse_texture2 +#define GL_EXT_sparse_texture2 1 + +#define GLEW_EXT_sparse_texture2 GLEW_GET_VAR(__GLEW_EXT_sparse_texture2) + +#endif /* GL_EXT_sparse_texture2 */ + +/* ------------------------ 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 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); + +#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT) + +#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_astc_decode_mode -------------- */ + +#ifndef GL_EXT_texture_compression_astc_decode_mode +#define GL_EXT_texture_compression_astc_decode_mode 1 + +#define GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69 + +#define GLEW_EXT_texture_compression_astc_decode_mode GLEW_GET_VAR(__GLEW_EXT_texture_compression_astc_decode_mode) + +#endif /* GL_EXT_texture_compression_astc_decode_mode */ + +/* ----------- GL_EXT_texture_compression_astc_decode_mode_rgb9e5 ---------- */ + +#ifndef GL_EXT_texture_compression_astc_decode_mode_rgb9e5 +#define GL_EXT_texture_compression_astc_decode_mode_rgb9e5 1 + +#define GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69 + +#define GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5 GLEW_GET_VAR(__GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5) + +#endif /* GL_EXT_texture_compression_astc_decode_mode_rgb9e5 */ + +/* -------------------- GL_EXT_texture_compression_bptc -------------------- */ + +#ifndef GL_EXT_texture_compression_bptc +#define GL_EXT_texture_compression_bptc 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM_EXT 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT 0x8E8F + +#define GLEW_EXT_texture_compression_bptc GLEW_GET_VAR(__GLEW_EXT_texture_compression_bptc) + +#endif /* GL_EXT_texture_compression_bptc */ + +/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */ + +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 + +#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_cube_map_array --------------------- */ + +#ifndef GL_EXT_texture_cube_map_array +#define GL_EXT_texture_cube_map_array 1 + +#define GL_TEXTURE_CUBE_MAP_ARRAY_EXT 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT 0x900A +#define GL_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900F +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A + +#define GLEW_EXT_texture_cube_map_array GLEW_GET_VAR(__GLEW_EXT_texture_cube_map_array) + +#endif /* GL_EXT_texture_cube_map_array */ + +/* ----------------------- 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 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_filter_minmax --------------------- */ + +#ifndef GL_EXT_texture_filter_minmax +#define GL_EXT_texture_filter_minmax 1 + +#define GL_TEXTURE_REDUCTION_MODE_EXT 0x9366 +#define GL_WEIGHTED_AVERAGE_EXT 0x9367 + +#define GLEW_EXT_texture_filter_minmax GLEW_GET_VAR(__GLEW_EXT_texture_filter_minmax) + +#endif /* GL_EXT_texture_filter_minmax */ + +/* --------------------- GL_EXT_texture_format_BGRA8888 -------------------- */ + +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_EXT_texture_format_BGRA8888 1 + +#define GL_BGRA_EXT 0x80E1 + +#define GLEW_EXT_texture_format_BGRA8888 GLEW_GET_VAR(__GLEW_EXT_texture_format_BGRA8888) + +#endif /* GL_EXT_texture_format_BGRA8888 */ + +/* ------------------------- 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_norm16 ------------------------- */ + +#ifndef GL_EXT_texture_norm16 +#define GL_EXT_texture_norm16 1 + +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA16_EXT 0x805B +#define GL_R16_EXT 0x822A +#define GL_RG16_EXT 0x822C +#define GL_R16_SNORM_EXT 0x8F98 +#define GL_RG16_SNORM_EXT 0x8F99 +#define GL_RGB16_SNORM_EXT 0x8F9A +#define GL_RGBA16_SNORM_EXT 0x8F9B + +#define GLEW_EXT_texture_norm16 GLEW_GET_VAR(__GLEW_EXT_texture_norm16) + +#endif /* GL_EXT_texture_norm16 */ + +/* ------------------------- 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_rg --------------------------- */ + +#ifndef GL_EXT_texture_rg +#define GL_EXT_texture_rg 1 + +#define GL_RED_EXT 0x1903 +#define GL_RG_EXT 0x8227 +#define GL_R8_EXT 0x8229 +#define GL_RG8_EXT 0x822B + +#define GLEW_EXT_texture_rg GLEW_GET_VAR(__GLEW_EXT_texture_rg) + +#endif /* GL_EXT_texture_rg */ + +/* -------------------------- 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_R8 ------------------------ */ + +#ifndef GL_EXT_texture_sRGB_R8 +#define GL_EXT_texture_sRGB_R8 1 + +#define GL_SR8_EXT 0x8FBD + +#define GLEW_EXT_texture_sRGB_R8 GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_R8) + +#endif /* GL_EXT_texture_sRGB_R8 */ + +/* ------------------------ GL_EXT_texture_sRGB_RG8 ------------------------ */ + +#ifndef GL_EXT_texture_sRGB_RG8 +#define GL_EXT_texture_sRGB_RG8 1 + +#define GL_SRG8_EXT 0x8FBE + +#define GLEW_EXT_texture_sRGB_RG8 GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_RG8) + +#endif /* GL_EXT_texture_sRGB_RG8 */ + +/* ----------------------- 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_storage ------------------------ */ + +#ifndef GL_EXT_texture_storage +#define GL_EXT_texture_storage 1 + +#define GL_ALPHA8_EXT 0x803C +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_R8_EXT 0x8229 +#define GL_RG8_EXT 0x822B +#define GL_R16F_EXT 0x822D +#define GL_R32F_EXT 0x822E +#define GL_RG16F_EXT 0x822F +#define GL_RG32F_EXT 0x8230 +#define GL_RGBA32F_EXT 0x8814 +#define GL_RGB32F_EXT 0x8815 +#define GL_ALPHA32F_EXT 0x8816 +#define GL_LUMINANCE32F_EXT 0x8818 +#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 +#define GL_RGBA16F_EXT 0x881A +#define GL_RGB16F_EXT 0x881B +#define GL_ALPHA16F_EXT 0x881C +#define GL_LUMINANCE16F_EXT 0x881E +#define GL_LUMINANCE_ALPHA16F_EXT 0x881F +#define GL_RGB_RAW_422_APPLE 0x8A51 +#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F +#define GL_BGRA8_EXT 0x93A1 + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + +#define glTexStorage1DEXT GLEW_GET_FUN(__glewTexStorage1DEXT) +#define glTexStorage2DEXT GLEW_GET_FUN(__glewTexStorage2DEXT) +#define glTexStorage3DEXT GLEW_GET_FUN(__glewTexStorage3DEXT) +#define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT) +#define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT) +#define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT) + +#define GLEW_EXT_texture_storage GLEW_GET_VAR(__GLEW_EXT_texture_storage) + +#endif /* GL_EXT_texture_storage */ + +/* ------------------------- 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_texture_type_2_10_10_10_REV ------------------ */ + +#ifndef GL_EXT_texture_type_2_10_10_10_REV +#define GL_EXT_texture_type_2_10_10_10_REV 1 + +#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 + +#define GLEW_EXT_texture_type_2_10_10_10_REV GLEW_GET_VAR(__GLEW_EXT_texture_type_2_10_10_10_REV) + +#endif /* GL_EXT_texture_type_2_10_10_10_REV */ + +/* -------------------------- GL_EXT_texture_view -------------------------- */ + +#ifndef GL_EXT_texture_view +#define GL_EXT_texture_view 1 + +#define GL_TEXTURE_VIEW_MIN_LEVEL_EXT 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS_EXT 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER_EXT 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS_EXT 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + +typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWEXTPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); + +#define glTextureViewEXT GLEW_GET_FUN(__glewTextureViewEXT) + +#define GLEW_EXT_texture_view GLEW_GET_VAR(__GLEW_EXT_texture_view) + +#endif /* GL_EXT_texture_view */ + +/* --------------------------- 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, GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar * const* 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_unpack_subimage ------------------------ */ + +#ifndef GL_EXT_unpack_subimage +#define GL_EXT_unpack_subimage 1 + +#define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2 +#define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4 + +#define GLEW_EXT_unpack_subimage GLEW_GET_VAR(__GLEW_EXT_unpack_subimage) + +#endif /* GL_EXT_unpack_subimage */ + +/* -------------------------- 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_array_setXXX ---------------------- */ + +#ifndef GL_EXT_vertex_array_setXXX +#define GL_EXT_vertex_array_setXXX 1 + +typedef void (GLAPIENTRY * PFNGLBINDARRAYSETEXTPROC) (const void *arrayset); +typedef const void * (GLAPIENTRY * PFNGLCREATEARRAYSETEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEARRAYSETSEXTPROC) (GLsizei n, const void *arrayset[]); + +#define glBindArraySetEXT GLEW_GET_FUN(__glewBindArraySetEXT) +#define glCreateArraySetExt GLEW_GET_FUN(__glewCreateArraySetExt) +#define glDeleteArraySetsEXT GLEW_GET_FUN(__glewDeleteArraySetsEXT) + +#define GLEW_EXT_vertex_array_setXXX GLEW_GET_VAR(__GLEW_EXT_vertex_array_setXXX) + +#endif /* GL_EXT_vertex_array_setXXX */ + +/* ----------------------- 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, void **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, void *addr); +typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, void *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, void *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_EXT_win32_keyed_mutex ----------------------- */ + +#ifndef GL_EXT_win32_keyed_mutex +#define GL_EXT_win32_keyed_mutex 1 + +typedef GLboolean (GLAPIENTRY * PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key, GLuint timeout); +typedef GLboolean (GLAPIENTRY * PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key); + +#define glAcquireKeyedMutexWin32EXT GLEW_GET_FUN(__glewAcquireKeyedMutexWin32EXT) +#define glReleaseKeyedMutexWin32EXT GLEW_GET_FUN(__glewReleaseKeyedMutexWin32EXT) + +#define GLEW_EXT_win32_keyed_mutex GLEW_GET_VAR(__GLEW_EXT_win32_keyed_mutex) + +#endif /* GL_EXT_win32_keyed_mutex */ + +/* ------------------------ GL_EXT_window_rectangles ----------------------- */ + +#ifndef GL_EXT_window_rectangles +#define GL_EXT_window_rectangles 1 + +#define GL_INCLUSIVE_EXT 0x8F10 +#define GL_EXCLUSIVE_EXT 0x8F11 +#define GL_WINDOW_RECTANGLE_EXT 0x8F12 +#define GL_WINDOW_RECTANGLE_MODE_EXT 0x8F13 +#define GL_MAX_WINDOW_RECTANGLES_EXT 0x8F14 +#define GL_NUM_WINDOW_RECTANGLES_EXT 0x8F15 + +typedef void (GLAPIENTRY * PFNGLWINDOWRECTANGLESEXTPROC) (GLenum mode, GLsizei count, const GLint box[]); + +#define glWindowRectanglesEXT GLEW_GET_FUN(__glewWindowRectanglesEXT) + +#define GLEW_EXT_window_rectangles GLEW_GET_VAR(__GLEW_EXT_window_rectangles) + +#endif /* GL_EXT_window_rectangles */ + +/* ------------------------- GL_EXT_x11_sync_object ------------------------ */ + +#ifndef GL_EXT_x11_sync_object +#define GL_EXT_x11_sync_object 1 + +#define GL_SYNC_X11_FENCE_EXT 0x90E1 + +typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); + +#define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT) + +#define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object) + +#endif /* GL_EXT_x11_sync_object */ + +/* ---------------------- 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 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 void *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 void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** 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_conservative_rasterization ------------------ */ + +#ifndef GL_INTEL_conservative_rasterization +#define GL_INTEL_conservative_rasterization 1 + +#define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE + +#define GLEW_INTEL_conservative_rasterization GLEW_GET_VAR(__GLEW_INTEL_conservative_rasterization) + +#endif /* GL_INTEL_conservative_rasterization */ + +/* ------------------- GL_INTEL_fragment_shader_ordering ------------------- */ + +#ifndef GL_INTEL_fragment_shader_ordering +#define GL_INTEL_fragment_shader_ordering 1 + +#define GLEW_INTEL_fragment_shader_ordering GLEW_GET_VAR(__GLEW_INTEL_fragment_shader_ordering) + +#endif /* GL_INTEL_fragment_shader_ordering */ + +/* ----------------------- GL_INTEL_framebuffer_CMAA ----------------------- */ + +#ifndef GL_INTEL_framebuffer_CMAA +#define GL_INTEL_framebuffer_CMAA 1 + +#define GLEW_INTEL_framebuffer_CMAA GLEW_GET_VAR(__GLEW_INTEL_framebuffer_CMAA) + +#endif /* GL_INTEL_framebuffer_CMAA */ + +/* -------------------------- GL_INTEL_map_texture ------------------------- */ + +#ifndef GL_INTEL_map_texture +#define GL_INTEL_map_texture 1 + +#define GL_LAYOUT_DEFAULT_INTEL 0 +#define GL_LAYOUT_LINEAR_INTEL 1 +#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 +#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF + +typedef void * (GLAPIENTRY * PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum *layout); +typedef void (GLAPIENTRY * PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); + +#define glMapTexture2DINTEL GLEW_GET_FUN(__glewMapTexture2DINTEL) +#define glSyncTextureINTEL GLEW_GET_FUN(__glewSyncTextureINTEL) +#define glUnmapTexture2DINTEL GLEW_GET_FUN(__glewUnmapTexture2DINTEL) + +#define GLEW_INTEL_map_texture GLEW_GET_VAR(__GLEW_INTEL_map_texture) + +#endif /* GL_INTEL_map_texture */ + +/* ------------------------ 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_performance_query ---------------------- */ + +#ifndef GL_INTEL_performance_query +#define GL_INTEL_performance_query 1 + +#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x0000 +#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x0001 +#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 +#define GL_PERFQUERY_FLUSH_INTEL 0x83FA +#define GL_PERFQUERY_WAIT_INTEL 0x83FB +#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 +#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 +#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 +#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 +#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 +#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 +#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 +#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 +#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA +#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB +#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC +#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD +#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE +#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF +#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 + +typedef void (GLAPIENTRY * PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (GLAPIENTRY * PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint* queryHandle); +typedef void (GLAPIENTRY * PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (GLAPIENTRY * PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (GLAPIENTRY * PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint* queryId); +typedef void (GLAPIENTRY * PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint* nextQueryId); +typedef void (GLAPIENTRY * PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar* counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); +typedef void (GLAPIENTRY * PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); +typedef void (GLAPIENTRY * PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar* queryName, GLuint *queryId); +typedef void (GLAPIENTRY * PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar* queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); + +#define glBeginPerfQueryINTEL GLEW_GET_FUN(__glewBeginPerfQueryINTEL) +#define glCreatePerfQueryINTEL GLEW_GET_FUN(__glewCreatePerfQueryINTEL) +#define glDeletePerfQueryINTEL GLEW_GET_FUN(__glewDeletePerfQueryINTEL) +#define glEndPerfQueryINTEL GLEW_GET_FUN(__glewEndPerfQueryINTEL) +#define glGetFirstPerfQueryIdINTEL GLEW_GET_FUN(__glewGetFirstPerfQueryIdINTEL) +#define glGetNextPerfQueryIdINTEL GLEW_GET_FUN(__glewGetNextPerfQueryIdINTEL) +#define glGetPerfCounterInfoINTEL GLEW_GET_FUN(__glewGetPerfCounterInfoINTEL) +#define glGetPerfQueryDataINTEL GLEW_GET_FUN(__glewGetPerfQueryDataINTEL) +#define glGetPerfQueryIdByNameINTEL GLEW_GET_FUN(__glewGetPerfQueryIdByNameINTEL) +#define glGetPerfQueryInfoINTEL GLEW_GET_FUN(__glewGetPerfQueryInfoINTEL) + +#define GLEW_INTEL_performance_query GLEW_GET_VAR(__GLEW_INTEL_performance_query) + +#endif /* GL_INTEL_performance_query */ + +/* ------------------------ 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_KHR_blend_equation_advanced -------------------- */ + +#ifndef GL_KHR_blend_equation_advanced +#define GL_KHR_blend_equation_advanced 1 + +#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 +#define GL_MULTIPLY_KHR 0x9294 +#define GL_SCREEN_KHR 0x9295 +#define GL_OVERLAY_KHR 0x9296 +#define GL_DARKEN_KHR 0x9297 +#define GL_LIGHTEN_KHR 0x9298 +#define GL_COLORDODGE_KHR 0x9299 +#define GL_COLORBURN_KHR 0x929A +#define GL_HARDLIGHT_KHR 0x929B +#define GL_SOFTLIGHT_KHR 0x929C +#define GL_DIFFERENCE_KHR 0x929E +#define GL_EXCLUSION_KHR 0x92A0 +#define GL_HSL_HUE_KHR 0x92AD +#define GL_HSL_SATURATION_KHR 0x92AE +#define GL_HSL_COLOR_KHR 0x92AF +#define GL_HSL_LUMINOSITY_KHR 0x92B0 + +typedef void (GLAPIENTRY * PFNGLBLENDBARRIERKHRPROC) (void); + +#define glBlendBarrierKHR GLEW_GET_FUN(__glewBlendBarrierKHR) + +#define GLEW_KHR_blend_equation_advanced GLEW_GET_VAR(__GLEW_KHR_blend_equation_advanced) + +#endif /* GL_KHR_blend_equation_advanced */ + +/* ---------------- GL_KHR_blend_equation_advanced_coherent ---------------- */ + +#ifndef GL_KHR_blend_equation_advanced_coherent +#define GL_KHR_blend_equation_advanced_coherent 1 + +#define GLEW_KHR_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_KHR_blend_equation_advanced_coherent) + +#endif /* GL_KHR_blend_equation_advanced_coherent */ + +/* ---------------------- GL_KHR_context_flush_control --------------------- */ + +#ifndef GL_KHR_context_flush_control +#define GL_KHR_context_flush_control 1 + +#define GLEW_KHR_context_flush_control GLEW_GET_VAR(__GLEW_KHR_context_flush_control) + +#endif /* GL_KHR_context_flush_control */ + +/* ------------------------------ GL_KHR_debug ----------------------------- */ + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 + +#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D +#define GL_BUFFER 0x82E0 +#define GL_SHADER 0x82E1 +#define GL_PROGRAM 0x82E2 +#define GL_QUERY 0x82E3 +#define GL_PROGRAM_PIPELINE 0x82E4 +#define GL_SAMPLER 0x82E6 +#define GL_DISPLAY_LIST 0x82E7 +#define GL_MAX_LABEL_LENGTH 0x82E8 +#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES 0x9145 +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 +#define GL_DEBUG_OUTPUT 0x92E0 + +typedef void (GLAPIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPTRLABELPROC) (void* ptr, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLOBJECTPTRLABELPROC) (void* ptr, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLPOPDEBUGGROUPPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar * message); + +#define glDebugMessageCallback GLEW_GET_FUN(__glewDebugMessageCallback) +#define glDebugMessageControl GLEW_GET_FUN(__glewDebugMessageControl) +#define glDebugMessageInsert GLEW_GET_FUN(__glewDebugMessageInsert) +#define glGetDebugMessageLog GLEW_GET_FUN(__glewGetDebugMessageLog) +#define glGetObjectLabel GLEW_GET_FUN(__glewGetObjectLabel) +#define glGetObjectPtrLabel GLEW_GET_FUN(__glewGetObjectPtrLabel) +#define glObjectLabel GLEW_GET_FUN(__glewObjectLabel) +#define glObjectPtrLabel GLEW_GET_FUN(__glewObjectPtrLabel) +#define glPopDebugGroup GLEW_GET_FUN(__glewPopDebugGroup) +#define glPushDebugGroup GLEW_GET_FUN(__glewPushDebugGroup) + +#define GLEW_KHR_debug GLEW_GET_VAR(__GLEW_KHR_debug) + +#endif /* GL_KHR_debug */ + +/* ---------------------------- GL_KHR_no_error ---------------------------- */ + +#ifndef GL_KHR_no_error +#define GL_KHR_no_error 1 + +#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 + +#define GLEW_KHR_no_error GLEW_GET_VAR(__GLEW_KHR_no_error) + +#endif /* GL_KHR_no_error */ + +/* --------------------- GL_KHR_parallel_shader_compile -------------------- */ + +#ifndef GL_KHR_parallel_shader_compile +#define GL_KHR_parallel_shader_compile 1 + +#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0 +#define GL_COMPLETION_STATUS_KHR 0x91B1 + +typedef void (GLAPIENTRY * PFNGLMAXSHADERCOMPILERTHREADSKHRPROC) (GLuint count); + +#define glMaxShaderCompilerThreadsKHR GLEW_GET_FUN(__glewMaxShaderCompilerThreadsKHR) + +#define GLEW_KHR_parallel_shader_compile GLEW_GET_VAR(__GLEW_KHR_parallel_shader_compile) + +#endif /* GL_KHR_parallel_shader_compile */ + +/* ------------------ GL_KHR_robust_buffer_access_behavior ----------------- */ + +#ifndef GL_KHR_robust_buffer_access_behavior +#define GL_KHR_robust_buffer_access_behavior 1 + +#define GLEW_KHR_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_KHR_robust_buffer_access_behavior) + +#endif /* GL_KHR_robust_buffer_access_behavior */ + +/* --------------------------- GL_KHR_robustness --------------------------- */ + +#ifndef GL_KHR_robustness +#define GL_KHR_robustness 1 + +#define GL_CONTEXT_LOST 0x0507 +#define GL_LOSE_CONTEXT_ON_RESET 0x8252 +#define GL_GUILTY_CONTEXT_RESET 0x8253 +#define GL_INNOCENT_CONTEXT_RESET 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY 0x8256 +#define GL_NO_RESET_NOTIFICATION 0x8261 +#define GL_CONTEXT_ROBUST_ACCESS 0x90F3 + +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); +typedef void (GLAPIENTRY * PFNGLREADNPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); + +#define glGetnUniformfv GLEW_GET_FUN(__glewGetnUniformfv) +#define glGetnUniformiv GLEW_GET_FUN(__glewGetnUniformiv) +#define glGetnUniformuiv GLEW_GET_FUN(__glewGetnUniformuiv) +#define glReadnPixels GLEW_GET_FUN(__glewReadnPixels) + +#define GLEW_KHR_robustness GLEW_GET_VAR(__GLEW_KHR_robustness) + +#endif /* GL_KHR_robustness */ + +/* ------------------ GL_KHR_texture_compression_astc_hdr ------------------ */ + +#ifndef GL_KHR_texture_compression_astc_hdr +#define GL_KHR_texture_compression_astc_hdr 1 + +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD + +#define GLEW_KHR_texture_compression_astc_hdr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_hdr) + +#endif /* GL_KHR_texture_compression_astc_hdr */ + +/* ------------------ GL_KHR_texture_compression_astc_ldr ------------------ */ + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 + +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD + +#define GLEW_KHR_texture_compression_astc_ldr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_ldr) + +#endif /* GL_KHR_texture_compression_astc_ldr */ + +/* --------------- GL_KHR_texture_compression_astc_sliced_3d --------------- */ + +#ifndef GL_KHR_texture_compression_astc_sliced_3d +#define GL_KHR_texture_compression_astc_sliced_3d 1 + +#define GLEW_KHR_texture_compression_astc_sliced_3d GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_sliced_3d) + +#endif /* GL_KHR_texture_compression_astc_sliced_3d */ + +/* -------------------------- 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 * PFNGLBUFFERREGIONENABLEDPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); +typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled) +#define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion) +#define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion) +#define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion) +#define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion) + +#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_shader_integer_functions ------------------- */ + +#ifndef GL_MESA_shader_integer_functions +#define GL_MESA_shader_integer_functions 1 + +#define GLEW_MESA_shader_integer_functions GLEW_GET_VAR(__GLEW_MESA_shader_integer_functions) + +#endif /* GL_MESA_shader_integer_functions */ + +/* --------------------------- 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_blend_equation_advanced_multi_draw_buffers ----------- */ + +#ifndef GL_NVX_blend_equation_advanced_multi_draw_buffers +#define GL_NVX_blend_equation_advanced_multi_draw_buffers 1 + +#define GLEW_NVX_blend_equation_advanced_multi_draw_buffers GLEW_GET_VAR(__GLEW_NVX_blend_equation_advanced_multi_draw_buffers) + +#endif /* GL_NVX_blend_equation_advanced_multi_draw_buffers */ + +/* ----------------------- GL_NVX_conditional_render ----------------------- */ + +#ifndef GL_NVX_conditional_render +#define GL_NVX_conditional_render 1 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVXPROC) (void); + +#define glBeginConditionalRenderNVX GLEW_GET_FUN(__glewBeginConditionalRenderNVX) +#define glEndConditionalRenderNVX GLEW_GET_FUN(__glewEndConditionalRenderNVX) + +#define GLEW_NVX_conditional_render GLEW_GET_VAR(__GLEW_NVX_conditional_render) + +#endif /* GL_NVX_conditional_render */ + +/* ------------------------- 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_NVX_linked_gpu_multicast ---------------------- */ + +#ifndef GL_NVX_linked_gpu_multicast +#define GL_NVX_linked_gpu_multicast 1 + +#define GL_LGPU_SEPARATE_STORAGE_BIT_NVX 0x0800 +#define GL_MAX_LGPU_GPUS_NVX 0x92BA + +typedef void (GLAPIENTRY * PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLLGPUINTERLOCKNVXPROC) (void); +typedef void (GLAPIENTRY * PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); + +#define glLGPUCopyImageSubDataNVX GLEW_GET_FUN(__glewLGPUCopyImageSubDataNVX) +#define glLGPUInterlockNVX GLEW_GET_FUN(__glewLGPUInterlockNVX) +#define glLGPUNamedBufferSubDataNVX GLEW_GET_FUN(__glewLGPUNamedBufferSubDataNVX) + +#define GLEW_NVX_linked_gpu_multicast GLEW_GET_VAR(__GLEW_NVX_linked_gpu_multicast) + +#endif /* GL_NVX_linked_gpu_multicast */ + +/* ------------------------ GL_NV_3dvision_settings ------------------------ */ + +#ifndef GL_NV_3dvision_settings +#define GL_NV_3dvision_settings 1 + +#define GL_3DVISION_STEREO_NV 0x90F4 +#define GL_STEREO_SEPARATION_NV 0x90F5 +#define GL_STEREO_CONVERGENCE_NV 0x90F6 +#define GL_STEREO_CUTOFF_NV 0x90F7 +#define GL_STEREO_PROJECTION_NV 0x90F8 +#define GL_STEREO_PROJECTION_PERSPECTIVE_NV 0x90F9 +#define GL_STEREO_PROJECTION_ORTHO_NV 0x90FA + +typedef void (GLAPIENTRY * PFNGLSTEREOPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSTEREOPARAMETERINVPROC) (GLenum pname, GLint param); + +#define glStereoParameterfNV GLEW_GET_FUN(__glewStereoParameterfNV) +#define glStereoParameteriNV GLEW_GET_FUN(__glewStereoParameteriNV) + +#define GLEW_NV_3dvision_settings GLEW_GET_VAR(__GLEW_NV_3dvision_settings) + +#endif /* GL_NV_3dvision_settings */ + +/* ------------------- GL_NV_EGL_stream_consumer_external ------------------ */ + +#ifndef GL_NV_EGL_stream_consumer_external +#define GL_NV_EGL_stream_consumer_external 1 + +#define GL_TEXTURE_EXTERNAL_OES 0x8D65 +#define GL_SAMPLER_EXTERNAL_OES 0x8D66 +#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 +#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 + +#define GLEW_NV_EGL_stream_consumer_external GLEW_GET_VAR(__GLEW_NV_EGL_stream_consumer_external) + +#endif /* GL_NV_EGL_stream_consumer_external */ + +/* ----------------- GL_NV_alpha_to_coverage_dither_control ---------------- */ + +#ifndef GL_NV_alpha_to_coverage_dither_control +#define GL_NV_alpha_to_coverage_dither_control 1 + +#define GL_ALPHA_TO_COVERAGE_DITHER_MODE_NV 0x92BF +#define GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV 0x934D +#define GL_ALPHA_TO_COVERAGE_DITHER_ENABLE_NV 0x934E +#define GL_ALPHA_TO_COVERAGE_DITHER_DISABLE_NV 0x934F + +#define GLEW_NV_alpha_to_coverage_dither_control GLEW_GET_VAR(__GLEW_NV_alpha_to_coverage_dither_control) + +#endif /* GL_NV_alpha_to_coverage_dither_control */ + +/* ------------------------------- GL_NV_bgr ------------------------------- */ + +#ifndef GL_NV_bgr +#define GL_NV_bgr 1 + +#define GL_BGR_NV 0x80E0 + +#define GLEW_NV_bgr GLEW_GET_VAR(__GLEW_NV_bgr) + +#endif /* GL_NV_bgr */ + +/* ------------------- GL_NV_bindless_multi_draw_indirect ------------------ */ + +#ifndef GL_NV_bindless_multi_draw_indirect +#define GL_NV_bindless_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); + +#define glMultiDrawArraysIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessNV) +#define glMultiDrawElementsIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessNV) + +#define GLEW_NV_bindless_multi_draw_indirect GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect) + +#endif /* GL_NV_bindless_multi_draw_indirect */ + +/* ---------------- GL_NV_bindless_multi_draw_indirect_count --------------- */ + +#ifndef GL_NV_bindless_multi_draw_indirect_count +#define GL_NV_bindless_multi_draw_indirect_count 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, const void *indirect, GLintptr drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); + +#define glMultiDrawArraysIndirectBindlessCountNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessCountNV) +#define glMultiDrawElementsIndirectBindlessCountNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessCountNV) + +#define GLEW_NV_bindless_multi_draw_indirect_count GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect_count) + +#endif /* GL_NV_bindless_multi_draw_indirect_count */ + +/* ------------------------- GL_NV_bindless_texture ------------------------ */ + +#ifndef GL_NV_bindless_texture +#define GL_NV_bindless_texture 1 + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64* value); + +#define glGetImageHandleNV GLEW_GET_FUN(__glewGetImageHandleNV) +#define glGetTextureHandleNV GLEW_GET_FUN(__glewGetTextureHandleNV) +#define glGetTextureSamplerHandleNV GLEW_GET_FUN(__glewGetTextureSamplerHandleNV) +#define glIsImageHandleResidentNV GLEW_GET_FUN(__glewIsImageHandleResidentNV) +#define glIsTextureHandleResidentNV GLEW_GET_FUN(__glewIsTextureHandleResidentNV) +#define glMakeImageHandleNonResidentNV GLEW_GET_FUN(__glewMakeImageHandleNonResidentNV) +#define glMakeImageHandleResidentNV GLEW_GET_FUN(__glewMakeImageHandleResidentNV) +#define glMakeTextureHandleNonResidentNV GLEW_GET_FUN(__glewMakeTextureHandleNonResidentNV) +#define glMakeTextureHandleResidentNV GLEW_GET_FUN(__glewMakeTextureHandleResidentNV) +#define glProgramUniformHandleui64NV GLEW_GET_FUN(__glewProgramUniformHandleui64NV) +#define glProgramUniformHandleui64vNV GLEW_GET_FUN(__glewProgramUniformHandleui64vNV) +#define glUniformHandleui64NV GLEW_GET_FUN(__glewUniformHandleui64NV) +#define glUniformHandleui64vNV GLEW_GET_FUN(__glewUniformHandleui64vNV) + +#define GLEW_NV_bindless_texture GLEW_GET_VAR(__GLEW_NV_bindless_texture) + +#endif /* GL_NV_bindless_texture */ + +/* --------------------- GL_NV_blend_equation_advanced --------------------- */ + +#ifndef GL_NV_blend_equation_advanced +#define GL_NV_blend_equation_advanced 1 + +#define GL_XOR_NV 0x1506 +#define GL_RED_NV 0x1903 +#define GL_GREEN_NV 0x1904 +#define GL_BLUE_NV 0x1905 +#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 +#define GL_BLEND_OVERLAP_NV 0x9281 +#define GL_UNCORRELATED_NV 0x9282 +#define GL_DISJOINT_NV 0x9283 +#define GL_CONJOINT_NV 0x9284 +#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 +#define GL_SRC_NV 0x9286 +#define GL_DST_NV 0x9287 +#define GL_SRC_OVER_NV 0x9288 +#define GL_DST_OVER_NV 0x9289 +#define GL_SRC_IN_NV 0x928A +#define GL_DST_IN_NV 0x928B +#define GL_SRC_OUT_NV 0x928C +#define GL_DST_OUT_NV 0x928D +#define GL_SRC_ATOP_NV 0x928E +#define GL_DST_ATOP_NV 0x928F +#define GL_PLUS_NV 0x9291 +#define GL_PLUS_DARKER_NV 0x9292 +#define GL_MULTIPLY_NV 0x9294 +#define GL_SCREEN_NV 0x9295 +#define GL_OVERLAY_NV 0x9296 +#define GL_DARKEN_NV 0x9297 +#define GL_LIGHTEN_NV 0x9298 +#define GL_COLORDODGE_NV 0x9299 +#define GL_COLORBURN_NV 0x929A +#define GL_HARDLIGHT_NV 0x929B +#define GL_SOFTLIGHT_NV 0x929C +#define GL_DIFFERENCE_NV 0x929E +#define GL_MINUS_NV 0x929F +#define GL_EXCLUSION_NV 0x92A0 +#define GL_CONTRAST_NV 0x92A1 +#define GL_INVERT_RGB_NV 0x92A3 +#define GL_LINEARDODGE_NV 0x92A4 +#define GL_LINEARBURN_NV 0x92A5 +#define GL_VIVIDLIGHT_NV 0x92A6 +#define GL_LINEARLIGHT_NV 0x92A7 +#define GL_PINLIGHT_NV 0x92A8 +#define GL_HARDMIX_NV 0x92A9 +#define GL_HSL_HUE_NV 0x92AD +#define GL_HSL_SATURATION_NV 0x92AE +#define GL_HSL_COLOR_NV 0x92AF +#define GL_HSL_LUMINOSITY_NV 0x92B0 +#define GL_PLUS_CLAMPED_NV 0x92B1 +#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 +#define GL_MINUS_CLAMPED_NV 0x92B3 +#define GL_INVERT_OVG_NV 0x92B4 + +typedef void (GLAPIENTRY * PFNGLBLENDBARRIERNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); + +#define glBlendBarrierNV GLEW_GET_FUN(__glewBlendBarrierNV) +#define glBlendParameteriNV GLEW_GET_FUN(__glewBlendParameteriNV) + +#define GLEW_NV_blend_equation_advanced GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced) + +#endif /* GL_NV_blend_equation_advanced */ + +/* ----------------- GL_NV_blend_equation_advanced_coherent ---------------- */ + +#ifndef GL_NV_blend_equation_advanced_coherent +#define GL_NV_blend_equation_advanced_coherent 1 + +#define GLEW_NV_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced_coherent) + +#endif /* GL_NV_blend_equation_advanced_coherent */ + +/* ----------------------- GL_NV_blend_minmax_factor ----------------------- */ + +#ifndef GL_NV_blend_minmax_factor +#define GL_NV_blend_minmax_factor 1 + +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D + +#define GLEW_NV_blend_minmax_factor GLEW_GET_VAR(__GLEW_NV_blend_minmax_factor) + +#endif /* GL_NV_blend_minmax_factor */ + +/* --------------------------- 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_clip_space_w_scaling ---------------------- */ + +#ifndef GL_NV_clip_space_w_scaling +#define GL_NV_clip_space_w_scaling 1 + +#define GL_VIEWPORT_POSITION_W_SCALE_NV 0x937C +#define GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV 0x937D +#define GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV 0x937E + +typedef void (GLAPIENTRY * PFNGLVIEWPORTPOSITIONWSCALENVPROC) (GLuint index, GLfloat xcoeff, GLfloat ycoeff); + +#define glViewportPositionWScaleNV GLEW_GET_FUN(__glewViewportPositionWScaleNV) + +#define GLEW_NV_clip_space_w_scaling GLEW_GET_VAR(__GLEW_NV_clip_space_w_scaling) + +#endif /* GL_NV_clip_space_w_scaling */ + +/* --------------------------- GL_NV_command_list -------------------------- */ + +#ifndef GL_NV_command_list +#define GL_NV_command_list 1 + +#define GL_TERMINATE_SEQUENCE_COMMAND_NV 0x0000 +#define GL_NOP_COMMAND_NV 0x0001 +#define GL_DRAW_ELEMENTS_COMMAND_NV 0x0002 +#define GL_DRAW_ARRAYS_COMMAND_NV 0x0003 +#define GL_DRAW_ELEMENTS_STRIP_COMMAND_NV 0x0004 +#define GL_DRAW_ARRAYS_STRIP_COMMAND_NV 0x0005 +#define GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV 0x0006 +#define GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV 0x0007 +#define GL_ELEMENT_ADDRESS_COMMAND_NV 0x0008 +#define GL_ATTRIBUTE_ADDRESS_COMMAND_NV 0x0009 +#define GL_UNIFORM_ADDRESS_COMMAND_NV 0x000a +#define GL_BLEND_COLOR_COMMAND_NV 0x000b +#define GL_STENCIL_REF_COMMAND_NV 0x000c +#define GL_LINE_WIDTH_COMMAND_NV 0x000d +#define GL_POLYGON_OFFSET_COMMAND_NV 0x000e +#define GL_ALPHA_REF_COMMAND_NV 0x000f +#define GL_VIEWPORT_COMMAND_NV 0x0010 +#define GL_SCISSOR_COMMAND_NV 0x0011 +#define GL_FRONT_FACE_COMMAND_NV 0x0012 + +typedef void (GLAPIENTRY * PFNGLCALLCOMMANDLISTNVPROC) (GLuint list); +typedef void (GLAPIENTRY * PFNGLCOMMANDLISTSEGMENTSNVPROC) (GLuint list, GLuint segments); +typedef void (GLAPIENTRY * PFNGLCOMPILECOMMANDLISTNVPROC) (GLuint list); +typedef void (GLAPIENTRY * PFNGLCREATECOMMANDLISTSNVPROC) (GLsizei n, GLuint* lists); +typedef void (GLAPIENTRY * PFNGLCREATESTATESNVPROC) (GLsizei n, GLuint* states); +typedef void (GLAPIENTRY * PFNGLDELETECOMMANDLISTSNVPROC) (GLsizei n, const GLuint* lists); +typedef void (GLAPIENTRY * PFNGLDELETESTATESNVPROC) (GLsizei n, const GLuint* states); +typedef void (GLAPIENTRY * PFNGLDRAWCOMMANDSADDRESSNVPROC) (GLenum primitiveMode, const GLuint64* indirects, const GLsizei* sizes, GLuint count); +typedef void (GLAPIENTRY * PFNGLDRAWCOMMANDSNVPROC) (GLenum primitiveMode, GLuint buffer, const GLintptr* indirects, const GLsizei* sizes, GLuint count); +typedef void (GLAPIENTRY * PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC) (const GLuint64* indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); +typedef void (GLAPIENTRY * PFNGLDRAWCOMMANDSSTATESNVPROC) (GLuint buffer, const GLintptr* indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); +typedef GLuint (GLAPIENTRY * PFNGLGETCOMMANDHEADERNVPROC) (GLenum tokenID, GLuint size); +typedef GLushort (GLAPIENTRY * PFNGLGETSTAGEINDEXNVPROC) (GLenum shadertype); +typedef GLboolean (GLAPIENTRY * PFNGLISCOMMANDLISTNVPROC) (GLuint list); +typedef GLboolean (GLAPIENTRY * PFNGLISSTATENVPROC) (GLuint state); +typedef void (GLAPIENTRY * PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC) (GLuint list, GLuint segment, const void** indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); +typedef void (GLAPIENTRY * PFNGLSTATECAPTURENVPROC) (GLuint state, GLenum mode); + +#define glCallCommandListNV GLEW_GET_FUN(__glewCallCommandListNV) +#define glCommandListSegmentsNV GLEW_GET_FUN(__glewCommandListSegmentsNV) +#define glCompileCommandListNV GLEW_GET_FUN(__glewCompileCommandListNV) +#define glCreateCommandListsNV GLEW_GET_FUN(__glewCreateCommandListsNV) +#define glCreateStatesNV GLEW_GET_FUN(__glewCreateStatesNV) +#define glDeleteCommandListsNV GLEW_GET_FUN(__glewDeleteCommandListsNV) +#define glDeleteStatesNV GLEW_GET_FUN(__glewDeleteStatesNV) +#define glDrawCommandsAddressNV GLEW_GET_FUN(__glewDrawCommandsAddressNV) +#define glDrawCommandsNV GLEW_GET_FUN(__glewDrawCommandsNV) +#define glDrawCommandsStatesAddressNV GLEW_GET_FUN(__glewDrawCommandsStatesAddressNV) +#define glDrawCommandsStatesNV GLEW_GET_FUN(__glewDrawCommandsStatesNV) +#define glGetCommandHeaderNV GLEW_GET_FUN(__glewGetCommandHeaderNV) +#define glGetStageIndexNV GLEW_GET_FUN(__glewGetStageIndexNV) +#define glIsCommandListNV GLEW_GET_FUN(__glewIsCommandListNV) +#define glIsStateNV GLEW_GET_FUN(__glewIsStateNV) +#define glListDrawCommandsStatesClientNV GLEW_GET_FUN(__glewListDrawCommandsStatesClientNV) +#define glStateCaptureNV GLEW_GET_FUN(__glewStateCaptureNV) + +#define GLEW_NV_command_list GLEW_GET_VAR(__GLEW_NV_command_list) + +#endif /* GL_NV_command_list */ + +/* ------------------------- GL_NV_compute_program5 ------------------------ */ + +#ifndef GL_NV_compute_program5 +#define GL_NV_compute_program5 1 + +#define GL_COMPUTE_PROGRAM_NV 0x90FB +#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC + +#define GLEW_NV_compute_program5 GLEW_GET_VAR(__GLEW_NV_compute_program5) + +#endif /* GL_NV_compute_program5 */ + +/* ------------------------ 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_conservative_raster ----------------------- */ + +#ifndef GL_NV_conservative_raster +#define GL_NV_conservative_raster 1 + +#define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 +#define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 +#define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 +#define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 + +typedef void (GLAPIENTRY * PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits); + +#define glSubpixelPrecisionBiasNV GLEW_GET_FUN(__glewSubpixelPrecisionBiasNV) + +#define GLEW_NV_conservative_raster GLEW_GET_VAR(__GLEW_NV_conservative_raster) + +#endif /* GL_NV_conservative_raster */ + +/* -------------------- GL_NV_conservative_raster_dilate ------------------- */ + +#ifndef GL_NV_conservative_raster_dilate +#define GL_NV_conservative_raster_dilate 1 + +#define GL_CONSERVATIVE_RASTER_DILATE_NV 0x9379 +#define GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV 0x937A +#define GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV 0x937B + +typedef void (GLAPIENTRY * PFNGLCONSERVATIVERASTERPARAMETERFNVPROC) (GLenum pname, GLfloat value); + +#define glConservativeRasterParameterfNV GLEW_GET_FUN(__glewConservativeRasterParameterfNV) + +#define GLEW_NV_conservative_raster_dilate GLEW_GET_VAR(__GLEW_NV_conservative_raster_dilate) + +#endif /* GL_NV_conservative_raster_dilate */ + +/* -------------- GL_NV_conservative_raster_pre_snap_triangles ------------- */ + +#ifndef GL_NV_conservative_raster_pre_snap_triangles +#define GL_NV_conservative_raster_pre_snap_triangles 1 + +#define GL_CONSERVATIVE_RASTER_MODE_NV 0x954D +#define GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV 0x954E +#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV 0x954F + +typedef void (GLAPIENTRY * PFNGLCONSERVATIVERASTERPARAMETERINVPROC) (GLenum pname, GLint param); + +#define glConservativeRasterParameteriNV GLEW_GET_FUN(__glewConservativeRasterParameteriNV) + +#define GLEW_NV_conservative_raster_pre_snap_triangles GLEW_GET_VAR(__GLEW_NV_conservative_raster_pre_snap_triangles) + +#endif /* GL_NV_conservative_raster_pre_snap_triangles */ + +/* --------------------------- GL_NV_copy_buffer --------------------------- */ + +#ifndef GL_NV_copy_buffer +#define GL_NV_copy_buffer 1 + +#define GL_COPY_READ_BUFFER_NV 0x8F36 +#define GL_COPY_WRITE_BUFFER_NV 0x8F37 + +typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATANVPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); + +#define glCopyBufferSubDataNV GLEW_GET_FUN(__glewCopyBufferSubDataNV) + +#define GLEW_NV_copy_buffer GLEW_GET_VAR(__GLEW_NV_copy_buffer) + +#endif /* GL_NV_copy_buffer */ + +/* ----------------------- 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_deep_texture3D ------------------------- */ + +#ifndef GL_NV_deep_texture3D +#define GL_NV_deep_texture3D 1 + +#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 +#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 + +#define GLEW_NV_deep_texture3D GLEW_GET_VAR(__GLEW_NV_deep_texture3D) + +#endif /* GL_NV_deep_texture3D */ + +/* ------------------------ 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_draw_buffers -------------------------- */ + +#ifndef GL_NV_draw_buffers +#define GL_NV_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_NV 0x8824 +#define GL_DRAW_BUFFER0_NV 0x8825 +#define GL_DRAW_BUFFER1_NV 0x8826 +#define GL_DRAW_BUFFER2_NV 0x8827 +#define GL_DRAW_BUFFER3_NV 0x8828 +#define GL_DRAW_BUFFER4_NV 0x8829 +#define GL_DRAW_BUFFER5_NV 0x882A +#define GL_DRAW_BUFFER6_NV 0x882B +#define GL_DRAW_BUFFER7_NV 0x882C +#define GL_DRAW_BUFFER8_NV 0x882D +#define GL_DRAW_BUFFER9_NV 0x882E +#define GL_DRAW_BUFFER10_NV 0x882F +#define GL_DRAW_BUFFER11_NV 0x8830 +#define GL_DRAW_BUFFER12_NV 0x8831 +#define GL_DRAW_BUFFER13_NV 0x8832 +#define GL_DRAW_BUFFER14_NV 0x8833 +#define GL_DRAW_BUFFER15_NV 0x8834 +#define GL_COLOR_ATTACHMENT0_NV 0x8CE0 +#define GL_COLOR_ATTACHMENT1_NV 0x8CE1 +#define GL_COLOR_ATTACHMENT2_NV 0x8CE2 +#define GL_COLOR_ATTACHMENT3_NV 0x8CE3 +#define GL_COLOR_ATTACHMENT4_NV 0x8CE4 +#define GL_COLOR_ATTACHMENT5_NV 0x8CE5 +#define GL_COLOR_ATTACHMENT6_NV 0x8CE6 +#define GL_COLOR_ATTACHMENT7_NV 0x8CE7 +#define GL_COLOR_ATTACHMENT8_NV 0x8CE8 +#define GL_COLOR_ATTACHMENT9_NV 0x8CE9 +#define GL_COLOR_ATTACHMENT10_NV 0x8CEA +#define GL_COLOR_ATTACHMENT11_NV 0x8CEB +#define GL_COLOR_ATTACHMENT12_NV 0x8CEC +#define GL_COLOR_ATTACHMENT13_NV 0x8CED +#define GL_COLOR_ATTACHMENT14_NV 0x8CEE +#define GL_COLOR_ATTACHMENT15_NV 0x8CEF + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersNV GLEW_GET_FUN(__glewDrawBuffersNV) + +#define GLEW_NV_draw_buffers GLEW_GET_VAR(__GLEW_NV_draw_buffers) + +#endif /* GL_NV_draw_buffers */ + +/* -------------------------- GL_NV_draw_instanced ------------------------- */ + +#ifndef GL_NV_draw_instanced +#define GL_NV_draw_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); + +#define glDrawArraysInstancedNV GLEW_GET_FUN(__glewDrawArraysInstancedNV) +#define glDrawElementsInstancedNV GLEW_GET_FUN(__glewDrawElementsInstancedNV) + +#define GLEW_NV_draw_instanced GLEW_GET_VAR(__GLEW_NV_draw_instanced) + +#endif /* GL_NV_draw_instanced */ + +/* --------------------------- GL_NV_draw_texture -------------------------- */ + +#ifndef GL_NV_draw_texture +#define GL_NV_draw_texture 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); + +#define glDrawTextureNV GLEW_GET_FUN(__glewDrawTextureNV) + +#define GLEW_NV_draw_texture GLEW_GET_VAR(__GLEW_NV_draw_texture) + +#endif /* GL_NV_draw_texture */ + +/* ------------------------ GL_NV_draw_vulkan_image ------------------------ */ + +#ifndef GL_NV_draw_vulkan_image +#define GL_NV_draw_vulkan_image 1 + +typedef void (APIENTRY *GLVULKANPROCNV)(void); + +typedef void (GLAPIENTRY * PFNGLDRAWVKIMAGENVPROC) (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); +typedef GLVULKANPROCNV (GLAPIENTRY * PFNGLGETVKPROCADDRNVPROC) (const GLchar* name); +typedef void (GLAPIENTRY * PFNGLSIGNALVKFENCENVPROC) (GLuint64 vkFence); +typedef void (GLAPIENTRY * PFNGLSIGNALVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); +typedef void (GLAPIENTRY * PFNGLWAITVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); + +#define glDrawVkImageNV GLEW_GET_FUN(__glewDrawVkImageNV) +#define glGetVkProcAddrNV GLEW_GET_FUN(__glewGetVkProcAddrNV) +#define glSignalVkFenceNV GLEW_GET_FUN(__glewSignalVkFenceNV) +#define glSignalVkSemaphoreNV GLEW_GET_FUN(__glewSignalVkSemaphoreNV) +#define glWaitVkSemaphoreNV GLEW_GET_FUN(__glewWaitVkSemaphoreNV) + +#define GLEW_NV_draw_vulkan_image GLEW_GET_VAR(__GLEW_NV_draw_vulkan_image) + +#endif /* GL_NV_draw_vulkan_image */ + +/* ---------------------------- 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_attrib_location -------------------- */ + +#ifndef GL_NV_explicit_attrib_location +#define GL_NV_explicit_attrib_location 1 + +#define GLEW_NV_explicit_attrib_location GLEW_GET_VAR(__GLEW_NV_explicit_attrib_location) + +#endif /* GL_NV_explicit_attrib_location */ + +/* ----------------------- 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_fbo_color_attachments ---------------------- */ + +#ifndef GL_NV_fbo_color_attachments +#define GL_NV_fbo_color_attachments 1 + +#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF +#define GL_COLOR_ATTACHMENT0_NV 0x8CE0 +#define GL_COLOR_ATTACHMENT1_NV 0x8CE1 +#define GL_COLOR_ATTACHMENT2_NV 0x8CE2 +#define GL_COLOR_ATTACHMENT3_NV 0x8CE3 +#define GL_COLOR_ATTACHMENT4_NV 0x8CE4 +#define GL_COLOR_ATTACHMENT5_NV 0x8CE5 +#define GL_COLOR_ATTACHMENT6_NV 0x8CE6 +#define GL_COLOR_ATTACHMENT7_NV 0x8CE7 +#define GL_COLOR_ATTACHMENT8_NV 0x8CE8 +#define GL_COLOR_ATTACHMENT9_NV 0x8CE9 +#define GL_COLOR_ATTACHMENT10_NV 0x8CEA +#define GL_COLOR_ATTACHMENT11_NV 0x8CEB +#define GL_COLOR_ATTACHMENT12_NV 0x8CEC +#define GL_COLOR_ATTACHMENT13_NV 0x8CED +#define GL_COLOR_ATTACHMENT14_NV 0x8CEE +#define GL_COLOR_ATTACHMENT15_NV 0x8CEF + +#define GLEW_NV_fbo_color_attachments GLEW_GET_VAR(__GLEW_NV_fbo_color_attachments) + +#endif /* GL_NV_fbo_color_attachments */ + +/* ------------------------------ 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_fill_rectangle ------------------------- */ + +#ifndef GL_NV_fill_rectangle +#define GL_NV_fill_rectangle 1 + +#define GL_FILL_RECTANGLE_NV 0x933C + +#define GLEW_NV_fill_rectangle GLEW_GET_VAR(__GLEW_NV_fill_rectangle) + +#endif /* GL_NV_fill_rectangle */ + +/* --------------------------- 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_coverage_to_color ------------------- */ + +#ifndef GL_NV_fragment_coverage_to_color +#define GL_NV_fragment_coverage_to_color 1 + +#define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD +#define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOVERAGECOLORNVPROC) (GLuint color); + +#define glFragmentCoverageColorNV GLEW_GET_FUN(__glewFragmentCoverageColorNV) + +#define GLEW_NV_fragment_coverage_to_color GLEW_GET_VAR(__GLEW_NV_fragment_coverage_to_color) + +#endif /* GL_NV_fragment_coverage_to_color */ + +/* ------------------------- 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_fragment_shader_interlock -------------------- */ + +#ifndef GL_NV_fragment_shader_interlock +#define GL_NV_fragment_shader_interlock 1 + +#define GLEW_NV_fragment_shader_interlock GLEW_GET_VAR(__GLEW_NV_fragment_shader_interlock) + +#endif /* GL_NV_fragment_shader_interlock */ + +/* ------------------------- GL_NV_framebuffer_blit ------------------------ */ + +#ifndef GL_NV_framebuffer_blit +#define GL_NV_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6 +#define GL_READ_FRAMEBUFFER_NV 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_NV 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferNV GLEW_GET_FUN(__glewBlitFramebufferNV) + +#define GLEW_NV_framebuffer_blit GLEW_GET_VAR(__GLEW_NV_framebuffer_blit) + +#endif /* GL_NV_framebuffer_blit */ + +/* -------------------- GL_NV_framebuffer_mixed_samples -------------------- */ + +#ifndef GL_NV_framebuffer_mixed_samples +#define GL_NV_framebuffer_mixed_samples 1 + +#define GL_COLOR_SAMPLES_NV 0x8E20 +#define GL_RASTER_MULTISAMPLE_EXT 0x9327 +#define GL_RASTER_SAMPLES_EXT 0x9328 +#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 +#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A +#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B +#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C +#define GL_DEPTH_SAMPLES_NV 0x932D +#define GL_STENCIL_SAMPLES_NV 0x932E +#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F +#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 +#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 +#define GL_COVERAGE_MODULATION_NV 0x9332 +#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 + +#define GLEW_NV_framebuffer_mixed_samples GLEW_GET_VAR(__GLEW_NV_framebuffer_mixed_samples) + +#endif /* GL_NV_framebuffer_mixed_samples */ + +/* --------------------- GL_NV_framebuffer_multisample --------------------- */ + +#ifndef GL_NV_framebuffer_multisample +#define GL_NV_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_NV 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56 +#define GL_MAX_SAMPLES_NV 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleNV) + +#define GLEW_NV_framebuffer_multisample GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample) + +#endif /* GL_NV_framebuffer_multisample */ + +/* ----------------- 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_generate_mipmap_sRGB ---------------------- */ + +#ifndef GL_NV_generate_mipmap_sRGB +#define GL_NV_generate_mipmap_sRGB 1 + +#define GLEW_NV_generate_mipmap_sRGB GLEW_GET_VAR(__GLEW_NV_generate_mipmap_sRGB) + +#endif /* GL_NV_generate_mipmap_sRGB */ + +/* ------------------------ 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_geometry_shader_passthrough ------------------- */ + +#ifndef GL_NV_geometry_shader_passthrough +#define GL_NV_geometry_shader_passthrough 1 + +#define GLEW_NV_geometry_shader_passthrough GLEW_GET_VAR(__GLEW_NV_geometry_shader_passthrough) + +#endif /* GL_NV_geometry_shader_passthrough */ + +/* -------------------------- GL_NV_gpu_multicast -------------------------- */ + +#ifndef GL_NV_gpu_multicast +#define GL_NV_gpu_multicast 1 + +#define GL_PER_GPU_STORAGE_BIT_NV 0x0800 +#define GL_MULTICAST_GPUS_NV 0x92BA +#define GL_PER_GPU_STORAGE_NV 0x9548 +#define GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9549 +#define GL_RENDER_GPU_MASK_NV 0x9558 + +typedef void (GLAPIENTRY * PFNGLMULTICASTBARRIERNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (GLAPIENTRY * PFNGLMULTICASTBUFFERSUBDATANVPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (GLAPIENTRY * PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGpu, GLbitfield dstGpuMask, 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 srcWidth, GLsizei srcHeight, GLsizei srcDepth); +typedef void (GLAPIENTRY * PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLMULTICASTGETQUERYOBJECTIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGpu, GLbitfield waitGpuMask); +typedef void (GLAPIENTRY * PFNGLRENDERGPUMASKNVPROC) (GLbitfield mask); + +#define glMulticastBarrierNV GLEW_GET_FUN(__glewMulticastBarrierNV) +#define glMulticastBlitFramebufferNV GLEW_GET_FUN(__glewMulticastBlitFramebufferNV) +#define glMulticastBufferSubDataNV GLEW_GET_FUN(__glewMulticastBufferSubDataNV) +#define glMulticastCopyBufferSubDataNV GLEW_GET_FUN(__glewMulticastCopyBufferSubDataNV) +#define glMulticastCopyImageSubDataNV GLEW_GET_FUN(__glewMulticastCopyImageSubDataNV) +#define glMulticastFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewMulticastFramebufferSampleLocationsfvNV) +#define glMulticastGetQueryObjecti64vNV GLEW_GET_FUN(__glewMulticastGetQueryObjecti64vNV) +#define glMulticastGetQueryObjectivNV GLEW_GET_FUN(__glewMulticastGetQueryObjectivNV) +#define glMulticastGetQueryObjectui64vNV GLEW_GET_FUN(__glewMulticastGetQueryObjectui64vNV) +#define glMulticastGetQueryObjectuivNV GLEW_GET_FUN(__glewMulticastGetQueryObjectuivNV) +#define glMulticastWaitSyncNV GLEW_GET_FUN(__glewMulticastWaitSyncNV) +#define glRenderGpuMaskNV GLEW_GET_FUN(__glewRenderGpuMaskNV) + +#define GLEW_NV_gpu_multicast GLEW_GET_VAR(__GLEW_NV_gpu_multicast) + +#endif /* GL_NV_gpu_multicast */ + +/* --------------------------- 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_program5_mem_extended -------------------- */ + +#ifndef GL_NV_gpu_program5_mem_extended +#define GL_NV_gpu_program5_mem_extended 1 + +#define GLEW_NV_gpu_program5_mem_extended GLEW_GET_VAR(__GLEW_NV_gpu_program5_mem_extended) + +#endif /* GL_NV_gpu_program5_mem_extended */ + +/* ------------------------- 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_image_formats -------------------------- */ + +#ifndef GL_NV_image_formats +#define GL_NV_image_formats 1 + +#define GLEW_NV_image_formats GLEW_GET_VAR(__GLEW_NV_image_formats) + +#endif /* GL_NV_image_formats */ + +/* ------------------------- GL_NV_instanced_arrays ------------------------ */ + +#ifndef GL_NV_instanced_arrays +#define GL_NV_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisorNV GLEW_GET_FUN(__glewVertexAttribDivisorNV) + +#define GLEW_NV_instanced_arrays GLEW_GET_VAR(__GLEW_NV_instanced_arrays) + +#endif /* GL_NV_instanced_arrays */ + +/* ------------------- GL_NV_internalformat_sample_query ------------------- */ + +#ifndef GL_NV_internalformat_sample_query +#define GL_NV_internalformat_sample_query 1 + +#define GL_MULTISAMPLES_NV 0x9371 +#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 +#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 +#define GL_CONFORMANT_NV 0x9374 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint* params); + +#define glGetInternalformatSampleivNV GLEW_GET_FUN(__glewGetInternalformatSampleivNV) + +#define GLEW_NV_internalformat_sample_query GLEW_GET_VAR(__GLEW_NV_internalformat_sample_query) + +#endif /* GL_NV_internalformat_sample_query */ + +/* ------------------------ 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_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_non_square_matrices ----------------------- */ + +#ifndef GL_NV_non_square_matrices +#define GL_NV_non_square_matrices 1 + +#define GL_FLOAT_MAT2x3_NV 0x8B65 +#define GL_FLOAT_MAT2x4_NV 0x8B66 +#define GL_FLOAT_MAT3x2_NV 0x8B67 +#define GL_FLOAT_MAT3x4_NV 0x8B68 +#define GL_FLOAT_MAT4x2_NV 0x8B69 +#define GL_FLOAT_MAT4x3_NV 0x8B6A + +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); + +#define glUniformMatrix2x3fvNV GLEW_GET_FUN(__glewUniformMatrix2x3fvNV) +#define glUniformMatrix2x4fvNV GLEW_GET_FUN(__glewUniformMatrix2x4fvNV) +#define glUniformMatrix3x2fvNV GLEW_GET_FUN(__glewUniformMatrix3x2fvNV) +#define glUniformMatrix3x4fvNV GLEW_GET_FUN(__glewUniformMatrix3x4fvNV) +#define glUniformMatrix4x2fvNV GLEW_GET_FUN(__glewUniformMatrix4x2fvNV) +#define glUniformMatrix4x3fvNV GLEW_GET_FUN(__glewUniformMatrix4x3fvNV) + +#define GLEW_NV_non_square_matrices GLEW_GET_VAR(__GLEW_NV_non_square_matrices) + +#endif /* GL_NV_non_square_matrices */ + +/* ------------------------- 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_pack_subimage -------------------------- */ + +#ifndef GL_NV_pack_subimage +#define GL_NV_pack_subimage 1 + +#define GL_PACK_ROW_LENGTH_NV 0x0D02 +#define GL_PACK_SKIP_ROWS_NV 0x0D03 +#define GL_PACK_SKIP_PIXELS_NV 0x0D04 + +#define GLEW_NV_pack_subimage GLEW_GET_VAR(__GLEW_NV_pack_subimage) + +#endif /* GL_NV_pack_subimage */ + +/* ----------------------- 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_packed_float -------------------------- */ + +#ifndef GL_NV_packed_float +#define GL_NV_packed_float 1 + +#define GL_R11F_G11F_B10F_NV 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_NV 0x8C3B + +#define GLEW_NV_packed_float GLEW_GET_VAR(__GLEW_NV_packed_float) + +#endif /* GL_NV_packed_float */ + +/* ----------------------- GL_NV_packed_float_linear ----------------------- */ + +#ifndef GL_NV_packed_float_linear +#define GL_NV_packed_float_linear 1 + +#define GL_R11F_G11F_B10F_NV 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_NV 0x8C3B + +#define GLEW_NV_packed_float_linear GLEW_GET_VAR(__GLEW_NV_packed_float_linear) + +#endif /* GL_NV_packed_float_linear */ + +/* --------------------- 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_path_rendering ------------------------- */ + +#ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 + +#define GL_CLOSE_PATH_NV 0x00 +#define GL_BOLD_BIT_NV 0x01 +#define GL_GLYPH_WIDTH_BIT_NV 0x01 +#define GL_GLYPH_HEIGHT_BIT_NV 0x02 +#define GL_ITALIC_BIT_NV 0x02 +#define GL_MOVE_TO_NV 0x02 +#define GL_RELATIVE_MOVE_TO_NV 0x03 +#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 +#define GL_LINE_TO_NV 0x04 +#define GL_RELATIVE_LINE_TO_NV 0x05 +#define GL_HORIZONTAL_LINE_TO_NV 0x06 +#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 +#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 +#define GL_VERTICAL_LINE_TO_NV 0x08 +#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 +#define GL_QUADRATIC_CURVE_TO_NV 0x0A +#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B +#define GL_CUBIC_CURVE_TO_NV 0x0C +#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D +#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E +#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F +#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 +#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 +#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 +#define GL_SMALL_CCW_ARC_TO_NV 0x12 +#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 +#define GL_SMALL_CW_ARC_TO_NV 0x14 +#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 +#define GL_LARGE_CCW_ARC_TO_NV 0x16 +#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 +#define GL_LARGE_CW_ARC_TO_NV 0x18 +#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 +#define GL_CONIC_CURVE_TO_NV 0x1A +#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B +#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 +#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 +#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 +#define GL_ROUNDED_RECT_NV 0xE8 +#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 +#define GL_ROUNDED_RECT2_NV 0xEA +#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB +#define GL_ROUNDED_RECT4_NV 0xEC +#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED +#define GL_ROUNDED_RECT8_NV 0xEE +#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF +#define GL_RESTART_PATH_NV 0xF0 +#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 +#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 +#define GL_RECT_NV 0xF6 +#define GL_RELATIVE_RECT_NV 0xF7 +#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 +#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA +#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC +#define GL_ARC_TO_NV 0xFE +#define GL_RELATIVE_ARC_TO_NV 0xFF +#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PATH_FORMAT_SVG_NV 0x9070 +#define GL_PATH_FORMAT_PS_NV 0x9071 +#define GL_STANDARD_FONT_NAME_NV 0x9072 +#define GL_SYSTEM_FONT_NAME_NV 0x9073 +#define GL_FILE_NAME_NV 0x9074 +#define GL_PATH_STROKE_WIDTH_NV 0x9075 +#define GL_PATH_END_CAPS_NV 0x9076 +#define GL_PATH_INITIAL_END_CAP_NV 0x9077 +#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 +#define GL_PATH_JOIN_STYLE_NV 0x9079 +#define GL_PATH_MITER_LIMIT_NV 0x907A +#define GL_PATH_DASH_CAPS_NV 0x907B +#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C +#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D +#define GL_PATH_DASH_OFFSET_NV 0x907E +#define GL_PATH_CLIENT_LENGTH_NV 0x907F +#define GL_PATH_FILL_MODE_NV 0x9080 +#define GL_PATH_FILL_MASK_NV 0x9081 +#define GL_PATH_FILL_COVER_MODE_NV 0x9082 +#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 +#define GL_PATH_STROKE_MASK_NV 0x9084 +#define GL_PATH_STROKE_BOUND_NV 0x9086 +#define GL_COUNT_UP_NV 0x9088 +#define GL_COUNT_DOWN_NV 0x9089 +#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A +#define GL_CONVEX_HULL_NV 0x908B +#define GL_BOUNDING_BOX_NV 0x908D +#define GL_TRANSLATE_X_NV 0x908E +#define GL_TRANSLATE_Y_NV 0x908F +#define GL_TRANSLATE_2D_NV 0x9090 +#define GL_TRANSLATE_3D_NV 0x9091 +#define GL_AFFINE_2D_NV 0x9092 +#define GL_AFFINE_3D_NV 0x9094 +#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 +#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 +#define GL_UTF8_NV 0x909A +#define GL_UTF16_NV 0x909B +#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C +#define GL_PATH_COMMAND_COUNT_NV 0x909D +#define GL_PATH_COORD_COUNT_NV 0x909E +#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F +#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 +#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 +#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 +#define GL_SQUARE_NV 0x90A3 +#define GL_ROUND_NV 0x90A4 +#define GL_TRIANGULAR_NV 0x90A5 +#define GL_BEVEL_NV 0x90A6 +#define GL_MITER_REVERT_NV 0x90A7 +#define GL_MITER_TRUNCATE_NV 0x90A8 +#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 +#define GL_USE_MISSING_GLYPH_NV 0x90AA +#define GL_PATH_ERROR_POSITION_NV 0x90AB +#define GL_PATH_FOG_GEN_MODE_NV 0x90AC +#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD +#define GL_ADJACENT_PAIRS_NV 0x90AE +#define GL_FIRST_TO_REST_NV 0x90AF +#define GL_PATH_GEN_MODE_NV 0x90B0 +#define GL_PATH_GEN_COEFF_NV 0x90B1 +#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 +#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 +#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 +#define GL_MOVE_TO_RESETS_NV 0x90B5 +#define GL_MOVE_TO_CONTINUES_NV 0x90B6 +#define GL_PATH_STENCIL_FUNC_NV 0x90B7 +#define GL_PATH_STENCIL_REF_NV 0x90B8 +#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 +#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD +#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE +#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF +#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 +#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 +#define GL_FONT_UNAVAILABLE_NV 0x936A +#define GL_FONT_UNINTELLIGIBLE_NV 0x936B +#define GL_STANDARD_FONT_FORMAT_NV 0x936C +#define GL_FRAGMENT_INPUT_NV 0x936D +#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 +#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 +#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 +#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 +#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 +#define GL_FONT_ASCENDER_BIT_NV 0x00200000 +#define GL_FONT_DESCENDER_BIT_NV 0x00400000 +#define GL_FONT_HEIGHT_BIT_NV 0x00800000 +#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 +#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 +#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 +#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 +#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 +#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 + +typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); +typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte* commands); +typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat* coords); +typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat* dashArray); +typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); +typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void*coords); +typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc); +typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray); +typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode); +typedef GLenum (GLAPIENTRY * PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef GLenum (GLAPIENTRY * PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef GLenum (GLAPIENTRY * PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void*coords); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); +typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +typedef void (GLAPIENTRY * PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat* coeffs); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); +typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]); + +#define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV) +#define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV) +#define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV) +#define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV) +#define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV) +#define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV) +#define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV) +#define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV) +#define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV) +#define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV) +#define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV) +#define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV) +#define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV) +#define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV) +#define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV) +#define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV) +#define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV) +#define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV) +#define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV) +#define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV) +#define glGetProgramResourcefvNV GLEW_GET_FUN(__glewGetProgramResourcefvNV) +#define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV) +#define glIsPathNV GLEW_GET_FUN(__glewIsPathNV) +#define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV) +#define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV) +#define glMatrixLoad3x2fNV GLEW_GET_FUN(__glewMatrixLoad3x2fNV) +#define glMatrixLoad3x3fNV GLEW_GET_FUN(__glewMatrixLoad3x3fNV) +#define glMatrixLoadTranspose3x3fNV GLEW_GET_FUN(__glewMatrixLoadTranspose3x3fNV) +#define glMatrixMult3x2fNV GLEW_GET_FUN(__glewMatrixMult3x2fNV) +#define glMatrixMult3x3fNV GLEW_GET_FUN(__glewMatrixMult3x3fNV) +#define glMatrixMultTranspose3x3fNV GLEW_GET_FUN(__glewMatrixMultTranspose3x3fNV) +#define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV) +#define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV) +#define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV) +#define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV) +#define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV) +#define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV) +#define glPathGlyphIndexArrayNV GLEW_GET_FUN(__glewPathGlyphIndexArrayNV) +#define glPathGlyphIndexRangeNV GLEW_GET_FUN(__glewPathGlyphIndexRangeNV) +#define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV) +#define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV) +#define glPathMemoryGlyphIndexArrayNV GLEW_GET_FUN(__glewPathMemoryGlyphIndexArrayNV) +#define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV) +#define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV) +#define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV) +#define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV) +#define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV) +#define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV) +#define glPathStringNV GLEW_GET_FUN(__glewPathStringNV) +#define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV) +#define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV) +#define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV) +#define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV) +#define glProgramPathFragmentInputGenNV GLEW_GET_FUN(__glewProgramPathFragmentInputGenNV) +#define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV) +#define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV) +#define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV) +#define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV) +#define glStencilThenCoverFillPathInstancedNV GLEW_GET_FUN(__glewStencilThenCoverFillPathInstancedNV) +#define glStencilThenCoverFillPathNV GLEW_GET_FUN(__glewStencilThenCoverFillPathNV) +#define glStencilThenCoverStrokePathInstancedNV GLEW_GET_FUN(__glewStencilThenCoverStrokePathInstancedNV) +#define glStencilThenCoverStrokePathNV GLEW_GET_FUN(__glewStencilThenCoverStrokePathNV) +#define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV) +#define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV) + +#define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering) + +#endif /* GL_NV_path_rendering */ + +/* -------------------- GL_NV_path_rendering_shared_edge ------------------- */ + +#ifndef GL_NV_path_rendering_shared_edge +#define GL_NV_path_rendering_shared_edge 1 + +#define GL_SHARED_EDGE_NV 0xC0 + +#define GLEW_NV_path_rendering_shared_edge GLEW_GET_VAR(__GLEW_NV_path_rendering_shared_edge) + +#endif /* GL_NV_path_rendering_shared_edge */ + +/* ----------------------- GL_NV_pixel_buffer_object ----------------------- */ + +#ifndef GL_NV_pixel_buffer_object +#define GL_NV_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_NV 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_NV 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_NV 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_NV 0x88EF + +#define GLEW_NV_pixel_buffer_object GLEW_GET_VAR(__GLEW_NV_pixel_buffer_object) + +#endif /* GL_NV_pixel_buffer_object */ + +/* ------------------------- 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_platform_binary ------------------------- */ + +#ifndef GL_NV_platform_binary +#define GL_NV_platform_binary 1 + +#define GL_NVIDIA_PLATFORM_BINARY_NV 0x890B + +#define GLEW_NV_platform_binary GLEW_GET_VAR(__GLEW_NV_platform_binary) + +#endif /* GL_NV_platform_binary */ + +/* --------------------------- 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_polygon_mode -------------------------- */ + +#ifndef GL_NV_polygon_mode +#define GL_NV_polygon_mode 1 + +#define GL_POLYGON_MODE_NV 0x0B40 +#define GL_POINT_NV 0x1B00 +#define GL_LINE_NV 0x1B01 +#define GL_FILL_NV 0x1B02 +#define GL_POLYGON_OFFSET_POINT_NV 0x2A01 +#define GL_POLYGON_OFFSET_LINE_NV 0x2A02 + +typedef void (GLAPIENTRY * PFNGLPOLYGONMODENVPROC) (GLenum face, GLenum mode); + +#define glPolygonModeNV GLEW_GET_FUN(__glewPolygonModeNV) + +#define GLEW_NV_polygon_mode GLEW_GET_VAR(__GLEW_NV_polygon_mode) + +#endif /* GL_NV_polygon_mode */ + +/* -------------------------- 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_read_depth --------------------------- */ + +#ifndef GL_NV_read_depth +#define GL_NV_read_depth 1 + +#define GLEW_NV_read_depth GLEW_GET_VAR(__GLEW_NV_read_depth) + +#endif /* GL_NV_read_depth */ + +/* ------------------------ GL_NV_read_depth_stencil ----------------------- */ + +#ifndef GL_NV_read_depth_stencil +#define GL_NV_read_depth_stencil 1 + +#define GLEW_NV_read_depth_stencil GLEW_GET_VAR(__GLEW_NV_read_depth_stencil) + +#endif /* GL_NV_read_depth_stencil */ + +/* --------------------------- GL_NV_read_stencil -------------------------- */ + +#ifndef GL_NV_read_stencil +#define GL_NV_read_stencil 1 + +#define GLEW_NV_read_stencil GLEW_GET_VAR(__GLEW_NV_read_stencil) + +#endif /* GL_NV_read_stencil */ + +/* ------------------------ 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_robustness_video_memory_purge ------------------ */ + +#ifndef GL_NV_robustness_video_memory_purge +#define GL_NV_robustness_video_memory_purge 1 + +#define GL_EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C +#define GL_PURGED_CONTEXT_RESET_NV 0x92BB + +#define GLEW_NV_robustness_video_memory_purge GLEW_GET_VAR(__GLEW_NV_robustness_video_memory_purge) + +#endif /* GL_NV_robustness_video_memory_purge */ + +/* --------------------------- GL_NV_sRGB_formats -------------------------- */ + +#ifndef GL_NV_sRGB_formats +#define GL_NV_sRGB_formats 1 + +#define GL_ETC1_SRGB8_NV 0x88EE +#define GL_SRGB8_NV 0x8C41 +#define GL_SLUMINANCE_ALPHA_NV 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_NV 0x8C45 +#define GL_SLUMINANCE_NV 0x8C46 +#define GL_SLUMINANCE8_NV 0x8C47 +#define GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F + +#define GLEW_NV_sRGB_formats GLEW_GET_VAR(__GLEW_NV_sRGB_formats) + +#endif /* GL_NV_sRGB_formats */ + +/* ------------------------- GL_NV_sample_locations ------------------------ */ + +#ifndef GL_NV_sample_locations +#define GL_NV_sample_locations 1 + +#define GL_SAMPLE_LOCATION_NV 0x8E50 +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); + +#define glFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewFramebufferSampleLocationsfvNV) +#define glNamedFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewNamedFramebufferSampleLocationsfvNV) + +#define GLEW_NV_sample_locations GLEW_GET_VAR(__GLEW_NV_sample_locations) + +#endif /* GL_NV_sample_locations */ + +/* ------------------ GL_NV_sample_mask_override_coverage ------------------ */ + +#ifndef GL_NV_sample_mask_override_coverage +#define GL_NV_sample_mask_override_coverage 1 + +#define GLEW_NV_sample_mask_override_coverage GLEW_GET_VAR(__GLEW_NV_sample_mask_override_coverage) + +#endif /* GL_NV_sample_mask_override_coverage */ + +/* ---------------------- GL_NV_shader_atomic_counters --------------------- */ + +#ifndef GL_NV_shader_atomic_counters +#define GL_NV_shader_atomic_counters 1 + +#define GLEW_NV_shader_atomic_counters GLEW_GET_VAR(__GLEW_NV_shader_atomic_counters) + +#endif /* GL_NV_shader_atomic_counters */ + +/* ----------------------- GL_NV_shader_atomic_float ----------------------- */ + +#ifndef GL_NV_shader_atomic_float +#define GL_NV_shader_atomic_float 1 + +#define GLEW_NV_shader_atomic_float GLEW_GET_VAR(__GLEW_NV_shader_atomic_float) + +#endif /* GL_NV_shader_atomic_float */ + +/* ---------------------- GL_NV_shader_atomic_float64 ---------------------- */ + +#ifndef GL_NV_shader_atomic_float64 +#define GL_NV_shader_atomic_float64 1 + +#define GLEW_NV_shader_atomic_float64 GLEW_GET_VAR(__GLEW_NV_shader_atomic_float64) + +#endif /* GL_NV_shader_atomic_float64 */ + +/* -------------------- GL_NV_shader_atomic_fp16_vector -------------------- */ + +#ifndef GL_NV_shader_atomic_fp16_vector +#define GL_NV_shader_atomic_fp16_vector 1 + +#define GLEW_NV_shader_atomic_fp16_vector GLEW_GET_VAR(__GLEW_NV_shader_atomic_fp16_vector) + +#endif /* GL_NV_shader_atomic_fp16_vector */ + +/* ----------------------- GL_NV_shader_atomic_int64 ----------------------- */ + +#ifndef GL_NV_shader_atomic_int64 +#define GL_NV_shader_atomic_int64 1 + +#define GLEW_NV_shader_atomic_int64 GLEW_GET_VAR(__GLEW_NV_shader_atomic_int64) + +#endif /* GL_NV_shader_atomic_int64 */ + +/* ------------------------ 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_shader_noperspective_interpolation --------------- */ + +#ifndef GL_NV_shader_noperspective_interpolation +#define GL_NV_shader_noperspective_interpolation 1 + +#define GLEW_NV_shader_noperspective_interpolation GLEW_GET_VAR(__GLEW_NV_shader_noperspective_interpolation) + +#endif /* GL_NV_shader_noperspective_interpolation */ + +/* ------------------- GL_NV_shader_storage_buffer_object ------------------ */ + +#ifndef GL_NV_shader_storage_buffer_object +#define GL_NV_shader_storage_buffer_object 1 + +#define GLEW_NV_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_NV_shader_storage_buffer_object) + +#endif /* GL_NV_shader_storage_buffer_object */ + +/* ----------------------- GL_NV_shader_thread_group ----------------------- */ + +#ifndef GL_NV_shader_thread_group +#define GL_NV_shader_thread_group 1 + +#define GL_WARP_SIZE_NV 0x9339 +#define GL_WARPS_PER_SM_NV 0x933A +#define GL_SM_COUNT_NV 0x933B + +#define GLEW_NV_shader_thread_group GLEW_GET_VAR(__GLEW_NV_shader_thread_group) + +#endif /* GL_NV_shader_thread_group */ + +/* ---------------------- GL_NV_shader_thread_shuffle ---------------------- */ + +#ifndef GL_NV_shader_thread_shuffle +#define GL_NV_shader_thread_shuffle 1 + +#define GLEW_NV_shader_thread_shuffle GLEW_GET_VAR(__GLEW_NV_shader_thread_shuffle) + +#endif /* GL_NV_shader_thread_shuffle */ + +/* ---------------------- GL_NV_shadow_samplers_array ---------------------- */ + +#ifndef GL_NV_shadow_samplers_array +#define GL_NV_shadow_samplers_array 1 + +#define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 + +#define GLEW_NV_shadow_samplers_array GLEW_GET_VAR(__GLEW_NV_shadow_samplers_array) + +#endif /* GL_NV_shadow_samplers_array */ + +/* ----------------------- GL_NV_shadow_samplers_cube ---------------------- */ + +#ifndef GL_NV_shadow_samplers_cube +#define GL_NV_shadow_samplers_cube 1 + +#define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5 + +#define GLEW_NV_shadow_samplers_cube GLEW_GET_VAR(__GLEW_NV_shadow_samplers_cube) + +#endif /* GL_NV_shadow_samplers_cube */ + +/* ---------------------- GL_NV_stereo_view_rendering ---------------------- */ + +#ifndef GL_NV_stereo_view_rendering +#define GL_NV_stereo_view_rendering 1 + +#define GLEW_NV_stereo_view_rendering GLEW_GET_VAR(__GLEW_NV_stereo_view_rendering) + +#endif /* GL_NV_stereo_view_rendering */ + +/* ---------------------- 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_array -------------------------- */ + +#ifndef GL_NV_texture_array +#define GL_NV_texture_array 1 + +#define GL_UNPACK_SKIP_IMAGES_NV 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_NV 0x806E +#define GL_MAX_ARRAY_TEXTURE_LAYERS_NV 0x88FF +#define GL_TEXTURE_2D_ARRAY_NV 0x8C1A +#define GL_TEXTURE_BINDING_2D_ARRAY_NV 0x8C1D +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_NV 0x8CD4 +#define GL_SAMPLER_2D_ARRAY_NV 0x8DC1 + +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DNVPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DNVPROC) (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 * PFNGLCOPYTEXSUBIMAGE3DNVPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERNVPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DNVPROC) (GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DNVPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); + +#define glCompressedTexImage3DNV GLEW_GET_FUN(__glewCompressedTexImage3DNV) +#define glCompressedTexSubImage3DNV GLEW_GET_FUN(__glewCompressedTexSubImage3DNV) +#define glCopyTexSubImage3DNV GLEW_GET_FUN(__glewCopyTexSubImage3DNV) +#define glFramebufferTextureLayerNV GLEW_GET_FUN(__glewFramebufferTextureLayerNV) +#define glTexImage3DNV GLEW_GET_FUN(__glewTexImage3DNV) +#define glTexSubImage3DNV GLEW_GET_FUN(__glewTexSubImage3DNV) + +#define GLEW_NV_texture_array GLEW_GET_VAR(__GLEW_NV_texture_array) + +#endif /* GL_NV_texture_array */ + +/* ------------------------- 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_border_clamp ---------------------- */ + +#ifndef GL_NV_texture_border_clamp +#define GL_NV_texture_border_clamp 1 + +#define GL_TEXTURE_BORDER_COLOR_NV 0x1004 +#define GL_CLAMP_TO_BORDER_NV 0x812D + +#define GLEW_NV_texture_border_clamp GLEW_GET_VAR(__GLEW_NV_texture_border_clamp) + +#endif /* GL_NV_texture_border_clamp */ + +/* --------------------- GL_NV_texture_compression_latc -------------------- */ + +#ifndef GL_NV_texture_compression_latc +#define GL_NV_texture_compression_latc 1 + +#define GL_COMPRESSED_LUMINANCE_LATC1_NV 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_NV 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_NV 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_NV 0x8C73 + +#define GLEW_NV_texture_compression_latc GLEW_GET_VAR(__GLEW_NV_texture_compression_latc) + +#endif /* GL_NV_texture_compression_latc */ + +/* --------------------- GL_NV_texture_compression_s3tc -------------------- */ + +#ifndef GL_NV_texture_compression_s3tc +#define GL_NV_texture_compression_s3tc 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_NV 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_NV 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_NV 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_NV 0x83F3 + +#define GLEW_NV_texture_compression_s3tc GLEW_GET_VAR(__GLEW_NV_texture_compression_s3tc) + +#endif /* GL_NV_texture_compression_s3tc */ + +/* ----------------- GL_NV_texture_compression_s3tc_update ----------------- */ + +#ifndef GL_NV_texture_compression_s3tc_update +#define GL_NV_texture_compression_s3tc_update 1 + +#define GLEW_NV_texture_compression_s3tc_update GLEW_GET_VAR(__GLEW_NV_texture_compression_s3tc_update) + +#endif /* GL_NV_texture_compression_s3tc_update */ + +/* --------------------- 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_multisample ----------------------- */ + +#ifndef GL_NV_texture_multisample +#define GL_NV_texture_multisample 1 + +#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 +#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); + +#define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV) +#define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV) +#define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV) +#define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV) +#define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV) +#define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV) + +#define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample) + +#endif /* GL_NV_texture_multisample */ + +/* ---------------------- GL_NV_texture_npot_2D_mipmap --------------------- */ + +#ifndef GL_NV_texture_npot_2D_mipmap +#define GL_NV_texture_npot_2D_mipmap 1 + +#define GLEW_NV_texture_npot_2D_mipmap GLEW_GET_VAR(__GLEW_NV_texture_npot_2D_mipmap) + +#endif /* GL_NV_texture_npot_2D_mipmap */ + +/* ------------------------ 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_rectangle_compressed ------------------ */ + +#ifndef GL_NV_texture_rectangle_compressed +#define GL_NV_texture_rectangle_compressed 1 + +#define GLEW_NV_texture_rectangle_compressed GLEW_GET_VAR(__GLEW_NV_texture_rectangle_compressed) + +#endif /* GL_NV_texture_rectangle_compressed */ + +/* -------------------------- 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_2D_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_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_uniform_buffer_unified_memory ------------------ */ + +#ifndef GL_NV_uniform_buffer_unified_memory +#define GL_NV_uniform_buffer_unified_memory 1 + +#define GL_UNIFORM_BUFFER_UNIFIED_NV 0x936E +#define GL_UNIFORM_BUFFER_ADDRESS_NV 0x936F +#define GL_UNIFORM_BUFFER_LENGTH_NV 0x9370 + +#define GLEW_NV_uniform_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_uniform_buffer_unified_memory) + +#endif /* GL_NV_uniform_buffer_unified_memory */ + +/* -------------------------- 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 void*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, void** 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_NV_video_capture -------------------------- */ + +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 + +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C + +typedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); + +#define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV) +#define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV) +#define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV) +#define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV) +#define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV) +#define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV) +#define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV) +#define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV) +#define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV) +#define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV) +#define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV) +#define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV) + +#define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture) + +#endif /* GL_NV_video_capture */ + +/* -------------------------- GL_NV_viewport_array ------------------------- */ + +#ifndef GL_NV_viewport_array +#define GL_NV_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_NV 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS_NV 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE_NV 0x825D +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX_NV 0x825F + +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYFVNVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDFNVPROC) (GLuint index, GLfloat n, GLfloat f); +typedef void (GLAPIENTRY * PFNGLDISABLEINVPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEINVPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VNVPROC) (GLenum target, GLuint index, GLfloat* data); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINVPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVNVPROC) (GLuint first, GLsizei count, const GLint * v); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDNVPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVNVPROC) (GLuint index, const GLint * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVNVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVNVPROC) (GLuint index, const GLfloat * v); + +#define glDepthRangeArrayfvNV GLEW_GET_FUN(__glewDepthRangeArrayfvNV) +#define glDepthRangeIndexedfNV GLEW_GET_FUN(__glewDepthRangeIndexedfNV) +#define glDisableiNV GLEW_GET_FUN(__glewDisableiNV) +#define glEnableiNV GLEW_GET_FUN(__glewEnableiNV) +#define glGetFloati_vNV GLEW_GET_FUN(__glewGetFloati_vNV) +#define glIsEnablediNV GLEW_GET_FUN(__glewIsEnablediNV) +#define glScissorArrayvNV GLEW_GET_FUN(__glewScissorArrayvNV) +#define glScissorIndexedNV GLEW_GET_FUN(__glewScissorIndexedNV) +#define glScissorIndexedvNV GLEW_GET_FUN(__glewScissorIndexedvNV) +#define glViewportArrayvNV GLEW_GET_FUN(__glewViewportArrayvNV) +#define glViewportIndexedfNV GLEW_GET_FUN(__glewViewportIndexedfNV) +#define glViewportIndexedfvNV GLEW_GET_FUN(__glewViewportIndexedfvNV) + +#define GLEW_NV_viewport_array GLEW_GET_VAR(__GLEW_NV_viewport_array) + +#endif /* GL_NV_viewport_array */ + +/* ------------------------- GL_NV_viewport_array2 ------------------------- */ + +#ifndef GL_NV_viewport_array2 +#define GL_NV_viewport_array2 1 + +#define GLEW_NV_viewport_array2 GLEW_GET_VAR(__GLEW_NV_viewport_array2) + +#endif /* GL_NV_viewport_array2 */ + +/* ------------------------- GL_NV_viewport_swizzle ------------------------ */ + +#ifndef GL_NV_viewport_swizzle +#define GL_NV_viewport_swizzle 1 + +#define GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV 0x9350 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV 0x9351 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV 0x9352 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV 0x9353 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV 0x9354 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV 0x9355 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV 0x9356 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV 0x9357 +#define GL_VIEWPORT_SWIZZLE_X_NV 0x9358 +#define GL_VIEWPORT_SWIZZLE_Y_NV 0x9359 +#define GL_VIEWPORT_SWIZZLE_Z_NV 0x935A +#define GL_VIEWPORT_SWIZZLE_W_NV 0x935B + +typedef void (GLAPIENTRY * PFNGLVIEWPORTSWIZZLENVPROC) (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew); + +#define glViewportSwizzleNV GLEW_GET_FUN(__glewViewportSwizzleNV) + +#define GLEW_NV_viewport_swizzle GLEW_GET_VAR(__GLEW_NV_viewport_swizzle) + +#endif /* GL_NV_viewport_swizzle */ + +/* ------------------------ GL_OES_byte_coordinates ------------------------ */ + +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 + +#define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates) + +#endif /* GL_OES_byte_coordinates */ + +/* ---------------------------- 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_OVR_multiview --------------------------- */ + +#ifndef GL_OVR_multiview +#define GL_OVR_multiview 1 + +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 +#define GL_MAX_VIEWS_OVR 0x9631 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 +#define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); + +#define glFramebufferTextureMultiviewOVR GLEW_GET_FUN(__glewFramebufferTextureMultiviewOVR) + +#define GLEW_OVR_multiview GLEW_GET_VAR(__GLEW_OVR_multiview) + +#endif /* GL_OVR_multiview */ + +/* --------------------------- GL_OVR_multiview2 --------------------------- */ + +#ifndef GL_OVR_multiview2 +#define GL_OVR_multiview2 1 + +#define GLEW_OVR_multiview2 GLEW_GET_VAR(__GLEW_OVR_multiview2) + +#endif /* GL_OVR_multiview2 */ + +/* ------------ GL_OVR_multiview_multisampled_render_to_texture ------------ */ + +#ifndef GL_OVR_multiview_multisampled_render_to_texture +#define GL_OVR_multiview_multisampled_render_to_texture 1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews); + +#define glFramebufferTextureMultisampleMultiviewOVR GLEW_GET_FUN(__glewFramebufferTextureMultisampleMultiviewOVR) + +#define GLEW_OVR_multiview_multisampled_render_to_texture GLEW_GET_VAR(__GLEW_OVR_multiview_multisampled_render_to_texture) + +#endif /* GL_OVR_multiview_multisampled_render_to_texture */ + +/* --------------------------- 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_QCOM_alpha_test -------------------------- */ + +#ifndef GL_QCOM_alpha_test +#define GL_QCOM_alpha_test 1 + +#define GL_ALPHA_TEST_QCOM 0x0BC0 +#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 +#define GL_ALPHA_TEST_REF_QCOM 0x0BC2 + +typedef void (GLAPIENTRY * PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref); + +#define glAlphaFuncQCOM GLEW_GET_FUN(__glewAlphaFuncQCOM) + +#define GLEW_QCOM_alpha_test GLEW_GET_VAR(__GLEW_QCOM_alpha_test) + +#endif /* GL_QCOM_alpha_test */ + +/* ------------------------ GL_QCOM_binning_control ------------------------ */ + +#ifndef GL_QCOM_binning_control +#define GL_QCOM_binning_control 1 + +#define GL_DONT_CARE 0x1100 +#define GL_BINNING_CONTROL_HINT_QCOM 0x8FB0 +#define GL_CPU_OPTIMIZED_QCOM 0x8FB1 +#define GL_GPU_OPTIMIZED_QCOM 0x8FB2 +#define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3 + +#define GLEW_QCOM_binning_control GLEW_GET_VAR(__GLEW_QCOM_binning_control) + +#endif /* GL_QCOM_binning_control */ + +/* ------------------------- GL_QCOM_driver_control ------------------------ */ + +#ifndef GL_QCOM_driver_control +#define GL_QCOM_driver_control 1 + +typedef void (GLAPIENTRY * PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GLAPIENTRY * PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GLAPIENTRY * PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar *driverControlString); +typedef void (GLAPIENTRY * PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint* num, GLsizei size, GLuint *driverControls); + +#define glDisableDriverControlQCOM GLEW_GET_FUN(__glewDisableDriverControlQCOM) +#define glEnableDriverControlQCOM GLEW_GET_FUN(__glewEnableDriverControlQCOM) +#define glGetDriverControlStringQCOM GLEW_GET_FUN(__glewGetDriverControlStringQCOM) +#define glGetDriverControlsQCOM GLEW_GET_FUN(__glewGetDriverControlsQCOM) + +#define GLEW_QCOM_driver_control GLEW_GET_VAR(__GLEW_QCOM_driver_control) + +#endif /* GL_QCOM_driver_control */ + +/* -------------------------- GL_QCOM_extended_get ------------------------- */ + +#ifndef GL_QCOM_extended_get +#define GL_QCOM_extended_get 1 + +#define GL_TEXTURE_WIDTH_QCOM 0x8BD2 +#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 +#define GL_TEXTURE_DEPTH_QCOM 0x8BD4 +#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 +#define GL_TEXTURE_FORMAT_QCOM 0x8BD6 +#define GL_TEXTURE_TYPE_QCOM 0x8BD7 +#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 +#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 +#define GL_TEXTURE_TARGET_QCOM 0x8BDA +#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB +#define GL_STATE_RESTORE 0x8BDC + +typedef void (GLAPIENTRY * PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, void** params); +typedef void (GLAPIENTRY * PFNGLEXTGETBUFFERSQCOMPROC) (GLuint* buffers, GLint maxBuffers, GLint* numBuffers); +typedef void (GLAPIENTRY * PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers); +typedef void (GLAPIENTRY * PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers); +typedef void (GLAPIENTRY * PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); +typedef void (GLAPIENTRY * PFNGLEXTGETTEXTURESQCOMPROC) (GLuint* textures, GLint maxTextures, GLint* numTextures); +typedef void (GLAPIENTRY * PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); + +#define glExtGetBufferPointervQCOM GLEW_GET_FUN(__glewExtGetBufferPointervQCOM) +#define glExtGetBuffersQCOM GLEW_GET_FUN(__glewExtGetBuffersQCOM) +#define glExtGetFramebuffersQCOM GLEW_GET_FUN(__glewExtGetFramebuffersQCOM) +#define glExtGetRenderbuffersQCOM GLEW_GET_FUN(__glewExtGetRenderbuffersQCOM) +#define glExtGetTexLevelParameterivQCOM GLEW_GET_FUN(__glewExtGetTexLevelParameterivQCOM) +#define glExtGetTexSubImageQCOM GLEW_GET_FUN(__glewExtGetTexSubImageQCOM) +#define glExtGetTexturesQCOM GLEW_GET_FUN(__glewExtGetTexturesQCOM) +#define glExtTexObjectStateOverrideiQCOM GLEW_GET_FUN(__glewExtTexObjectStateOverrideiQCOM) + +#define GLEW_QCOM_extended_get GLEW_GET_VAR(__GLEW_QCOM_extended_get) + +#endif /* GL_QCOM_extended_get */ + +/* ------------------------- GL_QCOM_extended_get2 ------------------------- */ + +#ifndef GL_QCOM_extended_get2 +#define GL_QCOM_extended_get2 1 + +typedef void (GLAPIENTRY * PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar* source, GLint* length); +typedef void (GLAPIENTRY * PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint* programs, GLint maxPrograms, GLint* numPrograms); +typedef void (GLAPIENTRY * PFNGLEXTGETSHADERSQCOMPROC) (GLuint* shaders, GLint maxShaders, GLint* numShaders); +typedef GLboolean (GLAPIENTRY * PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); + +#define glExtGetProgramBinarySourceQCOM GLEW_GET_FUN(__glewExtGetProgramBinarySourceQCOM) +#define glExtGetProgramsQCOM GLEW_GET_FUN(__glewExtGetProgramsQCOM) +#define glExtGetShadersQCOM GLEW_GET_FUN(__glewExtGetShadersQCOM) +#define glExtIsProgramBinaryQCOM GLEW_GET_FUN(__glewExtIsProgramBinaryQCOM) + +#define GLEW_QCOM_extended_get2 GLEW_GET_VAR(__GLEW_QCOM_extended_get2) + +#endif /* GL_QCOM_extended_get2 */ + +/* ---------------------- GL_QCOM_framebuffer_foveated --------------------- */ + +#ifndef GL_QCOM_framebuffer_foveated +#define GL_QCOM_framebuffer_foveated 1 + +#define GL_FOVEATION_ENABLE_BIT_QCOM 0x1 +#define GL_FOVEATION_SCALED_BIN_METHOD_BIT_QCOM 0x2 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC) (GLuint fbo, GLuint numLayers, GLuint focalPointsPerLayer, GLuint requestedFeatures, GLuint* providedFeatures); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC) (GLuint fbo, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); + +#define glFramebufferFoveationConfigQCOM GLEW_GET_FUN(__glewFramebufferFoveationConfigQCOM) +#define glFramebufferFoveationParametersQCOM GLEW_GET_FUN(__glewFramebufferFoveationParametersQCOM) + +#define GLEW_QCOM_framebuffer_foveated GLEW_GET_VAR(__GLEW_QCOM_framebuffer_foveated) + +#endif /* GL_QCOM_framebuffer_foveated */ + +/* ---------------------- GL_QCOM_perfmon_global_mode ---------------------- */ + +#ifndef GL_QCOM_perfmon_global_mode +#define GL_QCOM_perfmon_global_mode 1 + +#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 + +#define GLEW_QCOM_perfmon_global_mode GLEW_GET_VAR(__GLEW_QCOM_perfmon_global_mode) + +#endif /* GL_QCOM_perfmon_global_mode */ + +/* -------------- GL_QCOM_shader_framebuffer_fetch_noncoherent ------------- */ + +#ifndef GL_QCOM_shader_framebuffer_fetch_noncoherent +#define GL_QCOM_shader_framebuffer_fetch_noncoherent 1 + +#define GL_FRAMEBUFFER_FETCH_NONCOHERENT_QCOM 0x96A2 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC) (void); + +#define glFramebufferFetchBarrierQCOM GLEW_GET_FUN(__glewFramebufferFetchBarrierQCOM) + +#define GLEW_QCOM_shader_framebuffer_fetch_noncoherent GLEW_GET_VAR(__GLEW_QCOM_shader_framebuffer_fetch_noncoherent) + +#endif /* GL_QCOM_shader_framebuffer_fetch_noncoherent */ + +/* ------------------------ GL_QCOM_tiled_rendering ------------------------ */ + +#ifndef GL_QCOM_tiled_rendering +#define GL_QCOM_tiled_rendering 1 + +#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 +#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 +#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 +#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 +#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 +#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 +#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 +#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 +#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 +#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 +#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 +#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 +#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 +#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 +#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 +#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 +#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 +#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 +#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 +#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 +#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 +#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 +#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 +#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 +#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 +#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 +#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 +#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 +#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 +#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 +#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 +#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 + +typedef void (GLAPIENTRY * PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); +typedef void (GLAPIENTRY * PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); + +#define glEndTilingQCOM GLEW_GET_FUN(__glewEndTilingQCOM) +#define glStartTilingQCOM GLEW_GET_FUN(__glewStartTilingQCOM) + +#define GLEW_QCOM_tiled_rendering GLEW_GET_VAR(__GLEW_QCOM_tiled_rendering) + +#endif /* GL_QCOM_tiled_rendering */ + +/* ---------------------- GL_QCOM_writeonly_rendering ---------------------- */ + +#ifndef GL_QCOM_writeonly_rendering +#define GL_QCOM_writeonly_rendering 1 + +#define GL_WRITEONLY_RENDERING_QCOM 0x8823 + +#define GLEW_QCOM_writeonly_rendering GLEW_GET_VAR(__GLEW_QCOM_writeonly_rendering) + +#endif /* GL_QCOM_writeonly_rendering */ + +/* ---------------------- GL_REGAL_ES1_0_compatibility --------------------- */ + +#ifndef GL_REGAL_ES1_0_compatibility +#define GL_REGAL_ES1_0_compatibility 1 + +typedef int GLclampx; + +typedef void (GLAPIENTRY * PFNGLALPHAFUNCXPROC) (GLenum func, GLclampx ref); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORXPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHXPROC) (GLclampx depth); +typedef void (GLAPIENTRY * PFNGLCOLOR4XPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEXPROC) (GLclampx zNear, GLclampx zFar); +typedef void (GLAPIENTRY * PFNGLFOGXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLFOGXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLFRUSTUMFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GLAPIENTRY * PFNGLFRUSTUMXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GLAPIENTRY * PFNGLLIGHTMODELXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLLIGHTMODELXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLLIGHTXPROC) (GLenum light, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLLIGHTXVPROC) (GLenum light, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLLINEWIDTHXPROC) (GLfixed width); +typedef void (GLAPIENTRY * PFNGLLOADMATRIXXPROC) (const GLfixed* m); +typedef void (GLAPIENTRY * PFNGLMATERIALXPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLMATERIALXVPROC) (GLenum face, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLMULTMATRIXXPROC) (const GLfixed* m); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4XPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (GLAPIENTRY * PFNGLNORMAL3XPROC) (GLfixed nx, GLfixed ny, GLfixed nz); +typedef void (GLAPIENTRY * PFNGLORTHOFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GLAPIENTRY * PFNGLORTHOXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GLAPIENTRY * PFNGLPOINTSIZEXPROC) (GLfixed size); +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETXPROC) (GLfixed factor, GLfixed units); +typedef void (GLAPIENTRY * PFNGLROTATEXPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEXPROC) (GLclampx value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSCALEXPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (GLAPIENTRY * PFNGLTEXENVXPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLTEXENVXVPROC) (GLenum target, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLTRANSLATEXPROC) (GLfixed x, GLfixed y, GLfixed z); + +#define glAlphaFuncx GLEW_GET_FUN(__glewAlphaFuncx) +#define glClearColorx GLEW_GET_FUN(__glewClearColorx) +#define glClearDepthx GLEW_GET_FUN(__glewClearDepthx) +#define glColor4x GLEW_GET_FUN(__glewColor4x) +#define glDepthRangex GLEW_GET_FUN(__glewDepthRangex) +#define glFogx GLEW_GET_FUN(__glewFogx) +#define glFogxv GLEW_GET_FUN(__glewFogxv) +#define glFrustumf GLEW_GET_FUN(__glewFrustumf) +#define glFrustumx GLEW_GET_FUN(__glewFrustumx) +#define glLightModelx GLEW_GET_FUN(__glewLightModelx) +#define glLightModelxv GLEW_GET_FUN(__glewLightModelxv) +#define glLightx GLEW_GET_FUN(__glewLightx) +#define glLightxv GLEW_GET_FUN(__glewLightxv) +#define glLineWidthx GLEW_GET_FUN(__glewLineWidthx) +#define glLoadMatrixx GLEW_GET_FUN(__glewLoadMatrixx) +#define glMaterialx GLEW_GET_FUN(__glewMaterialx) +#define glMaterialxv GLEW_GET_FUN(__glewMaterialxv) +#define glMultMatrixx GLEW_GET_FUN(__glewMultMatrixx) +#define glMultiTexCoord4x GLEW_GET_FUN(__glewMultiTexCoord4x) +#define glNormal3x GLEW_GET_FUN(__glewNormal3x) +#define glOrthof GLEW_GET_FUN(__glewOrthof) +#define glOrthox GLEW_GET_FUN(__glewOrthox) +#define glPointSizex GLEW_GET_FUN(__glewPointSizex) +#define glPolygonOffsetx GLEW_GET_FUN(__glewPolygonOffsetx) +#define glRotatex GLEW_GET_FUN(__glewRotatex) +#define glSampleCoveragex GLEW_GET_FUN(__glewSampleCoveragex) +#define glScalex GLEW_GET_FUN(__glewScalex) +#define glTexEnvx GLEW_GET_FUN(__glewTexEnvx) +#define glTexEnvxv GLEW_GET_FUN(__glewTexEnvxv) +#define glTexParameterx GLEW_GET_FUN(__glewTexParameterx) +#define glTranslatex GLEW_GET_FUN(__glewTranslatex) + +#define GLEW_REGAL_ES1_0_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_0_compatibility) + +#endif /* GL_REGAL_ES1_0_compatibility */ + +/* ---------------------- GL_REGAL_ES1_1_compatibility --------------------- */ + +#ifndef GL_REGAL_ES1_1_compatibility +#define GL_REGAL_ES1_1_compatibility 1 + +typedef void (GLAPIENTRY * PFNGLCLIPPLANEFPROC) (GLenum plane, const GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLCLIPPLANEXPROC) (GLenum plane, const GLfixed* equation); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFPROC) (GLenum pname, GLfloat eqn[4]); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEXPROC) (GLenum pname, GLfixed eqn[4]); +typedef void (GLAPIENTRY * PFNGLGETFIXEDVPROC) (GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETLIGHTXVPROC) (GLenum light, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETMATERIALXVPROC) (GLenum face, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETTEXENVXVPROC) (GLenum env, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERXVPROC) (GLenum target, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLPOINTSIZEPOINTEROESPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXVPROC) (GLenum target, GLenum pname, const GLfixed* params); + +#define glClipPlanef GLEW_GET_FUN(__glewClipPlanef) +#define glClipPlanex GLEW_GET_FUN(__glewClipPlanex) +#define glGetClipPlanef GLEW_GET_FUN(__glewGetClipPlanef) +#define glGetClipPlanex GLEW_GET_FUN(__glewGetClipPlanex) +#define glGetFixedv GLEW_GET_FUN(__glewGetFixedv) +#define glGetLightxv GLEW_GET_FUN(__glewGetLightxv) +#define glGetMaterialxv GLEW_GET_FUN(__glewGetMaterialxv) +#define glGetTexEnvxv GLEW_GET_FUN(__glewGetTexEnvxv) +#define glGetTexParameterxv GLEW_GET_FUN(__glewGetTexParameterxv) +#define glPointParameterx GLEW_GET_FUN(__glewPointParameterx) +#define glPointParameterxv GLEW_GET_FUN(__glewPointParameterxv) +#define glPointSizePointerOES GLEW_GET_FUN(__glewPointSizePointerOES) +#define glTexParameterxv GLEW_GET_FUN(__glewTexParameterxv) + +#define GLEW_REGAL_ES1_1_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_1_compatibility) + +#endif /* GL_REGAL_ES1_1_compatibility */ + +/* ---------------------------- GL_REGAL_enable ---------------------------- */ + +#ifndef GL_REGAL_enable +#define GL_REGAL_enable 1 + +#define GL_ERROR_REGAL 0x9322 +#define GL_DEBUG_REGAL 0x9323 +#define GL_LOG_REGAL 0x9324 +#define GL_EMULATION_REGAL 0x9325 +#define GL_DRIVER_REGAL 0x9326 +#define GL_MISSING_REGAL 0x9360 +#define GL_TRACE_REGAL 0x9361 +#define GL_CACHE_REGAL 0x9362 +#define GL_CODE_REGAL 0x9363 +#define GL_STATISTICS_REGAL 0x9364 + +#define GLEW_REGAL_enable GLEW_GET_VAR(__GLEW_REGAL_enable) + +#endif /* GL_REGAL_enable */ + +/* ------------------------- GL_REGAL_error_string ------------------------- */ + +#ifndef GL_REGAL_error_string +#define GL_REGAL_error_string 1 + +typedef const GLchar* (GLAPIENTRY * PFNGLERRORSTRINGREGALPROC) (GLenum error); + +#define glErrorStringREGAL GLEW_GET_FUN(__glewErrorStringREGAL) + +#define GLEW_REGAL_error_string GLEW_GET_VAR(__GLEW_REGAL_error_string) + +#endif /* GL_REGAL_error_string */ + +/* ------------------------ GL_REGAL_extension_query ----------------------- */ + +#ifndef GL_REGAL_extension_query +#define GL_REGAL_extension_query 1 + +typedef GLboolean (GLAPIENTRY * PFNGLGETEXTENSIONREGALPROC) (const GLchar* ext); +typedef GLboolean (GLAPIENTRY * PFNGLISSUPPORTEDREGALPROC) (const GLchar* ext); + +#define glGetExtensionREGAL GLEW_GET_FUN(__glewGetExtensionREGAL) +#define glIsSupportedREGAL GLEW_GET_FUN(__glewIsSupportedREGAL) + +#define GLEW_REGAL_extension_query GLEW_GET_VAR(__GLEW_REGAL_extension_query) + +#endif /* GL_REGAL_extension_query */ + +/* ------------------------------ GL_REGAL_log ----------------------------- */ + +#ifndef GL_REGAL_log +#define GL_REGAL_log 1 + +#define GL_LOG_ERROR_REGAL 0x9319 +#define GL_LOG_WARNING_REGAL 0x931A +#define GL_LOG_INFO_REGAL 0x931B +#define GL_LOG_APP_REGAL 0x931C +#define GL_LOG_DRIVER_REGAL 0x931D +#define GL_LOG_INTERNAL_REGAL 0x931E +#define GL_LOG_DEBUG_REGAL 0x931F +#define GL_LOG_STATUS_REGAL 0x9320 +#define GL_LOG_HTTP_REGAL 0x9321 + +typedef void (APIENTRY *GLLOGPROCREGAL)(GLenum stream, GLsizei length, const GLchar *message, void *context); + +typedef void (GLAPIENTRY * PFNGLLOGMESSAGECALLBACKREGALPROC) (GLLOGPROCREGAL callback); + +#define glLogMessageCallbackREGAL GLEW_GET_FUN(__glewLogMessageCallbackREGAL) + +#define GLEW_REGAL_log GLEW_GET_VAR(__GLEW_REGAL_log) + +#endif /* GL_REGAL_log */ + +/* ------------------------- GL_REGAL_proc_address ------------------------- */ + +#ifndef GL_REGAL_proc_address +#define GL_REGAL_proc_address 1 + +typedef void * (GLAPIENTRY * PFNGLGETPROCADDRESSREGALPROC) (const GLchar *name); + +#define glGetProcAddressREGAL GLEW_GET_FUN(__glewGetProcAddressREGAL) + +#define GLEW_REGAL_proc_address GLEW_GET_VAR(__GLEW_REGAL_proc_address) + +#endif /* GL_REGAL_proc_address */ + +/* ----------------------- 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_clip_band_hint ------------------------ */ + +#ifndef GL_SGIS_clip_band_hint +#define GL_SGIS_clip_band_hint 1 + +#define GLEW_SGIS_clip_band_hint GLEW_GET_VAR(__GLEW_SGIS_clip_band_hint) + +#endif /* GL_SGIS_clip_band_hint */ + +/* -------------------------- 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_line_texgen -------------------------- */ + +#ifndef GL_SGIS_line_texgen +#define GL_SGIS_line_texgen 1 + +#define GLEW_SGIS_line_texgen GLEW_GET_VAR(__GLEW_SGIS_line_texgen) + +#endif /* GL_SGIS_line_texgen */ + +/* -------------------------- 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 + +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_multitexture ------------------------- */ + +#ifndef GL_SGIS_multitexture +#define GL_SGIS_multitexture 1 + +#define GL_SELECTED_TEXTURE_SGIS 0x83C0 +#define GL_SELECTED_TEXTURE_COORD_SET_SGIS 0x83C1 +#define GL_SELECTED_TEXTURE_TRANSFORM_SGIS 0x83C2 +#define GL_MAX_TEXTURES_SGIS 0x83C3 +#define GL_MAX_TEXTURE_COORD_SETS_SGIS 0x83C4 +#define GL_TEXTURE_COORD_SET_INTERLEAVE_FACTOR_SGIS 0x83C5 +#define GL_TEXTURE_ENV_COORD_SET_SGIS 0x83C6 +#define GL_TEXTURE0_SGIS 0x83C7 +#define GL_TEXTURE1_SGIS 0x83C8 +#define GL_TEXTURE2_SGIS 0x83C9 +#define GL_TEXTURE3_SGIS 0x83CA + +typedef void (GLAPIENTRY * PFNGLINTERLEAVEDTEXTURECOORDSETSSGISPROC) (GLint factor); +typedef void (GLAPIENTRY * PFNGLSELECTTEXTURECOORDSETSGISPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSELECTTEXTURESGISPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSELECTTEXTURETRANSFORMSGISPROC) (GLenum target); + +#define glInterleavedTextureCoordSetsSGIS GLEW_GET_FUN(__glewInterleavedTextureCoordSetsSGIS) +#define glSelectTextureCoordSetSGIS GLEW_GET_FUN(__glewSelectTextureCoordSetSGIS) +#define glSelectTextureSGIS GLEW_GET_FUN(__glewSelectTextureSGIS) +#define glSelectTextureTransformSGIS GLEW_GET_FUN(__glewSelectTextureTransformSGIS) + +#define GLEW_SGIS_multitexture GLEW_GET_VAR(__GLEW_SGIS_multitexture) + +#endif /* GL_SGIS_multitexture */ + +/* ------------------------- 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_shared_multisample ---------------------- */ + +#ifndef GL_SGIS_shared_multisample +#define GL_SGIS_shared_multisample 1 + +typedef void (GLAPIENTRY * PFNGLMULTISAMPLESUBRECTPOSSGISPROC) (GLint x, GLint y); + +#define glMultisampleSubRectPosSGIS GLEW_GET_FUN(__glewMultisampleSubRectPosSGIS) + +#define GLEW_SGIS_shared_multisample GLEW_GET_VAR(__GLEW_SGIS_shared_multisample) + +#endif /* GL_SGIS_shared_multisample */ + +/* ------------------------ 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_bali_g_instruments ---------------------- */ + +#ifndef GL_SGIX_bali_g_instruments +#define GL_SGIX_bali_g_instruments 1 + +#define GL_BALI_NUM_TRIS_CULLED_INSTRUMENT 0x6080 +#define GL_BALI_NUM_PRIMS_CLIPPED_INSTRUMENT 0x6081 +#define GL_BALI_NUM_PRIMS_REJECT_INSTRUMENT 0x6082 +#define GL_BALI_NUM_PRIMS_CLIP_RESULT_INSTRUMENT 0x6083 + +#define GLEW_SGIX_bali_g_instruments GLEW_GET_VAR(__GLEW_SGIX_bali_g_instruments) + +#endif /* GL_SGIX_bali_g_instruments */ + +/* ----------------------- GL_SGIX_bali_r_instruments ---------------------- */ + +#ifndef GL_SGIX_bali_r_instruments +#define GL_SGIX_bali_r_instruments 1 + +#define GL_BALI_FRAGMENTS_GENERATED_INSTRUMENT 0x6090 +#define GL_BALI_DEPTH_PASS_INSTRUMENT 0x6091 +#define GL_BALI_R_CHIP_COUNT 0x6092 + +#define GLEW_SGIX_bali_r_instruments GLEW_GET_VAR(__GLEW_SGIX_bali_r_instruments) + +#endif /* GL_SGIX_bali_r_instruments */ + +/* --------------------- GL_SGIX_bali_timer_instruments -------------------- */ + +#ifndef GL_SGIX_bali_timer_instruments +#define GL_SGIX_bali_timer_instruments 1 + +#define GLEW_SGIX_bali_timer_instruments GLEW_GET_VAR(__GLEW_SGIX_bali_timer_instruments) + +#endif /* GL_SGIX_bali_timer_instruments */ + +/* ----------------------- 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_blend_cadd -------------------------- */ + +#ifndef GL_SGIX_blend_cadd +#define GL_SGIX_blend_cadd 1 + +#define GL_FUNC_COMPLEX_ADD_EXT 0x601C + +#define GLEW_SGIX_blend_cadd GLEW_GET_VAR(__GLEW_SGIX_blend_cadd) + +#endif /* GL_SGIX_blend_cadd */ + +/* ------------------------ GL_SGIX_blend_cmultiply ------------------------ */ + +#ifndef GL_SGIX_blend_cmultiply +#define GL_SGIX_blend_cmultiply 1 + +#define GL_FUNC_COMPLEX_MULTIPLY_EXT 0x601B + +#define GLEW_SGIX_blend_cmultiply GLEW_GET_VAR(__GLEW_SGIX_blend_cmultiply) + +#endif /* GL_SGIX_blend_cmultiply */ + +/* --------------------- GL_SGIX_calligraphic_fragment --------------------- */ + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 + +#define GLEW_SGIX_calligraphic_fragment GLEW_GET_VAR(__GLEW_SGIX_calligraphic_fragment) + +#endif /* GL_SGIX_calligraphic_fragment */ + +/* ---------------------------- 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_color_matrix_accuracy --------------------- */ + +#ifndef GL_SGIX_color_matrix_accuracy +#define GL_SGIX_color_matrix_accuracy 1 + +#define GL_COLOR_MATRIX_HINT 0x8317 + +#define GLEW_SGIX_color_matrix_accuracy GLEW_GET_VAR(__GLEW_SGIX_color_matrix_accuracy) + +#endif /* GL_SGIX_color_matrix_accuracy */ + +/* --------------------- GL_SGIX_color_table_index_mode -------------------- */ + +#ifndef GL_SGIX_color_table_index_mode +#define GL_SGIX_color_table_index_mode 1 + +#define GLEW_SGIX_color_table_index_mode GLEW_GET_VAR(__GLEW_SGIX_color_table_index_mode) + +#endif /* GL_SGIX_color_table_index_mode */ + +/* ------------------------- GL_SGIX_complex_polar ------------------------- */ + +#ifndef GL_SGIX_complex_polar +#define GL_SGIX_complex_polar 1 + +#define GLEW_SGIX_complex_polar GLEW_GET_VAR(__GLEW_SGIX_complex_polar) + +#endif /* GL_SGIX_complex_polar */ + +/* ---------------------- 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_cube_map --------------------------- */ + +#ifndef GL_SGIX_cube_map +#define GL_SGIX_cube_map 1 + +#define GL_ENV_MAP_SGIX 0x8340 +#define GL_CUBE_MAP_SGIX 0x8341 +#define GL_CUBE_MAP_ZP_SGIX 0x8342 +#define GL_CUBE_MAP_ZN_SGIX 0x8343 +#define GL_CUBE_MAP_XN_SGIX 0x8344 +#define GL_CUBE_MAP_XP_SGIX 0x8345 +#define GL_CUBE_MAP_YN_SGIX 0x8346 +#define GL_CUBE_MAP_YP_SGIX 0x8347 +#define GL_CUBE_MAP_BINDING_SGIX 0x8348 + +#define GLEW_SGIX_cube_map GLEW_GET_VAR(__GLEW_SGIX_cube_map) + +#endif /* GL_SGIX_cube_map */ + +/* ------------------------ GL_SGIX_cylinder_texgen ------------------------ */ + +#ifndef GL_SGIX_cylinder_texgen +#define GL_SGIX_cylinder_texgen 1 + +#define GLEW_SGIX_cylinder_texgen GLEW_GET_VAR(__GLEW_SGIX_cylinder_texgen) + +#endif /* GL_SGIX_cylinder_texgen */ + +/* ---------------------------- GL_SGIX_datapipe --------------------------- */ + +#ifndef GL_SGIX_datapipe +#define GL_SGIX_datapipe 1 + +#define GL_GEOMETRY_BIT 0x1 +#define GL_IMAGE_BIT 0x2 + +typedef void (GLAPIENTRY * PFNGLADDRESSSPACEPROC) (GLenum space, GLbitfield mask); +typedef GLint (GLAPIENTRY * PFNGLDATAPIPEPROC) (GLenum space); + +#define glAddressSpace GLEW_GET_FUN(__glewAddressSpace) +#define glDataPipe GLEW_GET_FUN(__glewDataPipe) + +#define GLEW_SGIX_datapipe GLEW_GET_VAR(__GLEW_SGIX_datapipe) + +#endif /* GL_SGIX_datapipe */ + +/* --------------------------- GL_SGIX_decimation -------------------------- */ + +#ifndef GL_SGIX_decimation +#define GL_SGIX_decimation 1 + +#define GLEW_SGIX_decimation GLEW_GET_VAR(__GLEW_SGIX_decimation) + +#endif /* GL_SGIX_decimation */ + +/* --------------------- GL_SGIX_depth_pass_instrument --------------------- */ + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 + +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 + +#define GLEW_SGIX_depth_pass_instrument GLEW_GET_VAR(__GLEW_SGIX_depth_pass_instrument) + +#endif /* GL_SGIX_depth_pass_instrument */ + +/* ------------------------- 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_dvc ------------------------------ */ + +#ifndef GL_SGIX_dvc +#define GL_SGIX_dvc 1 + +#define GLEW_SGIX_dvc GLEW_GET_VAR(__GLEW_SGIX_dvc) + +#endif /* GL_SGIX_dvc */ + +/* -------------------------- 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_blend --------------------------- */ + +#ifndef GL_SGIX_fog_blend +#define GL_SGIX_fog_blend 1 + +#define GL_FOG_BLEND_ALPHA_SGIX 0x81FE +#define GL_FOG_BLEND_COLOR_SGIX 0x81FF + +#define GLEW_SGIX_fog_blend GLEW_GET_VAR(__GLEW_SGIX_fog_blend) + +#endif /* GL_SGIX_fog_blend */ + +/* ---------------------- GL_SGIX_fog_factor_to_alpha ---------------------- */ + +#ifndef GL_SGIX_fog_factor_to_alpha +#define GL_SGIX_fog_factor_to_alpha 1 + +#define GLEW_SGIX_fog_factor_to_alpha GLEW_GET_VAR(__GLEW_SGIX_fog_factor_to_alpha) + +#endif /* GL_SGIX_fog_factor_to_alpha */ + +/* --------------------------- GL_SGIX_fog_layers -------------------------- */ + +#ifndef GL_SGIX_fog_layers +#define GL_SGIX_fog_layers 1 + +#define GL_FOG_TYPE_SGIX 0x8323 +#define GL_UNIFORM_SGIX 0x8324 +#define GL_LAYERED_SGIX 0x8325 +#define GL_FOG_GROUND_PLANE_SGIX 0x8326 +#define GL_FOG_LAYERS_POINTS_SGIX 0x8327 +#define GL_MAX_FOG_LAYERS_POINTS_SGIX 0x8328 + +typedef void (GLAPIENTRY * PFNGLFOGLAYERSSGIXPROC) (GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETFOGLAYERSSGIXPROC) (GLfloat* points); + +#define glFogLayersSGIX GLEW_GET_FUN(__glewFogLayersSGIX) +#define glGetFogLayersSGIX GLEW_GET_FUN(__glewGetFogLayersSGIX) + +#define GLEW_SGIX_fog_layers GLEW_GET_VAR(__GLEW_SGIX_fog_layers) + +#endif /* GL_SGIX_fog_layers */ + +/* --------------------------- 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_patchy -------------------------- */ + +#ifndef GL_SGIX_fog_patchy +#define GL_SGIX_fog_patchy 1 + +#define GLEW_SGIX_fog_patchy GLEW_GET_VAR(__GLEW_SGIX_fog_patchy) + +#endif /* GL_SGIX_fog_patchy */ + +/* --------------------------- GL_SGIX_fog_scale --------------------------- */ + +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 + +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD + +#define GLEW_SGIX_fog_scale GLEW_GET_VAR(__GLEW_SGIX_fog_scale) + +#endif /* GL_SGIX_fog_scale */ + +/* -------------------------- GL_SGIX_fog_texture -------------------------- */ + +#ifndef GL_SGIX_fog_texture +#define GL_SGIX_fog_texture 1 + +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_lighting_space -------------------- */ + +#ifndef GL_SGIX_fragment_lighting_space +#define GL_SGIX_fragment_lighting_space 1 + +#define GL_EYE_SPACE_SGIX 0x8436 +#define GL_TANGENT_SPACE_SGIX 0x8437 +#define GL_OBJECT_SPACE_SGIX 0x8438 +#define GL_FRAGMENT_LIGHT_SPACE_SGIX 0x843D + +#define GLEW_SGIX_fragment_lighting_space GLEW_GET_VAR(__GLEW_SGIX_fragment_lighting_space) + +#endif /* GL_SGIX_fragment_lighting_space */ + +/* ------------------- 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_fragments_instrument --------------------- */ + +#ifndef GL_SGIX_fragments_instrument +#define GL_SGIX_fragments_instrument 1 + +#define GL_FRAGMENTS_INSTRUMENT_SGIX 0x8313 +#define GL_FRAGMENTS_INSTRUMENT_COUNTERS_SGIX 0x8314 +#define GL_FRAGMENTS_INSTRUMENT_MAX_SGIX 0x8315 + +#define GLEW_SGIX_fragments_instrument GLEW_GET_VAR(__GLEW_SGIX_fragments_instrument) + +#endif /* GL_SGIX_fragments_instrument */ + +/* --------------------------- 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_icc_texture -------------------------- */ + +#ifndef GL_SGIX_icc_texture +#define GL_SGIX_icc_texture 1 + +#define GL_RGB_ICC_SGIX 0x8460 +#define GL_RGBA_ICC_SGIX 0x8461 +#define GL_ALPHA_ICC_SGIX 0x8462 +#define GL_LUMINANCE_ICC_SGIX 0x8463 +#define GL_INTENSITY_ICC_SGIX 0x8464 +#define GL_LUMINANCE_ALPHA_ICC_SGIX 0x8465 +#define GL_R5_G6_B5_ICC_SGIX 0x8466 +#define GL_R5_G6_B5_A8_ICC_SGIX 0x8467 +#define GL_ALPHA16_ICC_SGIX 0x8468 +#define GL_LUMINANCE16_ICC_SGIX 0x8469 +#define GL_INTENSITY16_ICC_SGIX 0x846A +#define GL_LUMINANCE16_ALPHA8_ICC_SGIX 0x846B + +#define GLEW_SGIX_icc_texture GLEW_GET_VAR(__GLEW_SGIX_icc_texture) + +#endif /* GL_SGIX_icc_texture */ + +/* ------------------------ GL_SGIX_igloo_interface ------------------------ */ + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 + +#define GL_IGLOO_FULLSCREEN_SGIX 0x819E +#define GL_IGLOO_VIEWPORT_OFFSET_SGIX 0x819F +#define GL_IGLOO_SWAPTMESH_SGIX 0x81A0 +#define GL_IGLOO_COLORNORMAL_SGIX 0x81A1 +#define GL_IGLOO_IRISGL_MODE_SGIX 0x81A2 +#define GL_IGLOO_LMC_COLOR_SGIX 0x81A3 +#define GL_IGLOO_TMESHMODE_SGIX 0x81A4 +#define GL_LIGHT31 0xBEAD + +typedef void (GLAPIENTRY * PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, void *param); + +#define glIglooInterfaceSGIX GLEW_GET_FUN(__glewIglooInterfaceSGIX) + +#define GLEW_SGIX_igloo_interface GLEW_GET_VAR(__GLEW_SGIX_igloo_interface) + +#endif /* GL_SGIX_igloo_interface */ + +/* ----------------------- GL_SGIX_image_compression ----------------------- */ + +#ifndef GL_SGIX_image_compression +#define GL_SGIX_image_compression 1 + +#define GLEW_SGIX_image_compression GLEW_GET_VAR(__GLEW_SGIX_image_compression) + +#endif /* GL_SGIX_image_compression */ + +/* ---------------------- GL_SGIX_impact_pixel_texture --------------------- */ + +#ifndef GL_SGIX_impact_pixel_texture +#define GL_SGIX_impact_pixel_texture 1 + +#define GLEW_SGIX_impact_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_impact_pixel_texture) + +#endif /* GL_SGIX_impact_pixel_texture */ + +/* ------------------------ GL_SGIX_instrument_error ----------------------- */ + +#ifndef GL_SGIX_instrument_error +#define GL_SGIX_instrument_error 1 + +#define GLEW_SGIX_instrument_error GLEW_GET_VAR(__GLEW_SGIX_instrument_error) + +#endif /* GL_SGIX_instrument_error */ + +/* --------------------------- 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_line_quality_hint ----------------------- */ + +#ifndef GL_SGIX_line_quality_hint +#define GL_SGIX_line_quality_hint 1 + +#define GL_LINE_QUALITY_HINT_SGIX 0x835B + +#define GLEW_SGIX_line_quality_hint GLEW_GET_VAR(__GLEW_SGIX_line_quality_hint) + +#endif /* GL_SGIX_line_quality_hint */ + +/* ------------------------- 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_mpeg1 ----------------------------- */ + +#ifndef GL_SGIX_mpeg1 +#define GL_SGIX_mpeg1 1 + +typedef void (GLAPIENTRY * PFNGLALLOCMPEGPREDICTORSSGIXPROC) (GLsizei width, GLsizei height, GLsizei n, GLuint* predictors); +typedef void (GLAPIENTRY * PFNGLDELETEMPEGPREDICTORSSGIXPROC) (GLsizei n, GLuint* predictors); +typedef void (GLAPIENTRY * PFNGLGENMPEGPREDICTORSSGIXPROC) (GLsizei n, GLuint* predictors); +typedef void (GLAPIENTRY * PFNGLGETMPEGPARAMETERFVSGIXPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMPEGPARAMETERIVSGIXPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMPEGPREDICTORSGIXPROC) (GLenum target, GLenum format, GLenum type, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETMPEGQUANTTABLEUBVPROC) (GLenum target, GLubyte* values); +typedef GLboolean (GLAPIENTRY * PFNGLISMPEGPREDICTORSGIXPROC) (GLuint predictor); +typedef void (GLAPIENTRY * PFNGLMPEGPREDICTORSGIXPROC) (GLenum target, GLenum format, GLenum type, void *pixels); +typedef void (GLAPIENTRY * PFNGLMPEGQUANTTABLEUBVPROC) (GLenum target, GLubyte* values); +typedef void (GLAPIENTRY * PFNGLSWAPMPEGPREDICTORSSGIXPROC) (GLenum target0, GLenum target1); + +#define glAllocMPEGPredictorsSGIX GLEW_GET_FUN(__glewAllocMPEGPredictorsSGIX) +#define glDeleteMPEGPredictorsSGIX GLEW_GET_FUN(__glewDeleteMPEGPredictorsSGIX) +#define glGenMPEGPredictorsSGIX GLEW_GET_FUN(__glewGenMPEGPredictorsSGIX) +#define glGetMPEGParameterfvSGIX GLEW_GET_FUN(__glewGetMPEGParameterfvSGIX) +#define glGetMPEGParameterivSGIX GLEW_GET_FUN(__glewGetMPEGParameterivSGIX) +#define glGetMPEGPredictorSGIX GLEW_GET_FUN(__glewGetMPEGPredictorSGIX) +#define glGetMPEGQuantTableubv GLEW_GET_FUN(__glewGetMPEGQuantTableubv) +#define glIsMPEGPredictorSGIX GLEW_GET_FUN(__glewIsMPEGPredictorSGIX) +#define glMPEGPredictorSGIX GLEW_GET_FUN(__glewMPEGPredictorSGIX) +#define glMPEGQuantTableubv GLEW_GET_FUN(__glewMPEGQuantTableubv) +#define glSwapMPEGPredictorsSGIX GLEW_GET_FUN(__glewSwapMPEGPredictorsSGIX) + +#define GLEW_SGIX_mpeg1 GLEW_GET_VAR(__GLEW_SGIX_mpeg1) + +#endif /* GL_SGIX_mpeg1 */ + +/* ----------------------------- GL_SGIX_mpeg2 ----------------------------- */ + +#ifndef GL_SGIX_mpeg2 +#define GL_SGIX_mpeg2 1 + +#define GLEW_SGIX_mpeg2 GLEW_GET_VAR(__GLEW_SGIX_mpeg2) + +#endif /* GL_SGIX_mpeg2 */ + +/* ------------------ GL_SGIX_nonlinear_lighting_pervertex ----------------- */ + +#ifndef GL_SGIX_nonlinear_lighting_pervertex +#define GL_SGIX_nonlinear_lighting_pervertex 1 + +typedef void (GLAPIENTRY * PFNGLGETNONLINLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLint* terms, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETNONLINMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLint* terms, const GLfloat *data); +typedef void (GLAPIENTRY * PFNGLNONLINLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLint terms, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNONLINMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLint terms, const GLfloat* params); + +#define glGetNonlinLightfvSGIX GLEW_GET_FUN(__glewGetNonlinLightfvSGIX) +#define glGetNonlinMaterialfvSGIX GLEW_GET_FUN(__glewGetNonlinMaterialfvSGIX) +#define glNonlinLightfvSGIX GLEW_GET_FUN(__glewNonlinLightfvSGIX) +#define glNonlinMaterialfvSGIX GLEW_GET_FUN(__glewNonlinMaterialfvSGIX) + +#define GLEW_SGIX_nonlinear_lighting_pervertex GLEW_GET_VAR(__GLEW_SGIX_nonlinear_lighting_pervertex) + +#endif /* GL_SGIX_nonlinear_lighting_pervertex */ + +/* --------------------------- GL_SGIX_nurbs_eval -------------------------- */ + +#ifndef GL_SGIX_nurbs_eval +#define GL_SGIX_nurbs_eval 1 + +#define GL_MAP1_VERTEX_3_NURBS_SGIX 0x81CB +#define GL_MAP1_VERTEX_4_NURBS_SGIX 0x81CC +#define GL_MAP1_INDEX_NURBS_SGIX 0x81CD +#define GL_MAP1_COLOR_4_NURBS_SGIX 0x81CE +#define GL_MAP1_NORMAL_NURBS_SGIX 0x81CF +#define GL_MAP1_TEXTURE_COORD_1_NURBS_SGIX 0x81E0 +#define GL_MAP1_TEXTURE_COORD_2_NURBS_SGIX 0x81E1 +#define GL_MAP1_TEXTURE_COORD_3_NURBS_SGIX 0x81E2 +#define GL_MAP1_TEXTURE_COORD_4_NURBS_SGIX 0x81E3 +#define GL_MAP2_VERTEX_3_NURBS_SGIX 0x81E4 +#define GL_MAP2_VERTEX_4_NURBS_SGIX 0x81E5 +#define GL_MAP2_INDEX_NURBS_SGIX 0x81E6 +#define GL_MAP2_COLOR_4_NURBS_SGIX 0x81E7 +#define GL_MAP2_NORMAL_NURBS_SGIX 0x81E8 +#define GL_MAP2_TEXTURE_COORD_1_NURBS_SGIX 0x81E9 +#define GL_MAP2_TEXTURE_COORD_2_NURBS_SGIX 0x81EA +#define GL_MAP2_TEXTURE_COORD_3_NURBS_SGIX 0x81EB +#define GL_MAP2_TEXTURE_COORD_4_NURBS_SGIX 0x81EC +#define GL_NURBS_KNOT_COUNT_SGIX 0x81ED +#define GL_NURBS_KNOT_VECTOR_SGIX 0x81EE + +#define GLEW_SGIX_nurbs_eval GLEW_GET_VAR(__GLEW_SGIX_nurbs_eval) + +#endif /* GL_SGIX_nurbs_eval */ + +/* ---------------------- GL_SGIX_occlusion_instrument --------------------- */ + +#ifndef GL_SGIX_occlusion_instrument +#define GL_SGIX_occlusion_instrument 1 + +#define GL_OCCLUSION_INSTRUMENT_SGIX 0x6060 + +#define GLEW_SGIX_occlusion_instrument GLEW_GET_VAR(__GLEW_SGIX_occlusion_instrument) + +#endif /* GL_SGIX_occlusion_instrument */ + +/* ------------------------- GL_SGIX_packed_6bytes ------------------------- */ + +#ifndef GL_SGIX_packed_6bytes +#define GL_SGIX_packed_6bytes 1 + +#define GLEW_SGIX_packed_6bytes GLEW_GET_VAR(__GLEW_SGIX_packed_6bytes) + +#endif /* GL_SGIX_packed_6bytes */ + +/* ------------------------- 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_pixel_texture_lod ----------------------- */ + +#ifndef GL_SGIX_pixel_texture_lod +#define GL_SGIX_pixel_texture_lod 1 + +#define GLEW_SGIX_pixel_texture_lod GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_lod) + +#endif /* GL_SGIX_pixel_texture_lod */ + +/* -------------------------- GL_SGIX_pixel_tiles -------------------------- */ + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 + +#define GLEW_SGIX_pixel_tiles GLEW_GET_VAR(__GLEW_SGIX_pixel_tiles) + +#endif /* GL_SGIX_pixel_tiles */ + +/* ------------------------- GL_SGIX_polynomial_ffd ------------------------ */ + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 + +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x1 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x2 + +typedef void (GLAPIENTRY * PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); + +#define glDeformSGIX GLEW_GET_FUN(__glewDeformSGIX) +#define glLoadIdentityDeformationMapSGIX GLEW_GET_FUN(__glewLoadIdentityDeformationMapSGIX) + +#define GLEW_SGIX_polynomial_ffd GLEW_GET_VAR(__GLEW_SGIX_polynomial_ffd) + +#endif /* GL_SGIX_polynomial_ffd */ + +/* --------------------------- GL_SGIX_quad_mesh --------------------------- */ + +#ifndef GL_SGIX_quad_mesh +#define GL_SGIX_quad_mesh 1 + +typedef void (GLAPIENTRY * PFNGLMESHBREADTHSGIXPROC) (GLint breadth); +typedef void (GLAPIENTRY * PFNGLMESHSTRIDESGIXPROC) (GLint stride); + +#define glMeshBreadthSGIX GLEW_GET_FUN(__glewMeshBreadthSGIX) +#define glMeshStrideSGIX GLEW_GET_FUN(__glewMeshStrideSGIX) + +#define GLEW_SGIX_quad_mesh GLEW_GET_VAR(__GLEW_SGIX_quad_mesh) + +#endif /* GL_SGIX_quad_mesh */ + +/* ------------------------ 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_scalebias_hint ------------------------ */ + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 + +#define GL_SCALEBIAS_HINT_SGIX 0x8322 + +#define GLEW_SGIX_scalebias_hint GLEW_GET_VAR(__GLEW_SGIX_scalebias_hint) + +#endif /* GL_SGIX_scalebias_hint */ + +/* ----------------------------- 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_slim ----------------------------- */ + +#ifndef GL_SGIX_slim +#define GL_SGIX_slim 1 + +#define GL_PACK_MAX_COMPRESSED_SIZE_SGIX 0x831B +#define GL_SLIM8U_SGIX 0x831D +#define GL_SLIM10U_SGIX 0x831E +#define GL_SLIM12S_SGIX 0x831F + +#define GLEW_SGIX_slim GLEW_GET_VAR(__GLEW_SGIX_slim) + +#endif /* GL_SGIX_slim */ + +/* ------------------------ GL_SGIX_spotlight_cutoff ----------------------- */ + +#ifndef GL_SGIX_spotlight_cutoff +#define GL_SGIX_spotlight_cutoff 1 + +#define GL_SPOT_CUTOFF_DELTA_SGIX 0x8193 + +#define GLEW_SGIX_spotlight_cutoff GLEW_GET_VAR(__GLEW_SGIX_spotlight_cutoff) + +#endif /* GL_SGIX_spotlight_cutoff */ + +/* ----------------------------- 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_subdiv_patch ------------------------- */ + +#ifndef GL_SGIX_subdiv_patch +#define GL_SGIX_subdiv_patch 1 + +#define GLEW_SGIX_subdiv_patch GLEW_GET_VAR(__GLEW_SGIX_subdiv_patch) + +#endif /* GL_SGIX_subdiv_patch */ + +/* --------------------------- GL_SGIX_subsample --------------------------- */ + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 + +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 + +#define GLEW_SGIX_subsample GLEW_GET_VAR(__GLEW_SGIX_subsample) + +#endif /* GL_SGIX_subsample */ + +/* ----------------------- 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_mipmap_anisotropic ------------------ */ + +#ifndef GL_SGIX_texture_mipmap_anisotropic +#define GL_SGIX_texture_mipmap_anisotropic 1 + +#define GL_TEXTURE_MIPMAP_ANISOTROPY_SGIX 0x832E +#define GL_MAX_MIPMAP_ANISOTROPY_SGIX 0x832F + +#define GLEW_SGIX_texture_mipmap_anisotropic GLEW_GET_VAR(__GLEW_SGIX_texture_mipmap_anisotropic) + +#endif /* GL_SGIX_texture_mipmap_anisotropic */ + +/* ---------------------- 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_phase ------------------------- */ + +#ifndef GL_SGIX_texture_phase +#define GL_SGIX_texture_phase 1 + +#define GL_PHASE_SGIX 0x832A + +#define GLEW_SGIX_texture_phase GLEW_GET_VAR(__GLEW_SGIX_texture_phase) + +#endif /* GL_SGIX_texture_phase */ + +/* ------------------------- 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_texture_supersample ---------------------- */ + +#ifndef GL_SGIX_texture_supersample +#define GL_SGIX_texture_supersample 1 + +#define GLEW_SGIX_texture_supersample GLEW_GET_VAR(__GLEW_SGIX_texture_supersample) + +#endif /* GL_SGIX_texture_supersample */ + +/* --------------------------- GL_SGIX_vector_ops -------------------------- */ + +#ifndef GL_SGIX_vector_ops +#define GL_SGIX_vector_ops 1 + +typedef void (GLAPIENTRY * PFNGLGETVECTOROPERATIONSGIXPROC) (GLenum operation); +typedef void (GLAPIENTRY * PFNGLVECTOROPERATIONSGIXPROC) (GLenum operation); + +#define glGetVectorOperationSGIX GLEW_GET_FUN(__glewGetVectorOperationSGIX) +#define glVectorOperationSGIX GLEW_GET_FUN(__glewVectorOperationSGIX) + +#define GLEW_SGIX_vector_ops GLEW_GET_VAR(__GLEW_SGIX_vector_ops) + +#endif /* GL_SGIX_vector_ops */ + +/* ---------------------- GL_SGIX_vertex_array_object ---------------------- */ + +#ifndef GL_SGIX_vertex_array_object +#define GL_SGIX_vertex_array_object 1 + +typedef GLboolean (GLAPIENTRY * PFNGLAREVERTEXARRAYSRESIDENTSGIXPROC) (GLsizei n, const GLuint* arrays, GLboolean* residences); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYSGIXPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSSGIXPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSSGIXPROC) (GLsizei n, GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYSGIXPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLPRIORITIZEVERTEXARRAYSSGIXPROC) (GLsizei n, const GLuint* arrays, const GLclampf* priorities); + +#define glAreVertexArraysResidentSGIX GLEW_GET_FUN(__glewAreVertexArraysResidentSGIX) +#define glBindVertexArraySGIX GLEW_GET_FUN(__glewBindVertexArraySGIX) +#define glDeleteVertexArraysSGIX GLEW_GET_FUN(__glewDeleteVertexArraysSGIX) +#define glGenVertexArraysSGIX GLEW_GET_FUN(__glewGenVertexArraysSGIX) +#define glIsVertexArraySGIX GLEW_GET_FUN(__glewIsVertexArraySGIX) +#define glPrioritizeVertexArraysSGIX GLEW_GET_FUN(__glewPrioritizeVertexArraysSGIX) + +#define GLEW_SGIX_vertex_array_object GLEW_GET_VAR(__GLEW_SGIX_vertex_array_object) + +#endif /* GL_SGIX_vertex_array_object */ + +/* ------------------------- 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_SGIX_ycrcb_subsample ------------------------ */ + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 + +#define GLEW_SGIX_ycrcb_subsample GLEW_GET_VAR(__GLEW_SGIX_ycrcb_subsample) + +#endif /* GL_SGIX_ycrcb_subsample */ + +/* ----------------------------- GL_SGIX_ycrcba ---------------------------- */ + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 + +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 + +#define GLEW_SGIX_ycrcba GLEW_GET_VAR(__GLEW_SGIX_ycrcba) + +#endif /* GL_SGIX_ycrcba */ + +/* -------------------------- 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_complex ---------------------------- */ + +#ifndef GL_SGI_complex +#define GL_SGI_complex 1 + +#define GLEW_SGI_complex GLEW_GET_VAR(__GLEW_SGI_complex) + +#endif /* GL_SGI_complex */ + +/* -------------------------- GL_SGI_complex_type -------------------------- */ + +#ifndef GL_SGI_complex_type +#define GL_SGI_complex_type 1 + +#define GL_COMPLEX_UNSIGNED_BYTE_SGI 0x81BD +#define GL_COMPLEX_BYTE_SGI 0x81BE +#define GL_COMPLEX_UNSIGNED_SHORT_SGI 0x81BF +#define GL_COMPLEX_SHORT_SGI 0x81C0 +#define GL_COMPLEX_UNSIGNED_INT_SGI 0x81C1 +#define GL_COMPLEX_INT_SGI 0x81C2 +#define GL_COMPLEX_FLOAT_SGI 0x81C3 + +#define GLEW_SGI_complex_type GLEW_GET_VAR(__GLEW_SGI_complex_type) + +#endif /* GL_SGI_complex_type */ + +/* ------------------------------- GL_SGI_fft ------------------------------ */ + +#ifndef GL_SGI_fft +#define GL_SGI_fft 1 + +#define GL_PIXEL_TRANSFORM_OPERATOR_SGI 0x81C4 +#define GL_CONVOLUTION_SGI 0x81C5 +#define GL_FFT_1D_SGI 0x81C6 +#define GL_PIXEL_TRANSFORM_SGI 0x81C7 +#define GL_MAX_FFT_WIDTH_SGI 0x81C8 + +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFSGIPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERISGIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMSGIPROC) (GLenum target); + +#define glGetPixelTransformParameterfvSGI GLEW_GET_FUN(__glewGetPixelTransformParameterfvSGI) +#define glGetPixelTransformParameterivSGI GLEW_GET_FUN(__glewGetPixelTransformParameterivSGI) +#define glPixelTransformParameterfSGI GLEW_GET_FUN(__glewPixelTransformParameterfSGI) +#define glPixelTransformParameterfvSGI GLEW_GET_FUN(__glewPixelTransformParameterfvSGI) +#define glPixelTransformParameteriSGI GLEW_GET_FUN(__glewPixelTransformParameteriSGI) +#define glPixelTransformParameterivSGI GLEW_GET_FUN(__glewPixelTransformParameterivSGI) +#define glPixelTransformSGI GLEW_GET_FUN(__glewPixelTransformSGI) + +#define GLEW_SGI_fft GLEW_GET_VAR(__GLEW_SGI_fft) + +#endif /* GL_SGI_fft */ + +/* ----------------------- 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, void* 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_scene_markerXXX ------------------------ */ + +#ifndef GL_WIN_scene_markerXXX +#define GL_WIN_scene_markerXXX 1 + +#define GLEW_WIN_scene_markerXXX GLEW_GET_VAR(__GLEW_WIN_scene_markerXXX) + +#endif /* GL_WIN_scene_markerXXX */ + +/* -------------------------- 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 */ + +/* ------------------------------------------------------------------------- */ + + + +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 PFNGLGETGRAPHICSRESETSTATUSPROC __glewGetGraphicsResetStatus; +GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEPROC __glewGetnCompressedTexImage; +GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEPROC __glewGetnTexImage; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVPROC __glewGetnUniformdv; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC __glewMultiDrawArraysIndirectCount; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC __glewMultiDrawElementsIndirectCount; +GLEW_FUN_EXPORT PFNGLSPECIALIZESHADERPROC __glewSpecializeShader; + +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 PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC __glewFramebufferSamplePositionsfvAMD; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC __glewGetFramebufferParameterfvAMD; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC __glewGetNamedFramebufferParameterfvAMD; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC __glewNamedFramebufferSamplePositionsfvAMD; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD; + +GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD; +GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD; +GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD; + +GLEW_FUN_EXPORT PFNGLQUERYOBJECTPARAMETERUIAMDPROC __glewQueryObjectParameteruiAMD; + +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 PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD; + +GLEW_FUN_EXPORT PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD; + +GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD; +GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE; +GLEW_FUN_EXPORT PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE; +GLEW_FUN_EXPORT PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE; +GLEW_FUN_EXPORT PFNGLISQUERYANGLEPROC __glewIsQueryANGLE; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE; + +GLEW_FUN_EXPORT PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE; + +GLEW_FUN_EXPORT PFNGLCOPYTEXTURELEVELSAPPLEPROC __glewCopyTextureLevelsAPPLE; + +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 PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC __glewRenderbufferStorageMultisampleAPPLE; +GLEW_FUN_EXPORT PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC __glewResolveMultisampleFramebufferAPPLE; + +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE; + +GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCAPPLEPROC __glewClientWaitSyncAPPLE; +GLEW_FUN_EXPORT PFNGLDELETESYNCAPPLEPROC __glewDeleteSyncAPPLE; +GLEW_FUN_EXPORT PFNGLFENCESYNCAPPLEPROC __glewFenceSyncAPPLE; +GLEW_FUN_EXPORT PFNGLGETINTEGER64VAPPLEPROC __glewGetInteger64vAPPLE; +GLEW_FUN_EXPORT PFNGLGETSYNCIVAPPLEPROC __glewGetSyncivAPPLE; +GLEW_FUN_EXPORT PFNGLISSYNCAPPLEPROC __glewIsSyncAPPLE; +GLEW_FUN_EXPORT PFNGLWAITSYNCAPPLEPROC __glewWaitSyncAPPLE; + +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 PFNGLMEMORYBARRIERBYREGIONPROC __glewMemoryBarrierByRegion; + +GLEW_FUN_EXPORT PFNGLPRIMITIVEBOUNDINGBOXARBPROC __glewPrimitiveBoundingBoxARB; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed; +GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEPROC __glewBufferStorage; + +GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB; + +GLEW_FUN_EXPORT PFNGLCLEARBUFFERDATAPROC __glewClearBufferData; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT; + +GLEW_FUN_EXPORT PFNGLCLEARTEXIMAGEPROC __glewClearTexImage; +GLEW_FUN_EXPORT PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage; + +GLEW_FUN_EXPORT PFNGLCLIPCONTROLPROC __glewClipControl; + +GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute; +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB; + +GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB; + +GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPROC __glewBindTextureUnit; +GLEW_FUN_EXPORT PFNGLBLITNAMEDFRAMEBUFFERPROC __glewBlitNamedFramebuffer; +GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC __glewCheckNamedFramebufferStatus; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAPROC __glewClearNamedBufferData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAPROC __glewClearNamedBufferSubData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERFIPROC __glewClearNamedFramebufferfi; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERFVPROC __glewClearNamedFramebufferfv; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERIVPROC __glewClearNamedFramebufferiv; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC __glewClearNamedFramebufferuiv; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC __glewCompressedTextureSubImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC __glewCompressedTextureSubImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC __glewCompressedTextureSubImage3D; +GLEW_FUN_EXPORT PFNGLCOPYNAMEDBUFFERSUBDATAPROC __glewCopyNamedBufferSubData; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DPROC __glewCopyTextureSubImage1D; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DPROC __glewCopyTextureSubImage2D; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DPROC __glewCopyTextureSubImage3D; +GLEW_FUN_EXPORT PFNGLCREATEBUFFERSPROC __glewCreateBuffers; +GLEW_FUN_EXPORT PFNGLCREATEFRAMEBUFFERSPROC __glewCreateFramebuffers; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPIPELINESPROC __glewCreateProgramPipelines; +GLEW_FUN_EXPORT PFNGLCREATEQUERIESPROC __glewCreateQueries; +GLEW_FUN_EXPORT PFNGLCREATERENDERBUFFERSPROC __glewCreateRenderbuffers; +GLEW_FUN_EXPORT PFNGLCREATESAMPLERSPROC __glewCreateSamplers; +GLEW_FUN_EXPORT PFNGLCREATETEXTURESPROC __glewCreateTextures; +GLEW_FUN_EXPORT PFNGLCREATETRANSFORMFEEDBACKSPROC __glewCreateTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLCREATEVERTEXARRAYSPROC __glewCreateVertexArrays; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBPROC __glewDisableVertexArrayAttrib; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBPROC __glewEnableVertexArrayAttrib; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC __glewFlushMappedNamedBufferRange; +GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPPROC __glewGenerateTextureMipmap; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC __glewGetCompressedTextureImage; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERI64VPROC __glewGetNamedBufferParameteri64v; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVPROC __glewGetNamedBufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVPROC __glewGetNamedBufferPointerv; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAPROC __glewGetNamedBufferSubData; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetNamedFramebufferAttachmentParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC __glewGetNamedFramebufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC __glewGetNamedRenderbufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTI64VPROC __glewGetQueryBufferObjecti64v; +GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTIVPROC __glewGetQueryBufferObjectiv; +GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTUI64VPROC __glewGetQueryBufferObjectui64v; +GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTUIVPROC __glewGetQueryBufferObjectuiv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEPROC __glewGetTextureImage; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVPROC __glewGetTextureLevelParameterfv; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVPROC __glewGetTextureLevelParameteriv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVPROC __glewGetTextureParameterIiv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVPROC __glewGetTextureParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVPROC __glewGetTextureParameterfv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVPROC __glewGetTextureParameteriv; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKI64_VPROC __glewGetTransformFeedbacki64_v; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKI_VPROC __glewGetTransformFeedbacki_v; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKIVPROC __glewGetTransformFeedbackiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINDEXED64IVPROC __glewGetVertexArrayIndexed64iv; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINDEXEDIVPROC __glewGetVertexArrayIndexediv; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYIVPROC __glewGetVertexArrayiv; +GLEW_FUN_EXPORT PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC __glewInvalidateNamedFramebufferData; +GLEW_FUN_EXPORT PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC __glewInvalidateNamedFramebufferSubData; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERPROC __glewMapNamedBuffer; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEPROC __glewMapNamedBufferRange; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAPROC __glewNamedBufferData; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEPROC __glewNamedBufferStorage; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAPROC __glewNamedBufferSubData; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC __glewNamedFramebufferDrawBuffer; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC __glewNamedFramebufferDrawBuffers; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC __glewNamedFramebufferParameteri; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC __glewNamedFramebufferReadBuffer; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC __glewNamedFramebufferRenderbuffer; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREPROC __glewNamedFramebufferTexture; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC __glewNamedFramebufferTextureLayer; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEPROC __glewNamedRenderbufferStorage; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewNamedRenderbufferStorageMultisample; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERPROC __glewTextureBuffer; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEPROC __glewTextureBufferRange; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVPROC __glewTextureParameterIiv; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVPROC __glewTextureParameterIuiv; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFPROC __glewTextureParameterf; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVPROC __glewTextureParameterfv; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIPROC __glewTextureParameteri; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVPROC __glewTextureParameteriv; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DPROC __glewTextureStorage1D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DPROC __glewTextureStorage2D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC __glewTextureStorage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DPROC __glewTextureStorage3D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC __glewTextureStorage3DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DPROC __glewTextureSubImage1D; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DPROC __glewTextureSubImage2D; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DPROC __glewTextureSubImage3D; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC __glewTransformFeedbackBufferBase; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC __glewTransformFeedbackBufferRange; +GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFERPROC __glewUnmapNamedBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBBINDINGPROC __glewVertexArrayAttribBinding; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBFORMATPROC __glewVertexArrayAttribFormat; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBIFORMATPROC __glewVertexArrayAttribIFormat; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBLFORMATPROC __glewVertexArrayAttribLFormat; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYBINDINGDIVISORPROC __glewVertexArrayBindingDivisor; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYELEMENTBUFFERPROC __glewVertexArrayElementBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBUFFERPROC __glewVertexArrayVertexBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBUFFERSPROC __glewVertexArrayVertexBuffers; + +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 PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT; + +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 PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC __glewGetCompressedTextureSubImage; +GLEW_FUN_EXPORT PFNGLGETTEXTURESUBIMAGEPROC __glewGetTextureSubImage; + +GLEW_FUN_EXPORT PFNGLSPECIALIZESHADERARBPROC __glewSpecializeShaderARB; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv; +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 PFNGLGETUNIFORMI64VARBPROC __glewGetUniformi64vARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VARBPROC __glewGetUniformui64vARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMI64VARBPROC __glewGetnUniformi64vARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUI64VARBPROC __glewGetnUniformui64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64ARBPROC __glewProgramUniform1i64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VARBPROC __glewProgramUniform1i64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64ARBPROC __glewProgramUniform1ui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VARBPROC __glewProgramUniform1ui64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64ARBPROC __glewProgramUniform2i64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VARBPROC __glewProgramUniform2i64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64ARBPROC __glewProgramUniform2ui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VARBPROC __glewProgramUniform2ui64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64ARBPROC __glewProgramUniform3i64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VARBPROC __glewProgramUniform3i64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64ARBPROC __glewProgramUniform3ui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VARBPROC __glewProgramUniform3ui64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64ARBPROC __glewProgramUniform4i64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VARBPROC __glewProgramUniform4i64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64ARBPROC __glewProgramUniform4ui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VARBPROC __glewProgramUniform4ui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64ARBPROC __glewUniform1i64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64VARBPROC __glewUniform1i64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64ARBPROC __glewUniform1ui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VARBPROC __glewUniform1ui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64ARBPROC __glewUniform2i64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64VARBPROC __glewUniform2i64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64ARBPROC __glewUniform2ui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VARBPROC __glewUniform2ui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64ARBPROC __glewUniform3i64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64VARBPROC __glewUniform3i64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64ARBPROC __glewUniform3ui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VARBPROC __glewUniform3ui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64ARBPROC __glewUniform4i64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64VARBPROC __glewUniform4i64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64ARBPROC __glewUniform4ui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VARBPROC __glewUniform4ui64vARB; + +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 PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v; + +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData; +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData; +GLEW_FUN_EXPORT PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage; + +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 PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange; +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures; +GLEW_FUN_EXPORT PFNGLBINDSAMPLERSPROC __glewBindSamplers; +GLEW_FUN_EXPORT PFNGLBINDTEXTURESPROC __glewBindTextures; +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect; + +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 PFNGLMAXSHADERCOMPILERTHREADSARBPROC __glewMaxShaderCompilerThreadsARB; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; + +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETCLAMPPROC __glewPolygonOffsetClamp; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex; + +GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB; +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 PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewFramebufferSampleLocationsfvARB; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewNamedFramebufferSampleLocationsfvARB; + +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 PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier; + +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 PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding; + +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 PFNGLBUFFERPAGECOMMITMENTARBPROC __glewBufferPageCommitmentARB; + +GLEW_FUN_EXPORT PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB; + +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 PFNGLTEXTUREBARRIERPROC __glewTextureBarrier; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT; + +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 PFNGLTEXSTORAGE1DPROC __glewTexStorage1D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLTEXTUREVIEWPROC __glewTextureView; + +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 PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced; + +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 PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC __glewVertexArrayBindVertexBufferEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC __glewVertexArrayVertexAttribBindingEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC __glewVertexArrayVertexAttribFormatEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC __glewVertexArrayVertexAttribIFormatEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC __glewVertexArrayVertexAttribLFormatEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC __glewVertexArrayVertexBindingDivisorEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat; +GLEW_FUN_EXPORT PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor; + +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 __glewPNTrianglesfATI; +GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI; + +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 PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI; +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 PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC __glewDrawArraysInstancedBaseInstanceEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC __glewDrawElementsInstancedBaseInstanceEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC __glewDrawElementsInstancedBaseVertexBaseInstanceEXT; + +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 PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC __glewBindFragDataLocationIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXEXTPROC __glewGetFragDataIndexEXT; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC __glewGetProgramResourceLocationIndexEXT; + +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEEXTPROC __glewBufferStorageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLCLEARTEXIMAGEEXTPROC __glewClearTexImageEXT; +GLEW_FUN_EXPORT PFNGLCLEARTEXSUBIMAGEEXTPROC __glewClearTexSubImageEXT; + +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 PFNGLCOPYIMAGESUBDATAEXTPROC __glewCopyImageSubDataEXT; + +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 PFNGLGETOBJECTLABELEXTPROC __glewGetObjectLabelEXT; +GLEW_FUN_EXPORT PFNGLLABELOBJECTEXTPROC __glewLabelObjectEXT; + +GLEW_FUN_EXPORT PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT; +GLEW_FUN_EXPORT PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT; +GLEW_FUN_EXPORT PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT; + +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 PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC __glewVertexArrayVertexAttribDivisorEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT; + +GLEW_FUN_EXPORT PFNGLDISCARDFRAMEBUFFEREXTPROC __glewDiscardFramebufferEXT; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSEXTPROC __glewDrawBuffersEXT; + +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 PFNGLBLENDEQUATIONSEPARATEIEXTPROC __glewBlendEquationSeparateiEXT; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIEXTPROC __glewBlendEquationiEXT; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIEXTPROC __glewBlendFuncSeparateiEXT; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIEXTPROC __glewBlendFunciEXT; +GLEW_FUN_EXPORT PFNGLCOLORMASKIEXTPROC __glewColorMaskiEXT; +GLEW_FUN_EXPORT PFNGLDISABLEIEXTPROC __glewDisableiEXT; +GLEW_FUN_EXPORT PFNGLENABLEIEXTPROC __glewEnableiEXT; +GLEW_FUN_EXPORT PFNGLISENABLEDIEXTPROC __glewIsEnablediEXT; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXEXTPROC __glewDrawElementsBaseVertexEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC __glewDrawElementsInstancedBaseVertexEXT; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC __glewDrawRangeElementsBaseVertexEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC __glewMultiDrawElementsBaseVertexEXT; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEEXTERNALEXTPROC __glewBufferStorageExternalEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC __glewNamedBufferStorageExternalEXT; + +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 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 PFNGLVERTEXATTRIBDIVISOREXTPROC __glewVertexAttribDivisorEXT; + +GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT; +GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT; + +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC __glewFlushMappedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEEXTPROC __glewMapBufferRangeEXT; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEMEMEXTPROC __glewBufferStorageMemEXT; +GLEW_FUN_EXPORT PFNGLCREATEMEMORYOBJECTSEXTPROC __glewCreateMemoryObjectsEXT; +GLEW_FUN_EXPORT PFNGLDELETEMEMORYOBJECTSEXTPROC __glewDeleteMemoryObjectsEXT; +GLEW_FUN_EXPORT PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC __glewGetMemoryObjectParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETUNSIGNEDBYTEI_VEXTPROC __glewGetUnsignedBytei_vEXT; +GLEW_FUN_EXPORT PFNGLGETUNSIGNEDBYTEVEXTPROC __glewGetUnsignedBytevEXT; +GLEW_FUN_EXPORT PFNGLISMEMORYOBJECTEXTPROC __glewIsMemoryObjectEXT; +GLEW_FUN_EXPORT PFNGLMEMORYOBJECTPARAMETERIVEXTPROC __glewMemoryObjectParameterivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC __glewNamedBufferStorageMemEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM1DEXTPROC __glewTexStorageMem1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM2DEXTPROC __glewTexStorageMem2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC __glewTexStorageMem2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM3DEXTPROC __glewTexStorageMem3DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC __glewTexStorageMem3DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM1DEXTPROC __glewTextureStorageMem1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM2DEXTPROC __glewTextureStorageMem2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC __glewTextureStorageMem2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM3DEXTPROC __glewTextureStorageMem3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC __glewTextureStorageMem3DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTMEMORYFDEXTPROC __glewImportMemoryFdEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC __glewImportMemoryWin32HandleEXT; +GLEW_FUN_EXPORT PFNGLIMPORTMEMORYWIN32NAMEEXTPROC __glewImportMemoryWin32NameEXT; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC __glewMultiDrawArraysIndirectEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC __glewMultiDrawElementsIndirectEXT; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC __glewFramebufferTexture2DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSINDEXEDEXTPROC __glewDrawBuffersIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETINTEGERI_VEXTPROC __glewGetIntegeri_vEXT; +GLEW_FUN_EXPORT PFNGLREADBUFFERINDEXEDEXTPROC __glewReadBufferIndexedEXT; + +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 PFNGLPOLYGONOFFSETCLAMPEXTPROC __glewPolygonOffsetClampEXT; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT; + +GLEW_FUN_EXPORT PFNGLCOVERAGEMODULATIONNVPROC __glewCoverageModulationNV; +GLEW_FUN_EXPORT PFNGLCOVERAGEMODULATIONTABLENVPROC __glewCoverageModulationTableNV; +GLEW_FUN_EXPORT PFNGLGETCOVERAGEMODULATIONTABLENVPROC __glewGetCoverageModulationTableNV; +GLEW_FUN_EXPORT PFNGLRASTERSAMPLESEXTPROC __glewRasterSamplesEXT; + +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 PFNGLDELETESEMAPHORESEXTPROC __glewDeleteSemaphoresEXT; +GLEW_FUN_EXPORT PFNGLGENSEMAPHORESEXTPROC __glewGenSemaphoresEXT; +GLEW_FUN_EXPORT PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC __glewGetSemaphoreParameterui64vEXT; +GLEW_FUN_EXPORT PFNGLISSEMAPHOREEXTPROC __glewIsSemaphoreEXT; +GLEW_FUN_EXPORT PFNGLSEMAPHOREPARAMETERUI64VEXTPROC __glewSemaphoreParameterui64vEXT; +GLEW_FUN_EXPORT PFNGLSIGNALSEMAPHOREEXTPROC __glewSignalSemaphoreEXT; +GLEW_FUN_EXPORT PFNGLWAITSEMAPHOREEXTPROC __glewWaitSemaphoreEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSEMAPHOREFDEXTPROC __glewImportSemaphoreFdEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC __glewImportSemaphoreWin32HandleEXT; +GLEW_FUN_EXPORT PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC __glewImportSemaphoreWin32NameEXT; + +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 PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC __glewClearPixelLocalStorageuiEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC __glewFramebufferPixelLocalStorageSizeEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC __glewGetFramebufferPixelLocalStorageSizeEXT; + +GLEW_FUN_EXPORT PFNGLTEXPAGECOMMITMENTEXTPROC __glewTexPageCommitmentEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT; + +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 PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT; + +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 PFNGLTEXSTORAGE1DEXTPROC __glewTexStorage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DEXTPROC __glewTexStorage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DEXTPROC __glewTexStorage3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXTUREVIEWEXTPROC __glewTextureViewEXT; + +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 PFNGLBINDARRAYSETEXTPROC __glewBindArraySetEXT; +GLEW_FUN_EXPORT PFNGLCREATEARRAYSETEXTPROC __glewCreateArraySetExt; +GLEW_FUN_EXPORT PFNGLDELETEARRAYSETSEXTPROC __glewDeleteArraySetsEXT; + +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 PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC __glewAcquireKeyedMutexWin32EXT; +GLEW_FUN_EXPORT PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC __glewReleaseKeyedMutexWin32EXT; + +GLEW_FUN_EXPORT PFNGLWINDOWRECTANGLESEXTPROC __glewWindowRectanglesEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT; + +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 PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL; +GLEW_FUN_EXPORT PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL; +GLEW_FUN_EXPORT PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; + +GLEW_FUN_EXPORT PFNGLBEGINPERFQUERYINTELPROC __glewBeginPerfQueryINTEL; +GLEW_FUN_EXPORT PFNGLCREATEPERFQUERYINTELPROC __glewCreatePerfQueryINTEL; +GLEW_FUN_EXPORT PFNGLDELETEPERFQUERYINTELPROC __glewDeletePerfQueryINTEL; +GLEW_FUN_EXPORT PFNGLENDPERFQUERYINTELPROC __glewEndPerfQueryINTEL; +GLEW_FUN_EXPORT PFNGLGETFIRSTPERFQUERYIDINTELPROC __glewGetFirstPerfQueryIdINTEL; +GLEW_FUN_EXPORT PFNGLGETNEXTPERFQUERYIDINTELPROC __glewGetNextPerfQueryIdINTEL; +GLEW_FUN_EXPORT PFNGLGETPERFCOUNTERINFOINTELPROC __glewGetPerfCounterInfoINTEL; +GLEW_FUN_EXPORT PFNGLGETPERFQUERYDATAINTELPROC __glewGetPerfQueryDataINTEL; +GLEW_FUN_EXPORT PFNGLGETPERFQUERYIDBYNAMEINTELPROC __glewGetPerfQueryIdByNameINTEL; +GLEW_FUN_EXPORT PFNGLGETPERFQUERYINFOINTELPROC __glewGetPerfQueryInfoINTEL; + +GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; +GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; + +GLEW_FUN_EXPORT PFNGLBLENDBARRIERKHRPROC __glewBlendBarrierKHR; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog; +GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel; +GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel; +GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup; +GLEW_FUN_EXPORT PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup; + +GLEW_FUN_EXPORT PFNGLMAXSHADERCOMPILERTHREADSKHRPROC __glewMaxShaderCompilerThreadsKHR; + +GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVPROC __glewGetnUniformfv; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVPROC __glewGetnUniformiv; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVPROC __glewGetnUniformuiv; +GLEW_FUN_EXPORT PFNGLREADNPIXELSPROC __glewReadnPixels; + +GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion; +GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion; +GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion; + +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 PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX; + +GLEW_FUN_EXPORT PFNGLLGPUCOPYIMAGESUBDATANVXPROC __glewLGPUCopyImageSubDataNVX; +GLEW_FUN_EXPORT PFNGLLGPUINTERLOCKNVXPROC __glewLGPUInterlockNVX; +GLEW_FUN_EXPORT PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC __glewLGPUNamedBufferSubDataNVX; + +GLEW_FUN_EXPORT PFNGLSTEREOPARAMETERFNVPROC __glewStereoParameterfNV; +GLEW_FUN_EXPORT PFNGLSTEREOPARAMETERINVPROC __glewStereoParameteriNV; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawArraysIndirectBindlessCountNV; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawElementsIndirectBindlessCountNV; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV; + +GLEW_FUN_EXPORT PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV; +GLEW_FUN_EXPORT PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV; + +GLEW_FUN_EXPORT PFNGLVIEWPORTPOSITIONWSCALENVPROC __glewViewportPositionWScaleNV; + +GLEW_FUN_EXPORT PFNGLCALLCOMMANDLISTNVPROC __glewCallCommandListNV; +GLEW_FUN_EXPORT PFNGLCOMMANDLISTSEGMENTSNVPROC __glewCommandListSegmentsNV; +GLEW_FUN_EXPORT PFNGLCOMPILECOMMANDLISTNVPROC __glewCompileCommandListNV; +GLEW_FUN_EXPORT PFNGLCREATECOMMANDLISTSNVPROC __glewCreateCommandListsNV; +GLEW_FUN_EXPORT PFNGLCREATESTATESNVPROC __glewCreateStatesNV; +GLEW_FUN_EXPORT PFNGLDELETECOMMANDLISTSNVPROC __glewDeleteCommandListsNV; +GLEW_FUN_EXPORT PFNGLDELETESTATESNVPROC __glewDeleteStatesNV; +GLEW_FUN_EXPORT PFNGLDRAWCOMMANDSADDRESSNVPROC __glewDrawCommandsAddressNV; +GLEW_FUN_EXPORT PFNGLDRAWCOMMANDSNVPROC __glewDrawCommandsNV; +GLEW_FUN_EXPORT PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC __glewDrawCommandsStatesAddressNV; +GLEW_FUN_EXPORT PFNGLDRAWCOMMANDSSTATESNVPROC __glewDrawCommandsStatesNV; +GLEW_FUN_EXPORT PFNGLGETCOMMANDHEADERNVPROC __glewGetCommandHeaderNV; +GLEW_FUN_EXPORT PFNGLGETSTAGEINDEXNVPROC __glewGetStageIndexNV; +GLEW_FUN_EXPORT PFNGLISCOMMANDLISTNVPROC __glewIsCommandListNV; +GLEW_FUN_EXPORT PFNGLISSTATENVPROC __glewIsStateNV; +GLEW_FUN_EXPORT PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC __glewListDrawCommandsStatesClientNV; +GLEW_FUN_EXPORT PFNGLSTATECAPTURENVPROC __glewStateCaptureNV; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV; + +GLEW_FUN_EXPORT PFNGLSUBPIXELPRECISIONBIASNVPROC __glewSubpixelPrecisionBiasNV; + +GLEW_FUN_EXPORT PFNGLCONSERVATIVERASTERPARAMETERFNVPROC __glewConservativeRasterParameterfNV; + +GLEW_FUN_EXPORT PFNGLCONSERVATIVERASTERPARAMETERINVPROC __glewConservativeRasterParameteriNV; + +GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATANVPROC __glewCopyBufferSubDataNV; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV; +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSNVPROC __glewDrawBuffersNV; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDNVPROC __glewDrawArraysInstancedNV; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDNVPROC __glewDrawElementsInstancedNV; + +GLEW_FUN_EXPORT PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV; + +GLEW_FUN_EXPORT PFNGLDRAWVKIMAGENVPROC __glewDrawVkImageNV; +GLEW_FUN_EXPORT PFNGLGETVKPROCADDRNVPROC __glewGetVkProcAddrNV; +GLEW_FUN_EXPORT PFNGLSIGNALVKFENCENVPROC __glewSignalVkFenceNV; +GLEW_FUN_EXPORT PFNGLSIGNALVKSEMAPHORENVPROC __glewSignalVkSemaphoreNV; +GLEW_FUN_EXPORT PFNGLWAITVKSEMAPHORENVPROC __glewWaitVkSemaphoreNV; + +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 PFNGLFRAGMENTCOVERAGECOLORNVPROC __glewFragmentCoverageColorNV; + +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 PFNGLBLITFRAMEBUFFERNVPROC __glewBlitFramebufferNV; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC __glewRenderbufferStorageMultisampleNV; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV; + +GLEW_FUN_EXPORT PFNGLMULTICASTBARRIERNVPROC __glewMulticastBarrierNV; +GLEW_FUN_EXPORT PFNGLMULTICASTBLITFRAMEBUFFERNVPROC __glewMulticastBlitFramebufferNV; +GLEW_FUN_EXPORT PFNGLMULTICASTBUFFERSUBDATANVPROC __glewMulticastBufferSubDataNV; +GLEW_FUN_EXPORT PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC __glewMulticastCopyBufferSubDataNV; +GLEW_FUN_EXPORT PFNGLMULTICASTCOPYIMAGESUBDATANVPROC __glewMulticastCopyImageSubDataNV; +GLEW_FUN_EXPORT PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewMulticastFramebufferSampleLocationsfvNV; +GLEW_FUN_EXPORT PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC __glewMulticastGetQueryObjecti64vNV; +GLEW_FUN_EXPORT PFNGLMULTICASTGETQUERYOBJECTIVNVPROC __glewMulticastGetQueryObjectivNV; +GLEW_FUN_EXPORT PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC __glewMulticastGetQueryObjectui64vNV; +GLEW_FUN_EXPORT PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC __glewMulticastGetQueryObjectuivNV; +GLEW_FUN_EXPORT PFNGLMULTICASTWAITSYNCNVPROC __glewMulticastWaitSyncNV; +GLEW_FUN_EXPORT PFNGLRENDERGPUMASKNVPROC __glewRenderGpuMaskNV; + +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 PFNGLVERTEXATTRIBDIVISORNVPROC __glewVertexAttribDivisorNV; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATSAMPLEIVNVPROC __glewGetInternalformatSampleivNV; + +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVNVPROC __glewUniformMatrix2x3fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVNVPROC __glewUniformMatrix2x4fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVNVPROC __glewUniformMatrix3x2fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVNVPROC __glewUniformMatrix3x4fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVNVPROC __glewUniformMatrix4x2fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVNVPROC __glewUniformMatrix4x3fvNV; + +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 PFNGLCOPYPATHNVPROC __glewCopyPathNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV; +GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV; +GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV; +GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV; +GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEFVNVPROC __glewGetProgramResourcefvNV; +GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV; +GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV; +GLEW_FUN_EXPORT PFNGLMATRIXLOAD3X2FNVPROC __glewMatrixLoad3x2fNV; +GLEW_FUN_EXPORT PFNGLMATRIXLOAD3X3FNVPROC __glewMatrixLoad3x3fNV; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC __glewMatrixLoadTranspose3x3fNV; +GLEW_FUN_EXPORT PFNGLMATRIXMULT3X2FNVPROC __glewMatrixMult3x2fNV; +GLEW_FUN_EXPORT PFNGLMATRIXMULT3X3FNVPROC __glewMatrixMult3x3fNV; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC __glewMatrixMultTranspose3x3fNV; +GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV; +GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV; +GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHINDEXARRAYNVPROC __glewPathGlyphIndexArrayNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHINDEXRANGENVPROC __glewPathGlyphIndexRangeNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV; +GLEW_FUN_EXPORT PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC __glewPathMemoryGlyphIndexArrayNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV; +GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV; +GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC __glewProgramPathFragmentInputGenNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV; +GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC __glewStencilThenCoverFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERFILLPATHNVPROC __glewStencilThenCoverFillPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC __glewStencilThenCoverStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC __glewStencilThenCoverStrokePathNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV; +GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV; + +GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; +GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV; + +GLEW_FUN_EXPORT PFNGLPOLYGONMODENVPROC __glewPolygonModeNV; + +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 PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewFramebufferSampleLocationsfvNV; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewNamedFramebufferSampleLocationsfvNV; + +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 PFNGLCOMPRESSEDTEXIMAGE3DNVPROC __glewCompressedTexImage3DNV; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DNVPROC __glewCompressedTexSubImage3DNV; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DNVPROC __glewCopyTexSubImage3DNV; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERNVPROC __glewFramebufferTextureLayerNV; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DNVPROC __glewTexImage3DNV; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DNVPROC __glewTexSubImage3DNV; + +GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV; + +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 PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV; +GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV; + +GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYFVNVPROC __glewDepthRangeArrayfvNV; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDFNVPROC __glewDepthRangeIndexedfNV; +GLEW_FUN_EXPORT PFNGLDISABLEINVPROC __glewDisableiNV; +GLEW_FUN_EXPORT PFNGLENABLEINVPROC __glewEnableiNV; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VNVPROC __glewGetFloati_vNV; +GLEW_FUN_EXPORT PFNGLISENABLEDINVPROC __glewIsEnablediNV; +GLEW_FUN_EXPORT PFNGLSCISSORARRAYVNVPROC __glewScissorArrayvNV; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDNVPROC __glewScissorIndexedNV; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVNVPROC __glewScissorIndexedvNV; +GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVNVPROC __glewViewportArrayvNV; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFNVPROC __glewViewportIndexedfNV; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVNVPROC __glewViewportIndexedfvNV; + +GLEW_FUN_EXPORT PFNGLVIEWPORTSWIZZLENVPROC __glewViewportSwizzleNV; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC __glewFramebufferTextureMultiviewOVR; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC __glewFramebufferTextureMultisampleMultiviewOVR; + +GLEW_FUN_EXPORT PFNGLALPHAFUNCQCOMPROC __glewAlphaFuncQCOM; + +GLEW_FUN_EXPORT PFNGLDISABLEDRIVERCONTROLQCOMPROC __glewDisableDriverControlQCOM; +GLEW_FUN_EXPORT PFNGLENABLEDRIVERCONTROLQCOMPROC __glewEnableDriverControlQCOM; +GLEW_FUN_EXPORT PFNGLGETDRIVERCONTROLSTRINGQCOMPROC __glewGetDriverControlStringQCOM; +GLEW_FUN_EXPORT PFNGLGETDRIVERCONTROLSQCOMPROC __glewGetDriverControlsQCOM; + +GLEW_FUN_EXPORT PFNGLEXTGETBUFFERPOINTERVQCOMPROC __glewExtGetBufferPointervQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETBUFFERSQCOMPROC __glewExtGetBuffersQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETFRAMEBUFFERSQCOMPROC __glewExtGetFramebuffersQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETRENDERBUFFERSQCOMPROC __glewExtGetRenderbuffersQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC __glewExtGetTexLevelParameterivQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETTEXSUBIMAGEQCOMPROC __glewExtGetTexSubImageQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETTEXTURESQCOMPROC __glewExtGetTexturesQCOM; +GLEW_FUN_EXPORT PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC __glewExtTexObjectStateOverrideiQCOM; + +GLEW_FUN_EXPORT PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC __glewExtGetProgramBinarySourceQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETPROGRAMSQCOMPROC __glewExtGetProgramsQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETSHADERSQCOMPROC __glewExtGetShadersQCOM; +GLEW_FUN_EXPORT PFNGLEXTISPROGRAMBINARYQCOMPROC __glewExtIsProgramBinaryQCOM; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC __glewFramebufferFoveationConfigQCOM; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC __glewFramebufferFoveationParametersQCOM; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC __glewFramebufferFetchBarrierQCOM; + +GLEW_FUN_EXPORT PFNGLENDTILINGQCOMPROC __glewEndTilingQCOM; +GLEW_FUN_EXPORT PFNGLSTARTTILINGQCOMPROC __glewStartTilingQCOM; + +GLEW_FUN_EXPORT PFNGLALPHAFUNCXPROC __glewAlphaFuncx; +GLEW_FUN_EXPORT PFNGLCLEARCOLORXPROC __glewClearColorx; +GLEW_FUN_EXPORT PFNGLCLEARDEPTHXPROC __glewClearDepthx; +GLEW_FUN_EXPORT PFNGLCOLOR4XPROC __glewColor4x; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEXPROC __glewDepthRangex; +GLEW_FUN_EXPORT PFNGLFOGXPROC __glewFogx; +GLEW_FUN_EXPORT PFNGLFOGXVPROC __glewFogxv; +GLEW_FUN_EXPORT PFNGLFRUSTUMFPROC __glewFrustumf; +GLEW_FUN_EXPORT PFNGLFRUSTUMXPROC __glewFrustumx; +GLEW_FUN_EXPORT PFNGLLIGHTMODELXPROC __glewLightModelx; +GLEW_FUN_EXPORT PFNGLLIGHTMODELXVPROC __glewLightModelxv; +GLEW_FUN_EXPORT PFNGLLIGHTXPROC __glewLightx; +GLEW_FUN_EXPORT PFNGLLIGHTXVPROC __glewLightxv; +GLEW_FUN_EXPORT PFNGLLINEWIDTHXPROC __glewLineWidthx; +GLEW_FUN_EXPORT PFNGLLOADMATRIXXPROC __glewLoadMatrixx; +GLEW_FUN_EXPORT PFNGLMATERIALXPROC __glewMaterialx; +GLEW_FUN_EXPORT PFNGLMATERIALXVPROC __glewMaterialxv; +GLEW_FUN_EXPORT PFNGLMULTMATRIXXPROC __glewMultMatrixx; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x; +GLEW_FUN_EXPORT PFNGLNORMAL3XPROC __glewNormal3x; +GLEW_FUN_EXPORT PFNGLORTHOFPROC __glewOrthof; +GLEW_FUN_EXPORT PFNGLORTHOXPROC __glewOrthox; +GLEW_FUN_EXPORT PFNGLPOINTSIZEXPROC __glewPointSizex; +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx; +GLEW_FUN_EXPORT PFNGLROTATEXPROC __glewRotatex; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex; +GLEW_FUN_EXPORT PFNGLSCALEXPROC __glewScalex; +GLEW_FUN_EXPORT PFNGLTEXENVXPROC __glewTexEnvx; +GLEW_FUN_EXPORT PFNGLTEXENVXVPROC __glewTexEnvxv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERXPROC __glewTexParameterx; +GLEW_FUN_EXPORT PFNGLTRANSLATEXPROC __glewTranslatex; + +GLEW_FUN_EXPORT PFNGLCLIPPLANEFPROC __glewClipPlanef; +GLEW_FUN_EXPORT PFNGLCLIPPLANEXPROC __glewClipPlanex; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex; +GLEW_FUN_EXPORT PFNGLGETFIXEDVPROC __glewGetFixedv; +GLEW_FUN_EXPORT PFNGLGETLIGHTXVPROC __glewGetLightxv; +GLEW_FUN_EXPORT PFNGLGETMATERIALXVPROC __glewGetMaterialxv; +GLEW_FUN_EXPORT PFNGLGETTEXENVXVPROC __glewGetTexEnvxv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXPROC __glewPointParameterx; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv; +GLEW_FUN_EXPORT PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERXVPROC __glewTexParameterxv; + +GLEW_FUN_EXPORT PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL; + +GLEW_FUN_EXPORT PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL; +GLEW_FUN_EXPORT PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL; + +GLEW_FUN_EXPORT PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL; + +GLEW_FUN_EXPORT PFNGLGETPROCADDRESSREGALPROC __glewGetProcAddressREGAL; + +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 PFNGLINTERLEAVEDTEXTURECOORDSETSSGISPROC __glewInterleavedTextureCoordSetsSGIS; +GLEW_FUN_EXPORT PFNGLSELECTTEXTURECOORDSETSGISPROC __glewSelectTextureCoordSetSGIS; +GLEW_FUN_EXPORT PFNGLSELECTTEXTURESGISPROC __glewSelectTextureSGIS; +GLEW_FUN_EXPORT PFNGLSELECTTEXTURETRANSFORMSGISPROC __glewSelectTextureTransformSGIS; + +GLEW_FUN_EXPORT PFNGLMULTISAMPLESUBRECTPOSSGISPROC __glewMultisampleSubRectPosSGIS; + +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 PFNGLADDRESSSPACEPROC __glewAddressSpace; +GLEW_FUN_EXPORT PFNGLDATAPIPEPROC __glewDataPipe; + +GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX; + +GLEW_FUN_EXPORT PFNGLFOGLAYERSSGIXPROC __glewFogLayersSGIX; +GLEW_FUN_EXPORT PFNGLGETFOGLAYERSSGIXPROC __glewGetFogLayersSGIX; + +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 PFNGLIGLOOINTERFACESGIXPROC __glewIglooInterfaceSGIX; + +GLEW_FUN_EXPORT PFNGLALLOCMPEGPREDICTORSSGIXPROC __glewAllocMPEGPredictorsSGIX; +GLEW_FUN_EXPORT PFNGLDELETEMPEGPREDICTORSSGIXPROC __glewDeleteMPEGPredictorsSGIX; +GLEW_FUN_EXPORT PFNGLGENMPEGPREDICTORSSGIXPROC __glewGenMPEGPredictorsSGIX; +GLEW_FUN_EXPORT PFNGLGETMPEGPARAMETERFVSGIXPROC __glewGetMPEGParameterfvSGIX; +GLEW_FUN_EXPORT PFNGLGETMPEGPARAMETERIVSGIXPROC __glewGetMPEGParameterivSGIX; +GLEW_FUN_EXPORT PFNGLGETMPEGPREDICTORSGIXPROC __glewGetMPEGPredictorSGIX; +GLEW_FUN_EXPORT PFNGLGETMPEGQUANTTABLEUBVPROC __glewGetMPEGQuantTableubv; +GLEW_FUN_EXPORT PFNGLISMPEGPREDICTORSGIXPROC __glewIsMPEGPredictorSGIX; +GLEW_FUN_EXPORT PFNGLMPEGPREDICTORSGIXPROC __glewMPEGPredictorSGIX; +GLEW_FUN_EXPORT PFNGLMPEGQUANTTABLEUBVPROC __glewMPEGQuantTableubv; +GLEW_FUN_EXPORT PFNGLSWAPMPEGPREDICTORSSGIXPROC __glewSwapMPEGPredictorsSGIX; + +GLEW_FUN_EXPORT PFNGLGETNONLINLIGHTFVSGIXPROC __glewGetNonlinLightfvSGIX; +GLEW_FUN_EXPORT PFNGLGETNONLINMATERIALFVSGIXPROC __glewGetNonlinMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLNONLINLIGHTFVSGIXPROC __glewNonlinLightfvSGIX; +GLEW_FUN_EXPORT PFNGLNONLINMATERIALFVSGIXPROC __glewNonlinMaterialfvSGIX; + +GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX; + +GLEW_FUN_EXPORT PFNGLDEFORMSGIXPROC __glewDeformSGIX; +GLEW_FUN_EXPORT PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC __glewLoadIdentityDeformationMapSGIX; + +GLEW_FUN_EXPORT PFNGLMESHBREADTHSGIXPROC __glewMeshBreadthSGIX; +GLEW_FUN_EXPORT PFNGLMESHSTRIDESGIXPROC __glewMeshStrideSGIX; + +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 PFNGLGETVECTOROPERATIONSGIXPROC __glewGetVectorOperationSGIX; +GLEW_FUN_EXPORT PFNGLVECTOROPERATIONSGIXPROC __glewVectorOperationSGIX; + +GLEW_FUN_EXPORT PFNGLAREVERTEXARRAYSRESIDENTSGIXPROC __glewAreVertexArraysResidentSGIX; +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYSGIXPROC __glewBindVertexArraySGIX; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSSGIXPROC __glewDeleteVertexArraysSGIX; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSSGIXPROC __glewGenVertexArraysSGIX; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYSGIXPROC __glewIsVertexArraySGIX; +GLEW_FUN_EXPORT PFNGLPRIORITIZEVERTEXARRAYSSGIXPROC __glewPrioritizeVertexArraysSGIX; + +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 PFNGLGETPIXELTRANSFORMPARAMETERFVSGIPROC __glewGetPixelTransformParameterfvSGI; +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVSGIPROC __glewGetPixelTransformParameterivSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFSGIPROC __glewPixelTransformParameterfSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVSGIPROC __glewPixelTransformParameterfvSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERISGIPROC __glewPixelTransformParameteriSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVSGIPROC __glewPixelTransformParameterivSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMSGIPROC __glewPixelTransformSGI; + +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; +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_VERSION_4_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_4; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_5; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_6; +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_blend_minmax_factor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_compressed_3DC_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_compressed_ATC_texture; +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_framebuffer_sample_positions; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gcn_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gpu_shader_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gpu_shader_int16; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gpu_shader_int64; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_interleaved_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_occlusion_query_event; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_pinned_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_program_binary_Z400; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_atomic_counter_ops; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_ballot; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_explicit_vertex_parameter; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_value_export; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_trinary_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_stencil_operation_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_gather_bias_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback4; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_layer; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_viewport_index; +GLEW_VAR_EXPORT GLboolean __GLEW_ANDROID_extension_pack_es31a; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_pack_reverse_row_order; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt3; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt5; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_usage; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_translated_shader_source; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_clip_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_color_buffer_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_copy_texture_levels; +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_framebuffer_multisample; +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_sync; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_2D_limited_npot; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_format_BGRA8888; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_max_level; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_packed_float; +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_ES3_1_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_2_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_arrays_of_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_buffer_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clip_control; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_variable_group_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conditional_render_inverted; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cull_distance; +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_derivative_control; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_direct_state_access; +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_enhanced_layouts; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_uniform_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_layer_viewport; +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_fragment_shader_interlock; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_no_attachments; +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_get_texture_sub_image; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gl_spirv; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_int64; +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_indirect_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_invalidate_subdata; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_bind; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_draw_indirect; +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_parallel_shader_compile; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pipeline_statistics_query; +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_polygon_offset_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_post_depth_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_program_interface_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robust_buffer_access_behavior; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_application_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_share_group_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_locations; +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_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counter_ops; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_ballot; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_clock; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_draw_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_group_vote; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_size; +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_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_image_samples; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_viewport_layer_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_spirv_extensions; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_stencil_texturing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_barrier; +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_buffer_range; +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_filter_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_filter_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge; +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_levels; +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_stencil8; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_view; +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_transform_feedback_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_overflow_query; +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_attrib_binding; +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_10f_11f_11f_rev; +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_ARM_mali_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_mali_shader_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_rgba8; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_shader_framebuffer_fetch; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_shader_framebuffer_fetch_depth_stencil; +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_EGL_KHR_context_flush_control; +GLEW_VAR_EXPORT GLboolean __GLEW_EGL_NV_robustness_video_memory_purge; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_EGL_image_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_YUV_target; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_base_instance; +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_extended; +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_buffer_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clear_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_cull_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_buffer_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compressed_ETC1_RGB8_sub_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_label; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_discard_framebuffer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers_indexed; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_elements_base_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_external_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_float_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_frag_depth; +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_multisample_blit_scaled; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_point_size; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader; +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_gpu_shader5; +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_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_map_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_memory_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_memory_object_fd; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_memory_object_win32; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multiple_textures; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisampled_render_to_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisampled_render_to_texture2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multiview_draw_buffers; +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_polygon_offset_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_post_depth_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pvrtc_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_raster_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_read_format_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_render_snorm; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sRGB_write_control; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_semaphore; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_semaphore_fd; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_semaphore_win32; +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_framebuffer_fetch; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_group_vote; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_formatted; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_implicit_conversions; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_integer_mix; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_io_blocks; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_non_constant_global_initializers; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_pixel_local_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_pixel_local_storage2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_samplers; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sparse_texture2; +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_astc_decode_mode; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_bptc; +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_cube_map_array; +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_filter_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_format_BGRA8888; +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_norm16; +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_rg; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_R8; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_RG8; +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_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_type_2_10_10_10_REV; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_view; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_unpack_subimage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_setXXX; +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_EXT_win32_keyed_mutex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_window_rectangles; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object; +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_conservative_rasterization; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_fragment_shader_ordering; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_framebuffer_CMAA; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_map_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_performance_query; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_blend_equation_advanced; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_blend_equation_advanced_coherent; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_context_flush_control; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_debug; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_no_error; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_parallel_shader_compile; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_robust_buffer_access_behavior; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_robustness; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_hdr; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_ldr; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_sliced_3d; +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_shader_integer_functions; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_blend_equation_advanced_multi_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_linked_gpu_multicast; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_3dvision_settings; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_EGL_stream_consumer_external; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_alpha_to_coverage_dither_control; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bgr; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect_count; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced_coherent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_minmax_factor; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_clip_space_w_scaling; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_command_list; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_compute_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster_dilate; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster_pre_snap_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_deep_texture3D; +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_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_vulkan_image; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_attrib_location; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fbo_color_attachments; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fill_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_coverage_to_color; +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_fragment_shader_interlock; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_mixed_samples; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_generate_mipmap_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader_passthrough; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_multicast; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5_mem_extended; +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_image_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_internalformat_sample_query; +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_non_square_matrices; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pack_subimage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_float_linear; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering_shared_edge; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_platform_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_polygon_mode; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_read_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_read_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_read_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_robustness_video_memory_purge; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_sRGB_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_sample_locations; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_sample_mask_override_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_fp16_vector; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_int64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_noperspective_interpolation; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_thread_group; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_thread_shuffle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shadow_samplers_array; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shadow_samplers_cube; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_stereo_view_rendering; +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_array; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_latc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_s3tc_update; +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_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_npot_2D_mipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle_compressed; +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_uniform_buffer_unified_memory; +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_NV_video_capture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_viewport_array; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_viewport_array2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_viewport_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates; +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_OVR_multiview; +GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview2; +GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview_multisampled_render_to_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_alpha_test; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_binning_control; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_driver_control; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_extended_get; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_extended_get2; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_framebuffer_foveated; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_perfmon_global_mode; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_shader_framebuffer_fetch_noncoherent; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_tiled_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_writeonly_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_0_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_1_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_enable; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_error_string; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_extension_query; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_log; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_proc_address; +GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_clip_band_hint; +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_line_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multitexture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_shared_multisample; +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_bali_g_instruments; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_bali_r_instruments; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_bali_timer_instruments; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_cadd; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_cmultiply; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_calligraphic_fragment; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_color_matrix_accuracy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_color_table_index_mode; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_complex_polar; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_cylinder_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_datapipe; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_decimation; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_pass_instrument; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_dvc; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_factor_to_alpha; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_layers; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_patchy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_scale; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_lighting_space; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragments_instrument; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_icc_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_igloo_interface; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_image_compression; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_impact_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_instrument_error; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_line_quality_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_mpeg1; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_mpeg2; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_nonlinear_lighting_pervertex; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_nurbs_eval; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_occlusion_instrument; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_packed_6bytes; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_tiles; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_polynomial_ffd; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_quad_mesh; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_scalebias_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_slim; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_spotlight_cutoff; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_subdiv_patch; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_subsample; +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_mipmap_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_phase; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_supersample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vector_ops; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_array_object; +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_SGIX_ycrcb_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcba; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_complex; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_complex_type; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_fft; +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_scene_markerXXX; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; +/* ------------------------------------------------------------------------- */ + +/* 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 */ +#define GLEW_ERROR_NO_GLX_DISPLAY 4 /* Need GLX display for GLX support */ + +/* string codes */ +#define GLEW_VERSION 1 +#define GLEW_VERSION_MAJOR 2 +#define GLEW_VERSION_MINOR 3 +#define GLEW_VERSION_MICRO 4 + +/* ------------------------------------------------------------------------- */ + +/* GLEW version info */ + +/* +VERSION 2.1.0 +VERSION_MAJOR 2 +VERSION_MINOR 1 +VERSION_MICRO 0 +*/ + +/* API */ +GLEWAPI GLenum GLEWAPIENTRY glewInit (void); +GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name); +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#ifndef GLEW_GET_VAR +#define GLEW_GET_VAR(x) (*(const GLboolean*)&x) +#endif + +#ifndef GLEW_GET_FUN +#define GLEW_GET_FUN(x) x +#endif + +GLEWAPI GLboolean glewExperimental; +GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name); + +#ifdef __cplusplus +} +#endif + +#ifdef GLEW_APIENTRY_DEFINED +#undef GLEW_APIENTRY_DEFINED +#undef APIENTRY +#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/include/GL/glxew.h b/include/GL/glxew.h new file mode 100644 index 00000000..7e39c2fd --- /dev/null +++ b/include/GL/glxew.h @@ -0,0 +1,1775 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart +** 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 + +#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_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_RGBA_BIT 0x00000001 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_PIXMAP_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 + +typedef void ( * PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC) (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC) (unsigned int id, GLXContext share_list); +typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (unsigned int id, GLXContext share_context, const int* attribList); +typedef Bool ( * PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC) (GLXContext ctx); +typedef unsigned int ( * PFNGLXGETCONTEXTGPUIDAMDPROC) (GLXContext ctx); +typedef GLXContext ( * PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef unsigned int ( * PFNGLXGETGPUIDSAMDPROC) (unsigned int maxCount, unsigned int* ids); +typedef int ( * PFNGLXGETGPUINFOAMDPROC) (unsigned int id, int property, GLenum dataType, unsigned int size, void* data); +typedef Bool ( * PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (GLXContext ctx); + +#define glXBlitContextFramebufferAMD GLXEW_GET_FUN(__glewXBlitContextFramebufferAMD) +#define glXCreateAssociatedContextAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAMD) +#define glXCreateAssociatedContextAttribsAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAttribsAMD) +#define glXDeleteAssociatedContextAMD GLXEW_GET_FUN(__glewXDeleteAssociatedContextAMD) +#define glXGetContextGPUIDAMD GLXEW_GET_FUN(__glewXGetContextGPUIDAMD) +#define glXGetCurrentAssociatedContextAMD GLXEW_GET_FUN(__glewXGetCurrentAssociatedContextAMD) +#define glXGetGPUIDsAMD GLXEW_GET_FUN(__glewXGetGPUIDsAMD) +#define glXGetGPUInfoAMD GLXEW_GET_FUN(__glewXGetGPUInfoAMD) +#define glXMakeAssociatedContextCurrentAMD GLXEW_GET_FUN(__glewXMakeAssociatedContextCurrentAMD) + +#define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association) + +#endif /* GLX_AMD_gpu_association */ + +/* --------------------- GLX_ARB_context_flush_control --------------------- */ + +#ifndef GLX_ARB_context_flush_control +#define GLX_ARB_context_flush_control 1 + +#define GLXEW_ARB_context_flush_control GLXEW_GET_VAR(__GLXEW_ARB_context_flush_control) + +#endif /* GLX_ARB_context_flush_control */ + +/* ------------------------- 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_no_error -------------------- */ + +#ifndef GLX_ARB_create_context_no_error +#define GLX_ARB_create_context_no_error 1 + +#define GLXEW_ARB_create_context_no_error GLXEW_GET_VAR(__GLXEW_ARB_create_context_no_error) + +#endif /* GLX_ARB_create_context_no_error */ + +/* --------------------- 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_ARB 0x00000004 +#define GLX_RGBA_FLOAT_TYPE_ARB 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_robustness_application_isolation --------------- */ + +#ifndef GLX_ARB_robustness_application_isolation +#define GLX_ARB_robustness_application_isolation 1 + +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define GLXEW_ARB_robustness_application_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_application_isolation) + +#endif /* GLX_ARB_robustness_application_isolation */ + +/* ---------------- GLX_ARB_robustness_share_group_isolation --------------- */ + +#ifndef GLX_ARB_robustness_share_group_isolation +#define GLX_ARB_robustness_share_group_isolation 1 + +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define GLXEW_ARB_robustness_share_group_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_share_group_isolation) + +#endif /* GLX_ARB_robustness_share_group_isolation */ + +/* ---------------------- 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_buffer_age -------------------------- */ + +#ifndef GLX_EXT_buffer_age +#define GLX_EXT_buffer_age 1 + +#define GLX_BACK_BUFFER_AGE_EXT 0x20F4 + +#define GLXEW_EXT_buffer_age GLXEW_GET_VAR(__GLXEW_EXT_buffer_age) + +#endif /* GLX_EXT_buffer_age */ + +/* ------------------- 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_create_context_es_profile ------------------- */ + +#ifndef GLX_EXT_create_context_es_profile +#define GLX_EXT_create_context_es_profile 1 + +#define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define GLXEW_EXT_create_context_es_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es_profile) + +#endif /* GLX_EXT_create_context_es_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_libglvnd --------------------------- */ + +#ifndef GLX_EXT_libglvnd +#define GLX_EXT_libglvnd 1 + +#define GLX_VENDOR_NAMES_EXT 0x20F6 + +#define GLXEW_EXT_libglvnd GLXEW_GET_VAR(__GLXEW_EXT_libglvnd) + +#endif /* GLX_EXT_libglvnd */ + +/* -------------------------- 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_stereo_tree -------------------------- */ + +#ifndef GLX_EXT_stereo_tree +#define GLX_EXT_stereo_tree 1 + +#define GLX_STEREO_NOTIFY_EXT 0x00000000 +#define GLX_STEREO_NOTIFY_MASK_EXT 0x00000001 +#define GLX_STEREO_TREE_EXT 0x20F5 + +#define GLXEW_EXT_stereo_tree GLXEW_GET_VAR(__GLXEW_EXT_stereo_tree) + +#endif /* GLX_EXT_stereo_tree */ + +/* -------------------------- 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_swap_control_tear ----------------------- */ + +#ifndef GLX_EXT_swap_control_tear +#define GLX_EXT_swap_control_tear 1 + +#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3 + +#define GLXEW_EXT_swap_control_tear GLXEW_GET_VAR(__GLXEW_EXT_swap_control_tear) + +#endif /* GLX_EXT_swap_control_tear */ + +/* ---------------------- 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_query_renderer ------------------------ */ + +#ifndef GLX_MESA_query_renderer +#define GLX_MESA_query_renderer 1 + +#define GLX_RENDERER_VENDOR_ID_MESA 0x8183 +#define GLX_RENDERER_DEVICE_ID_MESA 0x8184 +#define GLX_RENDERER_VERSION_MESA 0x8185 +#define GLX_RENDERER_ACCELERATED_MESA 0x8186 +#define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187 +#define GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188 +#define GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189 +#define GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A +#define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B +#define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C +#define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D +#define GLX_RENDERER_ID_MESA 0x818E + +typedef Bool ( * PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int* value); +typedef const char* ( * PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) (int attribute); +typedef Bool ( * PFNGLXQUERYRENDERERINTEGERMESAPROC) (Display* dpy, int screen, int renderer, int attribute, unsigned int *value); +typedef const char* ( * PFNGLXQUERYRENDERERSTRINGMESAPROC) (Display *dpy, int screen, int renderer, int attribute); + +#define glXQueryCurrentRendererIntegerMESA GLXEW_GET_FUN(__glewXQueryCurrentRendererIntegerMESA) +#define glXQueryCurrentRendererStringMESA GLXEW_GET_FUN(__glewXQueryCurrentRendererStringMESA) +#define glXQueryRendererIntegerMESA GLXEW_GET_FUN(__glewXQueryRendererIntegerMESA) +#define glXQueryRendererStringMESA GLXEW_GET_FUN(__glewXQueryRendererStringMESA) + +#define GLXEW_MESA_query_renderer GLXEW_GET_VAR(__GLXEW_MESA_query_renderer) + +#endif /* GLX_MESA_query_renderer */ + +/* ------------------------ 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_MESA_swap_control ------------------------- */ + +#ifndef GLX_MESA_swap_control +#define GLX_MESA_swap_control 1 + +typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void); +typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval); + +#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA) +#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA) + +#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control) + +#endif /* GLX_MESA_swap_control */ + +/* --------------------------- GLX_NV_copy_buffer -------------------------- */ + +#ifndef GLX_NV_copy_buffer +#define GLX_NV_copy_buffer 1 + +typedef void ( * PFNGLXCOPYBUFFERSUBDATANVPROC) (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void ( * PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); + +#define glXCopyBufferSubDataNV GLXEW_GET_FUN(__glewXCopyBufferSubDataNV) +#define glXNamedCopyBufferSubDataNV GLXEW_GET_FUN(__glewXNamedCopyBufferSubDataNV) + +#define GLXEW_NV_copy_buffer GLXEW_GET_VAR(__GLXEW_NV_copy_buffer) + +#endif /* GLX_NV_copy_buffer */ + +/* --------------------------- 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_delay_before_swap ----------------------- */ + +#ifndef GLX_NV_delay_before_swap +#define GLX_NV_delay_before_swap 1 + +typedef Bool ( * PFNGLXDELAYBEFORESWAPNVPROC) (Display* dpy, GLXDrawable drawable, GLfloat seconds); + +#define glXDelayBeforeSwapNV GLXEW_GET_FUN(__glewXDelayBeforeSwapNV) + +#define GLXEW_NV_delay_before_swap GLXEW_GET_VAR(__GLXEW_NV_delay_before_swap) + +#endif /* GLX_NV_delay_before_swap */ + +/* -------------------------- 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_robustness_video_memory_purge ----------------- */ + +#ifndef GLX_NV_robustness_video_memory_purge +#define GLX_NV_robustness_video_memory_purge 1 + +#define GLX_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x20F7 + +#define GLXEW_NV_robustness_video_memory_purge GLXEW_GET_VAR(__GLXEW_NV_robustness_video_memory_purge) + +#endif /* GLX_NV_robustness_video_memory_purge */ + +/* --------------------------- 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_capture ------------------------- */ + +#ifndef GLX_NV_video_capture +#define GLX_NV_video_capture 1 + +#define GLX_DEVICE_ID_NV 0x20CD +#define GLX_UNIQUE_ID_NV 0x20CE +#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +typedef XID GLXVideoCaptureDeviceNV; + +typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device); +typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements); +typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); +typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value); +typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); + +#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV) +#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV) +#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV) +#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV) +#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV) + +#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture) + +#endif /* GLX_NV_video_capture */ + +/* ---------------------------- GLX_NV_video_out --------------------------- */ + +#ifndef GLX_NV_video_out +#define GLX_NV_video_out 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_out GLXEW_GET_VAR(__GLXEW_NV_video_out) + +#endif /* GLX_NV_video_out */ + +/* -------------------------- 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 ------------------------- */ + +#ifndef GLX_OML_sync_control +#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 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_RGBA_BIT_SGIX 0x00000001 +#define GLX_WINDOW_BIT_SGIX 0x00000001 +#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_PIXMAP_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_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 +#define GLX_PIPE_RECT_LIMITS_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_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_PBUFFER_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 */ + +/* ------------------------------------------------------------------------- */ + +#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT +#define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT + +GLXEW_FUN_EXPORT PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay; + +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig; +GLXEW_FUN_EXPORT PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext; +GLXEW_FUN_EXPORT PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer; +GLXEW_FUN_EXPORT PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap; +GLXEW_FUN_EXPORT PFNGLXCREATEWINDOWPROC __glewXCreateWindow; +GLXEW_FUN_EXPORT PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer; +GLXEW_FUN_EXPORT PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap; +GLXEW_FUN_EXPORT PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow; +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs; +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent; +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig; +GLXEW_FUN_EXPORT PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent; +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTPROC __glewXQueryContext; +GLXEW_FUN_EXPORT PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable; +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTPROC __glewXSelectEvent; + +GLXEW_FUN_EXPORT PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC __glewXBlitContextFramebufferAMD; +GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC __glewXCreateAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __glewXCreateAssociatedContextAttribsAMD; +GLXEW_FUN_EXPORT PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC __glewXDeleteAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXGETCONTEXTGPUIDAMDPROC __glewXGetContextGPUIDAMD; +GLXEW_FUN_EXPORT PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC __glewXGetCurrentAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXGETGPUIDSAMDPROC __glewXGetGPUIDsAMD; +GLXEW_FUN_EXPORT PFNGLXGETGPUINFOAMDPROC __glewXGetGPUInfoAMD; +GLXEW_FUN_EXPORT PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __glewXMakeAssociatedContextCurrentAMD; + +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB; + +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI; +GLXEW_FUN_EXPORT PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI; +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI; + +GLXEW_FUN_EXPORT PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT; +GLXEW_FUN_EXPORT PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT; +GLXEW_FUN_EXPORT PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT; +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT; + +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT; + +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT; +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT; + +GLXEW_FUN_EXPORT PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA; + +GLXEW_FUN_EXPORT PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA; + +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA; + +GLXEW_FUN_EXPORT PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC __glewXQueryCurrentRendererIntegerMESA; +GLXEW_FUN_EXPORT PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC __glewXQueryCurrentRendererStringMESA; +GLXEW_FUN_EXPORT PFNGLXQUERYRENDERERINTEGERMESAPROC __glewXQueryRendererIntegerMESA; +GLXEW_FUN_EXPORT PFNGLXQUERYRENDERERSTRINGMESAPROC __glewXQueryRendererStringMESA; + +GLXEW_FUN_EXPORT PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA; + +GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA; + +GLXEW_FUN_EXPORT PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA; +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA; + +GLXEW_FUN_EXPORT PFNGLXCOPYBUFFERSUBDATANVPROC __glewXCopyBufferSubDataNV; +GLXEW_FUN_EXPORT PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC __glewXNamedCopyBufferSubDataNV; + +GLXEW_FUN_EXPORT PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV; + +GLXEW_FUN_EXPORT PFNGLXDELAYBEFORESWAPNVPROC __glewXDelayBeforeSwapNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV; + +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV; +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV; +GLXEW_FUN_EXPORT PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV; +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV; +GLXEW_FUN_EXPORT PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV; +GLXEW_FUN_EXPORT PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV; + +GLXEW_FUN_EXPORT PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV; +GLXEW_FUN_EXPORT PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV; +GLXEW_FUN_EXPORT PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV; +GLXEW_FUN_EXPORT PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV; +GLXEW_FUN_EXPORT PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV; + +GLXEW_FUN_EXPORT PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML; +GLXEW_FUN_EXPORT PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML; +GLXEW_FUN_EXPORT PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML; +GLXEW_FUN_EXPORT PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML; +GLXEW_FUN_EXPORT PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML; + +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX; +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX; +GLXEW_FUN_EXPORT PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX; + +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX; + +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX; +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX; +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX; + +GLXEW_FUN_EXPORT PFNGLXCUSHIONSGIPROC __glewXCushionSGI; + +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI; +GLXEW_FUN_EXPORT PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI; + +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI; + +GLXEW_FUN_EXPORT PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI; +GLXEW_FUN_EXPORT PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI; + +GLXEW_FUN_EXPORT PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN; + +GLXEW_FUN_EXPORT PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN; +GLXEW_FUN_EXPORT PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_3; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_4; +GLXEW_VAR_EXPORT GLboolean __GLXEW_3DFX_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_AMD_gpu_association; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_context_flush_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_no_error; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_robustness; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_fbconfig_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_get_proc_address; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_application_isolation; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_share_group_isolation; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_pixel_format_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_render_texture; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_buffer_age; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_import_context; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_libglvnd; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_scene_marker; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_stereo_tree; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control_tear; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_info; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_rating; +GLXEW_VAR_EXPORT GLboolean __GLXEW_INTEL_swap_event; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_agp_offset; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_query_renderer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_release_buffers; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_image; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_delay_before_swap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_float_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_multisample_coverage; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_present_video; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_robustness_video_memory_purge; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_swap_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_vertex_array_range; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_capture; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_out; +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_swap_method; +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_sync_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_blended_overlay; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_color_range; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_shared_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_fbconfig; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_hyperpipe; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_pbuffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_barrier; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_video_resize; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_visual_select_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_cushion; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_make_current_read; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_video_sync; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_get_transparent_index; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_video_resize; +/* ------------------------------------------------------------------------ */ + +GLEWAPI GLenum GLEWAPIENTRY glxewInit (); +GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name); + +#ifndef GLXEW_GET_VAR +#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x) +#endif + +#ifndef GLXEW_GET_FUN +#define GLXEW_GET_FUN(x) x +#endif + +GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#endif /* __glxew_h__ */ diff --git a/include/GL/wglew.h b/include/GL/wglew.h new file mode 100644 index 00000000..2097c0f0 --- /dev/null +++ b/include/GL/wglew.h @@ -0,0 +1,1447 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart +** 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_context_flush_control --------------------- */ + +#ifndef WGL_ARB_context_flush_control +#define WGL_ARB_context_flush_control 1 + +#define WGLEW_ARB_context_flush_control WGLEW_GET_VAR(__WGLEW_ARB_context_flush_control) + +#endif /* WGL_ARB_context_flush_control */ + +/* ------------------------- 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 +#define ERROR_INVALID_VERSION_ARB 0x2095 +#define ERROR_INVALID_PROFILE_ARB 0x2096 + +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_no_error -------------------- */ + +#ifndef WGL_ARB_create_context_no_error +#define WGL_ARB_create_context_no_error 1 + +#define WGLEW_ARB_create_context_no_error WGLEW_GET_VAR(__WGLEW_ARB_create_context_no_error) + +#endif /* WGL_ARB_create_context_no_error */ + +/* --------------------- 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_ARB_robustness_application_isolation --------------- */ + +#ifndef WGL_ARB_robustness_application_isolation +#define WGL_ARB_robustness_application_isolation 1 + +#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define WGLEW_ARB_robustness_application_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_application_isolation) + +#endif /* WGL_ARB_robustness_application_isolation */ + +/* ---------------- WGL_ARB_robustness_share_group_isolation --------------- */ + +#ifndef WGL_ARB_robustness_share_group_isolation +#define WGL_ARB_robustness_share_group_isolation 1 + +#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define WGLEW_ARB_robustness_share_group_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_share_group_isolation) + +#endif /* WGL_ARB_robustness_share_group_isolation */ + +/* ----------------------- 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_colorspace -------------------------- */ + +#ifndef WGL_EXT_colorspace +#define WGL_EXT_colorspace 1 + +#define WGL_COLORSPACE_SRGB_EXT 0x3089 +#define WGL_COLORSPACE_LINEAR_EXT 0x308A +#define WGL_COLORSPACE_EXT 0x309D + +#define WGLEW_EXT_colorspace WGLEW_GET_VAR(__WGLEW_EXT_colorspace) + +#endif /* WGL_EXT_colorspace */ + +/* ------------------- 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_create_context_es_profile ------------------- */ + +#ifndef WGL_EXT_create_context_es_profile +#define WGL_EXT_create_context_es_profile 1 + +#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile) + +#endif /* WGL_EXT_create_context_es_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_EXT_swap_control_tear ----------------------- */ + +#ifndef WGL_EXT_swap_control_tear +#define WGL_EXT_swap_control_tear 1 + +#define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear) + +#endif /* WGL_EXT_swap_control_tear */ + +/* --------------------- 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_DX_interop --------------------------- */ + +#ifndef WGL_NV_DX_interop +#define WGL_NV_DX_interop 1 + +#define WGL_ACCESS_READ_ONLY_NV 0x0000 +#define WGL_ACCESS_READ_WRITE_NV 0x0001 +#define WGL_ACCESS_WRITE_DISCARD_NV 0x0002 + +typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); +typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); +typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice); +typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access); +typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle); +typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); + +#define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV) +#define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV) +#define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV) +#define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV) +#define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV) +#define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV) +#define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV) +#define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV) + +#define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop) + +#endif /* WGL_NV_DX_interop */ + +/* --------------------------- WGL_NV_DX_interop2 -------------------------- */ + +#ifndef WGL_NV_DX_interop2 +#define WGL_NV_DX_interop2 1 + +#define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2) + +#endif /* WGL_NV_DX_interop2 */ + +/* --------------------------- 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_delay_before_swap ----------------------- */ + +#ifndef WGL_NV_delay_before_swap +#define WGL_NV_delay_before_swap 1 + +typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds); + +#define wglDelayBeforeSwapNV WGLEW_GET_FUN(__wglewDelayBeforeSwapNV) + +#define WGLEW_NV_delay_before_swap WGLEW_GET_VAR(__WGLEW_NV_delay_before_swap) + +#endif /* WGL_NV_delay_before_swap */ + +/* -------------------------- 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_capture ------------------------- */ + +#ifndef WGL_NV_video_capture +#define WGL_NV_video_capture 1 + +#define WGL_UNIQUE_ID_NV 0x20CE +#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +DECLARE_HANDLE(HVIDEOINPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); + +#define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV) +#define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV) +#define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV) +#define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV) +#define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV) + +#define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture) + +#endif /* WGL_NV_video_capture */ + +/* -------------------------- 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 */ + +/* ------------------------------------------------------------------------- */ + +#define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT + +WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; + +WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD; +WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD; +WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD; +WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD; + +WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; + +WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB; + +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; + +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; + +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; + +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; + +WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; +WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; +WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; + +WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; + +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; + +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; + +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; + +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; + +WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; +WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; + +WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; + +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; + +WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; + +WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; +WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; + +WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; + +WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; + +WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV; +WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV; +WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV; +WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV; + +WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV; + +WGLEW_FUN_EXPORT PFNWGLDELAYBEFORESWAPNVPROC __wglewDelayBeforeSwapNV; + +WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV; +WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV; + +WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV; +WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV; +WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV; +WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV; + +WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; +WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV; +WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV; + +WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; +WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; +WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_context_flush_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_no_error; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_application_isolation; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_share_group_isolation; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_colorspace; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_delay_before_swap; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output; +WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control; +/* ------------------------------------------------------------------------- */ + +GLEWAPI GLenum GLEWAPIENTRY wglewInit (); +GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name); + +#ifndef WGLEW_GET_VAR +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) +#endif + +#ifndef WGLEW_GET_FUN +#define WGLEW_GET_FUN(x) x +#endif + +GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#undef GLEWAPI + +#endif /* __wglew_h__ */ diff --git a/include/PR/gbi.h b/include/PR/gbi.h index ebfab07e..bd981be8 100644 --- a/include/PR/gbi.h +++ b/include/PR/gbi.h @@ -1110,11 +1110,7 @@ * Vertex (set up for use with colors) */ typedef struct { -#ifndef GBI_FLOATS - short ob[3]; /* x, y, z */ -#else float ob[3]; /* x, y, z */ -#endif unsigned short flag; short tc[2]; /* texture coord */ unsigned char cn[4]; /* color & alpha */ @@ -1124,11 +1120,7 @@ typedef struct { * Vertex (set up for use with normals) */ typedef struct { -#ifndef GBI_FLOATS - short ob[3]; /* x, y, z */ -#else float ob[3]; /* x, y, z */ -#endif unsigned short flag; short tc[2]; /* texture coord */ signed char n[3]; /* normal */ @@ -1177,23 +1169,9 @@ typedef struct { unsigned char v[3]; } Tri; -#ifndef GBI_FLOATS -/* - * 4x4 matrix, fixed point s15.16 format. - * First 8 words are integer portion of the 4x4 matrix - * Last 8 words are the fraction portion of the 4x4 matrix - */ -typedef s32 Mtx_t[4][4]; - -typedef union { - Mtx_t m; - long long int force_structure_alignment; -} Mtx; -#else typedef struct { float m[4][4]; } Mtx; -#endif /* * Viewport diff --git a/include/PR/os_cont.h b/include/PR/os_cont.h index 15ee60f3..b266aa71 100644 --- a/include/PR/os_cont.h +++ b/include/PR/os_cont.h @@ -60,6 +60,8 @@ typedef struct { u16 button; s8 stick_x; /* -80 <= stick_x <= 80 */ s8 stick_y; /* -80 <= stick_y <= 80 */ + s8 ext_stick_x; + s8 ext_stick_y; u8 errnum; } OSContPad; diff --git a/include/PR/os_libc.h b/include/PR/os_libc.h index 4f3bec84..9eb872e7 100644 --- a/include/PR/os_libc.h +++ b/include/PR/os_libc.h @@ -3,8 +3,28 @@ #include "ultratypes.h" -// Old deprecated functions from strings.h, replaced by memcpy/memset. -extern "C" void bcopy(const void *, void *, size_t); -extern "C" void bzero(void *, size_t); +// old bstring functions that aren't present on some platforms + +#if defined(__APPLE__) + +// macOS libc has them +#include + +#elif defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) || defined(NO_BZERO_BCOPY) + +// there's no way that shit's defined, use memcpy/memset +#include +#undef bzero +#undef bcopy +#define bzero(buf, len) memset((buf), 0, (len)) +#define bcopy(src, dst, len) memcpy((dst), (src), (len)) + +#else + +// hope for the best +extern void bcopy(const void *, void *, size_t); +extern void bzero(void *, size_t); + +#endif #endif /* !_OS_LIBC_H_ */ diff --git a/include/PR/ultratypes.h b/include/PR/ultratypes.h index f885532a..1ebde775 100644 --- a/include/PR/ultratypes.h +++ b/include/PR/ultratypes.h @@ -14,25 +14,8 @@ typedef signed short int s16; typedef unsigned short int u16; typedef signed int s32; typedef unsigned int u32; - -typedef float f32; -typedef double f64; - -#ifdef TARGET_N64 typedef signed long long int s64; typedef unsigned long long int u64; -typedef u32 size_t; -typedef s32 ssize_t; -typedef u32 uintptr_t; -typedef s32 intptr_t; -typedef s32 ptrdiff_t; -#else -#include -#include -typedef ptrdiff_t ssize_t; -typedef int64_t s64; -typedef uint64_t u64; -#endif typedef volatile u8 vu8; typedef volatile u16 vu16; @@ -43,4 +26,20 @@ typedef volatile s16 vs16; typedef volatile s32 vs32; typedef volatile s64 vs64; +typedef float f32; +typedef double f64; + +#include +#include +#include + +#if defined(__MINGW32__) +#include <_mingw.h> +#if !defined(__MINGW64_VERSION_MAJOR) +typedef long ssize_t; +#else +typedef ptrdiff_t ssize_t; #endif +#endif + +#endif // _ULTRA64_TYPES_H_ diff --git a/include/behavior_macros.h b/include/behavior_macros.h deleted file mode 100644 index fa8becb6..00000000 --- a/include/behavior_macros.h +++ /dev/null @@ -1,284 +0,0 @@ -#pragma once - -// TODO: Clean up these imports. - -#define OBJECT_FIELDS_INDEX_DIRECTLY - -#include "sm64.h" - -#include "object_constants.h" -#include "game/object_list_processor.h" -#include "game/interaction.h" -#include "game/behavior_actions.h" -#include "game/behaviors/thwomp/thwomp.hpp" -#include "game/mario_actions_cutscene.h" -#include "game/mario_misc.h" -#include "game/object_helpers.h" -#include "game/debug.h" -#include "menu/file_select.hpp" -#include "engine/surface_load.h" - -#include "actors/common0.h" -#include "actors/common1.h" -#include "actors/group1.h" -#include "actors/group2.h" -#include "actors/group3.h" -#include "actors/group4.h" -#include "actors/group5.h" -#include "actors/group6.h" -#include "actors/group7.h" -#include "actors/group8.h" -#include "actors/group9.h" -#include "actors/group10.h" -#include "actors/group11.h" -#include "actors/group12.h" -#include "actors/group13.h" -#include "actors/group14.h" -#include "actors/group15.h" -#include "actors/group16.h" -#include "actors/group17.h" -#include "levels/bbh/header.h" -#include "levels/castle_inside/header.h" -#include "levels/hmc/header.h" -#include "levels/ssl/header.h" -#include "levels/bob/header.h" -#include "levels/sl/header.h" -#include "levels/wdw/header.h" -#include "levels/jrb/header.h" -#include "levels/thi/header.h" -#include "levels/ttc/header.h" -#include "levels/rr/header.h" -#include "levels/castle_grounds/header.h" -#include "levels/bitdw/header.h" -#include "levels/lll/header.h" -#include "levels/sa/header.h" -#include "levels/bitfs/header.h" -#include "levels/ddd/header.h" -#include "levels/wf/header.h" -#include "levels/bowser_2/header.h" -#include "levels/ttm/header.h" - -#include "make_const_nonconst.h" -#include "behavior_data.h" -#include "include/behavior_macros.h" - -#define BC_B(a) _SHIFTL(a, 24, 8) -#define BC_BB(a, b) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8)) -#define BC_BBBB(a, b, c, d) \ - (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 8, 8) | _SHIFTL(d, 0, 8)) -#define BC_BBH(a, b, c) \ - (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 0, 16)) -#define BC_B0H(a, b) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 0, 16)) -#define BC_H(a) _SHIFTL(a, 16, 16) -#define BC_HH(a, b) (_SHIFTL(a, 16, 16) | _SHIFTL(b, 0, 16)) -#define BC_W(a) ((uintptr_t)(u32)(a)) -#define BC_PTR(a) ((uintptr_t)(a)) - -// Defines the start of the behavior script as well as the object list the -// object belongs to. Has some special behavior for certain objects. -#define BEGIN(objList) BC_BB(0x00, objList) - -// Delays the behavior script for a certain number of frames. -#define DELAY(num) BC_B0H(0x01, num) - -// Jumps to a new behavior command and stores the return address in the object's -// stack. -#define CALL(addr) BC_B(0x02), BC_PTR(addr) - -// Jumps back to the behavior command stored in the object's stack. -#define RETURN() BC_B(0x03) - -// Jumps to a new behavior script without saving anything. -#define GOTO(addr) BC_B(0x04), BC_PTR(addr) - -// Marks the start of a loop that will repeat a certain number of times. -#define BEGIN_REPEAT(count) BC_B0H(0x05, count) - -// Marks the end of a repeating loop. -#define END_REPEAT() BC_B(0x06) - -// Also marks the end of a repeating loop, but continues executing commands -// following the loop on the same frame. -#define END_REPEAT_CONTINUE() BC_B(0x07) - -// Marks the beginning of an infinite loop. -#define BEGIN_LOOP() BC_B(0x08) - -// Marks the end of an infinite loop. -#define END_LOOP() BC_B(0x09) - -// Exits the behavior script. -// Often used to end behavior scripts that do not contain an infinite loop. -#define BREAK() BC_B(0x0A) - -// Exits the behavior script, unused. -#define BREAK_UNUSED() BC_B(0x0B) - -// Executes a native game function. -#define CALL_NATIVE(func) BC_B(0x0C), BC_PTR(func) - -// Adds a float to the specified field. -#define ADD_FLOAT(field, value) BC_BBH(0x0D, field, value) - -// Sets the specified field to a float. -#define SET_FLOAT(field, value) BC_BBH(0x0E, field, value) - -// Adds an integer to the specified field. -#define ADD_INT(field, value) BC_BBH(0x0F, field, value) - -// Sets the specified field to an integer. -#define SET_INT(field, value) BC_BBH(0x10, field, value) - -// Performs a bitwise OR with the specified field and the given integer. -// Usually used to set an object's flags. -#define OR_INT(field, value) BC_BBH(0x11, field, value) - -// Performs a bit clear with the specified short. Unused in favor of the 32-bit -// version. -#define BIT_CLEAR(field, value) BC_BBH(0x12, field, value) - -// TODO: this one needs a better name / labelling -// Gets a random short, right shifts it the specified amount and adds min to it, -// then sets the specified field to that value. -#define SET_INT_RAND_RSHIFT(field, min, rshift) \ - BC_BBH(0x13, field, min), BC_H(rshift) - -// Sets the specified field to a random float in the given range. -#define SET_RANDOM_FLOAT(field, min, range) \ - BC_BBH(0x14, field, min), BC_H(range) - -// Sets the specified field to a random integer in the given range. -#define SET_RANDOM_INT(field, min, range) BC_BBH(0x15, field, min), BC_H(range) - -// Adds a random float in the given range to the specified field. -#define ADD_RANDOM_FLOAT(field, min, range) \ - BC_BBH(0x16, field, min), BC_H(range) - -// TODO: better name (unused anyway) -// Gets a random short, right shifts it the specified amount and adds min to it, -// then adds the value to the specified field. Unused. -#define ADD_INT_RAND_RSHIFT(field, min, rshift) \ - BC_BBH(0x17, field, min), BC_H(rshift) - -// No operation. Unused. -#define CMD_NOP_1(field) BC_BB(0x18, field) - -// No operation. Unused. -#define CMD_NOP_2(field) BC_BB(0x19, field) - -// No operation. Unused. -#define CMD_NOP_3(field) BC_BB(0x1A, field) - -// Sets the current model ID of the object. -#define SET_MODEL(modelID) BC_B0H(0x1B, modelID) - -// Spawns a child object with the specified model and behavior. -#define SPAWN_CHILD(modelID, behavior) \ - BC_B(0x1C), BC_W(modelID), BC_PTR(behavior) - -// Exits the behavior script and despawns the object. -// Often used to end behavior scripts that do not contain an infinite loop. -#define DEACTIVATE() BC_B(0x1D) - -// Finds the floor triangle directly under the object and moves the object down -// to it. -#define DROP_TO_FLOOR() BC_B(0x1E) - -// Sets the destination float field to the sum of the values of the given float -// fields. -#define SUM_FLOAT(fieldDst, fieldSrc1, fieldSrc2) \ - BC_BBBB(0x1F, fieldDst, fieldSrc1, fieldSrc2) - -// Sets the destination integer field to the sum of the values of the given -// integer fields. Unused. -#define SUM_INT(fieldDst, fieldSrc1, fieldSrc2) \ - BC_BBBB(0x20, fieldDst, fieldSrc1, fieldSrc2) - -// Billboards the current object, making it always face the camera. -#define BILLBOARD() BC_B(0x21) - -// Hides the current object. -#define HIDE() BC_B(0x22) - -// Sets the size of the object's cylindrical hitbox. -#define SET_HITBOX(radius, height) BC_B(0x23), BC_HH(radius, height) - -// No operation. Unused. -#define CMD_NOP_4(field, value) BC_BBH(0x24, field, value) - -// Delays the behavior script for the number of frames given by the value of the -// specified field. -#define DELAY_VAR(field) BC_BB(0x25, field) - -// Unused. Marks the start of a loop that will repeat a certain number of times. -// Uses a u8 as the argument, instead of a s16 like the other version does. -#define BEGIN_REPEAT_UNUSED(count) BC_BB(0x26, count) - -// Loads the animations for the object. is always set to oAnimations. -#define LOAD_ANIMATIONS(field, anims) BC_BB(0x27, field), BC_PTR(anims) - -// Begins animation and sets the object's current animation index to the -// specified value. -#define ANIMATE(animIndex) BC_BB(0x28, animIndex) - -// Spawns a child object with the specified model and behavior, plus a behavior -// param. -#define SPAWN_CHILD_WITH_PARAM(bhvParam, modelID, behavior) \ - BC_B0H(0x29, bhvParam), BC_W(modelID), BC_PTR(behavior) - -// Loads collision data for the object. -#define LOAD_COLLISION_DATA(collisionData) BC_B(0x2A), BC_PTR(collisionData) - -// Sets the size of the object's cylindrical hitbox, and applies a downwards -// offset. -#define SET_HITBOX_WITH_OFFSET(radius, height, downOffset) \ - BC_B(0x2B), BC_HH(radius, height), BC_H(downOffset) - -// Spawns a new object with the specified model and behavior. -#define SPAWN_OBJ(modelID, behavior) BC_B(0x2C), BC_W(modelID), BC_PTR(behavior) - -// Sets the home position of the object to its current position. -#define SET_HOME() BC_B(0x2D) - -// Sets the size of the object's cylindrical hurtbox. -#define SET_HURTBOX(radius, height) BC_B(0x2E), BC_HH(radius, height) - -// Sets the object's interaction type. -#define SET_INTERACT_TYPE(type) BC_B(0x2F), BC_W(type) - -// Sets various parameters that the object uses for calculating physics. -#define SET_OBJ_PHYSICS(wallHitboxRadius, \ - gravity, \ - bounciness, \ - dragStrength, \ - friction, \ - buoyancy, \ - unused1, \ - unused2) \ - BC_B(0x30), BC_HH(wallHitboxRadius, gravity), \ - BC_HH(bounciness, dragStrength), BC_HH(friction, buoyancy), \ - BC_HH(unused1, unused2) - -// Sets the object's interaction subtype. Unused. -#define SET_INTERACT_SUBTYPE(subtype) BC_B(0x31), BC_W(subtype) - -// Sets the object's size to the specified percentage. -#define SCALE(unusedField, percent) BC_BBH(0x32, unusedField, percent) - -// Performs a bit clear on the object's parent's field with the specified value. -// Used for clearing active particle flags fron Mario's object. -#define PARENT_BIT_CLEAR(field, flags) BC_BB(0x33, field), BC_W(flags) - -// Animates an object using texture animation. is always set to -// oAnimState. -#define ANIMATE_TEXTURE(field, rate) BC_BBH(0x34, field, rate) - -// Disables rendering for the object. -#define DISABLE_RENDERING() BC_B(0x35) - -// Unused. Sets the specified field to an integer. Wastes 4 bytes of space for -// no reason at all. -#define SET_INT_UNUSED(field, value) BC_BB(0x36, field), BC_HH(0, value) - -// Spawns a water droplet with the given parameters. -#define SPAWN_WATER_DROPLET(dropletParams) BC_B(0x37), BC_PTR(dropletParams) \ No newline at end of file diff --git a/include/config.h b/include/config.h index 0a1255e8..4512546e 100644 --- a/include/config.h +++ b/include/config.h @@ -1,4 +1,5 @@ #ifndef CONFIG_H + #define CONFIG_H /** @@ -27,16 +28,7 @@ #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 -// Border Height Define for NTSC Versions -#ifdef TARGET_N64 -#ifndef VERSION_EU -#define BORDER_HEIGHT 8 -#else -#define BORDER_HEIGHT 1 -#endif -#else -// What's the point of having a border? -#define BORDER_HEIGHT 0 -#endif +// What's the point of having a border if we're not an N64? +#define BORDER_HEIGHT 0 // Never use a border as not-N64 #endif // CONFIG_H diff --git a/src/pc/gfx/dxsdk/d3d12.h b/include/dxsdk/d3d12.h similarity index 100% rename from src/pc/gfx/dxsdk/d3d12.h rename to include/dxsdk/d3d12.h diff --git a/src/pc/gfx/dxsdk/d3d12sdklayers.h b/include/dxsdk/d3d12sdklayers.h similarity index 100% rename from src/pc/gfx/dxsdk/d3d12sdklayers.h rename to include/dxsdk/d3d12sdklayers.h diff --git a/src/pc/gfx/dxsdk/d3dcommon.h b/include/dxsdk/d3dcommon.h similarity index 100% rename from src/pc/gfx/dxsdk/d3dcommon.h rename to include/dxsdk/d3dcommon.h diff --git a/src/pc/gfx/dxsdk/d3dx12.h b/include/dxsdk/d3dx12.h similarity index 100% rename from src/pc/gfx/dxsdk/d3dx12.h rename to include/dxsdk/d3dx12.h diff --git a/include/gfx_dimensions.h b/include/gfx_dimensions.h index 49414129..a0c90a43 100644 --- a/include/gfx_dimensions.h +++ b/include/gfx_dimensions.h @@ -1,49 +1,16 @@ #ifndef GFX_DIMENSIONS_H #define GFX_DIMENSIONS_H -/* - -This file is for ports that want to enable widescreen. -Change the definitions to the following: - -#include -#define GFX_DIMENSIONS_FROM_LEFT_EDGE(v) (SCREEN_WIDTH / 2 - SCREEN_HEIGHT / 2 * [current_aspect_ratio] + (v)) -#define GFX_DIMENSIONS_FROM_RIGHT_EDGE(v) (SCREEN_WIDTH / 2 + SCREEN_HEIGHT / 2 * [current_aspect_ratio] - (v)) -#define GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(v) ((int)floorf(GFX_DIMENSIONS_FROM_LEFT_EDGE(v))) -#define GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(v) ((int)ceilf(GFX_DIMENSIONS_FROM_RIGHT_EDGE(v))) -#define GFX_DIMENSIONS_ASPECT_RATIO [current_aspect_ratio] - -The idea is that SCREEN_WIDTH and SCREEN_HEIGHT are still hardcoded to 320 and 240, and that -x=0 lies at where a 4:3 left edge would be. On 16:9 widescreen, the left edge is hence at -53.33. - -To get better accuracy, consider using floats instead of shorts for coordinates in Vertex and Matrix structures. - -The conversion to integers above is for RECT commands which naturally only accept integer values. -Note that RECT commands must be enhanced to support negative coordinates with this modification. - -*/ - -#ifdef WIDESCREEN - #include #include "pc/gfx/gfx_pc.h" + #define GFX_DIMENSIONS_FROM_LEFT_EDGE(v) (SCREEN_WIDTH / 2 - SCREEN_HEIGHT / 2 * gfx_current_dimensions.aspect_ratio + (v)) #define GFX_DIMENSIONS_FROM_RIGHT_EDGE(v) (SCREEN_WIDTH / 2 + SCREEN_HEIGHT / 2 * gfx_current_dimensions.aspect_ratio - (v)) #define GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(v) ((int)floorf(GFX_DIMENSIONS_FROM_LEFT_EDGE(v))) #define GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(v) ((int)ceilf(GFX_DIMENSIONS_FROM_RIGHT_EDGE(v))) #define GFX_DIMENSIONS_ASPECT_RATIO (gfx_current_dimensions.aspect_ratio) -#else - -#define GFX_DIMENSIONS_FROM_LEFT_EDGE(v) (v) -#define GFX_DIMENSIONS_FROM_RIGHT_EDGE(v) (SCREEN_WIDTH - (v)) -#define GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(v) (v) -#define GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(v) (SCREEN_WIDTH - (v)) -#define GFX_DIMENSIONS_ASPECT_RATIO (4.0f / 3.0f) - -#endif - // If screen is taller than it is wide, radius should be equal to SCREEN_HEIGHT since we scale horizontally #define GFX_DIMENSIONS_FULL_RADIUS (SCREEN_HEIGHT * (GFX_DIMENSIONS_ASPECT_RATIO > 1 ? GFX_DIMENSIONS_ASPECT_RATIO : 1)) -#endif // GFX_DIMENSIONS_H +#endif diff --git a/include/glad/vk_platform.h b/include/glad/vk_platform.h new file mode 100644 index 00000000..6543d435 --- /dev/null +++ b/include/glad/vk_platform.h @@ -0,0 +1,82 @@ +/* */ +/* File: vk_platform.h */ +/* */ +/* +** Copyright (c) 2014-2020 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + + +#ifndef VK_PLATFORM_H_ +#define VK_PLATFORM_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +/* +*************************************************************************************************** +* Platform-specific directives and type declarations +*************************************************************************************************** +*/ + +/* Platform-specific calling convention macros. + * + * Platforms should define these so that Vulkan clients call Vulkan commands + * with the same calling conventions that the Vulkan implementation expects. + * + * VKAPI_ATTR - Placed before the return type in function declarations. + * Useful for C++11 and GCC/Clang-style function attribute syntax. + * VKAPI_CALL - Placed after the return type in function declarations. + * Useful for MSVC-style calling convention syntax. + * VKAPI_PTR - Placed between the '(' and '*' in function pointer types. + * + * Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void); + * Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void); + */ +#if defined(_WIN32) + /* On Windows, Vulkan commands use the stdcall convention */ + #define VKAPI_ATTR + #define VKAPI_CALL __stdcall + #define VKAPI_PTR VKAPI_CALL +#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7 + #error "Vulkan isn't supported for the 'armeabi' NDK ABI" +#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE) + /* On Android 32-bit ARM targets, Vulkan functions use the "hardfloat" */ + /* calling convention, i.e. float parameters are passed in registers. This */ + /* is true even if the rest of the application passes floats on the stack, */ + /* as it does by default when compiling for the armeabi-v7a NDK ABI. */ + #define VKAPI_ATTR __attribute__((pcs("aapcs-vfp"))) + #define VKAPI_CALL + #define VKAPI_PTR VKAPI_ATTR +#else + /* On other platforms, use the default calling convention */ + #define VKAPI_ATTR + #define VKAPI_CALL + #define VKAPI_PTR +#endif + +#include + +#if !defined(VK_NO_STDINT_H) + #if defined(_MSC_VER) && (_MSC_VER < 1600) + typedef signed __int8 int8_t; + typedef unsigned __int8 uint8_t; + typedef signed __int16 int16_t; + typedef unsigned __int16 uint16_t; + typedef signed __int32 int32_t; + typedef unsigned __int32 uint32_t; + typedef signed __int64 int64_t; + typedef unsigned __int64 uint64_t; + #else + #include + #endif +#endif /* !defined(VK_NO_STDINT_H) */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif \ No newline at end of file diff --git a/include/glad/vulkan.h b/include/glad/vulkan.h new file mode 100644 index 00000000..dc9e57c0 --- /dev/null +++ b/include/glad/vulkan.h @@ -0,0 +1,3057 @@ +/** + * Loader generated by glad 2.0.0-beta on Sun Aug 23 21:28:52 2020 + * + * Generator: C/C++ + * Specification: vk + * Extensions: 2 + * + * APIs: + * - vulkan=1.0 + * + * Options: + * - MX_GLOBAL = False + * - ON_DEMAND = False + * - LOADER = False + * - ALIAS = True + * - HEADER_ONLY = False + * - DEBUG = False + * - MX = False + * + * Commandline: + * --api='vulkan=1.0' --extensions='VK_KHR_device_group,VK_KHR_swapchain' c --alias + * + * Online: + * http://glad.sh/#api=vulkan%3D1.0&extensions=VK_KHR_device_group%2CVK_KHR_swapchain&generator=c&options=ALIAS + * + */ + +#ifndef GLAD_VULKAN_H_ +#define GLAD_VULKAN_H_ + +#ifdef VULKAN_H_ + #error header already included (API: vulkan), remove previous include! +#endif +#define VULKAN_H_ 1 + +#ifdef VULKAN_CORE_H_ + #error header already included (API: vulkan), remove previous include! +#endif +#define VULKAN_CORE_H_ 1 + + +#define GLAD_VULKAN +#define GLAD_OPTION_VULKAN_ALIAS + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef GLAD_PLATFORM_H_ +#define GLAD_PLATFORM_H_ + +#ifndef GLAD_PLATFORM_WIN32 + #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__) + #define GLAD_PLATFORM_WIN32 1 + #else + #define GLAD_PLATFORM_WIN32 0 + #endif +#endif + +#ifndef GLAD_PLATFORM_APPLE + #ifdef __APPLE__ + #define GLAD_PLATFORM_APPLE 1 + #else + #define GLAD_PLATFORM_APPLE 0 + #endif +#endif + +#ifndef GLAD_PLATFORM_EMSCRIPTEN + #ifdef __EMSCRIPTEN__ + #define GLAD_PLATFORM_EMSCRIPTEN 1 + #else + #define GLAD_PLATFORM_EMSCRIPTEN 0 + #endif +#endif + +#ifndef GLAD_PLATFORM_UWP + #if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY) + #ifdef __has_include + #if __has_include() + #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1 + #endif + #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_ + #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1 + #endif + #endif + + #ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY + #include + #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) + #define GLAD_PLATFORM_UWP 1 + #endif + #endif + + #ifndef GLAD_PLATFORM_UWP + #define GLAD_PLATFORM_UWP 0 + #endif +#endif + +#ifdef __GNUC__ + #define GLAD_GNUC_EXTENSION __extension__ +#else + #define GLAD_GNUC_EXTENSION +#endif + +#ifndef GLAD_API_CALL + #if defined(GLAD_API_CALL_EXPORT) + #if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__) + #if defined(GLAD_API_CALL_EXPORT_BUILD) + #if defined(__GNUC__) + #define GLAD_API_CALL __attribute__ ((dllexport)) extern + #else + #define GLAD_API_CALL __declspec(dllexport) extern + #endif + #else + #if defined(__GNUC__) + #define GLAD_API_CALL __attribute__ ((dllimport)) extern + #else + #define GLAD_API_CALL __declspec(dllimport) extern + #endif + #endif + #elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD) + #define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern + #else + #define GLAD_API_CALL extern + #endif + #else + #define GLAD_API_CALL extern + #endif +#endif + +#ifdef APIENTRY + #define GLAD_API_PTR APIENTRY +#elif GLAD_PLATFORM_WIN32 + #define GLAD_API_PTR __stdcall +#else + #define GLAD_API_PTR +#endif + +#ifndef GLAPI +#define GLAPI GLAD_API_CALL +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY GLAD_API_PTR +#endif + +#define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor) +#define GLAD_VERSION_MAJOR(version) (version / 10000) +#define GLAD_VERSION_MINOR(version) (version % 10000) + +#define GLAD_GENERATOR_VERSION "2.0.0-beta" + +typedef void (*GLADapiproc)(void); + +typedef GLADapiproc (*GLADloadfunc)(const char *name); +typedef GLADapiproc (*GLADuserptrloadfunc)(void *userptr, const char *name); + +typedef void (*GLADprecallback)(const char *name, GLADapiproc apiproc, int len_args, ...); +typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apiproc, int len_args, ...); + +#endif /* GLAD_PLATFORM_H_ */ + +#define VK_ATTACHMENT_UNUSED (~0U) +#define VK_FALSE 0 +#define VK_KHR_DEVICE_GROUP_EXTENSION_NAME "VK_KHR_device_group" +#define VK_KHR_DEVICE_GROUP_SPEC_VERSION 4 +#define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain" +#define VK_KHR_SWAPCHAIN_SPEC_VERSION 70 +#define VK_LOD_CLAMP_NONE 1000.0f +#define VK_MAX_DESCRIPTION_SIZE 256 +#define VK_MAX_DEVICE_GROUP_SIZE 32 +#define VK_MAX_EXTENSION_NAME_SIZE 256 +#define VK_MAX_MEMORY_HEAPS 16 +#define VK_MAX_MEMORY_TYPES 32 +#define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256 +#define VK_QUEUE_FAMILY_IGNORED (~0U) +#define VK_REMAINING_ARRAY_LAYERS (~0U) +#define VK_REMAINING_MIP_LEVELS (~0U) +#define VK_SUBPASS_EXTERNAL (~0U) +#define VK_TRUE 1 +#define VK_UUID_SIZE 16 +#define VK_WHOLE_SIZE (~0ULL) + + +#include "vk_platform.h" + +#define VK_MAKE_VERSION(major, minor, patch) \ + ((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch))) + +#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22) + +#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) + +#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) + +/* DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead. */ +/*#define VK_API_VERSION VK_MAKE_VERSION(1, 0, 0) // Patch version should always be set to 0 */ + +/* Vulkan 1.0 version number */ +#define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0)/* Patch version should always be set to 0 */ + +/* Version of this file */ +#define VK_HEADER_VERSION 151 + +/* Complete version of this file */ +#define VK_HEADER_VERSION_COMPLETE VK_MAKE_VERSION(1, 2, VK_HEADER_VERSION) + +#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; + +#if !defined(VK_DEFINE_NON_DISPATCHABLE_HANDLE) +#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) + #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object; +#else + #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; +#endif +#endif + +#define VK_NULL_HANDLE 0 + + + + + + + + + +VK_DEFINE_HANDLE(VkInstance) + +VK_DEFINE_HANDLE(VkPhysicalDevice) + +VK_DEFINE_HANDLE(VkDevice) + +VK_DEFINE_HANDLE(VkQueue) + +VK_DEFINE_HANDLE(VkCommandBuffer) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkEvent) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) + +typedef enum VkAttachmentLoadOp { + VK_ATTACHMENT_LOAD_OP_LOAD = 0, + VK_ATTACHMENT_LOAD_OP_CLEAR = 1, + VK_ATTACHMENT_LOAD_OP_DONT_CARE = 2 +} VkAttachmentLoadOp; + +typedef enum VkAttachmentStoreOp { + VK_ATTACHMENT_STORE_OP_STORE = 0, + VK_ATTACHMENT_STORE_OP_DONT_CARE = 1 +} VkAttachmentStoreOp; + +typedef enum VkBlendFactor { + VK_BLEND_FACTOR_ZERO = 0, + VK_BLEND_FACTOR_ONE = 1, + VK_BLEND_FACTOR_SRC_COLOR = 2, + VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3, + VK_BLEND_FACTOR_DST_COLOR = 4, + VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 5, + VK_BLEND_FACTOR_SRC_ALPHA = 6, + VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 7, + VK_BLEND_FACTOR_DST_ALPHA = 8, + VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 9, + VK_BLEND_FACTOR_CONSTANT_COLOR = 10, + VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 11, + VK_BLEND_FACTOR_CONSTANT_ALPHA = 12, + VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 13, + VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 14, + VK_BLEND_FACTOR_SRC1_COLOR = 15, + VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 16, + VK_BLEND_FACTOR_SRC1_ALPHA = 17, + VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 18 +} VkBlendFactor; + +typedef enum VkBlendOp { + VK_BLEND_OP_ADD = 0, + VK_BLEND_OP_SUBTRACT = 1, + VK_BLEND_OP_REVERSE_SUBTRACT = 2, + VK_BLEND_OP_MIN = 3, + VK_BLEND_OP_MAX = 4 +} VkBlendOp; + +typedef enum VkBorderColor { + VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0, + VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 1, + VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 2, + VK_BORDER_COLOR_INT_OPAQUE_BLACK = 3, + VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 4, + VK_BORDER_COLOR_INT_OPAQUE_WHITE = 5 +} VkBorderColor; + + + + +typedef enum VkPipelineCacheHeaderVersion { + VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1 +} VkPipelineCacheHeaderVersion; + + + + + +typedef enum VkBufferCreateFlagBits { + VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 1, + VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 2, + VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 4 +} VkBufferCreateFlagBits; + +typedef enum VkBufferUsageFlagBits { + VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 1, + VK_BUFFER_USAGE_TRANSFER_DST_BIT = 2, + VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 4, + VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 8, + VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 16, + VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 32, + VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 64, + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 128, + VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 256 +} VkBufferUsageFlagBits; + +typedef enum VkColorComponentFlagBits { + VK_COLOR_COMPONENT_R_BIT = 1, + VK_COLOR_COMPONENT_G_BIT = 2, + VK_COLOR_COMPONENT_B_BIT = 4, + VK_COLOR_COMPONENT_A_BIT = 8 +} VkColorComponentFlagBits; + +typedef enum VkComponentSwizzle { + VK_COMPONENT_SWIZZLE_IDENTITY = 0, + VK_COMPONENT_SWIZZLE_ZERO = 1, + VK_COMPONENT_SWIZZLE_ONE = 2, + VK_COMPONENT_SWIZZLE_R = 3, + VK_COMPONENT_SWIZZLE_G = 4, + VK_COMPONENT_SWIZZLE_B = 5, + VK_COMPONENT_SWIZZLE_A = 6 +} VkComponentSwizzle; + +typedef enum VkCommandPoolCreateFlagBits { + VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 1, + VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 2 +} VkCommandPoolCreateFlagBits; + +typedef enum VkCommandPoolResetFlagBits { + VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 1 +} VkCommandPoolResetFlagBits; + +typedef enum VkCommandBufferResetFlagBits { + VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 1 +} VkCommandBufferResetFlagBits; + +typedef enum VkCommandBufferLevel { + VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0, + VK_COMMAND_BUFFER_LEVEL_SECONDARY = 1 +} VkCommandBufferLevel; + +typedef enum VkCommandBufferUsageFlagBits { + VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 1, + VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 2, + VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 4 +} VkCommandBufferUsageFlagBits; + +typedef enum VkCompareOp { + VK_COMPARE_OP_NEVER = 0, + VK_COMPARE_OP_LESS = 1, + VK_COMPARE_OP_EQUAL = 2, + VK_COMPARE_OP_LESS_OR_EQUAL = 3, + VK_COMPARE_OP_GREATER = 4, + VK_COMPARE_OP_NOT_EQUAL = 5, + VK_COMPARE_OP_GREATER_OR_EQUAL = 6, + VK_COMPARE_OP_ALWAYS = 7 +} VkCompareOp; + +typedef enum VkCullModeFlagBits { + VK_CULL_MODE_NONE = 0, + VK_CULL_MODE_FRONT_BIT = 1, + VK_CULL_MODE_BACK_BIT = 2, + VK_CULL_MODE_FRONT_AND_BACK = 0x00000003 +} VkCullModeFlagBits; + +typedef enum VkDescriptorType { + VK_DESCRIPTOR_TYPE_SAMPLER = 0, + VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 1, + VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 2, + VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 3, + VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 4, + VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 5, + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 6, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 7, + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 8, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9, + VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10 +} VkDescriptorType; + +typedef enum VkDynamicState { + VK_DYNAMIC_STATE_VIEWPORT = 0, + VK_DYNAMIC_STATE_SCISSOR = 1, + VK_DYNAMIC_STATE_LINE_WIDTH = 2, + VK_DYNAMIC_STATE_DEPTH_BIAS = 3, + VK_DYNAMIC_STATE_BLEND_CONSTANTS = 4, + VK_DYNAMIC_STATE_DEPTH_BOUNDS = 5, + VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6, + VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7, + VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8 +} VkDynamicState; + +typedef enum VkFenceCreateFlagBits { + VK_FENCE_CREATE_SIGNALED_BIT = 1 +} VkFenceCreateFlagBits; + +typedef enum VkPolygonMode { + VK_POLYGON_MODE_FILL = 0, + VK_POLYGON_MODE_LINE = 1, + VK_POLYGON_MODE_POINT = 2 +} VkPolygonMode; + +typedef enum VkFormat { + VK_FORMAT_UNDEFINED = 0, + VK_FORMAT_R4G4_UNORM_PACK8 = 1, + VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2, + VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3, + VK_FORMAT_R5G6B5_UNORM_PACK16 = 4, + VK_FORMAT_B5G6R5_UNORM_PACK16 = 5, + VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6, + VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7, + VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8, + VK_FORMAT_R8_UNORM = 9, + VK_FORMAT_R8_SNORM = 10, + VK_FORMAT_R8_USCALED = 11, + VK_FORMAT_R8_SSCALED = 12, + VK_FORMAT_R8_UINT = 13, + VK_FORMAT_R8_SINT = 14, + VK_FORMAT_R8_SRGB = 15, + VK_FORMAT_R8G8_UNORM = 16, + VK_FORMAT_R8G8_SNORM = 17, + VK_FORMAT_R8G8_USCALED = 18, + VK_FORMAT_R8G8_SSCALED = 19, + VK_FORMAT_R8G8_UINT = 20, + VK_FORMAT_R8G8_SINT = 21, + VK_FORMAT_R8G8_SRGB = 22, + VK_FORMAT_R8G8B8_UNORM = 23, + VK_FORMAT_R8G8B8_SNORM = 24, + VK_FORMAT_R8G8B8_USCALED = 25, + VK_FORMAT_R8G8B8_SSCALED = 26, + VK_FORMAT_R8G8B8_UINT = 27, + VK_FORMAT_R8G8B8_SINT = 28, + VK_FORMAT_R8G8B8_SRGB = 29, + VK_FORMAT_B8G8R8_UNORM = 30, + VK_FORMAT_B8G8R8_SNORM = 31, + VK_FORMAT_B8G8R8_USCALED = 32, + VK_FORMAT_B8G8R8_SSCALED = 33, + VK_FORMAT_B8G8R8_UINT = 34, + VK_FORMAT_B8G8R8_SINT = 35, + VK_FORMAT_B8G8R8_SRGB = 36, + VK_FORMAT_R8G8B8A8_UNORM = 37, + VK_FORMAT_R8G8B8A8_SNORM = 38, + VK_FORMAT_R8G8B8A8_USCALED = 39, + VK_FORMAT_R8G8B8A8_SSCALED = 40, + VK_FORMAT_R8G8B8A8_UINT = 41, + VK_FORMAT_R8G8B8A8_SINT = 42, + VK_FORMAT_R8G8B8A8_SRGB = 43, + VK_FORMAT_B8G8R8A8_UNORM = 44, + VK_FORMAT_B8G8R8A8_SNORM = 45, + VK_FORMAT_B8G8R8A8_USCALED = 46, + VK_FORMAT_B8G8R8A8_SSCALED = 47, + VK_FORMAT_B8G8R8A8_UINT = 48, + VK_FORMAT_B8G8R8A8_SINT = 49, + VK_FORMAT_B8G8R8A8_SRGB = 50, + VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51, + VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52, + VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53, + VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54, + VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55, + VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56, + VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57, + VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58, + VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59, + VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60, + VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61, + VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62, + VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63, + VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64, + VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65, + VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66, + VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67, + VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68, + VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69, + VK_FORMAT_R16_UNORM = 70, + VK_FORMAT_R16_SNORM = 71, + VK_FORMAT_R16_USCALED = 72, + VK_FORMAT_R16_SSCALED = 73, + VK_FORMAT_R16_UINT = 74, + VK_FORMAT_R16_SINT = 75, + VK_FORMAT_R16_SFLOAT = 76, + VK_FORMAT_R16G16_UNORM = 77, + VK_FORMAT_R16G16_SNORM = 78, + VK_FORMAT_R16G16_USCALED = 79, + VK_FORMAT_R16G16_SSCALED = 80, + VK_FORMAT_R16G16_UINT = 81, + VK_FORMAT_R16G16_SINT = 82, + VK_FORMAT_R16G16_SFLOAT = 83, + VK_FORMAT_R16G16B16_UNORM = 84, + VK_FORMAT_R16G16B16_SNORM = 85, + VK_FORMAT_R16G16B16_USCALED = 86, + VK_FORMAT_R16G16B16_SSCALED = 87, + VK_FORMAT_R16G16B16_UINT = 88, + VK_FORMAT_R16G16B16_SINT = 89, + VK_FORMAT_R16G16B16_SFLOAT = 90, + VK_FORMAT_R16G16B16A16_UNORM = 91, + VK_FORMAT_R16G16B16A16_SNORM = 92, + VK_FORMAT_R16G16B16A16_USCALED = 93, + VK_FORMAT_R16G16B16A16_SSCALED = 94, + VK_FORMAT_R16G16B16A16_UINT = 95, + VK_FORMAT_R16G16B16A16_SINT = 96, + VK_FORMAT_R16G16B16A16_SFLOAT = 97, + VK_FORMAT_R32_UINT = 98, + VK_FORMAT_R32_SINT = 99, + VK_FORMAT_R32_SFLOAT = 100, + VK_FORMAT_R32G32_UINT = 101, + VK_FORMAT_R32G32_SINT = 102, + VK_FORMAT_R32G32_SFLOAT = 103, + VK_FORMAT_R32G32B32_UINT = 104, + VK_FORMAT_R32G32B32_SINT = 105, + VK_FORMAT_R32G32B32_SFLOAT = 106, + VK_FORMAT_R32G32B32A32_UINT = 107, + VK_FORMAT_R32G32B32A32_SINT = 108, + VK_FORMAT_R32G32B32A32_SFLOAT = 109, + VK_FORMAT_R64_UINT = 110, + VK_FORMAT_R64_SINT = 111, + VK_FORMAT_R64_SFLOAT = 112, + VK_FORMAT_R64G64_UINT = 113, + VK_FORMAT_R64G64_SINT = 114, + VK_FORMAT_R64G64_SFLOAT = 115, + VK_FORMAT_R64G64B64_UINT = 116, + VK_FORMAT_R64G64B64_SINT = 117, + VK_FORMAT_R64G64B64_SFLOAT = 118, + VK_FORMAT_R64G64B64A64_UINT = 119, + VK_FORMAT_R64G64B64A64_SINT = 120, + VK_FORMAT_R64G64B64A64_SFLOAT = 121, + VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122, + VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123, + VK_FORMAT_D16_UNORM = 124, + VK_FORMAT_X8_D24_UNORM_PACK32 = 125, + VK_FORMAT_D32_SFLOAT = 126, + VK_FORMAT_S8_UINT = 127, + VK_FORMAT_D16_UNORM_S8_UINT = 128, + VK_FORMAT_D24_UNORM_S8_UINT = 129, + VK_FORMAT_D32_SFLOAT_S8_UINT = 130, + VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131, + VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132, + VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133, + VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134, + VK_FORMAT_BC2_UNORM_BLOCK = 135, + VK_FORMAT_BC2_SRGB_BLOCK = 136, + VK_FORMAT_BC3_UNORM_BLOCK = 137, + VK_FORMAT_BC3_SRGB_BLOCK = 138, + VK_FORMAT_BC4_UNORM_BLOCK = 139, + VK_FORMAT_BC4_SNORM_BLOCK = 140, + VK_FORMAT_BC5_UNORM_BLOCK = 141, + VK_FORMAT_BC5_SNORM_BLOCK = 142, + VK_FORMAT_BC6H_UFLOAT_BLOCK = 143, + VK_FORMAT_BC6H_SFLOAT_BLOCK = 144, + VK_FORMAT_BC7_UNORM_BLOCK = 145, + VK_FORMAT_BC7_SRGB_BLOCK = 146, + VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147, + VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148, + VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149, + VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150, + VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151, + VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152, + VK_FORMAT_EAC_R11_UNORM_BLOCK = 153, + VK_FORMAT_EAC_R11_SNORM_BLOCK = 154, + VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155, + VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156, + VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157, + VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158, + VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159, + VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160, + VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161, + VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162, + VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163, + VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164, + VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165, + VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166, + VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167, + VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168, + VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169, + VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170, + VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171, + VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172, + VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173, + VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174, + VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175, + VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176, + VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177, + VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178, + VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179, + VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180, + VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181, + VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, + VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, + VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184 +} VkFormat; + +typedef enum VkFormatFeatureFlagBits { + VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 1, + VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 2, + VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 4, + VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 8, + VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 16, + VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 32, + VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 64, + VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 128, + VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 256, + VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 512, + VK_FORMAT_FEATURE_BLIT_SRC_BIT = 1024, + VK_FORMAT_FEATURE_BLIT_DST_BIT = 2048, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 4096 +} VkFormatFeatureFlagBits; + +typedef enum VkFrontFace { + VK_FRONT_FACE_COUNTER_CLOCKWISE = 0, + VK_FRONT_FACE_CLOCKWISE = 1 +} VkFrontFace; + +typedef enum VkImageAspectFlagBits { + VK_IMAGE_ASPECT_COLOR_BIT = 1, + VK_IMAGE_ASPECT_DEPTH_BIT = 2, + VK_IMAGE_ASPECT_STENCIL_BIT = 4, + VK_IMAGE_ASPECT_METADATA_BIT = 8 +} VkImageAspectFlagBits; + +typedef enum VkImageCreateFlagBits { + VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 1, + VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 2, + VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 4, + VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 8, + VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 16, + VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT = 64, + VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT +} VkImageCreateFlagBits; + +typedef enum VkImageLayout { + VK_IMAGE_LAYOUT_UNDEFINED = 0, + VK_IMAGE_LAYOUT_GENERAL = 1, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 2, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 3, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4, + VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5, + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 6, + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 7, + VK_IMAGE_LAYOUT_PREINITIALIZED = 8, + VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002 +} VkImageLayout; + +typedef enum VkImageTiling { + VK_IMAGE_TILING_OPTIMAL = 0, + VK_IMAGE_TILING_LINEAR = 1 +} VkImageTiling; + +typedef enum VkImageType { + VK_IMAGE_TYPE_1D = 0, + VK_IMAGE_TYPE_2D = 1, + VK_IMAGE_TYPE_3D = 2 +} VkImageType; + +typedef enum VkImageUsageFlagBits { + VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 1, + VK_IMAGE_USAGE_TRANSFER_DST_BIT = 2, + VK_IMAGE_USAGE_SAMPLED_BIT = 4, + VK_IMAGE_USAGE_STORAGE_BIT = 8, + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 16, + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 32, + VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 64, + VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 128 +} VkImageUsageFlagBits; + + +typedef enum VkImageViewType { + VK_IMAGE_VIEW_TYPE_1D = 0, + VK_IMAGE_VIEW_TYPE_2D = 1, + VK_IMAGE_VIEW_TYPE_3D = 2, + VK_IMAGE_VIEW_TYPE_CUBE = 3, + VK_IMAGE_VIEW_TYPE_1D_ARRAY = 4, + VK_IMAGE_VIEW_TYPE_2D_ARRAY = 5, + VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 6 +} VkImageViewType; + +typedef enum VkSharingMode { + VK_SHARING_MODE_EXCLUSIVE = 0, + VK_SHARING_MODE_CONCURRENT = 1 +} VkSharingMode; + +typedef enum VkIndexType { + VK_INDEX_TYPE_UINT16 = 0, + VK_INDEX_TYPE_UINT32 = 1 +} VkIndexType; + +typedef enum VkLogicOp { + VK_LOGIC_OP_CLEAR = 0, + VK_LOGIC_OP_AND = 1, + VK_LOGIC_OP_AND_REVERSE = 2, + VK_LOGIC_OP_COPY = 3, + VK_LOGIC_OP_AND_INVERTED = 4, + VK_LOGIC_OP_NO_OP = 5, + VK_LOGIC_OP_XOR = 6, + VK_LOGIC_OP_OR = 7, + VK_LOGIC_OP_NOR = 8, + VK_LOGIC_OP_EQUIVALENT = 9, + VK_LOGIC_OP_INVERT = 10, + VK_LOGIC_OP_OR_REVERSE = 11, + VK_LOGIC_OP_COPY_INVERTED = 12, + VK_LOGIC_OP_OR_INVERTED = 13, + VK_LOGIC_OP_NAND = 14, + VK_LOGIC_OP_SET = 15 +} VkLogicOp; + +typedef enum VkMemoryHeapFlagBits { + VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 1 +} VkMemoryHeapFlagBits; + +typedef enum VkAccessFlagBits { + VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 1, + VK_ACCESS_INDEX_READ_BIT = 2, + VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 4, + VK_ACCESS_UNIFORM_READ_BIT = 8, + VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 16, + VK_ACCESS_SHADER_READ_BIT = 32, + VK_ACCESS_SHADER_WRITE_BIT = 64, + VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 128, + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 256, + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 512, + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 1024, + VK_ACCESS_TRANSFER_READ_BIT = 2048, + VK_ACCESS_TRANSFER_WRITE_BIT = 4096, + VK_ACCESS_HOST_READ_BIT = 8192, + VK_ACCESS_HOST_WRITE_BIT = 16384, + VK_ACCESS_MEMORY_READ_BIT = 32768, + VK_ACCESS_MEMORY_WRITE_BIT = 65536 +} VkAccessFlagBits; + +typedef enum VkMemoryPropertyFlagBits { + VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 1, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 2, + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 4, + VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 8, + VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 16 +} VkMemoryPropertyFlagBits; + +typedef enum VkPhysicalDeviceType { + VK_PHYSICAL_DEVICE_TYPE_OTHER = 0, + VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 1, + VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 2, + VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 3, + VK_PHYSICAL_DEVICE_TYPE_CPU = 4 +} VkPhysicalDeviceType; + +typedef enum VkPipelineBindPoint { + VK_PIPELINE_BIND_POINT_GRAPHICS = 0, + VK_PIPELINE_BIND_POINT_COMPUTE = 1 +} VkPipelineBindPoint; + +typedef enum VkPipelineCreateFlagBits { + VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 1, + VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 2, + VK_PIPELINE_CREATE_DERIVATIVE_BIT = 4, + VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT = 8, + VK_PIPELINE_CREATE_DISPATCH_BASE = 16, + VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT, + VK_PIPELINE_CREATE_DISPATCH_BASE_KHR = VK_PIPELINE_CREATE_DISPATCH_BASE +} VkPipelineCreateFlagBits; + +typedef enum VkPrimitiveTopology { + VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0, + VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 1, + VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 2, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 3, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 4, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 5, + VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 6, + VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 7, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 8, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 9, + VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 10 +} VkPrimitiveTopology; + +typedef enum VkQueryControlFlagBits { + VK_QUERY_CONTROL_PRECISE_BIT = 1 +} VkQueryControlFlagBits; + +typedef enum VkQueryPipelineStatisticFlagBits { + VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 1, + VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 2, + VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 4, + VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 8, + VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 16, + VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 32, + VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 64, + VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 128, + VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 256, + VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 512, + VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 1024 +} VkQueryPipelineStatisticFlagBits; + +typedef enum VkQueryResultFlagBits { + VK_QUERY_RESULT_64_BIT = 1, + VK_QUERY_RESULT_WAIT_BIT = 2, + VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 4, + VK_QUERY_RESULT_PARTIAL_BIT = 8 +} VkQueryResultFlagBits; + +typedef enum VkQueryType { + VK_QUERY_TYPE_OCCLUSION = 0, + VK_QUERY_TYPE_PIPELINE_STATISTICS = 1, + VK_QUERY_TYPE_TIMESTAMP = 2 +} VkQueryType; + +typedef enum VkQueueFlagBits { + VK_QUEUE_GRAPHICS_BIT = 1, + VK_QUEUE_COMPUTE_BIT = 2, + VK_QUEUE_TRANSFER_BIT = 4, + VK_QUEUE_SPARSE_BINDING_BIT = 8 +} VkQueueFlagBits; + +typedef enum VkSubpassContents { + VK_SUBPASS_CONTENTS_INLINE = 0, + VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1 +} VkSubpassContents; + +typedef enum VkResult { + VK_SUCCESS = 0, + VK_NOT_READY = 1, + VK_TIMEOUT = 2, + VK_EVENT_SET = 3, + VK_EVENT_RESET = 4, + VK_INCOMPLETE = 5, + VK_ERROR_OUT_OF_HOST_MEMORY = -1, + VK_ERROR_OUT_OF_DEVICE_MEMORY = -2, + VK_ERROR_INITIALIZATION_FAILED = -3, + VK_ERROR_DEVICE_LOST = -4, + VK_ERROR_MEMORY_MAP_FAILED = -5, + VK_ERROR_LAYER_NOT_PRESENT = -6, + VK_ERROR_EXTENSION_NOT_PRESENT = -7, + VK_ERROR_FEATURE_NOT_PRESENT = -8, + VK_ERROR_INCOMPATIBLE_DRIVER = -9, + VK_ERROR_TOO_MANY_OBJECTS = -10, + VK_ERROR_FORMAT_NOT_SUPPORTED = -11, + VK_ERROR_FRAGMENTED_POOL = -12, + VK_ERROR_UNKNOWN = -13, + VK_SUBOPTIMAL_KHR = 1000001003, + VK_ERROR_OUT_OF_DATE_KHR = -1000001004 +} VkResult; + +typedef enum VkShaderStageFlagBits { + VK_SHADER_STAGE_VERTEX_BIT = 1, + VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 2, + VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 4, + VK_SHADER_STAGE_GEOMETRY_BIT = 8, + VK_SHADER_STAGE_FRAGMENT_BIT = 16, + VK_SHADER_STAGE_COMPUTE_BIT = 32, + VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F, + VK_SHADER_STAGE_ALL = 0x7FFFFFFF +} VkShaderStageFlagBits; + +typedef enum VkSparseMemoryBindFlagBits { + VK_SPARSE_MEMORY_BIND_METADATA_BIT = 1 +} VkSparseMemoryBindFlagBits; + +typedef enum VkStencilFaceFlagBits { + VK_STENCIL_FACE_FRONT_BIT = 1, + VK_STENCIL_FACE_BACK_BIT = 2, + VK_STENCIL_FACE_FRONT_AND_BACK = 0x00000003, + VK_STENCIL_FRONT_AND_BACK = VK_STENCIL_FACE_FRONT_AND_BACK +} VkStencilFaceFlagBits; + +typedef enum VkStencilOp { + VK_STENCIL_OP_KEEP = 0, + VK_STENCIL_OP_ZERO = 1, + VK_STENCIL_OP_REPLACE = 2, + VK_STENCIL_OP_INCREMENT_AND_CLAMP = 3, + VK_STENCIL_OP_DECREMENT_AND_CLAMP = 4, + VK_STENCIL_OP_INVERT = 5, + VK_STENCIL_OP_INCREMENT_AND_WRAP = 6, + VK_STENCIL_OP_DECREMENT_AND_WRAP = 7 +} VkStencilOp; + +typedef enum VkStructureType { + VK_STRUCTURE_TYPE_APPLICATION_INFO = 0, + VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1, + VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2, + VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3, + VK_STRUCTURE_TYPE_SUBMIT_INFO = 4, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5, + VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6, + VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7, + VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8, + VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9, + VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10, + VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11, + VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12, + VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13, + VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14, + VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15, + VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16, + VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17, + VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18, + VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19, + VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20, + VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23, + VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24, + VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25, + VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26, + VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27, + VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28, + VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29, + VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30, + VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32, + VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34, + VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35, + VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36, + VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37, + VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38, + VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42, + VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43, + VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44, + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45, + VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46, + VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47, + VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO = 1000060000, + VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO = 1000060003, + VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO = 1000060004, + VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO = 1000060005, + VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO = 1000060006, + VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO = 1000060013, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO = 1000060014, + VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000, + VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001, + VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR = 1000060007, + VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR = 1000060008, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR = 1000060009, + VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR = 1000060010, + VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR = 1000060011, + VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR = 1000060012, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO, + VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO, + VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO, + VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO, + VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO, + VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHR = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO +} VkStructureType; + +typedef enum VkSystemAllocationScope { + VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0, + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 1, + VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 2, + VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 3, + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 4 +} VkSystemAllocationScope; + +typedef enum VkInternalAllocationType { + VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0 +} VkInternalAllocationType; + +typedef enum VkSamplerAddressMode { + VK_SAMPLER_ADDRESS_MODE_REPEAT = 0, + VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 1, + VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 2, + VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 3 +} VkSamplerAddressMode; + +typedef enum VkFilter { + VK_FILTER_NEAREST = 0, + VK_FILTER_LINEAR = 1 +} VkFilter; + +typedef enum VkSamplerMipmapMode { + VK_SAMPLER_MIPMAP_MODE_NEAREST = 0, + VK_SAMPLER_MIPMAP_MODE_LINEAR = 1 +} VkSamplerMipmapMode; + +typedef enum VkVertexInputRate { + VK_VERTEX_INPUT_RATE_VERTEX = 0, + VK_VERTEX_INPUT_RATE_INSTANCE = 1 +} VkVertexInputRate; + +typedef enum VkPipelineStageFlagBits { + VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 1, + VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 2, + VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 4, + VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 8, + VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 16, + VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 32, + VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 64, + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 128, + VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 256, + VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 512, + VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 1024, + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 2048, + VK_PIPELINE_STAGE_TRANSFER_BIT = 4096, + VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 8192, + VK_PIPELINE_STAGE_HOST_BIT = 16384, + VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 32768, + VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 65536 +} VkPipelineStageFlagBits; + +typedef enum VkSparseImageFormatFlagBits { + VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 1, + VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT = 2, + VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 4 +} VkSparseImageFormatFlagBits; + +typedef enum VkSampleCountFlagBits { + VK_SAMPLE_COUNT_1_BIT = 1, + VK_SAMPLE_COUNT_2_BIT = 2, + VK_SAMPLE_COUNT_4_BIT = 4, + VK_SAMPLE_COUNT_8_BIT = 8, + VK_SAMPLE_COUNT_16_BIT = 16, + VK_SAMPLE_COUNT_32_BIT = 32, + VK_SAMPLE_COUNT_64_BIT = 64 +} VkSampleCountFlagBits; + +typedef enum VkAttachmentDescriptionFlagBits { + VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 1 +} VkAttachmentDescriptionFlagBits; + +typedef enum VkDescriptorPoolCreateFlagBits { + VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 1 +} VkDescriptorPoolCreateFlagBits; + +typedef enum VkDependencyFlagBits { + VK_DEPENDENCY_BY_REGION_BIT = 1, + VK_DEPENDENCY_DEVICE_GROUP_BIT = 4, + VK_DEPENDENCY_DEVICE_GROUP_BIT_KHR = VK_DEPENDENCY_DEVICE_GROUP_BIT +} VkDependencyFlagBits; + +typedef enum VkObjectType { + VK_OBJECT_TYPE_UNKNOWN = 0, + VK_OBJECT_TYPE_INSTANCE = 1, + VK_OBJECT_TYPE_PHYSICAL_DEVICE = 2, + VK_OBJECT_TYPE_DEVICE = 3, + VK_OBJECT_TYPE_QUEUE = 4, + VK_OBJECT_TYPE_SEMAPHORE = 5, + VK_OBJECT_TYPE_COMMAND_BUFFER = 6, + VK_OBJECT_TYPE_FENCE = 7, + VK_OBJECT_TYPE_DEVICE_MEMORY = 8, + VK_OBJECT_TYPE_BUFFER = 9, + VK_OBJECT_TYPE_IMAGE = 10, + VK_OBJECT_TYPE_EVENT = 11, + VK_OBJECT_TYPE_QUERY_POOL = 12, + VK_OBJECT_TYPE_BUFFER_VIEW = 13, + VK_OBJECT_TYPE_IMAGE_VIEW = 14, + VK_OBJECT_TYPE_SHADER_MODULE = 15, + VK_OBJECT_TYPE_PIPELINE_CACHE = 16, + VK_OBJECT_TYPE_PIPELINE_LAYOUT = 17, + VK_OBJECT_TYPE_RENDER_PASS = 18, + VK_OBJECT_TYPE_PIPELINE = 19, + VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT = 20, + VK_OBJECT_TYPE_SAMPLER = 21, + VK_OBJECT_TYPE_DESCRIPTOR_POOL = 22, + VK_OBJECT_TYPE_DESCRIPTOR_SET = 23, + VK_OBJECT_TYPE_FRAMEBUFFER = 24, + VK_OBJECT_TYPE_COMMAND_POOL = 25, + VK_OBJECT_TYPE_SWAPCHAIN_KHR = 1000001000 +} VkObjectType; + + + +typedef enum VkColorSpaceKHR { + VK_COLOR_SPACE_SRGB_NONLINEAR_KHR = 0, + VK_COLORSPACE_SRGB_NONLINEAR_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR +} VkColorSpaceKHR; + +typedef enum VkCompositeAlphaFlagBitsKHR { + VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 1, + VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 2, + VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 4, + VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 8 +} VkCompositeAlphaFlagBitsKHR; + +typedef enum VkPresentModeKHR { + VK_PRESENT_MODE_IMMEDIATE_KHR = 0, + VK_PRESENT_MODE_MAILBOX_KHR = 1, + VK_PRESENT_MODE_FIFO_KHR = 2, + VK_PRESENT_MODE_FIFO_RELAXED_KHR = 3 +} VkPresentModeKHR; + +typedef enum VkSurfaceTransformFlagBitsKHR { + VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 1, + VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 2, + VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 4, + VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 8, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 16, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 32, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 64, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 128, + VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 256 +} VkSurfaceTransformFlagBitsKHR; + +typedef enum VkPeerMemoryFeatureFlagBits { + VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT = 1, + VK_PEER_MEMORY_FEATURE_COPY_DST_BIT = 2, + VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT = 4, + VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT = 8, + VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT_KHR = VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT, + VK_PEER_MEMORY_FEATURE_COPY_DST_BIT_KHR = VK_PEER_MEMORY_FEATURE_COPY_DST_BIT, + VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT_KHR = VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT, + VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT_KHR = VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT +} VkPeerMemoryFeatureFlagBits; + +typedef enum VkPeerMemoryFeatureFlagBits VkPeerMemoryFeatureFlagBitsKHR; + +typedef enum VkMemoryAllocateFlagBits { + VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT = 1, + VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHR = VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT +} VkMemoryAllocateFlagBits; + +typedef enum VkMemoryAllocateFlagBits VkMemoryAllocateFlagBitsKHR; + +typedef enum VkDeviceGroupPresentModeFlagBitsKHR { + VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR = 1, + VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR = 2, + VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR = 4, + VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR = 8 +} VkDeviceGroupPresentModeFlagBitsKHR; + +typedef enum VkSwapchainCreateFlagBitsKHR { + VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = 1, + VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR = 2 +} VkSwapchainCreateFlagBitsKHR; + +typedef enum VkVendorId { + VK_VENDOR_ID_VIV = 0x10001, + VK_VENDOR_ID_VSI = 0x10002, + VK_VENDOR_ID_KAZAN = 0x10003, + VK_VENDOR_ID_CODEPLAY = 0x10004, + VK_VENDOR_ID_MESA = 0x10005 +} VkVendorId; + +typedef void (VKAPI_PTR *PFN_vkInternalAllocationNotification)( + void* pUserData, + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); + +typedef void (VKAPI_PTR *PFN_vkInternalFreeNotification)( + void* pUserData, + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); + +typedef void* (VKAPI_PTR *PFN_vkReallocationFunction)( + void* pUserData, + void* pOriginal, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); + +typedef void* (VKAPI_PTR *PFN_vkAllocationFunction)( + void* pUserData, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); + +typedef void (VKAPI_PTR *PFN_vkFreeFunction)( + void* pUserData, + void* pMemory); + +typedef void (VKAPI_PTR *PFN_vkVoidFunction)(void); + +typedef struct VkBaseOutStructure { + VkStructureType sType; + struct VkBaseOutStructure * pNext; +} VkBaseOutStructure; + +typedef struct VkBaseInStructure { + VkStructureType sType; + const struct VkBaseInStructure * pNext; +} VkBaseInStructure; + +typedef struct VkOffset2D { + int32_t x; + int32_t y; +} VkOffset2D; + +typedef struct VkOffset3D { + int32_t x; + int32_t y; + int32_t z; +} VkOffset3D; + +typedef struct VkExtent2D { + uint32_t width; + uint32_t height; +} VkExtent2D; + +typedef struct VkExtent3D { + uint32_t width; + uint32_t height; + uint32_t depth; +} VkExtent3D; + +typedef struct VkViewport { + float x; + float y; + float width; + float height; + float minDepth; + float maxDepth; +} VkViewport; + +typedef struct VkRect2D { + VkOffset2D offset; + VkExtent2D extent; +} VkRect2D; + +typedef struct VkClearRect { + VkRect2D rect; + uint32_t baseArrayLayer; + uint32_t layerCount; +} VkClearRect; + +typedef struct VkComponentMapping { + VkComponentSwizzle r; + VkComponentSwizzle g; + VkComponentSwizzle b; + VkComponentSwizzle a; +} VkComponentMapping; + +typedef struct VkExtensionProperties { + char extensionName [ VK_MAX_EXTENSION_NAME_SIZE ]; + uint32_t specVersion; +} VkExtensionProperties; + +typedef struct VkLayerProperties { + char layerName [ VK_MAX_EXTENSION_NAME_SIZE ]; + uint32_t specVersion; + uint32_t implementationVersion; + char description [ VK_MAX_DESCRIPTION_SIZE ]; +} VkLayerProperties; + +typedef struct VkApplicationInfo { + VkStructureType sType; + const void * pNext; + const char * pApplicationName; + uint32_t applicationVersion; + const char * pEngineName; + uint32_t engineVersion; + uint32_t apiVersion; +} VkApplicationInfo; + +typedef struct VkAllocationCallbacks { + void * pUserData; + PFN_vkAllocationFunction pfnAllocation; + PFN_vkReallocationFunction pfnReallocation; + PFN_vkFreeFunction pfnFree; + PFN_vkInternalAllocationNotification pfnInternalAllocation; + PFN_vkInternalFreeNotification pfnInternalFree; +} VkAllocationCallbacks; + +typedef struct VkDescriptorImageInfo { + VkSampler sampler; + VkImageView imageView; + VkImageLayout imageLayout; +} VkDescriptorImageInfo; + +typedef struct VkCopyDescriptorSet { + VkStructureType sType; + const void * pNext; + VkDescriptorSet srcSet; + uint32_t srcBinding; + uint32_t srcArrayElement; + VkDescriptorSet dstSet; + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; +} VkCopyDescriptorSet; + +typedef struct VkDescriptorPoolSize { + VkDescriptorType type; + uint32_t descriptorCount; +} VkDescriptorPoolSize; + +typedef struct VkDescriptorSetAllocateInfo { + VkStructureType sType; + const void * pNext; + VkDescriptorPool descriptorPool; + uint32_t descriptorSetCount; + const VkDescriptorSetLayout * pSetLayouts; +} VkDescriptorSetAllocateInfo; + +typedef struct VkSpecializationMapEntry { + uint32_t constantID; + uint32_t offset; + size_t size; +} VkSpecializationMapEntry; + +typedef struct VkSpecializationInfo { + uint32_t mapEntryCount; + const VkSpecializationMapEntry * pMapEntries; + size_t dataSize; + const void * pData; +} VkSpecializationInfo; + +typedef struct VkVertexInputBindingDescription { + uint32_t binding; + uint32_t stride; + VkVertexInputRate inputRate; +} VkVertexInputBindingDescription; + +typedef struct VkVertexInputAttributeDescription { + uint32_t location; + uint32_t binding; + VkFormat format; + uint32_t offset; +} VkVertexInputAttributeDescription; + +typedef struct VkStencilOpState { + VkStencilOp failOp; + VkStencilOp passOp; + VkStencilOp depthFailOp; + VkCompareOp compareOp; + uint32_t compareMask; + uint32_t writeMask; + uint32_t reference; +} VkStencilOpState; + +typedef struct VkCommandBufferAllocateInfo { + VkStructureType sType; + const void * pNext; + VkCommandPool commandPool; + VkCommandBufferLevel level; + uint32_t commandBufferCount; +} VkCommandBufferAllocateInfo; + +typedef union VkClearColorValue { + float float32 [4]; + int32_t int32 [4]; + uint32_t uint32 [4]; +} VkClearColorValue; + +typedef struct VkClearDepthStencilValue { + float depth; + uint32_t stencil; +} VkClearDepthStencilValue; + +typedef union VkClearValue { + VkClearColorValue color; + VkClearDepthStencilValue depthStencil; +} VkClearValue; + +typedef struct VkAttachmentReference { + uint32_t attachment; + VkImageLayout layout; +} VkAttachmentReference; + +typedef struct VkDrawIndirectCommand { + uint32_t vertexCount; + uint32_t instanceCount; + uint32_t firstVertex; + uint32_t firstInstance; +} VkDrawIndirectCommand; + +typedef struct VkDrawIndexedIndirectCommand { + uint32_t indexCount; + uint32_t instanceCount; + uint32_t firstIndex; + int32_t vertexOffset; + uint32_t firstInstance; +} VkDrawIndexedIndirectCommand; + +typedef struct VkDispatchIndirectCommand { + uint32_t x; + uint32_t y; + uint32_t z; +} VkDispatchIndirectCommand; + +typedef struct VkPresentInfoKHR { + VkStructureType sType; + const void * pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore * pWaitSemaphores; + uint32_t swapchainCount; + const VkSwapchainKHR * pSwapchains; + const uint32_t * pImageIndices; + VkResult * pResults; +} VkPresentInfoKHR; + +typedef struct VkBindBufferMemoryDeviceGroupInfo { + VkStructureType sType; + const void * pNext; + uint32_t deviceIndexCount; + const uint32_t * pDeviceIndices; +} VkBindBufferMemoryDeviceGroupInfo; + +typedef struct VkBindBufferMemoryDeviceGroupInfo VkBindBufferMemoryDeviceGroupInfoKHR; + +typedef struct VkBindImageMemoryDeviceGroupInfo { + VkStructureType sType; + const void * pNext; + uint32_t deviceIndexCount; + const uint32_t * pDeviceIndices; + uint32_t splitInstanceBindRegionCount; + const VkRect2D * pSplitInstanceBindRegions; +} VkBindImageMemoryDeviceGroupInfo; + +typedef struct VkBindImageMemoryDeviceGroupInfo VkBindImageMemoryDeviceGroupInfoKHR; + +typedef struct VkDeviceGroupRenderPassBeginInfo { + VkStructureType sType; + const void * pNext; + uint32_t deviceMask; + uint32_t deviceRenderAreaCount; + const VkRect2D * pDeviceRenderAreas; +} VkDeviceGroupRenderPassBeginInfo; + +typedef struct VkDeviceGroupRenderPassBeginInfo VkDeviceGroupRenderPassBeginInfoKHR; + +typedef struct VkDeviceGroupCommandBufferBeginInfo { + VkStructureType sType; + const void * pNext; + uint32_t deviceMask; +} VkDeviceGroupCommandBufferBeginInfo; + +typedef struct VkDeviceGroupCommandBufferBeginInfo VkDeviceGroupCommandBufferBeginInfoKHR; + +typedef struct VkDeviceGroupSubmitInfo { + VkStructureType sType; + const void * pNext; + uint32_t waitSemaphoreCount; + const uint32_t * pWaitSemaphoreDeviceIndices; + uint32_t commandBufferCount; + const uint32_t * pCommandBufferDeviceMasks; + uint32_t signalSemaphoreCount; + const uint32_t * pSignalSemaphoreDeviceIndices; +} VkDeviceGroupSubmitInfo; + +typedef struct VkDeviceGroupSubmitInfo VkDeviceGroupSubmitInfoKHR; + +typedef struct VkDeviceGroupBindSparseInfo { + VkStructureType sType; + const void * pNext; + uint32_t resourceDeviceIndex; + uint32_t memoryDeviceIndex; +} VkDeviceGroupBindSparseInfo; + +typedef struct VkDeviceGroupBindSparseInfo VkDeviceGroupBindSparseInfoKHR; + +typedef struct VkImageSwapchainCreateInfoKHR { + VkStructureType sType; + const void * pNext; + VkSwapchainKHR swapchain; +} VkImageSwapchainCreateInfoKHR; + +typedef struct VkBindImageMemorySwapchainInfoKHR { + VkStructureType sType; + const void * pNext; + VkSwapchainKHR swapchain; + uint32_t imageIndex; +} VkBindImageMemorySwapchainInfoKHR; + +typedef struct VkAcquireNextImageInfoKHR { + VkStructureType sType; + const void * pNext; + VkSwapchainKHR swapchain; + uint64_t timeout; + VkSemaphore semaphore; + VkFence fence; + uint32_t deviceMask; +} VkAcquireNextImageInfoKHR; + +typedef struct VkDeviceGroupPresentInfoKHR { + VkStructureType sType; + const void * pNext; + uint32_t swapchainCount; + const uint32_t * pDeviceMasks; + VkDeviceGroupPresentModeFlagBitsKHR mode; +} VkDeviceGroupPresentInfoKHR; + +typedef uint32_t VkSampleMask; + +typedef uint32_t VkBool32; + +typedef uint32_t VkFlags; + +typedef uint64_t VkDeviceSize; + +typedef uint64_t VkDeviceAddress; + +typedef VkFlags VkFramebufferCreateFlags; + +typedef VkFlags VkQueryPoolCreateFlags; + +typedef VkFlags VkRenderPassCreateFlags; + +typedef VkFlags VkSamplerCreateFlags; + +typedef VkFlags VkPipelineLayoutCreateFlags; + +typedef VkFlags VkPipelineCacheCreateFlags; + +typedef VkFlags VkPipelineDepthStencilStateCreateFlags; + +typedef VkFlags VkPipelineDynamicStateCreateFlags; + +typedef VkFlags VkPipelineColorBlendStateCreateFlags; + +typedef VkFlags VkPipelineMultisampleStateCreateFlags; + +typedef VkFlags VkPipelineRasterizationStateCreateFlags; + +typedef VkFlags VkPipelineViewportStateCreateFlags; + +typedef VkFlags VkPipelineTessellationStateCreateFlags; + +typedef VkFlags VkPipelineInputAssemblyStateCreateFlags; + +typedef VkFlags VkPipelineVertexInputStateCreateFlags; + +typedef VkFlags VkPipelineShaderStageCreateFlags; + +typedef VkFlags VkDescriptorSetLayoutCreateFlags; + +typedef VkFlags VkBufferViewCreateFlags; + +typedef VkFlags VkInstanceCreateFlags; + +typedef VkFlags VkDeviceCreateFlags; + +typedef VkFlags VkDeviceQueueCreateFlags; + +typedef VkFlags VkQueueFlags; + +typedef VkFlags VkMemoryPropertyFlags; + +typedef VkFlags VkMemoryHeapFlags; + +typedef VkFlags VkAccessFlags; + +typedef VkFlags VkBufferUsageFlags; + +typedef VkFlags VkBufferCreateFlags; + +typedef VkFlags VkShaderStageFlags; + +typedef VkFlags VkImageUsageFlags; + +typedef VkFlags VkImageCreateFlags; + +typedef VkFlags VkImageViewCreateFlags; + +typedef VkFlags VkPipelineCreateFlags; + +typedef VkFlags VkColorComponentFlags; + +typedef VkFlags VkFenceCreateFlags; + +typedef VkFlags VkSemaphoreCreateFlags; + +typedef VkFlags VkFormatFeatureFlags; + +typedef VkFlags VkQueryControlFlags; + +typedef VkFlags VkQueryResultFlags; + +typedef VkFlags VkShaderModuleCreateFlags; + +typedef VkFlags VkEventCreateFlags; + +typedef VkFlags VkCommandPoolCreateFlags; + +typedef VkFlags VkCommandPoolResetFlags; + +typedef VkFlags VkCommandBufferResetFlags; + +typedef VkFlags VkCommandBufferUsageFlags; + +typedef VkFlags VkQueryPipelineStatisticFlags; + +typedef VkFlags VkMemoryMapFlags; + +typedef VkFlags VkImageAspectFlags; + +typedef VkFlags VkSparseMemoryBindFlags; + +typedef VkFlags VkSparseImageFormatFlags; + +typedef VkFlags VkSubpassDescriptionFlags; + +typedef VkFlags VkPipelineStageFlags; + +typedef VkFlags VkSampleCountFlags; + +typedef VkFlags VkAttachmentDescriptionFlags; + +typedef VkFlags VkStencilFaceFlags; + +typedef VkFlags VkCullModeFlags; + +typedef VkFlags VkDescriptorPoolCreateFlags; + +typedef VkFlags VkDescriptorPoolResetFlags; + +typedef VkFlags VkDependencyFlags; + +typedef VkFlags VkSwapchainCreateFlagsKHR; + +typedef VkFlags VkPeerMemoryFeatureFlags; + +#define VkPeerMemoryFeatureFlagsKHR VkPeerMemoryFeatureFlags + +typedef VkFlags VkMemoryAllocateFlags; + +#define VkMemoryAllocateFlagsKHR VkMemoryAllocateFlags + +typedef VkFlags VkDeviceGroupPresentModeFlagsKHR; + +typedef struct VkDeviceQueueCreateInfo { + VkStructureType sType; + const void * pNext; + VkDeviceQueueCreateFlags flags; + uint32_t queueFamilyIndex; + uint32_t queueCount; + const float * pQueuePriorities; +} VkDeviceQueueCreateInfo; + +typedef struct VkInstanceCreateInfo { + VkStructureType sType; + const void * pNext; + VkInstanceCreateFlags flags; + const VkApplicationInfo * pApplicationInfo; + uint32_t enabledLayerCount; + const char * const* ppEnabledLayerNames; + uint32_t enabledExtensionCount; + const char * const* ppEnabledExtensionNames; +} VkInstanceCreateInfo; + +typedef struct VkQueueFamilyProperties { + VkQueueFlags queueFlags; + uint32_t queueCount; + uint32_t timestampValidBits; + VkExtent3D minImageTransferGranularity; +} VkQueueFamilyProperties; + +typedef struct VkMemoryAllocateInfo { + VkStructureType sType; + const void * pNext; + VkDeviceSize allocationSize; + uint32_t memoryTypeIndex; +} VkMemoryAllocateInfo; + +typedef struct VkMemoryRequirements { + VkDeviceSize size; + VkDeviceSize alignment; + uint32_t memoryTypeBits; +} VkMemoryRequirements; + +typedef struct VkSparseImageFormatProperties { + VkImageAspectFlags aspectMask; + VkExtent3D imageGranularity; + VkSparseImageFormatFlags flags; +} VkSparseImageFormatProperties; + +typedef struct VkSparseImageMemoryRequirements { + VkSparseImageFormatProperties formatProperties; + uint32_t imageMipTailFirstLod; + VkDeviceSize imageMipTailSize; + VkDeviceSize imageMipTailOffset; + VkDeviceSize imageMipTailStride; +} VkSparseImageMemoryRequirements; + +typedef struct VkMemoryType { + VkMemoryPropertyFlags propertyFlags; + uint32_t heapIndex; +} VkMemoryType; + +typedef struct VkMemoryHeap { + VkDeviceSize size; + VkMemoryHeapFlags flags; +} VkMemoryHeap; + +typedef struct VkMappedMemoryRange { + VkStructureType sType; + const void * pNext; + VkDeviceMemory memory; + VkDeviceSize offset; + VkDeviceSize size; +} VkMappedMemoryRange; + +typedef struct VkFormatProperties { + VkFormatFeatureFlags linearTilingFeatures; + VkFormatFeatureFlags optimalTilingFeatures; + VkFormatFeatureFlags bufferFeatures; +} VkFormatProperties; + +typedef struct VkImageFormatProperties { + VkExtent3D maxExtent; + uint32_t maxMipLevels; + uint32_t maxArrayLayers; + VkSampleCountFlags sampleCounts; + VkDeviceSize maxResourceSize; +} VkImageFormatProperties; + +typedef struct VkDescriptorBufferInfo { + VkBuffer buffer; + VkDeviceSize offset; + VkDeviceSize range; +} VkDescriptorBufferInfo; + +typedef struct VkWriteDescriptorSet { + VkStructureType sType; + const void * pNext; + VkDescriptorSet dstSet; + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + VkDescriptorType descriptorType; + const VkDescriptorImageInfo * pImageInfo; + const VkDescriptorBufferInfo * pBufferInfo; + const VkBufferView * pTexelBufferView; +} VkWriteDescriptorSet; + +typedef struct VkBufferCreateInfo { + VkStructureType sType; + const void * pNext; + VkBufferCreateFlags flags; + VkDeviceSize size; + VkBufferUsageFlags usage; + VkSharingMode sharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t * pQueueFamilyIndices; +} VkBufferCreateInfo; + +typedef struct VkBufferViewCreateInfo { + VkStructureType sType; + const void * pNext; + VkBufferViewCreateFlags flags; + VkBuffer buffer; + VkFormat format; + VkDeviceSize offset; + VkDeviceSize range; +} VkBufferViewCreateInfo; + +typedef struct VkImageSubresource { + VkImageAspectFlags aspectMask; + uint32_t mipLevel; + uint32_t arrayLayer; +} VkImageSubresource; + +typedef struct VkImageSubresourceLayers { + VkImageAspectFlags aspectMask; + uint32_t mipLevel; + uint32_t baseArrayLayer; + uint32_t layerCount; +} VkImageSubresourceLayers; + +typedef struct VkImageSubresourceRange { + VkImageAspectFlags aspectMask; + uint32_t baseMipLevel; + uint32_t levelCount; + uint32_t baseArrayLayer; + uint32_t layerCount; +} VkImageSubresourceRange; + +typedef struct VkMemoryBarrier { + VkStructureType sType; + const void * pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; +} VkMemoryBarrier; + +typedef struct VkBufferMemoryBarrier { + VkStructureType sType; + const void * pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + uint32_t srcQueueFamilyIndex; + uint32_t dstQueueFamilyIndex; + VkBuffer buffer; + VkDeviceSize offset; + VkDeviceSize size; +} VkBufferMemoryBarrier; + +typedef struct VkImageMemoryBarrier { + VkStructureType sType; + const void * pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + VkImageLayout oldLayout; + VkImageLayout newLayout; + uint32_t srcQueueFamilyIndex; + uint32_t dstQueueFamilyIndex; + VkImage image; + VkImageSubresourceRange subresourceRange; +} VkImageMemoryBarrier; + +typedef struct VkImageCreateInfo { + VkStructureType sType; + const void * pNext; + VkImageCreateFlags flags; + VkImageType imageType; + VkFormat format; + VkExtent3D extent; + uint32_t mipLevels; + uint32_t arrayLayers; + VkSampleCountFlagBits samples; + VkImageTiling tiling; + VkImageUsageFlags usage; + VkSharingMode sharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t * pQueueFamilyIndices; + VkImageLayout initialLayout; +} VkImageCreateInfo; + +typedef struct VkSubresourceLayout { + VkDeviceSize offset; + VkDeviceSize size; + VkDeviceSize rowPitch; + VkDeviceSize arrayPitch; + VkDeviceSize depthPitch; +} VkSubresourceLayout; + +typedef struct VkImageViewCreateInfo { + VkStructureType sType; + const void * pNext; + VkImageViewCreateFlags flags; + VkImage image; + VkImageViewType viewType; + VkFormat format; + VkComponentMapping components; + VkImageSubresourceRange subresourceRange; +} VkImageViewCreateInfo; + +typedef struct VkBufferCopy { + VkDeviceSize srcOffset; + VkDeviceSize dstOffset; + VkDeviceSize size; +} VkBufferCopy; + +typedef struct VkSparseMemoryBind { + VkDeviceSize resourceOffset; + VkDeviceSize size; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; + VkSparseMemoryBindFlags flags; +} VkSparseMemoryBind; + +typedef struct VkSparseImageMemoryBind { + VkImageSubresource subresource; + VkOffset3D offset; + VkExtent3D extent; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; + VkSparseMemoryBindFlags flags; +} VkSparseImageMemoryBind; + +typedef struct VkSparseBufferMemoryBindInfo { + VkBuffer buffer; + uint32_t bindCount; + const VkSparseMemoryBind * pBinds; +} VkSparseBufferMemoryBindInfo; + +typedef struct VkSparseImageOpaqueMemoryBindInfo { + VkImage image; + uint32_t bindCount; + const VkSparseMemoryBind * pBinds; +} VkSparseImageOpaqueMemoryBindInfo; + +typedef struct VkSparseImageMemoryBindInfo { + VkImage image; + uint32_t bindCount; + const VkSparseImageMemoryBind * pBinds; +} VkSparseImageMemoryBindInfo; + +typedef struct VkBindSparseInfo { + VkStructureType sType; + const void * pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore * pWaitSemaphores; + uint32_t bufferBindCount; + const VkSparseBufferMemoryBindInfo * pBufferBinds; + uint32_t imageOpaqueBindCount; + const VkSparseImageOpaqueMemoryBindInfo * pImageOpaqueBinds; + uint32_t imageBindCount; + const VkSparseImageMemoryBindInfo * pImageBinds; + uint32_t signalSemaphoreCount; + const VkSemaphore * pSignalSemaphores; +} VkBindSparseInfo; + +typedef struct VkImageCopy { + VkImageSubresourceLayers srcSubresource; + VkOffset3D srcOffset; + VkImageSubresourceLayers dstSubresource; + VkOffset3D dstOffset; + VkExtent3D extent; +} VkImageCopy; + +typedef struct VkImageBlit { + VkImageSubresourceLayers srcSubresource; + VkOffset3D srcOffsets [2]; + VkImageSubresourceLayers dstSubresource; + VkOffset3D dstOffsets [2]; +} VkImageBlit; + +typedef struct VkBufferImageCopy { + VkDeviceSize bufferOffset; + uint32_t bufferRowLength; + uint32_t bufferImageHeight; + VkImageSubresourceLayers imageSubresource; + VkOffset3D imageOffset; + VkExtent3D imageExtent; +} VkBufferImageCopy; + +typedef struct VkImageResolve { + VkImageSubresourceLayers srcSubresource; + VkOffset3D srcOffset; + VkImageSubresourceLayers dstSubresource; + VkOffset3D dstOffset; + VkExtent3D extent; +} VkImageResolve; + +typedef struct VkShaderModuleCreateInfo { + VkStructureType sType; + const void * pNext; + VkShaderModuleCreateFlags flags; + size_t codeSize; + const uint32_t * pCode; +} VkShaderModuleCreateInfo; + +typedef struct VkDescriptorSetLayoutBinding { + uint32_t binding; + VkDescriptorType descriptorType; + uint32_t descriptorCount; + VkShaderStageFlags stageFlags; + const VkSampler * pImmutableSamplers; +} VkDescriptorSetLayoutBinding; + +typedef struct VkDescriptorSetLayoutCreateInfo { + VkStructureType sType; + const void * pNext; + VkDescriptorSetLayoutCreateFlags flags; + uint32_t bindingCount; + const VkDescriptorSetLayoutBinding * pBindings; +} VkDescriptorSetLayoutCreateInfo; + +typedef struct VkDescriptorPoolCreateInfo { + VkStructureType sType; + const void * pNext; + VkDescriptorPoolCreateFlags flags; + uint32_t maxSets; + uint32_t poolSizeCount; + const VkDescriptorPoolSize * pPoolSizes; +} VkDescriptorPoolCreateInfo; + +typedef struct VkPipelineShaderStageCreateInfo { + VkStructureType sType; + const void * pNext; + VkPipelineShaderStageCreateFlags flags; + VkShaderStageFlagBits stage; + VkShaderModule module; + const char * pName; + const VkSpecializationInfo * pSpecializationInfo; +} VkPipelineShaderStageCreateInfo; + +typedef struct VkComputePipelineCreateInfo { + VkStructureType sType; + const void * pNext; + VkPipelineCreateFlags flags; + VkPipelineShaderStageCreateInfo stage; + VkPipelineLayout layout; + VkPipeline basePipelineHandle; + int32_t basePipelineIndex; +} VkComputePipelineCreateInfo; + +typedef struct VkPipelineVertexInputStateCreateInfo { + VkStructureType sType; + const void * pNext; + VkPipelineVertexInputStateCreateFlags flags; + uint32_t vertexBindingDescriptionCount; + const VkVertexInputBindingDescription * pVertexBindingDescriptions; + uint32_t vertexAttributeDescriptionCount; + const VkVertexInputAttributeDescription * pVertexAttributeDescriptions; +} VkPipelineVertexInputStateCreateInfo; + +typedef struct VkPipelineInputAssemblyStateCreateInfo { + VkStructureType sType; + const void * pNext; + VkPipelineInputAssemblyStateCreateFlags flags; + VkPrimitiveTopology topology; + VkBool32 primitiveRestartEnable; +} VkPipelineInputAssemblyStateCreateInfo; + +typedef struct VkPipelineTessellationStateCreateInfo { + VkStructureType sType; + const void * pNext; + VkPipelineTessellationStateCreateFlags flags; + uint32_t patchControlPoints; +} VkPipelineTessellationStateCreateInfo; + +typedef struct VkPipelineViewportStateCreateInfo { + VkStructureType sType; + const void * pNext; + VkPipelineViewportStateCreateFlags flags; + uint32_t viewportCount; + const VkViewport * pViewports; + uint32_t scissorCount; + const VkRect2D * pScissors; +} VkPipelineViewportStateCreateInfo; + +typedef struct VkPipelineRasterizationStateCreateInfo { + VkStructureType sType; + const void * pNext; + VkPipelineRasterizationStateCreateFlags flags; + VkBool32 depthClampEnable; + VkBool32 rasterizerDiscardEnable; + VkPolygonMode polygonMode; + VkCullModeFlags cullMode; + VkFrontFace frontFace; + VkBool32 depthBiasEnable; + float depthBiasConstantFactor; + float depthBiasClamp; + float depthBiasSlopeFactor; + float lineWidth; +} VkPipelineRasterizationStateCreateInfo; + +typedef struct VkPipelineMultisampleStateCreateInfo { + VkStructureType sType; + const void * pNext; + VkPipelineMultisampleStateCreateFlags flags; + VkSampleCountFlagBits rasterizationSamples; + VkBool32 sampleShadingEnable; + float minSampleShading; + const VkSampleMask * pSampleMask; + VkBool32 alphaToCoverageEnable; + VkBool32 alphaToOneEnable; +} VkPipelineMultisampleStateCreateInfo; + +typedef struct VkPipelineColorBlendAttachmentState { + VkBool32 blendEnable; + VkBlendFactor srcColorBlendFactor; + VkBlendFactor dstColorBlendFactor; + VkBlendOp colorBlendOp; + VkBlendFactor srcAlphaBlendFactor; + VkBlendFactor dstAlphaBlendFactor; + VkBlendOp alphaBlendOp; + VkColorComponentFlags colorWriteMask; +} VkPipelineColorBlendAttachmentState; + +typedef struct VkPipelineColorBlendStateCreateInfo { + VkStructureType sType; + const void * pNext; + VkPipelineColorBlendStateCreateFlags flags; + VkBool32 logicOpEnable; + VkLogicOp logicOp; + uint32_t attachmentCount; + const VkPipelineColorBlendAttachmentState * pAttachments; + float blendConstants [4]; +} VkPipelineColorBlendStateCreateInfo; + +typedef struct VkPipelineDynamicStateCreateInfo { + VkStructureType sType; + const void * pNext; + VkPipelineDynamicStateCreateFlags flags; + uint32_t dynamicStateCount; + const VkDynamicState * pDynamicStates; +} VkPipelineDynamicStateCreateInfo; + +typedef struct VkPipelineDepthStencilStateCreateInfo { + VkStructureType sType; + const void * pNext; + VkPipelineDepthStencilStateCreateFlags flags; + VkBool32 depthTestEnable; + VkBool32 depthWriteEnable; + VkCompareOp depthCompareOp; + VkBool32 depthBoundsTestEnable; + VkBool32 stencilTestEnable; + VkStencilOpState front; + VkStencilOpState back; + float minDepthBounds; + float maxDepthBounds; +} VkPipelineDepthStencilStateCreateInfo; + +typedef struct VkGraphicsPipelineCreateInfo { + VkStructureType sType; + const void * pNext; + VkPipelineCreateFlags flags; + uint32_t stageCount; + const VkPipelineShaderStageCreateInfo * pStages; + const VkPipelineVertexInputStateCreateInfo * pVertexInputState; + const VkPipelineInputAssemblyStateCreateInfo * pInputAssemblyState; + const VkPipelineTessellationStateCreateInfo * pTessellationState; + const VkPipelineViewportStateCreateInfo * pViewportState; + const VkPipelineRasterizationStateCreateInfo * pRasterizationState; + const VkPipelineMultisampleStateCreateInfo * pMultisampleState; + const VkPipelineDepthStencilStateCreateInfo * pDepthStencilState; + const VkPipelineColorBlendStateCreateInfo * pColorBlendState; + const VkPipelineDynamicStateCreateInfo * pDynamicState; + VkPipelineLayout layout; + VkRenderPass renderPass; + uint32_t subpass; + VkPipeline basePipelineHandle; + int32_t basePipelineIndex; +} VkGraphicsPipelineCreateInfo; + +typedef struct VkPipelineCacheCreateInfo { + VkStructureType sType; + const void * pNext; + VkPipelineCacheCreateFlags flags; + size_t initialDataSize; + const void * pInitialData; +} VkPipelineCacheCreateInfo; + +typedef struct VkPushConstantRange { + VkShaderStageFlags stageFlags; + uint32_t offset; + uint32_t size; +} VkPushConstantRange; + +typedef struct VkPipelineLayoutCreateInfo { + VkStructureType sType; + const void * pNext; + VkPipelineLayoutCreateFlags flags; + uint32_t setLayoutCount; + const VkDescriptorSetLayout * pSetLayouts; + uint32_t pushConstantRangeCount; + const VkPushConstantRange * pPushConstantRanges; +} VkPipelineLayoutCreateInfo; + +typedef struct VkSamplerCreateInfo { + VkStructureType sType; + const void * pNext; + VkSamplerCreateFlags flags; + VkFilter magFilter; + VkFilter minFilter; + VkSamplerMipmapMode mipmapMode; + VkSamplerAddressMode addressModeU; + VkSamplerAddressMode addressModeV; + VkSamplerAddressMode addressModeW; + float mipLodBias; + VkBool32 anisotropyEnable; + float maxAnisotropy; + VkBool32 compareEnable; + VkCompareOp compareOp; + float minLod; + float maxLod; + VkBorderColor borderColor; + VkBool32 unnormalizedCoordinates; +} VkSamplerCreateInfo; + +typedef struct VkCommandPoolCreateInfo { + VkStructureType sType; + const void * pNext; + VkCommandPoolCreateFlags flags; + uint32_t queueFamilyIndex; +} VkCommandPoolCreateInfo; + +typedef struct VkCommandBufferInheritanceInfo { + VkStructureType sType; + const void * pNext; + VkRenderPass renderPass; + uint32_t subpass; + VkFramebuffer framebuffer; + VkBool32 occlusionQueryEnable; + VkQueryControlFlags queryFlags; + VkQueryPipelineStatisticFlags pipelineStatistics; +} VkCommandBufferInheritanceInfo; + +typedef struct VkCommandBufferBeginInfo { + VkStructureType sType; + const void * pNext; + VkCommandBufferUsageFlags flags; + const VkCommandBufferInheritanceInfo * pInheritanceInfo; +} VkCommandBufferBeginInfo; + +typedef struct VkRenderPassBeginInfo { + VkStructureType sType; + const void * pNext; + VkRenderPass renderPass; + VkFramebuffer framebuffer; + VkRect2D renderArea; + uint32_t clearValueCount; + const VkClearValue * pClearValues; +} VkRenderPassBeginInfo; + +typedef struct VkClearAttachment { + VkImageAspectFlags aspectMask; + uint32_t colorAttachment; + VkClearValue clearValue; +} VkClearAttachment; + +typedef struct VkAttachmentDescription { + VkAttachmentDescriptionFlags flags; + VkFormat format; + VkSampleCountFlagBits samples; + VkAttachmentLoadOp loadOp; + VkAttachmentStoreOp storeOp; + VkAttachmentLoadOp stencilLoadOp; + VkAttachmentStoreOp stencilStoreOp; + VkImageLayout initialLayout; + VkImageLayout finalLayout; +} VkAttachmentDescription; + +typedef struct VkSubpassDescription { + VkSubpassDescriptionFlags flags; + VkPipelineBindPoint pipelineBindPoint; + uint32_t inputAttachmentCount; + const VkAttachmentReference * pInputAttachments; + uint32_t colorAttachmentCount; + const VkAttachmentReference * pColorAttachments; + const VkAttachmentReference * pResolveAttachments; + const VkAttachmentReference * pDepthStencilAttachment; + uint32_t preserveAttachmentCount; + const uint32_t * pPreserveAttachments; +} VkSubpassDescription; + +typedef struct VkSubpassDependency { + uint32_t srcSubpass; + uint32_t dstSubpass; + VkPipelineStageFlags srcStageMask; + VkPipelineStageFlags dstStageMask; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + VkDependencyFlags dependencyFlags; +} VkSubpassDependency; + +typedef struct VkRenderPassCreateInfo { + VkStructureType sType; + const void * pNext; + VkRenderPassCreateFlags flags; + uint32_t attachmentCount; + const VkAttachmentDescription * pAttachments; + uint32_t subpassCount; + const VkSubpassDescription * pSubpasses; + uint32_t dependencyCount; + const VkSubpassDependency * pDependencies; +} VkRenderPassCreateInfo; + +typedef struct VkEventCreateInfo { + VkStructureType sType; + const void * pNext; + VkEventCreateFlags flags; +} VkEventCreateInfo; + +typedef struct VkFenceCreateInfo { + VkStructureType sType; + const void * pNext; + VkFenceCreateFlags flags; +} VkFenceCreateInfo; + +typedef struct VkPhysicalDeviceFeatures { + VkBool32 robustBufferAccess; + VkBool32 fullDrawIndexUint32; + VkBool32 imageCubeArray; + VkBool32 independentBlend; + VkBool32 geometryShader; + VkBool32 tessellationShader; + VkBool32 sampleRateShading; + VkBool32 dualSrcBlend; + VkBool32 logicOp; + VkBool32 multiDrawIndirect; + VkBool32 drawIndirectFirstInstance; + VkBool32 depthClamp; + VkBool32 depthBiasClamp; + VkBool32 fillModeNonSolid; + VkBool32 depthBounds; + VkBool32 wideLines; + VkBool32 largePoints; + VkBool32 alphaToOne; + VkBool32 multiViewport; + VkBool32 samplerAnisotropy; + VkBool32 textureCompressionETC2; + VkBool32 textureCompressionASTC_LDR; + VkBool32 textureCompressionBC; + VkBool32 occlusionQueryPrecise; + VkBool32 pipelineStatisticsQuery; + VkBool32 vertexPipelineStoresAndAtomics; + VkBool32 fragmentStoresAndAtomics; + VkBool32 shaderTessellationAndGeometryPointSize; + VkBool32 shaderImageGatherExtended; + VkBool32 shaderStorageImageExtendedFormats; + VkBool32 shaderStorageImageMultisample; + VkBool32 shaderStorageImageReadWithoutFormat; + VkBool32 shaderStorageImageWriteWithoutFormat; + VkBool32 shaderUniformBufferArrayDynamicIndexing; + VkBool32 shaderSampledImageArrayDynamicIndexing; + VkBool32 shaderStorageBufferArrayDynamicIndexing; + VkBool32 shaderStorageImageArrayDynamicIndexing; + VkBool32 shaderClipDistance; + VkBool32 shaderCullDistance; + VkBool32 shaderFloat64; + VkBool32 shaderInt64; + VkBool32 shaderInt16; + VkBool32 shaderResourceResidency; + VkBool32 shaderResourceMinLod; + VkBool32 sparseBinding; + VkBool32 sparseResidencyBuffer; + VkBool32 sparseResidencyImage2D; + VkBool32 sparseResidencyImage3D; + VkBool32 sparseResidency2Samples; + VkBool32 sparseResidency4Samples; + VkBool32 sparseResidency8Samples; + VkBool32 sparseResidency16Samples; + VkBool32 sparseResidencyAliased; + VkBool32 variableMultisampleRate; + VkBool32 inheritedQueries; +} VkPhysicalDeviceFeatures; + +typedef struct VkPhysicalDeviceSparseProperties { + VkBool32 residencyStandard2DBlockShape; + VkBool32 residencyStandard2DMultisampleBlockShape; + VkBool32 residencyStandard3DBlockShape; + VkBool32 residencyAlignedMipSize; + VkBool32 residencyNonResidentStrict; +} VkPhysicalDeviceSparseProperties; + +typedef struct VkPhysicalDeviceLimits { + uint32_t maxImageDimension1D; + uint32_t maxImageDimension2D; + uint32_t maxImageDimension3D; + uint32_t maxImageDimensionCube; + uint32_t maxImageArrayLayers; + uint32_t maxTexelBufferElements; + uint32_t maxUniformBufferRange; + uint32_t maxStorageBufferRange; + uint32_t maxPushConstantsSize; + uint32_t maxMemoryAllocationCount; + uint32_t maxSamplerAllocationCount; + VkDeviceSize bufferImageGranularity; + VkDeviceSize sparseAddressSpaceSize; + uint32_t maxBoundDescriptorSets; + uint32_t maxPerStageDescriptorSamplers; + uint32_t maxPerStageDescriptorUniformBuffers; + uint32_t maxPerStageDescriptorStorageBuffers; + uint32_t maxPerStageDescriptorSampledImages; + uint32_t maxPerStageDescriptorStorageImages; + uint32_t maxPerStageDescriptorInputAttachments; + uint32_t maxPerStageResources; + uint32_t maxDescriptorSetSamplers; + uint32_t maxDescriptorSetUniformBuffers; + uint32_t maxDescriptorSetUniformBuffersDynamic; + uint32_t maxDescriptorSetStorageBuffers; + uint32_t maxDescriptorSetStorageBuffersDynamic; + uint32_t maxDescriptorSetSampledImages; + uint32_t maxDescriptorSetStorageImages; + uint32_t maxDescriptorSetInputAttachments; + uint32_t maxVertexInputAttributes; + uint32_t maxVertexInputBindings; + uint32_t maxVertexInputAttributeOffset; + uint32_t maxVertexInputBindingStride; + uint32_t maxVertexOutputComponents; + uint32_t maxTessellationGenerationLevel; + uint32_t maxTessellationPatchSize; + uint32_t maxTessellationControlPerVertexInputComponents; + uint32_t maxTessellationControlPerVertexOutputComponents; + uint32_t maxTessellationControlPerPatchOutputComponents; + uint32_t maxTessellationControlTotalOutputComponents; + uint32_t maxTessellationEvaluationInputComponents; + uint32_t maxTessellationEvaluationOutputComponents; + uint32_t maxGeometryShaderInvocations; + uint32_t maxGeometryInputComponents; + uint32_t maxGeometryOutputComponents; + uint32_t maxGeometryOutputVertices; + uint32_t maxGeometryTotalOutputComponents; + uint32_t maxFragmentInputComponents; + uint32_t maxFragmentOutputAttachments; + uint32_t maxFragmentDualSrcAttachments; + uint32_t maxFragmentCombinedOutputResources; + uint32_t maxComputeSharedMemorySize; + uint32_t maxComputeWorkGroupCount [3]; + uint32_t maxComputeWorkGroupInvocations; + uint32_t maxComputeWorkGroupSize [3]; + uint32_t subPixelPrecisionBits; + uint32_t subTexelPrecisionBits; + uint32_t mipmapPrecisionBits; + uint32_t maxDrawIndexedIndexValue; + uint32_t maxDrawIndirectCount; + float maxSamplerLodBias; + float maxSamplerAnisotropy; + uint32_t maxViewports; + uint32_t maxViewportDimensions [2]; + float viewportBoundsRange [2]; + uint32_t viewportSubPixelBits; + size_t minMemoryMapAlignment; + VkDeviceSize minTexelBufferOffsetAlignment; + VkDeviceSize minUniformBufferOffsetAlignment; + VkDeviceSize minStorageBufferOffsetAlignment; + int32_t minTexelOffset; + uint32_t maxTexelOffset; + int32_t minTexelGatherOffset; + uint32_t maxTexelGatherOffset; + float minInterpolationOffset; + float maxInterpolationOffset; + uint32_t subPixelInterpolationOffsetBits; + uint32_t maxFramebufferWidth; + uint32_t maxFramebufferHeight; + uint32_t maxFramebufferLayers; + VkSampleCountFlags framebufferColorSampleCounts; + VkSampleCountFlags framebufferDepthSampleCounts; + VkSampleCountFlags framebufferStencilSampleCounts; + VkSampleCountFlags framebufferNoAttachmentsSampleCounts; + uint32_t maxColorAttachments; + VkSampleCountFlags sampledImageColorSampleCounts; + VkSampleCountFlags sampledImageIntegerSampleCounts; + VkSampleCountFlags sampledImageDepthSampleCounts; + VkSampleCountFlags sampledImageStencilSampleCounts; + VkSampleCountFlags storageImageSampleCounts; + uint32_t maxSampleMaskWords; + VkBool32 timestampComputeAndGraphics; + float timestampPeriod; + uint32_t maxClipDistances; + uint32_t maxCullDistances; + uint32_t maxCombinedClipAndCullDistances; + uint32_t discreteQueuePriorities; + float pointSizeRange [2]; + float lineWidthRange [2]; + float pointSizeGranularity; + float lineWidthGranularity; + VkBool32 strictLines; + VkBool32 standardSampleLocations; + VkDeviceSize optimalBufferCopyOffsetAlignment; + VkDeviceSize optimalBufferCopyRowPitchAlignment; + VkDeviceSize nonCoherentAtomSize; +} VkPhysicalDeviceLimits; + +typedef struct VkSemaphoreCreateInfo { + VkStructureType sType; + const void * pNext; + VkSemaphoreCreateFlags flags; +} VkSemaphoreCreateInfo; + +typedef struct VkQueryPoolCreateInfo { + VkStructureType sType; + const void * pNext; + VkQueryPoolCreateFlags flags; + VkQueryType queryType; + uint32_t queryCount; + VkQueryPipelineStatisticFlags pipelineStatistics; +} VkQueryPoolCreateInfo; + +typedef struct VkFramebufferCreateInfo { + VkStructureType sType; + const void * pNext; + VkFramebufferCreateFlags flags; + VkRenderPass renderPass; + uint32_t attachmentCount; + const VkImageView * pAttachments; + uint32_t width; + uint32_t height; + uint32_t layers; +} VkFramebufferCreateInfo; + +typedef struct VkSubmitInfo { + VkStructureType sType; + const void * pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore * pWaitSemaphores; + const VkPipelineStageFlags * pWaitDstStageMask; + uint32_t commandBufferCount; + const VkCommandBuffer * pCommandBuffers; + uint32_t signalSemaphoreCount; + const VkSemaphore * pSignalSemaphores; +} VkSubmitInfo; + +typedef struct VkSwapchainCreateInfoKHR { + VkStructureType sType; + const void * pNext; + VkSwapchainCreateFlagsKHR flags; + VkSurfaceKHR surface; + uint32_t minImageCount; + VkFormat imageFormat; + VkColorSpaceKHR imageColorSpace; + VkExtent2D imageExtent; + uint32_t imageArrayLayers; + VkImageUsageFlags imageUsage; + VkSharingMode imageSharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t * pQueueFamilyIndices; + VkSurfaceTransformFlagBitsKHR preTransform; + VkCompositeAlphaFlagBitsKHR compositeAlpha; + VkPresentModeKHR presentMode; + VkBool32 clipped; + VkSwapchainKHR oldSwapchain; +} VkSwapchainCreateInfoKHR; + +typedef struct VkMemoryAllocateFlagsInfo { + VkStructureType sType; + const void * pNext; + VkMemoryAllocateFlags flags; + uint32_t deviceMask; +} VkMemoryAllocateFlagsInfo; + +typedef struct VkMemoryAllocateFlagsInfo VkMemoryAllocateFlagsInfoKHR; + +typedef struct VkDeviceGroupPresentCapabilitiesKHR { + VkStructureType sType; + const void * pNext; + uint32_t presentMask [ VK_MAX_DEVICE_GROUP_SIZE ]; + VkDeviceGroupPresentModeFlagsKHR modes; +} VkDeviceGroupPresentCapabilitiesKHR; + +typedef struct VkDeviceGroupSwapchainCreateInfoKHR { + VkStructureType sType; + const void * pNext; + VkDeviceGroupPresentModeFlagsKHR modes; +} VkDeviceGroupSwapchainCreateInfoKHR; + +typedef struct VkPhysicalDeviceProperties { + uint32_t apiVersion; + uint32_t driverVersion; + uint32_t vendorID; + uint32_t deviceID; + VkPhysicalDeviceType deviceType; + char deviceName [ VK_MAX_PHYSICAL_DEVICE_NAME_SIZE ]; + uint8_t pipelineCacheUUID [ VK_UUID_SIZE ]; + VkPhysicalDeviceLimits limits; + VkPhysicalDeviceSparseProperties sparseProperties; +} VkPhysicalDeviceProperties; + +typedef struct VkDeviceCreateInfo { + VkStructureType sType; + const void * pNext; + VkDeviceCreateFlags flags; + uint32_t queueCreateInfoCount; + const VkDeviceQueueCreateInfo * pQueueCreateInfos; + uint32_t enabledLayerCount; + const char * const* ppEnabledLayerNames; + uint32_t enabledExtensionCount; + const char * const* ppEnabledExtensionNames; + const VkPhysicalDeviceFeatures * pEnabledFeatures; +} VkDeviceCreateInfo; + +typedef struct VkPhysicalDeviceMemoryProperties { + uint32_t memoryTypeCount; + VkMemoryType memoryTypes [ VK_MAX_MEMORY_TYPES ]; + uint32_t memoryHeapCount; + VkMemoryHeap memoryHeaps [ VK_MAX_MEMORY_HEAPS ]; +} VkPhysicalDeviceMemoryProperties; + + + +#define VK_VERSION_1_0 1 +GLAD_API_CALL int GLAD_VK_VERSION_1_0; +#define VK_KHR_device_group 1 +GLAD_API_CALL int GLAD_VK_KHR_device_group; +#define VK_KHR_swapchain 1 +GLAD_API_CALL int GLAD_VK_KHR_swapchain; + + +typedef VkResult (GLAD_API_PTR *PFN_vkAcquireNextImage2KHR)(VkDevice device, const VkAcquireNextImageInfoKHR * pAcquireInfo, uint32_t * pImageIndex); +typedef VkResult (GLAD_API_PTR *PFN_vkAcquireNextImageKHR)(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t * pImageIndex); +typedef VkResult (GLAD_API_PTR *PFN_vkAllocateCommandBuffers)(VkDevice device, const VkCommandBufferAllocateInfo * pAllocateInfo, VkCommandBuffer * pCommandBuffers); +typedef VkResult (GLAD_API_PTR *PFN_vkAllocateDescriptorSets)(VkDevice device, const VkDescriptorSetAllocateInfo * pAllocateInfo, VkDescriptorSet * pDescriptorSets); +typedef VkResult (GLAD_API_PTR *PFN_vkAllocateMemory)(VkDevice device, const VkMemoryAllocateInfo * pAllocateInfo, const VkAllocationCallbacks * pAllocator, VkDeviceMemory * pMemory); +typedef VkResult (GLAD_API_PTR *PFN_vkBeginCommandBuffer)(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo * pBeginInfo); +typedef VkResult (GLAD_API_PTR *PFN_vkBindBufferMemory)(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset); +typedef VkResult (GLAD_API_PTR *PFN_vkBindImageMemory)(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset); +typedef void (GLAD_API_PTR *PFN_vkCmdBeginQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags); +typedef void (GLAD_API_PTR *PFN_vkCmdBeginRenderPass)(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo * pRenderPassBegin, VkSubpassContents contents); +typedef void (GLAD_API_PTR *PFN_vkCmdBindDescriptorSets)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet * pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t * pDynamicOffsets); +typedef void (GLAD_API_PTR *PFN_vkCmdBindIndexBuffer)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType); +typedef void (GLAD_API_PTR *PFN_vkCmdBindPipeline)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); +typedef void (GLAD_API_PTR *PFN_vkCmdBindVertexBuffers)(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer * pBuffers, const VkDeviceSize * pOffsets); +typedef void (GLAD_API_PTR *PFN_vkCmdBlitImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit * pRegions, VkFilter filter); +typedef void (GLAD_API_PTR *PFN_vkCmdClearAttachments)(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment * pAttachments, uint32_t rectCount, const VkClearRect * pRects); +typedef void (GLAD_API_PTR *PFN_vkCmdClearColorImage)(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue * pColor, uint32_t rangeCount, const VkImageSubresourceRange * pRanges); +typedef void (GLAD_API_PTR *PFN_vkCmdClearDepthStencilImage)(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue * pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange * pRanges); +typedef void (GLAD_API_PTR *PFN_vkCmdCopyBuffer)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy * pRegions); +typedef void (GLAD_API_PTR *PFN_vkCmdCopyBufferToImage)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy * pRegions); +typedef void (GLAD_API_PTR *PFN_vkCmdCopyImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy * pRegions); +typedef void (GLAD_API_PTR *PFN_vkCmdCopyImageToBuffer)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy * pRegions); +typedef void (GLAD_API_PTR *PFN_vkCmdCopyQueryPoolResults)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags); +typedef void (GLAD_API_PTR *PFN_vkCmdDispatch)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); +typedef void (GLAD_API_PTR *PFN_vkCmdDispatchBaseKHR)(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); +typedef void (GLAD_API_PTR *PFN_vkCmdDispatchIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); +typedef void (GLAD_API_PTR *PFN_vkCmdDraw)(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); +typedef void (GLAD_API_PTR *PFN_vkCmdDrawIndexed)(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); +typedef void (GLAD_API_PTR *PFN_vkCmdDrawIndexedIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); +typedef void (GLAD_API_PTR *PFN_vkCmdDrawIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); +typedef void (GLAD_API_PTR *PFN_vkCmdEndQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query); +typedef void (GLAD_API_PTR *PFN_vkCmdEndRenderPass)(VkCommandBuffer commandBuffer); +typedef void (GLAD_API_PTR *PFN_vkCmdExecuteCommands)(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer * pCommandBuffers); +typedef void (GLAD_API_PTR *PFN_vkCmdFillBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data); +typedef void (GLAD_API_PTR *PFN_vkCmdNextSubpass)(VkCommandBuffer commandBuffer, VkSubpassContents contents); +typedef void (GLAD_API_PTR *PFN_vkCmdPipelineBarrier)(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier * pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier * pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier * pImageMemoryBarriers); +typedef void (GLAD_API_PTR *PFN_vkCmdPushConstants)(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void * pValues); +typedef void (GLAD_API_PTR *PFN_vkCmdResetEvent)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); +typedef void (GLAD_API_PTR *PFN_vkCmdResetQueryPool)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); +typedef void (GLAD_API_PTR *PFN_vkCmdResolveImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve * pRegions); +typedef void (GLAD_API_PTR *PFN_vkCmdSetBlendConstants)(VkCommandBuffer commandBuffer, const float blendConstants [4]); +typedef void (GLAD_API_PTR *PFN_vkCmdSetDepthBias)(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor); +typedef void (GLAD_API_PTR *PFN_vkCmdSetDepthBounds)(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds); +typedef void (GLAD_API_PTR *PFN_vkCmdSetDeviceMaskKHR)(VkCommandBuffer commandBuffer, uint32_t deviceMask); +typedef void (GLAD_API_PTR *PFN_vkCmdSetEvent)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); +typedef void (GLAD_API_PTR *PFN_vkCmdSetLineWidth)(VkCommandBuffer commandBuffer, float lineWidth); +typedef void (GLAD_API_PTR *PFN_vkCmdSetScissor)(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D * pScissors); +typedef void (GLAD_API_PTR *PFN_vkCmdSetStencilCompareMask)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask); +typedef void (GLAD_API_PTR *PFN_vkCmdSetStencilReference)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference); +typedef void (GLAD_API_PTR *PFN_vkCmdSetStencilWriteMask)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask); +typedef void (GLAD_API_PTR *PFN_vkCmdSetViewport)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport * pViewports); +typedef void (GLAD_API_PTR *PFN_vkCmdUpdateBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void * pData); +typedef void (GLAD_API_PTR *PFN_vkCmdWaitEvents)(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent * pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier * pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier * pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier * pImageMemoryBarriers); +typedef void (GLAD_API_PTR *PFN_vkCmdWriteTimestamp)(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateBuffer)(VkDevice device, const VkBufferCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkBuffer * pBuffer); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateBufferView)(VkDevice device, const VkBufferViewCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkBufferView * pView); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateCommandPool)(VkDevice device, const VkCommandPoolCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkCommandPool * pCommandPool); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateComputePipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo * pCreateInfos, const VkAllocationCallbacks * pAllocator, VkPipeline * pPipelines); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateDescriptorPool)(VkDevice device, const VkDescriptorPoolCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkDescriptorPool * pDescriptorPool); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateDescriptorSetLayout)(VkDevice device, const VkDescriptorSetLayoutCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkDescriptorSetLayout * pSetLayout); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateDevice)(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkDevice * pDevice); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateEvent)(VkDevice device, const VkEventCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkEvent * pEvent); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateFence)(VkDevice device, const VkFenceCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkFence * pFence); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateFramebuffer)(VkDevice device, const VkFramebufferCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkFramebuffer * pFramebuffer); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateGraphicsPipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo * pCreateInfos, const VkAllocationCallbacks * pAllocator, VkPipeline * pPipelines); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateImage)(VkDevice device, const VkImageCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkImage * pImage); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateImageView)(VkDevice device, const VkImageViewCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkImageView * pView); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateInstance)(const VkInstanceCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkInstance * pInstance); +typedef VkResult (GLAD_API_PTR *PFN_vkCreatePipelineCache)(VkDevice device, const VkPipelineCacheCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkPipelineCache * pPipelineCache); +typedef VkResult (GLAD_API_PTR *PFN_vkCreatePipelineLayout)(VkDevice device, const VkPipelineLayoutCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkPipelineLayout * pPipelineLayout); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateQueryPool)(VkDevice device, const VkQueryPoolCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkQueryPool * pQueryPool); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateRenderPass)(VkDevice device, const VkRenderPassCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkRenderPass * pRenderPass); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateSampler)(VkDevice device, const VkSamplerCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkSampler * pSampler); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateSemaphore)(VkDevice device, const VkSemaphoreCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkSemaphore * pSemaphore); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateShaderModule)(VkDevice device, const VkShaderModuleCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkShaderModule * pShaderModule); +typedef VkResult (GLAD_API_PTR *PFN_vkCreateSwapchainKHR)(VkDevice device, const VkSwapchainCreateInfoKHR * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkSwapchainKHR * pSwapchain); +typedef void (GLAD_API_PTR *PFN_vkDestroyBuffer)(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyBufferView)(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyCommandPool)(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyDescriptorSetLayout)(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyDevice)(VkDevice device, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyEvent)(VkDevice device, VkEvent event, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyFence)(VkDevice device, VkFence fence, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyFramebuffer)(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyImage)(VkDevice device, VkImage image, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyImageView)(VkDevice device, VkImageView imageView, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyInstance)(VkInstance instance, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyPipeline)(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyPipelineCache)(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyPipelineLayout)(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyQueryPool)(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyRenderPass)(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroySampler)(VkDevice device, VkSampler sampler, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroySemaphore)(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroyShaderModule)(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkDestroySwapchainKHR)(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks * pAllocator); +typedef VkResult (GLAD_API_PTR *PFN_vkDeviceWaitIdle)(VkDevice device); +typedef VkResult (GLAD_API_PTR *PFN_vkEndCommandBuffer)(VkCommandBuffer commandBuffer); +typedef VkResult (GLAD_API_PTR *PFN_vkEnumerateDeviceExtensionProperties)(VkPhysicalDevice physicalDevice, const char * pLayerName, uint32_t * pPropertyCount, VkExtensionProperties * pProperties); +typedef VkResult (GLAD_API_PTR *PFN_vkEnumerateDeviceLayerProperties)(VkPhysicalDevice physicalDevice, uint32_t * pPropertyCount, VkLayerProperties * pProperties); +typedef VkResult (GLAD_API_PTR *PFN_vkEnumerateInstanceExtensionProperties)(const char * pLayerName, uint32_t * pPropertyCount, VkExtensionProperties * pProperties); +typedef VkResult (GLAD_API_PTR *PFN_vkEnumerateInstanceLayerProperties)(uint32_t * pPropertyCount, VkLayerProperties * pProperties); +typedef VkResult (GLAD_API_PTR *PFN_vkEnumeratePhysicalDevices)(VkInstance instance, uint32_t * pPhysicalDeviceCount, VkPhysicalDevice * pPhysicalDevices); +typedef VkResult (GLAD_API_PTR *PFN_vkFlushMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange * pMemoryRanges); +typedef void (GLAD_API_PTR *PFN_vkFreeCommandBuffers)(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer * pCommandBuffers); +typedef VkResult (GLAD_API_PTR *PFN_vkFreeDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet * pDescriptorSets); +typedef void (GLAD_API_PTR *PFN_vkFreeMemory)(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks * pAllocator); +typedef void (GLAD_API_PTR *PFN_vkGetBufferMemoryRequirements)(VkDevice device, VkBuffer buffer, VkMemoryRequirements * pMemoryRequirements); +typedef void (GLAD_API_PTR *PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR)(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags * pPeerMemoryFeatures); +typedef VkResult (GLAD_API_PTR *PFN_vkGetDeviceGroupPresentCapabilitiesKHR)(VkDevice device, VkDeviceGroupPresentCapabilitiesKHR * pDeviceGroupPresentCapabilities); +typedef VkResult (GLAD_API_PTR *PFN_vkGetDeviceGroupSurfacePresentModesKHR)(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR * pModes); +typedef void (GLAD_API_PTR *PFN_vkGetDeviceMemoryCommitment)(VkDevice device, VkDeviceMemory memory, VkDeviceSize * pCommittedMemoryInBytes); +typedef PFN_vkVoidFunction (GLAD_API_PTR *PFN_vkGetDeviceProcAddr)(VkDevice device, const char * pName); +typedef void (GLAD_API_PTR *PFN_vkGetDeviceQueue)(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue * pQueue); +typedef VkResult (GLAD_API_PTR *PFN_vkGetEventStatus)(VkDevice device, VkEvent event); +typedef VkResult (GLAD_API_PTR *PFN_vkGetFenceStatus)(VkDevice device, VkFence fence); +typedef void (GLAD_API_PTR *PFN_vkGetImageMemoryRequirements)(VkDevice device, VkImage image, VkMemoryRequirements * pMemoryRequirements); +typedef void (GLAD_API_PTR *PFN_vkGetImageSparseMemoryRequirements)(VkDevice device, VkImage image, uint32_t * pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements * pSparseMemoryRequirements); +typedef void (GLAD_API_PTR *PFN_vkGetImageSubresourceLayout)(VkDevice device, VkImage image, const VkImageSubresource * pSubresource, VkSubresourceLayout * pLayout); +typedef PFN_vkVoidFunction (GLAD_API_PTR *PFN_vkGetInstanceProcAddr)(VkInstance instance, const char * pName); +typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures * pFeatures); +typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties * pFormatProperties); +typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties * pImageFormatProperties); +typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties * pMemoryProperties); +typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDevicePresentRectanglesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t * pRectCount, VkRect2D * pRects); +typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties * pProperties); +typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties)(VkPhysicalDevice physicalDevice, uint32_t * pQueueFamilyPropertyCount, VkQueueFamilyProperties * pQueueFamilyProperties); +typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t * pPropertyCount, VkSparseImageFormatProperties * pProperties); +typedef VkResult (GLAD_API_PTR *PFN_vkGetPipelineCacheData)(VkDevice device, VkPipelineCache pipelineCache, size_t * pDataSize, void * pData); +typedef VkResult (GLAD_API_PTR *PFN_vkGetQueryPoolResults)(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void * pData, VkDeviceSize stride, VkQueryResultFlags flags); +typedef void (GLAD_API_PTR *PFN_vkGetRenderAreaGranularity)(VkDevice device, VkRenderPass renderPass, VkExtent2D * pGranularity); +typedef VkResult (GLAD_API_PTR *PFN_vkGetSwapchainImagesKHR)(VkDevice device, VkSwapchainKHR swapchain, uint32_t * pSwapchainImageCount, VkImage * pSwapchainImages); +typedef VkResult (GLAD_API_PTR *PFN_vkInvalidateMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange * pMemoryRanges); +typedef VkResult (GLAD_API_PTR *PFN_vkMapMemory)(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void ** ppData); +typedef VkResult (GLAD_API_PTR *PFN_vkMergePipelineCaches)(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache * pSrcCaches); +typedef VkResult (GLAD_API_PTR *PFN_vkQueueBindSparse)(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo * pBindInfo, VkFence fence); +typedef VkResult (GLAD_API_PTR *PFN_vkQueuePresentKHR)(VkQueue queue, const VkPresentInfoKHR * pPresentInfo); +typedef VkResult (GLAD_API_PTR *PFN_vkQueueSubmit)(VkQueue queue, uint32_t submitCount, const VkSubmitInfo * pSubmits, VkFence fence); +typedef VkResult (GLAD_API_PTR *PFN_vkQueueWaitIdle)(VkQueue queue); +typedef VkResult (GLAD_API_PTR *PFN_vkResetCommandBuffer)(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags); +typedef VkResult (GLAD_API_PTR *PFN_vkResetCommandPool)(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags); +typedef VkResult (GLAD_API_PTR *PFN_vkResetDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags); +typedef VkResult (GLAD_API_PTR *PFN_vkResetEvent)(VkDevice device, VkEvent event); +typedef VkResult (GLAD_API_PTR *PFN_vkResetFences)(VkDevice device, uint32_t fenceCount, const VkFence * pFences); +typedef VkResult (GLAD_API_PTR *PFN_vkSetEvent)(VkDevice device, VkEvent event); +typedef void (GLAD_API_PTR *PFN_vkUnmapMemory)(VkDevice device, VkDeviceMemory memory); +typedef void (GLAD_API_PTR *PFN_vkUpdateDescriptorSets)(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet * pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet * pDescriptorCopies); +typedef VkResult (GLAD_API_PTR *PFN_vkWaitForFences)(VkDevice device, uint32_t fenceCount, const VkFence * pFences, VkBool32 waitAll, uint64_t timeout); + +GLAD_API_CALL PFN_vkAcquireNextImage2KHR glad_vkAcquireNextImage2KHR; +#define vkAcquireNextImage2KHR glad_vkAcquireNextImage2KHR +GLAD_API_CALL PFN_vkAcquireNextImageKHR glad_vkAcquireNextImageKHR; +#define vkAcquireNextImageKHR glad_vkAcquireNextImageKHR +GLAD_API_CALL PFN_vkAllocateCommandBuffers glad_vkAllocateCommandBuffers; +#define vkAllocateCommandBuffers glad_vkAllocateCommandBuffers +GLAD_API_CALL PFN_vkAllocateDescriptorSets glad_vkAllocateDescriptorSets; +#define vkAllocateDescriptorSets glad_vkAllocateDescriptorSets +GLAD_API_CALL PFN_vkAllocateMemory glad_vkAllocateMemory; +#define vkAllocateMemory glad_vkAllocateMemory +GLAD_API_CALL PFN_vkBeginCommandBuffer glad_vkBeginCommandBuffer; +#define vkBeginCommandBuffer glad_vkBeginCommandBuffer +GLAD_API_CALL PFN_vkBindBufferMemory glad_vkBindBufferMemory; +#define vkBindBufferMemory glad_vkBindBufferMemory +GLAD_API_CALL PFN_vkBindImageMemory glad_vkBindImageMemory; +#define vkBindImageMemory glad_vkBindImageMemory +GLAD_API_CALL PFN_vkCmdBeginQuery glad_vkCmdBeginQuery; +#define vkCmdBeginQuery glad_vkCmdBeginQuery +GLAD_API_CALL PFN_vkCmdBeginRenderPass glad_vkCmdBeginRenderPass; +#define vkCmdBeginRenderPass glad_vkCmdBeginRenderPass +GLAD_API_CALL PFN_vkCmdBindDescriptorSets glad_vkCmdBindDescriptorSets; +#define vkCmdBindDescriptorSets glad_vkCmdBindDescriptorSets +GLAD_API_CALL PFN_vkCmdBindIndexBuffer glad_vkCmdBindIndexBuffer; +#define vkCmdBindIndexBuffer glad_vkCmdBindIndexBuffer +GLAD_API_CALL PFN_vkCmdBindPipeline glad_vkCmdBindPipeline; +#define vkCmdBindPipeline glad_vkCmdBindPipeline +GLAD_API_CALL PFN_vkCmdBindVertexBuffers glad_vkCmdBindVertexBuffers; +#define vkCmdBindVertexBuffers glad_vkCmdBindVertexBuffers +GLAD_API_CALL PFN_vkCmdBlitImage glad_vkCmdBlitImage; +#define vkCmdBlitImage glad_vkCmdBlitImage +GLAD_API_CALL PFN_vkCmdClearAttachments glad_vkCmdClearAttachments; +#define vkCmdClearAttachments glad_vkCmdClearAttachments +GLAD_API_CALL PFN_vkCmdClearColorImage glad_vkCmdClearColorImage; +#define vkCmdClearColorImage glad_vkCmdClearColorImage +GLAD_API_CALL PFN_vkCmdClearDepthStencilImage glad_vkCmdClearDepthStencilImage; +#define vkCmdClearDepthStencilImage glad_vkCmdClearDepthStencilImage +GLAD_API_CALL PFN_vkCmdCopyBuffer glad_vkCmdCopyBuffer; +#define vkCmdCopyBuffer glad_vkCmdCopyBuffer +GLAD_API_CALL PFN_vkCmdCopyBufferToImage glad_vkCmdCopyBufferToImage; +#define vkCmdCopyBufferToImage glad_vkCmdCopyBufferToImage +GLAD_API_CALL PFN_vkCmdCopyImage glad_vkCmdCopyImage; +#define vkCmdCopyImage glad_vkCmdCopyImage +GLAD_API_CALL PFN_vkCmdCopyImageToBuffer glad_vkCmdCopyImageToBuffer; +#define vkCmdCopyImageToBuffer glad_vkCmdCopyImageToBuffer +GLAD_API_CALL PFN_vkCmdCopyQueryPoolResults glad_vkCmdCopyQueryPoolResults; +#define vkCmdCopyQueryPoolResults glad_vkCmdCopyQueryPoolResults +GLAD_API_CALL PFN_vkCmdDispatch glad_vkCmdDispatch; +#define vkCmdDispatch glad_vkCmdDispatch +GLAD_API_CALL PFN_vkCmdDispatchBaseKHR glad_vkCmdDispatchBaseKHR; +#define vkCmdDispatchBaseKHR glad_vkCmdDispatchBaseKHR +GLAD_API_CALL PFN_vkCmdDispatchIndirect glad_vkCmdDispatchIndirect; +#define vkCmdDispatchIndirect glad_vkCmdDispatchIndirect +GLAD_API_CALL PFN_vkCmdDraw glad_vkCmdDraw; +#define vkCmdDraw glad_vkCmdDraw +GLAD_API_CALL PFN_vkCmdDrawIndexed glad_vkCmdDrawIndexed; +#define vkCmdDrawIndexed glad_vkCmdDrawIndexed +GLAD_API_CALL PFN_vkCmdDrawIndexedIndirect glad_vkCmdDrawIndexedIndirect; +#define vkCmdDrawIndexedIndirect glad_vkCmdDrawIndexedIndirect +GLAD_API_CALL PFN_vkCmdDrawIndirect glad_vkCmdDrawIndirect; +#define vkCmdDrawIndirect glad_vkCmdDrawIndirect +GLAD_API_CALL PFN_vkCmdEndQuery glad_vkCmdEndQuery; +#define vkCmdEndQuery glad_vkCmdEndQuery +GLAD_API_CALL PFN_vkCmdEndRenderPass glad_vkCmdEndRenderPass; +#define vkCmdEndRenderPass glad_vkCmdEndRenderPass +GLAD_API_CALL PFN_vkCmdExecuteCommands glad_vkCmdExecuteCommands; +#define vkCmdExecuteCommands glad_vkCmdExecuteCommands +GLAD_API_CALL PFN_vkCmdFillBuffer glad_vkCmdFillBuffer; +#define vkCmdFillBuffer glad_vkCmdFillBuffer +GLAD_API_CALL PFN_vkCmdNextSubpass glad_vkCmdNextSubpass; +#define vkCmdNextSubpass glad_vkCmdNextSubpass +GLAD_API_CALL PFN_vkCmdPipelineBarrier glad_vkCmdPipelineBarrier; +#define vkCmdPipelineBarrier glad_vkCmdPipelineBarrier +GLAD_API_CALL PFN_vkCmdPushConstants glad_vkCmdPushConstants; +#define vkCmdPushConstants glad_vkCmdPushConstants +GLAD_API_CALL PFN_vkCmdResetEvent glad_vkCmdResetEvent; +#define vkCmdResetEvent glad_vkCmdResetEvent +GLAD_API_CALL PFN_vkCmdResetQueryPool glad_vkCmdResetQueryPool; +#define vkCmdResetQueryPool glad_vkCmdResetQueryPool +GLAD_API_CALL PFN_vkCmdResolveImage glad_vkCmdResolveImage; +#define vkCmdResolveImage glad_vkCmdResolveImage +GLAD_API_CALL PFN_vkCmdSetBlendConstants glad_vkCmdSetBlendConstants; +#define vkCmdSetBlendConstants glad_vkCmdSetBlendConstants +GLAD_API_CALL PFN_vkCmdSetDepthBias glad_vkCmdSetDepthBias; +#define vkCmdSetDepthBias glad_vkCmdSetDepthBias +GLAD_API_CALL PFN_vkCmdSetDepthBounds glad_vkCmdSetDepthBounds; +#define vkCmdSetDepthBounds glad_vkCmdSetDepthBounds +GLAD_API_CALL PFN_vkCmdSetDeviceMaskKHR glad_vkCmdSetDeviceMaskKHR; +#define vkCmdSetDeviceMaskKHR glad_vkCmdSetDeviceMaskKHR +GLAD_API_CALL PFN_vkCmdSetEvent glad_vkCmdSetEvent; +#define vkCmdSetEvent glad_vkCmdSetEvent +GLAD_API_CALL PFN_vkCmdSetLineWidth glad_vkCmdSetLineWidth; +#define vkCmdSetLineWidth glad_vkCmdSetLineWidth +GLAD_API_CALL PFN_vkCmdSetScissor glad_vkCmdSetScissor; +#define vkCmdSetScissor glad_vkCmdSetScissor +GLAD_API_CALL PFN_vkCmdSetStencilCompareMask glad_vkCmdSetStencilCompareMask; +#define vkCmdSetStencilCompareMask glad_vkCmdSetStencilCompareMask +GLAD_API_CALL PFN_vkCmdSetStencilReference glad_vkCmdSetStencilReference; +#define vkCmdSetStencilReference glad_vkCmdSetStencilReference +GLAD_API_CALL PFN_vkCmdSetStencilWriteMask glad_vkCmdSetStencilWriteMask; +#define vkCmdSetStencilWriteMask glad_vkCmdSetStencilWriteMask +GLAD_API_CALL PFN_vkCmdSetViewport glad_vkCmdSetViewport; +#define vkCmdSetViewport glad_vkCmdSetViewport +GLAD_API_CALL PFN_vkCmdUpdateBuffer glad_vkCmdUpdateBuffer; +#define vkCmdUpdateBuffer glad_vkCmdUpdateBuffer +GLAD_API_CALL PFN_vkCmdWaitEvents glad_vkCmdWaitEvents; +#define vkCmdWaitEvents glad_vkCmdWaitEvents +GLAD_API_CALL PFN_vkCmdWriteTimestamp glad_vkCmdWriteTimestamp; +#define vkCmdWriteTimestamp glad_vkCmdWriteTimestamp +GLAD_API_CALL PFN_vkCreateBuffer glad_vkCreateBuffer; +#define vkCreateBuffer glad_vkCreateBuffer +GLAD_API_CALL PFN_vkCreateBufferView glad_vkCreateBufferView; +#define vkCreateBufferView glad_vkCreateBufferView +GLAD_API_CALL PFN_vkCreateCommandPool glad_vkCreateCommandPool; +#define vkCreateCommandPool glad_vkCreateCommandPool +GLAD_API_CALL PFN_vkCreateComputePipelines glad_vkCreateComputePipelines; +#define vkCreateComputePipelines glad_vkCreateComputePipelines +GLAD_API_CALL PFN_vkCreateDescriptorPool glad_vkCreateDescriptorPool; +#define vkCreateDescriptorPool glad_vkCreateDescriptorPool +GLAD_API_CALL PFN_vkCreateDescriptorSetLayout glad_vkCreateDescriptorSetLayout; +#define vkCreateDescriptorSetLayout glad_vkCreateDescriptorSetLayout +GLAD_API_CALL PFN_vkCreateDevice glad_vkCreateDevice; +#define vkCreateDevice glad_vkCreateDevice +GLAD_API_CALL PFN_vkCreateEvent glad_vkCreateEvent; +#define vkCreateEvent glad_vkCreateEvent +GLAD_API_CALL PFN_vkCreateFence glad_vkCreateFence; +#define vkCreateFence glad_vkCreateFence +GLAD_API_CALL PFN_vkCreateFramebuffer glad_vkCreateFramebuffer; +#define vkCreateFramebuffer glad_vkCreateFramebuffer +GLAD_API_CALL PFN_vkCreateGraphicsPipelines glad_vkCreateGraphicsPipelines; +#define vkCreateGraphicsPipelines glad_vkCreateGraphicsPipelines +GLAD_API_CALL PFN_vkCreateImage glad_vkCreateImage; +#define vkCreateImage glad_vkCreateImage +GLAD_API_CALL PFN_vkCreateImageView glad_vkCreateImageView; +#define vkCreateImageView glad_vkCreateImageView +GLAD_API_CALL PFN_vkCreateInstance glad_vkCreateInstance; +#define vkCreateInstance glad_vkCreateInstance +GLAD_API_CALL PFN_vkCreatePipelineCache glad_vkCreatePipelineCache; +#define vkCreatePipelineCache glad_vkCreatePipelineCache +GLAD_API_CALL PFN_vkCreatePipelineLayout glad_vkCreatePipelineLayout; +#define vkCreatePipelineLayout glad_vkCreatePipelineLayout +GLAD_API_CALL PFN_vkCreateQueryPool glad_vkCreateQueryPool; +#define vkCreateQueryPool glad_vkCreateQueryPool +GLAD_API_CALL PFN_vkCreateRenderPass glad_vkCreateRenderPass; +#define vkCreateRenderPass glad_vkCreateRenderPass +GLAD_API_CALL PFN_vkCreateSampler glad_vkCreateSampler; +#define vkCreateSampler glad_vkCreateSampler +GLAD_API_CALL PFN_vkCreateSemaphore glad_vkCreateSemaphore; +#define vkCreateSemaphore glad_vkCreateSemaphore +GLAD_API_CALL PFN_vkCreateShaderModule glad_vkCreateShaderModule; +#define vkCreateShaderModule glad_vkCreateShaderModule +GLAD_API_CALL PFN_vkCreateSwapchainKHR glad_vkCreateSwapchainKHR; +#define vkCreateSwapchainKHR glad_vkCreateSwapchainKHR +GLAD_API_CALL PFN_vkDestroyBuffer glad_vkDestroyBuffer; +#define vkDestroyBuffer glad_vkDestroyBuffer +GLAD_API_CALL PFN_vkDestroyBufferView glad_vkDestroyBufferView; +#define vkDestroyBufferView glad_vkDestroyBufferView +GLAD_API_CALL PFN_vkDestroyCommandPool glad_vkDestroyCommandPool; +#define vkDestroyCommandPool glad_vkDestroyCommandPool +GLAD_API_CALL PFN_vkDestroyDescriptorPool glad_vkDestroyDescriptorPool; +#define vkDestroyDescriptorPool glad_vkDestroyDescriptorPool +GLAD_API_CALL PFN_vkDestroyDescriptorSetLayout glad_vkDestroyDescriptorSetLayout; +#define vkDestroyDescriptorSetLayout glad_vkDestroyDescriptorSetLayout +GLAD_API_CALL PFN_vkDestroyDevice glad_vkDestroyDevice; +#define vkDestroyDevice glad_vkDestroyDevice +GLAD_API_CALL PFN_vkDestroyEvent glad_vkDestroyEvent; +#define vkDestroyEvent glad_vkDestroyEvent +GLAD_API_CALL PFN_vkDestroyFence glad_vkDestroyFence; +#define vkDestroyFence glad_vkDestroyFence +GLAD_API_CALL PFN_vkDestroyFramebuffer glad_vkDestroyFramebuffer; +#define vkDestroyFramebuffer glad_vkDestroyFramebuffer +GLAD_API_CALL PFN_vkDestroyImage glad_vkDestroyImage; +#define vkDestroyImage glad_vkDestroyImage +GLAD_API_CALL PFN_vkDestroyImageView glad_vkDestroyImageView; +#define vkDestroyImageView glad_vkDestroyImageView +GLAD_API_CALL PFN_vkDestroyInstance glad_vkDestroyInstance; +#define vkDestroyInstance glad_vkDestroyInstance +GLAD_API_CALL PFN_vkDestroyPipeline glad_vkDestroyPipeline; +#define vkDestroyPipeline glad_vkDestroyPipeline +GLAD_API_CALL PFN_vkDestroyPipelineCache glad_vkDestroyPipelineCache; +#define vkDestroyPipelineCache glad_vkDestroyPipelineCache +GLAD_API_CALL PFN_vkDestroyPipelineLayout glad_vkDestroyPipelineLayout; +#define vkDestroyPipelineLayout glad_vkDestroyPipelineLayout +GLAD_API_CALL PFN_vkDestroyQueryPool glad_vkDestroyQueryPool; +#define vkDestroyQueryPool glad_vkDestroyQueryPool +GLAD_API_CALL PFN_vkDestroyRenderPass glad_vkDestroyRenderPass; +#define vkDestroyRenderPass glad_vkDestroyRenderPass +GLAD_API_CALL PFN_vkDestroySampler glad_vkDestroySampler; +#define vkDestroySampler glad_vkDestroySampler +GLAD_API_CALL PFN_vkDestroySemaphore glad_vkDestroySemaphore; +#define vkDestroySemaphore glad_vkDestroySemaphore +GLAD_API_CALL PFN_vkDestroyShaderModule glad_vkDestroyShaderModule; +#define vkDestroyShaderModule glad_vkDestroyShaderModule +GLAD_API_CALL PFN_vkDestroySwapchainKHR glad_vkDestroySwapchainKHR; +#define vkDestroySwapchainKHR glad_vkDestroySwapchainKHR +GLAD_API_CALL PFN_vkDeviceWaitIdle glad_vkDeviceWaitIdle; +#define vkDeviceWaitIdle glad_vkDeviceWaitIdle +GLAD_API_CALL PFN_vkEndCommandBuffer glad_vkEndCommandBuffer; +#define vkEndCommandBuffer glad_vkEndCommandBuffer +GLAD_API_CALL PFN_vkEnumerateDeviceExtensionProperties glad_vkEnumerateDeviceExtensionProperties; +#define vkEnumerateDeviceExtensionProperties glad_vkEnumerateDeviceExtensionProperties +GLAD_API_CALL PFN_vkEnumerateDeviceLayerProperties glad_vkEnumerateDeviceLayerProperties; +#define vkEnumerateDeviceLayerProperties glad_vkEnumerateDeviceLayerProperties +GLAD_API_CALL PFN_vkEnumerateInstanceExtensionProperties glad_vkEnumerateInstanceExtensionProperties; +#define vkEnumerateInstanceExtensionProperties glad_vkEnumerateInstanceExtensionProperties +GLAD_API_CALL PFN_vkEnumerateInstanceLayerProperties glad_vkEnumerateInstanceLayerProperties; +#define vkEnumerateInstanceLayerProperties glad_vkEnumerateInstanceLayerProperties +GLAD_API_CALL PFN_vkEnumeratePhysicalDevices glad_vkEnumeratePhysicalDevices; +#define vkEnumeratePhysicalDevices glad_vkEnumeratePhysicalDevices +GLAD_API_CALL PFN_vkFlushMappedMemoryRanges glad_vkFlushMappedMemoryRanges; +#define vkFlushMappedMemoryRanges glad_vkFlushMappedMemoryRanges +GLAD_API_CALL PFN_vkFreeCommandBuffers glad_vkFreeCommandBuffers; +#define vkFreeCommandBuffers glad_vkFreeCommandBuffers +GLAD_API_CALL PFN_vkFreeDescriptorSets glad_vkFreeDescriptorSets; +#define vkFreeDescriptorSets glad_vkFreeDescriptorSets +GLAD_API_CALL PFN_vkFreeMemory glad_vkFreeMemory; +#define vkFreeMemory glad_vkFreeMemory +GLAD_API_CALL PFN_vkGetBufferMemoryRequirements glad_vkGetBufferMemoryRequirements; +#define vkGetBufferMemoryRequirements glad_vkGetBufferMemoryRequirements +GLAD_API_CALL PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR glad_vkGetDeviceGroupPeerMemoryFeaturesKHR; +#define vkGetDeviceGroupPeerMemoryFeaturesKHR glad_vkGetDeviceGroupPeerMemoryFeaturesKHR +GLAD_API_CALL PFN_vkGetDeviceGroupPresentCapabilitiesKHR glad_vkGetDeviceGroupPresentCapabilitiesKHR; +#define vkGetDeviceGroupPresentCapabilitiesKHR glad_vkGetDeviceGroupPresentCapabilitiesKHR +GLAD_API_CALL PFN_vkGetDeviceGroupSurfacePresentModesKHR glad_vkGetDeviceGroupSurfacePresentModesKHR; +#define vkGetDeviceGroupSurfacePresentModesKHR glad_vkGetDeviceGroupSurfacePresentModesKHR +GLAD_API_CALL PFN_vkGetDeviceMemoryCommitment glad_vkGetDeviceMemoryCommitment; +#define vkGetDeviceMemoryCommitment glad_vkGetDeviceMemoryCommitment +GLAD_API_CALL PFN_vkGetDeviceProcAddr glad_vkGetDeviceProcAddr; +#define vkGetDeviceProcAddr glad_vkGetDeviceProcAddr +GLAD_API_CALL PFN_vkGetDeviceQueue glad_vkGetDeviceQueue; +#define vkGetDeviceQueue glad_vkGetDeviceQueue +GLAD_API_CALL PFN_vkGetEventStatus glad_vkGetEventStatus; +#define vkGetEventStatus glad_vkGetEventStatus +GLAD_API_CALL PFN_vkGetFenceStatus glad_vkGetFenceStatus; +#define vkGetFenceStatus glad_vkGetFenceStatus +GLAD_API_CALL PFN_vkGetImageMemoryRequirements glad_vkGetImageMemoryRequirements; +#define vkGetImageMemoryRequirements glad_vkGetImageMemoryRequirements +GLAD_API_CALL PFN_vkGetImageSparseMemoryRequirements glad_vkGetImageSparseMemoryRequirements; +#define vkGetImageSparseMemoryRequirements glad_vkGetImageSparseMemoryRequirements +GLAD_API_CALL PFN_vkGetImageSubresourceLayout glad_vkGetImageSubresourceLayout; +#define vkGetImageSubresourceLayout glad_vkGetImageSubresourceLayout +GLAD_API_CALL PFN_vkGetInstanceProcAddr glad_vkGetInstanceProcAddr; +#define vkGetInstanceProcAddr glad_vkGetInstanceProcAddr +GLAD_API_CALL PFN_vkGetPhysicalDeviceFeatures glad_vkGetPhysicalDeviceFeatures; +#define vkGetPhysicalDeviceFeatures glad_vkGetPhysicalDeviceFeatures +GLAD_API_CALL PFN_vkGetPhysicalDeviceFormatProperties glad_vkGetPhysicalDeviceFormatProperties; +#define vkGetPhysicalDeviceFormatProperties glad_vkGetPhysicalDeviceFormatProperties +GLAD_API_CALL PFN_vkGetPhysicalDeviceImageFormatProperties glad_vkGetPhysicalDeviceImageFormatProperties; +#define vkGetPhysicalDeviceImageFormatProperties glad_vkGetPhysicalDeviceImageFormatProperties +GLAD_API_CALL PFN_vkGetPhysicalDeviceMemoryProperties glad_vkGetPhysicalDeviceMemoryProperties; +#define vkGetPhysicalDeviceMemoryProperties glad_vkGetPhysicalDeviceMemoryProperties +GLAD_API_CALL PFN_vkGetPhysicalDevicePresentRectanglesKHR glad_vkGetPhysicalDevicePresentRectanglesKHR; +#define vkGetPhysicalDevicePresentRectanglesKHR glad_vkGetPhysicalDevicePresentRectanglesKHR +GLAD_API_CALL PFN_vkGetPhysicalDeviceProperties glad_vkGetPhysicalDeviceProperties; +#define vkGetPhysicalDeviceProperties glad_vkGetPhysicalDeviceProperties +GLAD_API_CALL PFN_vkGetPhysicalDeviceQueueFamilyProperties glad_vkGetPhysicalDeviceQueueFamilyProperties; +#define vkGetPhysicalDeviceQueueFamilyProperties glad_vkGetPhysicalDeviceQueueFamilyProperties +GLAD_API_CALL PFN_vkGetPhysicalDeviceSparseImageFormatProperties glad_vkGetPhysicalDeviceSparseImageFormatProperties; +#define vkGetPhysicalDeviceSparseImageFormatProperties glad_vkGetPhysicalDeviceSparseImageFormatProperties +GLAD_API_CALL PFN_vkGetPipelineCacheData glad_vkGetPipelineCacheData; +#define vkGetPipelineCacheData glad_vkGetPipelineCacheData +GLAD_API_CALL PFN_vkGetQueryPoolResults glad_vkGetQueryPoolResults; +#define vkGetQueryPoolResults glad_vkGetQueryPoolResults +GLAD_API_CALL PFN_vkGetRenderAreaGranularity glad_vkGetRenderAreaGranularity; +#define vkGetRenderAreaGranularity glad_vkGetRenderAreaGranularity +GLAD_API_CALL PFN_vkGetSwapchainImagesKHR glad_vkGetSwapchainImagesKHR; +#define vkGetSwapchainImagesKHR glad_vkGetSwapchainImagesKHR +GLAD_API_CALL PFN_vkInvalidateMappedMemoryRanges glad_vkInvalidateMappedMemoryRanges; +#define vkInvalidateMappedMemoryRanges glad_vkInvalidateMappedMemoryRanges +GLAD_API_CALL PFN_vkMapMemory glad_vkMapMemory; +#define vkMapMemory glad_vkMapMemory +GLAD_API_CALL PFN_vkMergePipelineCaches glad_vkMergePipelineCaches; +#define vkMergePipelineCaches glad_vkMergePipelineCaches +GLAD_API_CALL PFN_vkQueueBindSparse glad_vkQueueBindSparse; +#define vkQueueBindSparse glad_vkQueueBindSparse +GLAD_API_CALL PFN_vkQueuePresentKHR glad_vkQueuePresentKHR; +#define vkQueuePresentKHR glad_vkQueuePresentKHR +GLAD_API_CALL PFN_vkQueueSubmit glad_vkQueueSubmit; +#define vkQueueSubmit glad_vkQueueSubmit +GLAD_API_CALL PFN_vkQueueWaitIdle glad_vkQueueWaitIdle; +#define vkQueueWaitIdle glad_vkQueueWaitIdle +GLAD_API_CALL PFN_vkResetCommandBuffer glad_vkResetCommandBuffer; +#define vkResetCommandBuffer glad_vkResetCommandBuffer +GLAD_API_CALL PFN_vkResetCommandPool glad_vkResetCommandPool; +#define vkResetCommandPool glad_vkResetCommandPool +GLAD_API_CALL PFN_vkResetDescriptorPool glad_vkResetDescriptorPool; +#define vkResetDescriptorPool glad_vkResetDescriptorPool +GLAD_API_CALL PFN_vkResetEvent glad_vkResetEvent; +#define vkResetEvent glad_vkResetEvent +GLAD_API_CALL PFN_vkResetFences glad_vkResetFences; +#define vkResetFences glad_vkResetFences +GLAD_API_CALL PFN_vkSetEvent glad_vkSetEvent; +#define vkSetEvent glad_vkSetEvent +GLAD_API_CALL PFN_vkUnmapMemory glad_vkUnmapMemory; +#define vkUnmapMemory glad_vkUnmapMemory +GLAD_API_CALL PFN_vkUpdateDescriptorSets glad_vkUpdateDescriptorSets; +#define vkUpdateDescriptorSets glad_vkUpdateDescriptorSets +GLAD_API_CALL PFN_vkWaitForFences glad_vkWaitForFences; +#define vkWaitForFences glad_vkWaitForFences + + + + + +GLAD_API_CALL int gladLoadVulkanUserPtr( VkPhysicalDevice physical_device, GLADuserptrloadfunc load, void *userptr); +GLAD_API_CALL int gladLoadVulkan( VkPhysicalDevice physical_device, GLADloadfunc load); + + + +#ifdef __cplusplus +} +#endif +#endif \ No newline at end of file diff --git a/include/level_commands.h b/include/level_commands.h index cbc0ad0b..513ff6f0 100644 --- a/include/level_commands.h +++ b/include/level_commands.h @@ -34,284 +34,251 @@ #define REGULAR_FACE 0x0002 #define DIZZY_FACE 0x0003 -#ifdef NO_SEGMENTED_MEMORY #define EXECUTE(seg, script, scriptEnd, entry) \ - (LevelScript) CMD_BBH(0x00, 0x10, 0x0000), \ - (LevelScript) CMD_PTR(NULL), \ - (LevelScript) CMD_PTR(NULL), \ - (LevelScript) CMD_PTR(entry) + CMD_BBH(0x00, 0x10, 0x0000), \ + CMD_PTR(NULL), \ + CMD_PTR(NULL), \ + CMD_PTR(entry) #define EXIT_AND_EXECUTE(seg, script, scriptEnd, entry) \ - (LevelScript) CMD_BBH(0x01, 0x10, 0x0000), \ - (LevelScript) CMD_PTR(NULL), \ - (LevelScript) CMD_PTR(NULL), \ - (LevelScript) CMD_PTR(entry) -#else -#define EXECUTE(seg, script, scriptEnd, entry) \ - (LevelScript) CMD_BBH(0x00, 0x10, seg), \ - (LevelScript) CMD_PTR(script), \ - (LevelScript) CMD_PTR(scriptEnd), \ - (LevelScript) CMD_PTR(entry) - -#define EXIT_AND_EXECUTE(seg, script, scriptEnd, entry) \ - (LevelScript) CMD_BBH(0x01, 0x10, seg), \ - (LevelScript) CMD_PTR(script), \ - (LevelScript) CMD_PTR(scriptEnd), \ - (LevelScript) CMD_PTR(entry) -#endif + CMD_BBH(0x01, 0x10, 0x0000), \ + CMD_PTR(NULL), \ + CMD_PTR(NULL), \ + CMD_PTR(entry) #define EXIT() \ - (LevelScript) CMD_BBH(0x02, 0x04, 0x0000) + CMD_BBH(0x02, 0x04, 0x0000) #define SLEEP(frames) \ - (LevelScript) CMD_BBH(0x03, 0x04, frames) + CMD_BBH(0x03, 0x04, frames) #define SLEEP_BEFORE_EXIT(frames) \ - (LevelScript) CMD_BBH(0x04, 0x04, frames) + CMD_BBH(0x04, 0x04, frames) #define JUMP(target) \ - (LevelScript) CMD_BBH(0x05, 0x08, 0x0000), \ - (LevelScript) CMD_PTR(target) + CMD_BBH(0x05, 0x08, 0x0000), \ + CMD_PTR(target) #define JUMP_LINK(target) \ - (LevelScript) CMD_BBH(0x06, 0x08, 0x0000), \ - (LevelScript) CMD_PTR(target) + CMD_BBH(0x06, 0x08, 0x0000), \ + CMD_PTR(target) #define RETURN() \ - (LevelScript) CMD_BBH(0x07, 0x04, 0x0000) + CMD_BBH(0x07, 0x04, 0x0000) #define JUMP_LINK_PUSH_ARG(arg) \ - (LevelScript) CMD_BBH(0x08, 0x04, arg) + CMD_BBH(0x08, 0x04, arg) #define JUMP_N_TIMES() \ - (LevelScript) CMD_BBH(0x09, 0x04, 0x0000) + CMD_BBH(0x09, 0x04, 0x0000) #define LOOP_BEGIN() \ - (LevelScript) CMD_BBH(0x0A, 0x04, 0x0000) + CMD_BBH(0x0A, 0x04, 0x0000) #define LOOP_UNTIL(op, arg) \ - (LevelScript) CMD_BBBB(0x0B, 0x08, op, 0x00), \ - (LevelScript) CMD_W(arg) + CMD_BBBB(0x0B, 0x08, op, 0x00), \ + CMD_W(arg) #define JUMP_IF(op, arg, target) \ - (LevelScript) CMD_BBBB(0x0C, 0x0C, op, 0x00), \ - (LevelScript) CMD_W(arg), \ - (LevelScript) CMD_PTR(target) + CMD_BBBB(0x0C, 0x0C, op, 0x00), \ + CMD_W(arg), \ + CMD_PTR(target) #define JUMP_LINK_IF(op, arg, target) \ - (LevelScript) CMD_BBBB(0x0D, 0x0C, op, 0x00), \ - (LevelScript) CMD_W(arg), \ - (LevelScript) CMD_PTR(target) + CMD_BBBB(0x0D, 0x0C, op, 0x00), \ + CMD_W(arg), \ + CMD_PTR(target) #define SKIP_IF(op, arg) \ - (LevelScript) CMD_BBBB(0x0E, 0x08, op, 0) \ - (LevelScript) CMD_W(arg) + CMD_BBBB(0x0E, 0x08, op, 0) \ + CMD_W(arg) #define SKIP() \ - (LevelScript) CMD_BBH(0x0F, 0x04, 0x0000) + CMD_BBH(0x0F, 0x04, 0x0000) #define SKIP_NOP() \ - (LevelScript) CMD_BBH(0x10, 0x04, 0x0000) + CMD_BBH(0x10, 0x04, 0x0000) #define CALL(arg, func) \ - (LevelScript) CMD_BBH(0x11, 0x08, arg), \ - (LevelScript) CMD_PTR(func) + CMD_BBH(0x11, 0x08, arg), \ + CMD_PTR(func) #define CALL_LOOP(arg, func) \ - (LevelScript) CMD_BBH(0x12, 0x08, arg), \ - (LevelScript) CMD_PTR(func) + CMD_BBH(0x12, 0x08, arg), \ + CMD_PTR(func) #define SET_REG(value) \ - (LevelScript) CMD_BBH(0x13, 0x04, value) + CMD_BBH(0x13, 0x04, value) #define PUSH_POOL() \ - (LevelScript) CMD_BBH(0x14, 0x04, 0x0000) + CMD_BBH(0x14, 0x04, 0x0000) #define POP_POOL() \ - (LevelScript) CMD_BBH(0x15, 0x04, 0x0000) + CMD_BBH(0x15, 0x04, 0x0000) -#ifdef NO_SEGMENTED_MEMORY #define FIXED_LOAD(loadAddr, romStart, romEnd) \ - (LevelScript) CMD_BBH(0x16, 0x10, 0x0000), \ - (LevelScript) CMD_PTR(NULL), \ - (LevelScript) CMD_PTR(NULL), \ - (LevelScript) CMD_PTR(NULL) + CMD_BBH(0x16, 0x10, 0x0000), \ + CMD_PTR(NULL), \ + CMD_PTR(NULL), \ + CMD_PTR(NULL) #define LOAD_RAW(seg, romStart, romEnd) \ - (LevelScript) CMD_BBH(0x17, 0x0C, 0x0000), \ - (LevelScript) CMD_PTR(NULL), \ - (LevelScript) CMD_PTR(NULL) + CMD_BBH(0x17, 0x0C, 0x0000), \ + CMD_PTR(NULL), \ + CMD_PTR(NULL) #define LOAD_MIO0(seg, romStart, romEnd) \ - (LevelScript) CMD_BBH(0x18, 0x0C, 0x0000), \ - (LevelScript) CMD_PTR(NULL), \ - (LevelScript) CMD_PTR(NULL) -#else -#define FIXED_LOAD(loadAddr, romStart, romEnd) \ - (LevelScript) CMD_BBH(0x16, 0x10, 0x0000), \ - (LevelScript) CMD_PTR(loadAddr), \ - (LevelScript) CMD_PTR(romStart), \ - (LevelScript) CMD_PTR(romEnd) - -#define LOAD_RAW(seg, romStart, romEnd) \ - (LevelScript) CMD_BBH(0x17, 0x0C, seg), \ - (LevelScript) CMD_PTR(romStart), \ - (LevelScript) CMD_PTR(romEnd) - -#define LOAD_MIO0(seg, romStart, romEnd) \ - (LevelScript) CMD_BBH(0x18, 0x0C, seg), \ - (LevelScript) CMD_PTR(romStart), \ - (LevelScript) CMD_PTR(romEnd) -#endif + CMD_BBH(0x18, 0x0C, 0x0000), \ + CMD_PTR(NULL), \ + CMD_PTR(NULL) #define LOAD_MARIO_HEAD(sethead) \ - (LevelScript) CMD_BBH(0x19, 0x04, sethead) + CMD_BBH(0x19, 0x04, sethead) -#ifdef NO_SEGMENTED_MEMORY #define LOAD_MIO0_TEXTURE(seg, romStart, romEnd) \ - (LevelScript) CMD_BBH(0x1A, 0x0C, 0x0000), \ - (LevelScript) CMD_PTR(NULL), \ - (LevelScript) CMD_PTR(NULL) -#else -#define LOAD_MIO0_TEXTURE(seg, romStart, romEnd) \ - (LevelScript) CMD_BBH(0x1A, 0x0C, seg), \ - (LevelScript) CMD_PTR(romStart), \ - (LevelScript) CMD_PTR(romEnd) -#endif + CMD_BBH(0x1A, 0x0C, 0x0000), \ + CMD_PTR(NULL), \ + CMD_PTR(NULL) #define INIT_LEVEL() \ - (LevelScript) CMD_BBH(0x1B, 0x04, 0x0000) + CMD_BBH(0x1B, 0x04, 0x0000) #define CLEAR_LEVEL() \ - (LevelScript) CMD_BBH(0x1C, 0x04, 0x0000) + CMD_BBH(0x1C, 0x04, 0x0000) #define ALLOC_LEVEL_POOL() \ - (LevelScript) CMD_BBH(0x1D, 0x04, 0x0000) + CMD_BBH(0x1D, 0x04, 0x0000) #define FREE_LEVEL_POOL() \ - (LevelScript) CMD_BBH(0x1E, 0x04, 0x0000) + CMD_BBH(0x1E, 0x04, 0x0000) #define AREA(index, geo) \ - (LevelScript) CMD_BBBB(0x1F, 0x08, index, 0), \ - (LevelScript) CMD_PTR(geo) + CMD_BBBB(0x1F, 0x08, index, 0), \ + CMD_PTR(geo) #define END_AREA() \ - (LevelScript) CMD_BBH(0x20, 0x04, 0x0000) + CMD_BBH(0x20, 0x04, 0x0000) #define LOAD_MODEL_FROM_DL(model, dl, layer) \ - (LevelScript) CMD_BBH(0x21, 0x08, ((layer << 12) | model)), \ - (LevelScript) CMD_PTR(dl) + CMD_BBH(0x21, 0x08, ((layer << 12) | model)), \ + CMD_PTR(dl) #define LOAD_MODEL_FROM_GEO(model, geo) \ - (LevelScript) CMD_BBH(0x22, 0x08, model), \ - (LevelScript) CMD_PTR(geo) + CMD_BBH(0x22, 0x08, model), \ + CMD_PTR(geo) // unk8 is float, but doesn't really matter since CMD23 is unused #define CMD23(model, unk4, unk8) \ - (LevelScript) CMD_BBH(0x22, 0x08, model), \ - (LevelScript) CMD_PTR(unk4), \ - (LevelScript) CMD_W(unk8) + CMD_BBH(0x22, 0x08, model), \ + CMD_PTR(unk4), \ + CMD_W(unk8) #define OBJECT_WITH_ACTS(model, posX, posY, posZ, angleX, angleY, angleZ, behParam, beh, acts) \ - (LevelScript) CMD_BBBB(0x24, 0x18, acts, model), \ - (LevelScript) CMD_HHHHHH(posX, posY, posZ, angleX, angleY, angleZ), \ - (LevelScript) CMD_W(behParam), \ - (LevelScript) CMD_PTR(beh) + CMD_BBBB(0x24, 0x18, acts, model), \ + CMD_HHHHHH(posX, posY, posZ, angleX, angleY, angleZ), \ + CMD_W(behParam), \ + CMD_PTR(beh) #define OBJECT(model, posX, posY, posZ, angleX, angleY, angleZ, behParam, beh) \ - (LevelScript) OBJECT_WITH_ACTS(model, posX, posY, posZ, angleX, angleY, angleZ, behParam, beh, 0x1F) + OBJECT_WITH_ACTS(model, posX, posY, posZ, angleX, angleY, angleZ, behParam, beh, 0x1F) #define MARIO(unk3, behArg, beh) \ - (LevelScript) CMD_BBBB(0x25, 0x0C, 0x00, unk3), \ - (LevelScript) CMD_W(behArg), \ - (LevelScript) CMD_PTR(beh) + CMD_BBBB(0x25, 0x0C, 0x00, unk3), \ + CMD_W(behArg), \ + CMD_PTR(beh) #define WARP_NODE(id, destLevel, destArea, destNode, flags) \ - (LevelScript) CMD_BBBB(0x26, 0x08, id, destLevel), \ - (LevelScript) CMD_BBBB(destArea, destNode, flags, 0x00) + CMD_BBBB(0x26, 0x08, id, destLevel), \ + CMD_BBBB(destArea, destNode, flags, 0x00) #define PAINTING_WARP_NODE(id, destLevel, destArea, destNode, flags) \ - (LevelScript) CMD_BBBB(0x27, 0x08, id, destLevel), \ - (LevelScript) CMD_BBBB(destArea, destNode, flags, 0x00) + CMD_BBBB(0x27, 0x08, id, destLevel), \ + CMD_BBBB(destArea, destNode, flags, 0x00) #define INSTANT_WARP(index, destArea, displaceX, displaceY, displaceZ) \ - (LevelScript) CMD_BBBB(0x28, 0x0C, index, destArea), \ - (LevelScript) CMD_HH(displaceX, displaceY), \ - (LevelScript) CMD_HH(displaceZ, 0x0000) + CMD_BBBB(0x28, 0x0C, index, destArea), \ + CMD_HH(displaceX, displaceY), \ + CMD_HH(displaceZ, 0x0000) #define LOAD_AREA(area) \ - (LevelScript) CMD_BBBB(0x29, 0x04, area, 0x00) + CMD_BBBB(0x29, 0x04, area, 0x00) #define CMD2A(unk2) \ - (LevelScript) CMD_BBBB(0x2A, 0x04, unk2, 0x00) + CMD_BBBB(0x2A, 0x04, unk2, 0x00) #define MARIO_POS(area, yaw, posX, posY, posZ) \ - (LevelScript) CMD_BBBB(0x2B, 0x0C, area, 0x00), \ - (LevelScript) CMD_HH(yaw, posX), \ - (LevelScript) CMD_HH(posY, posZ) + CMD_BBBB(0x2B, 0x0C, area, 0x00), \ + CMD_HH(yaw, posX), \ + CMD_HH(posY, posZ) // unused #define CMD2C() \ - (LevelScript) CMD_BBH(0x2C, 0x04, 0x0000) + CMD_BBH(0x2C, 0x04, 0x0000) // unused #define CMD2D() \ - (LevelScript) CMD_BBH(0x2D, 0x04, 0x0000) + CMD_BBH(0x2D, 0x04, 0x0000) #define TERRAIN(terrainData) \ - (LevelScript) CMD_BBH(0x2E, 0x08, 0x0000), \ - (LevelScript) CMD_PTR(terrainData) + CMD_BBH(0x2E, 0x08, 0x0000), \ + CMD_PTR(terrainData) #define ROOMS(surfaceRooms) \ - (LevelScript) CMD_BBH(0x2F, 0x08, 0x0000), \ - (LevelScript) CMD_PTR(surfaceRooms) + CMD_BBH(0x2F, 0x08, 0x0000), \ + CMD_PTR(surfaceRooms) #define SHOW_DIALOG(index, dialogId) \ - (LevelScript) CMD_BBBB(0x30, 0x04, index, dialogId) + CMD_BBBB(0x30, 0x04, index, dialogId) #define TERRAIN_TYPE(terrainType) \ - (LevelScript) CMD_BBH(0x31, 0x04, terrainType) + CMD_BBH(0x31, 0x04, terrainType) #define NOP() \ - (LevelScript) CMD_BBH(0x32, 0x04, 0x0000) + CMD_BBH(0x32, 0x04, 0x0000) #define TRANSITION(transType, time, colorR, colorG, colorB) \ - (LevelScript) CMD_BBBB(0x33, 0x08, transType, time), \ - (LevelScript) CMD_BBBB(colorR, colorG, colorB, 0x00) + CMD_BBBB(0x33, 0x08, transType, time), \ + CMD_BBBB(colorR, colorG, colorB, 0x00) #define BLACKOUT(active) \ - (LevelScript) CMD_BBBB(0x34, 0x04, active, 0x00) + CMD_BBBB(0x34, 0x04, active, 0x00) #define GAMMA(enabled) \ - (LevelScript) CMD_BBBB(0x35, 0x04, enabled, 0x00) + CMD_BBBB(0x35, 0x04, enabled, 0x00) #define SET_BACKGROUND_MUSIC(settingsPreset, seq) \ - (LevelScript) CMD_BBH(0x36, 0x08, settingsPreset), \ - (LevelScript) CMD_HH(seq, 0x0000) + CMD_BBH(0x36, 0x08, settingsPreset), \ + CMD_HH(seq, 0x0000) #define SET_MENU_MUSIC(seq) \ - (LevelScript) CMD_BBH(0x37, 0x04, seq) + CMD_BBH(0x37, 0x04, seq) #define STOP_MUSIC(fadeOutTime) \ - (LevelScript) CMD_BBH(0x38, 0x04, fadeOutTime) + CMD_BBH(0x38, 0x04, fadeOutTime) #define MACRO_OBJECTS(objList) \ - (LevelScript) CMD_BBH(0x39, 0x08, 0x0000), \ - (LevelScript) CMD_PTR(objList) + CMD_BBH(0x39, 0x08, 0x0000), \ + CMD_PTR(objList) // unused #define CMD3A(unk2, unk4, unk6, unk8, unk10) \ - (LevelScript) CMD_BBH(0x3A, 0x0C, unk2), \ - (LevelScript) CMD_HH(unk6, unk8), \ - (LevelScript) CMD_HH(unk10, 0x0000) + CMD_BBH(0x3A, 0x0C, unk2), \ + CMD_HH(unk6, unk8), \ + CMD_HH(unk10, 0x0000) #define WHIRLPOOL(index, condition, posX, posY, posZ, strength) \ - (LevelScript) CMD_BBBB(0x3B, 0x0C, index, condition), \ - (LevelScript) CMD_HH(posX, posY), \ - (LevelScript) CMD_HH(posZ, strength) + CMD_BBBB(0x3B, 0x0C, index, condition), \ + CMD_HH(posX, posY), \ + CMD_HH(posZ, strength) #define GET_OR_SET(op, var) \ - (LevelScript) CMD_BBBB(0x3C, 0x04, op, var) + CMD_BBBB(0x3C, 0x04, op, var) + +#define ADV_DEMO() \ + CMD_BBH(0x3D, 0x04, 0x0000) + +#define CLEAR_DEMO_PTR() \ + CMD_BBH(0x3E, 0x04, 0x0000) #endif // LEVEL_COMMANDS_H diff --git a/include/libc/stdlib.h b/include/libc/stdlib.h index c23b4542..1aaa2702 100644 --- a/include/libc/stdlib.h +++ b/include/libc/stdlib.h @@ -1,6 +1,9 @@ #ifndef STDLIB_H #define STDLIB_H +#include + +#ifdef NO_LDIV typedef struct lldiv_t { long long quot; @@ -15,5 +18,6 @@ typedef struct ldiv_t lldiv_t lldiv(long long num, long long denom); ldiv_t ldiv(long num, long denom); +#endif #endif diff --git a/include/macros.h b/include/macros.h index 3c171faf..1d070362 100644 --- a/include/macros.h +++ b/include/macros.h @@ -53,20 +53,28 @@ #define ALIGNED16 #endif -#ifndef NO_SEGMENTED_MEMORY -// convert a virtual address to physical. -#define VIRTUAL_TO_PHYSICAL(addr) ((uintptr_t)(addr) & 0x1FFFFFFF) - -// convert a physical address to virtual. -#define PHYSICAL_TO_VIRTUAL(addr) ((uintptr_t)(addr) | 0x80000000) - -// another way of converting virtual to physical -#define VIRTUAL_TO_PHYSICAL2(addr) ((u8 *)(addr) - 0x80000000U) -#else -// no conversion needed other than cast +// no conversion for pc port other than cast #define VIRTUAL_TO_PHYSICAL(addr) ((uintptr_t)(addr)) #define PHYSICAL_TO_VIRTUAL(addr) ((uintptr_t)(addr)) #define VIRTUAL_TO_PHYSICAL2(addr) ((void *)(addr)) + +// Byteswap macros +#define BSWAP16(x) (((x) & 0xFF) << 8 | (((x) >> 8) & 0xFF)) +#define BSWAP32(x) \ + ( (((x) >> 24) & 0x000000FF) | (((x) >> 8) & 0x0000FF00) | \ + (((x) << 8) & 0x00FF0000) | (((x) << 24) & 0xFF000000) ) + +// Convenience macros for endian conversions +#if IS_BIG_ENDIAN +# define BE_TO_HOST16(x) (x) +# define BE_TO_HOST32(x) (x) +# define LE_TO_HOST16(x) BSWAP16(x) +# define LE_TO_HOST32(x) BSWAP32(x) +#else +# define BE_TO_HOST16(x) BSWAP16(x) +# define BE_TO_HOST32(x) BSWAP32(x) +# define LE_TO_HOST16(x) (x) +# define LE_TO_HOST32(x) (x) #endif #endif // MACROS_H diff --git a/include/make_const_nonconst.h b/include/make_const_nonconst.h index dbe5031e..249f73ae 100644 --- a/include/make_const_nonconst.h +++ b/include/make_const_nonconst.h @@ -1,11 +1,4 @@ #ifndef MAKE_CONST_NONCONST_H #define MAKE_CONST_NONCONST_H -#ifdef TARGET_N64 -// IDO sometimes puts const variables in .rodata and sometimes in .data, which breaks ordering. -// This makes sure all variables are put into the same section (.data). We need to do this for -// both IDO and gcc for TARGET_N64. -#define const #endif - -#endif // MAKE_CONST_NONCONST_H diff --git a/include/platform_info.h b/include/platform_info.h index 310aa4d1..3222bc7a 100644 --- a/include/platform_info.h +++ b/include/platform_info.h @@ -1,14 +1,9 @@ #ifndef PLATFORM_INFO_H #define PLATFORM_INFO_H -#ifdef TARGET_N64 -#define IS_64_BIT 0 -#define IS_BIG_ENDIAN 1 -#else #include #define IS_64_BIT (UINTPTR_MAX == 0xFFFFFFFFFFFFFFFFU) #define IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) -#endif #define DOUBLE_SIZE_ON_64_BIT(size) ((size) * (sizeof(void *) / 4)) diff --git a/include/segment_symbols.h b/include/segment_symbols.h index 9d1bdcd9..09c950d0 100644 --- a/include/segment_symbols.h +++ b/include/segment_symbols.h @@ -1,92 +1,4 @@ -#pragma once +#ifndef SEGMENT_SYMBOLS_H +#define SEGMENT_SYMBOLS_H -#ifndef NO_SEGMENTED_MEMORY -#define DECLARE_SEGMENT(name) \ - extern u8 _##name##SegmentRomStart[]; \ - extern u8 _##name##SegmentRomEnd[]; - -#define DECLARE_ACTOR_SEGMENT(name) \ - DECLARE_SEGMENT(name##_mio0) \ - DECLARE_SEGMENT(name##_geo) - -#define DECLARE_LEVEL_SEGMENT(name) \ - DECLARE_SEGMENT(name) \ - DECLARE_SEGMENT(name##_segment_7) - -DECLARE_ACTOR_SEGMENT(common0) -DECLARE_ACTOR_SEGMENT(common1) -DECLARE_ACTOR_SEGMENT(group0) -DECLARE_ACTOR_SEGMENT(group1) -DECLARE_ACTOR_SEGMENT(group2) -DECLARE_ACTOR_SEGMENT(group3) -DECLARE_ACTOR_SEGMENT(group4) -DECLARE_ACTOR_SEGMENT(group5) -DECLARE_ACTOR_SEGMENT(group6) -DECLARE_ACTOR_SEGMENT(group7) -DECLARE_ACTOR_SEGMENT(group8) -DECLARE_ACTOR_SEGMENT(group9) -DECLARE_ACTOR_SEGMENT(group10) -DECLARE_ACTOR_SEGMENT(group11) -DECLARE_ACTOR_SEGMENT(group12) -DECLARE_ACTOR_SEGMENT(group13) -DECLARE_ACTOR_SEGMENT(group14) -DECLARE_ACTOR_SEGMENT(group15) -DECLARE_ACTOR_SEGMENT(group16) -DECLARE_ACTOR_SEGMENT(group17) - -DECLARE_SEGMENT(entry) -DECLARE_SEGMENT(engine) -DECLARE_SEGMENT(behavior) -DECLARE_SEGMENT(scripts) -DECLARE_SEGMENT(goddard) -extern u8 _goddardSegmentStart[]; - -DECLARE_LEVEL_SEGMENT(menu) -DECLARE_LEVEL_SEGMENT(intro) -DECLARE_LEVEL_SEGMENT(ending) - -#define STUB_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8) -#define DEFINE_LEVEL(_0, _1, _2, folder, _4, _5, _6, _7, _8, _9, _10) DECLARE_LEVEL_SEGMENT(folder) - -#include "levels/level_defines.h" - -#undef STUB_LEVEL -#undef DEFINE_LEVEL - -DECLARE_SEGMENT(segment2_mio0) - -DECLARE_SEGMENT(water_skybox_mio0) -DECLARE_SEGMENT(ccm_skybox_mio0) -DECLARE_SEGMENT(clouds_skybox_mio0) -DECLARE_SEGMENT(bitfs_skybox_mio0) -DECLARE_SEGMENT(wdw_skybox_mio0) -DECLARE_SEGMENT(cloud_floor_skybox_mio0) -DECLARE_SEGMENT(ssl_skybox_mio0) -DECLARE_SEGMENT(bbh_skybox_mio0) -DECLARE_SEGMENT(bidw_skybox_mio0) -DECLARE_SEGMENT(bits_skybox_mio0) - -DECLARE_SEGMENT(fire_mio0) -DECLARE_SEGMENT(spooky_mio0) -DECLARE_SEGMENT(generic_mio0) -DECLARE_SEGMENT(water_mio0) -DECLARE_SEGMENT(sky_mio0) -DECLARE_SEGMENT(snow_mio0) -DECLARE_SEGMENT(cave_mio0) -DECLARE_SEGMENT(machine_mio0) -DECLARE_SEGMENT(mountain_mio0) -DECLARE_SEGMENT(grass_mio0) -DECLARE_SEGMENT(outside_mio0) -DECLARE_SEGMENT(inside_mio0) -DECLARE_SEGMENT(effect_mio0) -DECLARE_SEGMENT(title_screen_bg_mio0) - -DECLARE_SEGMENT(debug_level_select_mio0) - -#ifdef VERSION_EU -DECLARE_SEGMENT(translation_de_mio0) -DECLARE_SEGMENT(translation_en_mio0) -DECLARE_SEGMENT(translation_fr_mio0) -#endif - -#endif \ No newline at end of file +#endif // SEGMENT_SYMBOLS_H diff --git a/include/segments.h b/include/segments.h index 89634464..ab4c68d7 100644 --- a/include/segments.h +++ b/include/segments.h @@ -1,6 +1,10 @@ #ifndef SEGMENTS_H #define SEGMENTS_H +#ifdef BETTERCAMERA +#define USE_EXT_RAM +#endif + /* * Memory addresses for segments. Ideally, this header file would not be * needed, and the addresses would be defined in sm64.ld and linker-inserted @@ -44,10 +48,17 @@ */ #define SEG_BUFFERS 0x8005C000 // 0x0085000 in size +#ifdef BETTERCAMERA +#define SEG_MAIN 0x800F1000 // 0x1328000 in size +#define SEG_ENGINE 0x80223800 // 0x0017000 in size +#define SEG_FRAMEBUFFERS 0x8023A800 // 0x0070800 in size +#define SEG_POOL_START 0x802AB000 // 0x0165000 in size +#else #define SEG_MAIN 0x800E1000 // 0x1328000 in size #define SEG_ENGINE 0x80213800 // 0x0017000 in size #define SEG_FRAMEBUFFERS 0x8022A800 // 0x0070800 in size #define SEG_POOL_START 0x8029B000 // 0x0165000 in size +#endif #define SEG_POOL_END 0x80800000 #define SEG_POOL_END_4MB 0x80400000 // For the error message screen enhancement. #define SEG_GODDARD SEG_POOL_START + 0x113000 diff --git a/tools/stb/stb_image.h b/include/stb/stb_image.h similarity index 100% rename from tools/stb/stb_image.h rename to include/stb/stb_image.h diff --git a/tools/stb/stb_image_write.h b/include/stb/stb_image_write.h similarity index 100% rename from tools/stb/stb_image_write.h rename to include/stb/stb_image_write.h diff --git a/include/text_options_strings.h.in b/include/text_options_strings.h.in new file mode 100644 index 00000000..a1ce481f --- /dev/null +++ b/include/text_options_strings.h.in @@ -0,0 +1,154 @@ +#ifndef TEXT_OPTIONS_STRINGS_H +#define TEXT_OPTIONS_STRINGS_H + +/* Extended options menu text */ + +// Menu title strings + +#define TEXT_OPT_OPTIONS _("OPTIONS") +#define TEXT_OPT_CAMERA _("CAMERA") +#define TEXT_OPT_CONTROLS _("CONTROLS") +#define TEXT_OPT_VIDEO _("DISPLAY") +#define TEXT_OPT_AUDIO _("SOUND") +#define TEXT_OPT_CHEATS _("CHEATS") + +// Markers + +#define TEXT_OPT_HIGHLIGHT _("O") +#define TEXT_OPT_UNBOUND _("NONE") + +// Language specific strings + +#if defined(VERSION_JP) || defined(VERSION_SH) + +// TODO: Actually translate this to JP + +// No . in JP + +#define TEXT_OPT_PRESSKEY _("・・・") + +// Option strings + +#define TEXT_OPT_BUTTON1 _("R OPTIONS") +#define TEXT_OPT_BUTTON2 _("R RETURN") +#define TEXT_OPT_ENABLED _("ENABLED") +#define TEXT_OPT_DISABLED _("DISABLED") +#define TEXT_OPT_CAMX _("CAMERA X SENSITIVITY") +#define TEXT_OPT_CAMY _("CAMERA Y SENSITIVITY") +#define TEXT_OPT_INVERTX _("INVERT X AXIS") +#define TEXT_OPT_INVERTY _("INVERT Y AXIS") +#define TEXT_OPT_CAMC _("CAMERA CENTRE AGGRESSION") +#define TEXT_OPT_CAMP _("CAMERA PAN LEVEL") +#define TEXT_OPT_CAMD _("CAMERA DECELERATION") +#define TEXT_OPT_CAMON _("FREE CAMERA") +#define TEXT_OPT_ANALOGUE _("ANALOGUE CAMERA") +#define TEXT_OPT_MOUSE _("MOUSE LOOK") +#define TEXT_OPT_TEXFILTER _("TEXTURE FILTERING") +#define TEXT_OPT_FSCREEN _("FULLSCREEN") +#define TEXT_OPT_NEAREST _("NEAREST") +#define TEXT_OPT_LINEAR _("LINEAR") +#define TEXT_OPT_MVOLUME _("MASTER VOLUME") +#define TEXT_OPT_MUSVOLUME _("MUSIC VOLUME") +#define TEXT_OPT_SFXVOLUME _("SFX VOLUME") +#define TEXT_OPT_ENVVOLUME _("ENV VOLUME") +#define TEXT_OPT_VSYNC _("VERTICAL SYNC") +#define TEXT_OPT_AUTO _("AUTO") +#define TEXT_OPT_HUD _("HUD") +#define TEXT_OPT_THREEPT _("THREE POINT") +#define TEXT_OPT_APPLY _("APPLY") +#define TEXT_OPT_RESETWND _("RESET WINDOW") + +#define TEXT_BIND_A _("A BUTTON") +#define TEXT_BIND_B _("B BUTTON") +#define TEXT_BIND_START _("START BUTTON") +#define TEXT_BIND_L _("L TRIGGER") +#define TEXT_BIND_R _("R TRIGGER") +#define TEXT_BIND_Z _("Z TRIGGER") +#define TEXT_BIND_C_UP _("C-UP") +#define TEXT_BIND_C_DOWN _("C-DOWN") +#define TEXT_BIND_C_LEFT _("C-LEFT") +#define TEXT_BIND_C_RIGHT _("C-RIGHT") +#define TEXT_BIND_UP _("STICK UP") +#define TEXT_BIND_DOWN _("STICK DOWN") +#define TEXT_BIND_LEFT _("STICK LEFT") +#define TEXT_BIND_RIGHT _("STICK RIGHT") +#define TEXT_OPT_DEADZONE _("STICK DEADZONE") +#define TEXT_OPT_RUMBLE _("RUMBLE STRENGTH") + +#define TEXT_OPT_CHEAT1 _("ENABLE CHEATS") +#define TEXT_OPT_CHEAT2 _("MOONJUMP (PRESS L)") +#define TEXT_OPT_CHEAT3 _("INVINCIBLE MARIO") +#define TEXT_OPT_CHEAT4 _("INFINITE LIVES") +#define TEXT_OPT_CHEAT5 _("SUPER SPEED") +#define TEXT_OPT_CHEAT6 _("SUPER RESPONSIVE CONTROLS") +#define TEXT_OPT_CHEAT7 _("EXIT COURSE AT ANY TIME") +#define TEXT_OPT_CHEAT8 _("HUGE MARIO") +#define TEXT_OPT_CHEAT9 _("TINY MARIO") + +#else // VERSION + +// Markers + +#define TEXT_OPT_PRESSKEY _("...") + +// Option strings + +#define TEXT_OPT_BUTTON1 _("[R] Options") +#define TEXT_OPT_BUTTON2 _("[R] Return") +#define TEXT_OPT_ENABLED _("Enabled") +#define TEXT_OPT_DISABLED _("Disabled") +#define TEXT_OPT_CAMX _("Camera X Sensitivity") +#define TEXT_OPT_CAMY _("Camera Y Sensitivity") +#define TEXT_OPT_INVERTX _("Invert X Axis") +#define TEXT_OPT_INVERTY _("Invert Y Axis") +#define TEXT_OPT_CAMC _("Camera Centre Aggression") +#define TEXT_OPT_CAMP _("Camera Pan Level") +#define TEXT_OPT_CAMD _("Camera Deceleration") +#define TEXT_OPT_CAMON _("Free Camera") +#define TEXT_OPT_ANALOGUE _("Analogue Camera") +#define TEXT_OPT_MOUSE _("Mouse Look") +#define TEXT_OPT_TEXFILTER _("Texture Filtering") +#define TEXT_OPT_FSCREEN _("Fullscreen") +#define TEXT_OPT_NEAREST _("Nearest") +#define TEXT_OPT_LINEAR _("Linear") +#define TEXT_OPT_MVOLUME _("Master Volume") +#define TEXT_OPT_MUSVOLUME _("Music Volume") +#define TEXT_OPT_SFXVOLUME _("Sfx Volume") +#define TEXT_OPT_ENVVOLUME _("Env Volume") +#define TEXT_OPT_VSYNC _("Vertical Sync") +#define TEXT_OPT_AUTO _("Auto") +#define TEXT_OPT_HUD _("HUD") +#define TEXT_OPT_THREEPT _("Three-point") +#define TEXT_OPT_APPLY _("Apply") +#define TEXT_OPT_RESETWND _("Reset Window") + +#define TEXT_BIND_A _("A Button") +#define TEXT_BIND_B _("B Button") +#define TEXT_BIND_START _("Start Button") +#define TEXT_BIND_L _("L Trigger") +#define TEXT_BIND_R _("R Trigger") +#define TEXT_BIND_Z _("Z Trigger") +#define TEXT_BIND_C_UP _("C-Up") +#define TEXT_BIND_C_DOWN _("C-Down") +#define TEXT_BIND_C_LEFT _("C-Left") +#define TEXT_BIND_C_RIGHT _("C-Right") +#define TEXT_BIND_UP _("Stick Up") +#define TEXT_BIND_DOWN _("Stick Down") +#define TEXT_BIND_LEFT _("Stick Left") +#define TEXT_BIND_RIGHT _("Stick Right") +#define TEXT_OPT_DEADZONE _("Stick Deadzone") +#define TEXT_OPT_RUMBLE _("Rumble Strength") + +#define TEXT_OPT_CHEAT1 _("Enable cheats") +#define TEXT_OPT_CHEAT2 _("Moonjump (Press L)") +#define TEXT_OPT_CHEAT3 _("Invincible Mario") +#define TEXT_OPT_CHEAT4 _("Infinite lives") +#define TEXT_OPT_CHEAT5 _("Super speed") +#define TEXT_OPT_CHEAT6 _("Super responsive controls") +#define TEXT_OPT_CHEAT7 _("Exit course at any time") +#define TEXT_OPT_CHEAT8 _("Huge Mario") +#define TEXT_OPT_CHEAT9 _("Tiny Mario") + +#endif // VERSION + +#endif // TEXT_OPTIONS_STRINGS_H diff --git a/include/text_strings.h.in b/include/text_strings.h.in index 749179b1..e5065c57 100644 --- a/include/text_strings.h.in +++ b/include/text_strings.h.in @@ -3,6 +3,10 @@ #include "text_menu_strings.h" +#ifdef EXT_OPTIONS_MENU +#include "text_options_strings.h" +#endif + /** * Global Symbols */ @@ -90,6 +94,7 @@ #define TEXT_COURSE _("コース") #define TEXT_MYSCORE _("マイスコア") #define TEXT_CONTINUE _("つづけて マリオする?") +#define TEXT_EXIT_GAME _("ゲームをしゅうりょうする") #define TEXT_EXIT_COURSE _("コースからでる?") #define TEXT_CAMERA_ANGLE_R _("Rボタンのカメラきりかえ") @@ -107,6 +112,7 @@ // Save Options #define TEXT_SAVE_AND_CONTINUE _("セーブしてつづける?") #define TEXT_SAVE_AND_QUIT _("セーブしておわる?") +#define TEXT_SAVE_EXIT_GAME _("ゲームをやめる?") #define TEXT_CONTINUE_WITHOUT_SAVING _("セーブしないでつづける?") /** @@ -189,6 +195,7 @@ #define TEXT_MYSCORE _("MYSCORE") #define TEXT_CONTINUE _("CONTINUE") #define TEXT_EXIT_COURSE _("EXIT COURSE") +#define TEXT_EXIT_GAME _("EXIT GAME") #ifndef VERSION_EU // "R" text is different in EU #define TEXT_CAMERA_ANGLE_R _("SET CAMERA ANGLE WITH R") #endif @@ -207,6 +214,7 @@ // Save Options #define TEXT_SAVE_AND_CONTINUE _("SAVE & CONTINUE") #define TEXT_SAVE_AND_QUIT _("SAVE & QUIT") +#define TEXT_SAVE_EXIT_GAME _("SAVE & EXIT GAME") #define TEXT_CONTINUE_WITHOUT_SAVING _("CONTINUE, DON'T SAVE") /** @@ -333,12 +341,14 @@ #define TEXT_MY_SCORE_FR _("MON SCORE") #define TEXT_CONTINUE_FR _("CONTINUER") #define TEXT_EXIT_COURSE_FR _("QUITTER NIVEAU") +#define TEXT_EXIT_GAME_FR _("QUITTER JEU") #define TEXT_CAMERA_ANGLE_R_FR _("RÉGLAGE CAMÉRA AVEC [R]") // German #define TEXT_COURSE_DE _("KURS") #define TEXT_MY_SCORE_DE _("LEISTUNG") #define TEXT_CONTINUE_DE _("WEITER") #define TEXT_EXIT_COURSE_DE _("KURS VERLASSEN") +#define TEXT_EXIT_GAME_DE _("SPIEL VERLASSEN") #define TEXT_CAMERA_ANGLE_R_DE _("KAMERA MIT [R] VERSTELLEN") // Camera Options @@ -361,10 +371,12 @@ // French #define TEXT_SAVE_AND_CONTINUE_FR _("SAUVEGARDER & CONTINUER") #define TEXT_SAVE_AND_QUIT_FR _("SAUVEGARDER & QUITTER") +#define TEXT_SAVE_EXIT_GAME_FR _("SAUVEGARDER & QUITTER JEU") #define TEXT_CONTINUE_WITHOUT_SAVING_FR _("CONTINUER SANS SAUVEGARDER") // German #define TEXT_SAVE_AND_CONTINUE_DE _("SPEICHERN & WEITER") #define TEXT_SAVE_AND_QUIT_DE _("SPEICHERN & ENDE") +#define TEXT_SAVE_EXIT_GAME_DE _("SPEICHERN & SPIEL VERLASSEN") #define TEXT_CONTINUE_WITHOUT_SAVING_DE _("WEITER OHNE ZU SPEICHERN") /** diff --git a/include/tinfl.h b/include/tinfl.h new file mode 100644 index 00000000..b6b31d0a --- /dev/null +++ b/include/tinfl.h @@ -0,0 +1,724 @@ +/* tinfl.c v1.11 - public domain inflate with zlib header parsing/adler32 checking (inflate-only subset of miniz.c) + See "unlicense" statement at the end of this file. + Rich Geldreich , last updated May 20, 2011 + Implements RFC 1950: https://www.ietf.org/rfc/rfc1950.txt and RFC 1951: https://www.ietf.org/rfc/rfc1951.txt + + The entire decompressor coroutine is implemented in tinfl_decompress(). The other functions are optional high-level helpers. +*/ +#ifndef TINFL_HEADER_INCLUDED +#define TINFL_HEADER_INCLUDED + +#include + +typedef uint8_t mz_uint8; +typedef int16_t mz_int16; +typedef uint16_t mz_uint16; +typedef uint32_t mz_uint32; +typedef unsigned int mz_uint; +typedef uint64_t mz_uint64; + +/* For more compatibility with zlib, miniz.c uses unsigned long for some parameters/struct members. */ +typedef unsigned long mz_ulong; + +/* Heap allocation callbacks. */ +typedef void *(*mz_alloc_func)(void *opaque, unsigned int items, unsigned int size); +typedef void (*mz_free_func)(void *opaque, void *address); + +#if defined(_M_IX86) || defined(_M_X64) +/* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 if integer loads and stores to unaligned addresses are acceptable on the target platform (slightly faster). */ +#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1 +/* Set MINIZ_LITTLE_ENDIAN to 1 if the processor is little endian. */ +#define MINIZ_LITTLE_ENDIAN 1 +#endif + +#if defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__) +/* Set MINIZ_HAS_64BIT_REGISTERS to 1 if the processor has 64-bit general purpose registers (enables 64-bit bitbuffer in inflator) */ +#define MINIZ_HAS_64BIT_REGISTERS 1 +#endif + +/* Works around MSVC's spammy "warning C4127: conditional expression is constant" message. */ +#ifdef _MSC_VER +#define MZ_MACRO_END while (0, 0) +#else +#define MZ_MACRO_END while (0) +#endif + +/* Decompression flags. */ +enum +{ + TINFL_FLAG_PARSE_ZLIB_HEADER = 1, + TINFL_FLAG_HAS_MORE_INPUT = 2, + TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF = 4, + TINFL_FLAG_COMPUTE_ADLER32 = 8 +}; + +struct tinfl_decompressor_tag; typedef struct tinfl_decompressor_tag tinfl_decompressor; + +/* Max size of LZ dictionary. */ +#define TINFL_LZ_DICT_SIZE 32768 + +/* Return status. */ +typedef enum +{ + TINFL_STATUS_BAD_PARAM = -3, + TINFL_STATUS_ADLER32_MISMATCH = -2, + TINFL_STATUS_FAILED = -1, + TINFL_STATUS_DONE = 0, + TINFL_STATUS_NEEDS_MORE_INPUT = 1, + TINFL_STATUS_HAS_MORE_OUTPUT = 2 +} tinfl_status; + +/* Initializes the decompressor to its initial state. */ +#define tinfl_init(r) do { (r)->m_state = 0; } MZ_MACRO_END +#define tinfl_get_adler32(r) (r)->m_check_adler32 + +/* Main low-level decompressor coroutine function. This is the only function actually needed for decompression. All the other functions are just high-level helpers for improved usability. */ +/* This is a universal API, i.e. it can be used as a building block to build any desired higher level decompression API. In the limit case, it can be called once per every byte input or output. */ +static tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags); + +/* Internal/private bits follow. */ +enum +{ + TINFL_MAX_HUFF_TABLES = 3, TINFL_MAX_HUFF_SYMBOLS_0 = 288, TINFL_MAX_HUFF_SYMBOLS_1 = 32, TINFL_MAX_HUFF_SYMBOLS_2 = 19, + TINFL_FAST_LOOKUP_BITS = 10, TINFL_FAST_LOOKUP_SIZE = 1 << TINFL_FAST_LOOKUP_BITS +}; + +typedef struct +{ + mz_uint8 m_code_size[TINFL_MAX_HUFF_SYMBOLS_0]; + mz_int16 m_look_up[TINFL_FAST_LOOKUP_SIZE], m_tree[TINFL_MAX_HUFF_SYMBOLS_0 * 2]; +} tinfl_huff_table; + +#if MINIZ_HAS_64BIT_REGISTERS + #define TINFL_USE_64BIT_BITBUF 1 +#endif + +#if TINFL_USE_64BIT_BITBUF + typedef mz_uint64 tinfl_bit_buf_t; + #define TINFL_BITBUF_SIZE (64) +#else + typedef mz_uint32 tinfl_bit_buf_t; + #define TINFL_BITBUF_SIZE (32) +#endif + +struct tinfl_decompressor_tag +{ + mz_uint32 m_state, m_num_bits, m_zhdr0, m_zhdr1, m_z_adler32, m_final, m_type, m_check_adler32, m_dist, m_counter, m_num_extra, m_table_sizes[TINFL_MAX_HUFF_TABLES]; + tinfl_bit_buf_t m_bit_buf; + size_t m_dist_from_out_buf_start; + tinfl_huff_table m_tables[TINFL_MAX_HUFF_TABLES]; + mz_uint8 m_raw_header[4], m_len_codes[TINFL_MAX_HUFF_SYMBOLS_0 + TINFL_MAX_HUFF_SYMBOLS_1 + 137]; +}; + +#endif /* #ifdef TINFL_HEADER_INCLUDED */ + +/* ------------------- End of Header: Implementation follows. (If you only want the header, define MINIZ_HEADER_FILE_ONLY.) */ + +#ifndef TINFL_HEADER_FILE_ONLY + +#ifdef MINIZ_NO_MALLOC + #define MZ_MALLOC(x) NULL + #define MZ_FREE(x) x, ((void)0) + #define MZ_REALLOC(p, x) NULL +#else + #define MZ_MALLOC(x) malloc(x) + #define MZ_FREE(x) free(x) + #define MZ_REALLOC(p, x) realloc(p, x) +#endif + +#define MZ_MAX(a,b) (((a)>(b))?(a):(b)) +#define MZ_MIN(a,b) (((a)<(b))?(a):(b)) +#define MZ_CLEAR_OBJ(obj) memset(&(obj), 0, sizeof(obj)) + +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN + #define MZ_READ_LE16(p) *((const mz_uint16 *)(p)) + #define MZ_READ_LE32(p) *((const mz_uint32 *)(p)) +#else + #define MZ_READ_LE16(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U)) + #define MZ_READ_LE32(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U) | ((mz_uint32)(((const mz_uint8 *)(p))[2]) << 16U) | ((mz_uint32)(((const mz_uint8 *)(p))[3]) << 24U)) +#endif + +#define TINFL_MEMCPY(d, s, l) memcpy(d, s, l) +#define TINFL_MEMSET(p, c, l) memset(p, c, l) + +#define TINFL_CR_BEGIN switch(r->m_state) { case 0: +#define TINFL_CR_RETURN(state_index, result) do { status = result; r->m_state = state_index; goto common_exit; case state_index:; } MZ_MACRO_END +#define TINFL_CR_RETURN_FOREVER(state_index, result) do { for ( ; ; ) { TINFL_CR_RETURN(state_index, result); } } MZ_MACRO_END +#define TINFL_CR_FINISH } + +/* TODO: If the caller has indicated that there's no more input, and we attempt to read beyond the input buf, then something is wrong with the input because the inflator never */ +/* reads ahead more than it needs to. Currently TINFL_GET_BYTE() pads the end of the stream with 0's in this scenario. */ +#define TINFL_GET_BYTE(state_index, c) do { \ + if (pIn_buf_cur >= pIn_buf_end) { \ + for ( ; ; ) { \ + if (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) { \ + TINFL_CR_RETURN(state_index, TINFL_STATUS_NEEDS_MORE_INPUT); \ + if (pIn_buf_cur < pIn_buf_end) { \ + c = *pIn_buf_cur++; \ + break; \ + } \ + } else { \ + c = 0; \ + break; \ + } \ + } \ + } else c = *pIn_buf_cur++; } MZ_MACRO_END + +#define TINFL_NEED_BITS(state_index, n) do { mz_uint c; TINFL_GET_BYTE(state_index, c); bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); num_bits += 8; } while (num_bits < (mz_uint)(n)) +#define TINFL_SKIP_BITS(state_index, n) do { if (num_bits < (mz_uint)(n)) { TINFL_NEED_BITS(state_index, n); } bit_buf >>= (n); num_bits -= (n); } MZ_MACRO_END +#define TINFL_GET_BITS(state_index, b, n) do { if (num_bits < (mz_uint)(n)) { TINFL_NEED_BITS(state_index, n); } b = bit_buf & ((1 << (n)) - 1); bit_buf >>= (n); num_bits -= (n); } MZ_MACRO_END + +/* TINFL_HUFF_BITBUF_FILL() is only used rarely, when the number of bytes remaining in the input buffer falls below 2. */ +/* It reads just enough bytes from the input stream that are needed to decode the next Huffman code (and absolutely no more). It works by trying to fully decode a */ +/* Huffman code by using whatever bits are currently present in the bit buffer. If this fails, it reads another byte, and tries again until it succeeds or until the */ +/* bit buffer contains >=15 bits (deflate's max. Huffman code size). */ +#define TINFL_HUFF_BITBUF_FILL(state_index, pHuff) \ + do { \ + temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]; \ + if (temp >= 0) { \ + code_len = temp >> 9; \ + if ((code_len) && (num_bits >= code_len)) \ + break; \ + } else if (num_bits > TINFL_FAST_LOOKUP_BITS) { \ + code_len = TINFL_FAST_LOOKUP_BITS; \ + do { \ + temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; \ + } while ((temp < 0) && (num_bits >= (code_len + 1))); if (temp >= 0) break; \ + } TINFL_GET_BYTE(state_index, c); bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); num_bits += 8; \ + } while (num_bits < 15); + +/* TINFL_HUFF_DECODE() decodes the next Huffman coded symbol. It's more complex than you would initially expect because the zlib API expects the decompressor to never read */ +/* beyond the final byte of the deflate stream. (In other words, when this macro wants to read another byte from the input, it REALLY needs another byte in order to fully */ +/* decode the next Huffman code.) Handling this properly is particularly important on raw deflate (non-zlib) streams, which aren't followed by a byte aligned adler-32. */ +/* The slow path is only executed at the very end of the input buffer. */ +#define TINFL_HUFF_DECODE(state_index, sym, pHuff) do { \ + int temp; mz_uint code_len, c; \ + if (num_bits < 15) { \ + if ((pIn_buf_end - pIn_buf_cur) < 2) { \ + TINFL_HUFF_BITBUF_FILL(state_index, pHuff); \ + } else { \ + bit_buf |= (((tinfl_bit_buf_t)pIn_buf_cur[0]) << num_bits) | (((tinfl_bit_buf_t)pIn_buf_cur[1]) << (num_bits + 8)); pIn_buf_cur += 2; num_bits += 16; \ + } \ + } \ + if ((temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) \ + code_len = temp >> 9, temp &= 511; \ + else { \ + code_len = TINFL_FAST_LOOKUP_BITS; do { temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; } while (temp < 0); \ + } sym = temp; bit_buf >>= code_len; num_bits -= code_len; } MZ_MACRO_END + +static void tinfl_def_free_func(void *opaque, void *address) { + (void)opaque, (void)address; + MZ_FREE(address); +} + +static void *tinfl_def_alloc_func(void *opaque, unsigned int items, unsigned int size) { + (void)opaque, (void)items, (void)size; + return MZ_MALLOC(items * size); +} + +static tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags) +{ + static const int s_length_base[31] = { 3,4,5,6,7,8,9,10,11,13, 15,17,19,23,27,31,35,43,51,59, 67,83,99,115,131,163,195,227,258,0,0 }; + static const int s_length_extra[31]= { 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 }; + static const int s_dist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193, 257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0}; + static const int s_dist_extra[32] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; + static const mz_uint8 s_length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 }; + static const int s_min_table_sizes[3] = { 257, 1, 4 }; + + tinfl_status status = TINFL_STATUS_FAILED; mz_uint32 num_bits, dist, counter, num_extra; tinfl_bit_buf_t bit_buf; + const mz_uint8 *pIn_buf_cur = pIn_buf_next, *const pIn_buf_end = pIn_buf_next + *pIn_buf_size; + mz_uint8 *pOut_buf_cur = pOut_buf_next, *const pOut_buf_end = pOut_buf_next + *pOut_buf_size; + size_t out_buf_size_mask = (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF) ? (size_t)-1 : ((pOut_buf_next - pOut_buf_start) + *pOut_buf_size) - 1, dist_from_out_buf_start; + + /* Ensure the output buffer's size is a power of 2, unless the output buffer is large enough to hold the entire output file (in which case it doesn't matter). */ + if (((out_buf_size_mask + 1) & out_buf_size_mask) || (pOut_buf_next < pOut_buf_start)) { *pIn_buf_size = *pOut_buf_size = 0; return TINFL_STATUS_BAD_PARAM; } + + num_bits = r->m_num_bits; bit_buf = r->m_bit_buf; dist = r->m_dist; counter = r->m_counter; num_extra = r->m_num_extra; dist_from_out_buf_start = r->m_dist_from_out_buf_start; + TINFL_CR_BEGIN + + bit_buf = num_bits = dist = counter = num_extra = r->m_zhdr0 = r->m_zhdr1 = 0; r->m_z_adler32 = r->m_check_adler32 = 1; + if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) + { + TINFL_GET_BYTE(1, r->m_zhdr0); TINFL_GET_BYTE(2, r->m_zhdr1); + counter = (((r->m_zhdr0 * 256 + r->m_zhdr1) % 31 != 0) || (r->m_zhdr1 & 32) || ((r->m_zhdr0 & 15) != 8)); + if (!(decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) counter |= (((1U << (8U + (r->m_zhdr0 >> 4))) > 32768U) || ((out_buf_size_mask + 1) < (size_t)(1U << (8U + (r->m_zhdr0 >> 4))))); + if (counter) { TINFL_CR_RETURN_FOREVER(36, TINFL_STATUS_FAILED); } + } + + do + { + TINFL_GET_BITS(3, r->m_final, 3); r->m_type = r->m_final >> 1; + if (r->m_type == 0) + { + TINFL_SKIP_BITS(5, num_bits & 7); + for (counter = 0; counter < 4; ++counter) { if (num_bits) TINFL_GET_BITS(6, r->m_raw_header[counter], 8); else TINFL_GET_BYTE(7, r->m_raw_header[counter]); } + if ((counter = (r->m_raw_header[0] | (r->m_raw_header[1] << 8))) != (mz_uint)(0xFFFF ^ (r->m_raw_header[2] | (r->m_raw_header[3] << 8)))) { TINFL_CR_RETURN_FOREVER(39, TINFL_STATUS_FAILED); } + while ((counter) && (num_bits)) + { + TINFL_GET_BITS(51, dist, 8); + while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(52, TINFL_STATUS_HAS_MORE_OUTPUT); } + *pOut_buf_cur++ = (mz_uint8)dist; + counter--; + } + while (counter) + { + size_t n; while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(9, TINFL_STATUS_HAS_MORE_OUTPUT); } + while (pIn_buf_cur >= pIn_buf_end) + { + if (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) + { + TINFL_CR_RETURN(38, TINFL_STATUS_NEEDS_MORE_INPUT); + } + else + { + TINFL_CR_RETURN_FOREVER(40, TINFL_STATUS_FAILED); + } + } + n = MZ_MIN(MZ_MIN((size_t)(pOut_buf_end - pOut_buf_cur), (size_t)(pIn_buf_end - pIn_buf_cur)), counter); + TINFL_MEMCPY(pOut_buf_cur, pIn_buf_cur, n); pIn_buf_cur += n; pOut_buf_cur += n; counter -= (mz_uint)n; + } + } + else if (r->m_type == 3) + { + TINFL_CR_RETURN_FOREVER(10, TINFL_STATUS_FAILED); + } + else + { + if (r->m_type == 1) + { + mz_uint8 *p = r->m_tables[0].m_code_size; mz_uint i; + r->m_table_sizes[0] = 288; r->m_table_sizes[1] = 32; TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32); + for ( i = 0; i <= 143; ++i) *p++ = 8; + for ( ; i <= 255; ++i) *p++ = 9; + for ( ; i <= 279; ++i) *p++ = 7; + for ( ; i <= 287; ++i) *p++ = 8; + } + else + { + for (counter = 0; counter < 3; counter++) { TINFL_GET_BITS(11, r->m_table_sizes[counter], "\05\05\04"[counter]); r->m_table_sizes[counter] += s_min_table_sizes[counter]; } + MZ_CLEAR_OBJ(r->m_tables[2].m_code_size); for (counter = 0; counter < r->m_table_sizes[2]; counter++) { mz_uint s; TINFL_GET_BITS(14, s, 3); r->m_tables[2].m_code_size[s_length_dezigzag[counter]] = (mz_uint8)s; } + r->m_table_sizes[2] = 19; + } + for ( ; (int)r->m_type >= 0; r->m_type--) + { + int tree_next, tree_cur; tinfl_huff_table *pTable; + mz_uint i, j, used_syms, total, sym_index, next_code[17], total_syms[16]; pTable = &r->m_tables[r->m_type]; MZ_CLEAR_OBJ(total_syms); MZ_CLEAR_OBJ(pTable->m_look_up); MZ_CLEAR_OBJ(pTable->m_tree); + for (i = 0; i < r->m_table_sizes[r->m_type]; ++i) total_syms[pTable->m_code_size[i]]++; + used_syms = 0, total = 0; next_code[0] = next_code[1] = 0; + for (i = 1; i <= 15; ++i) { used_syms += total_syms[i]; next_code[i + 1] = (total = ((total + total_syms[i]) << 1)); } + if ((65536 != total) && (used_syms > 1)) + { + TINFL_CR_RETURN_FOREVER(35, TINFL_STATUS_FAILED); + } + for (tree_next = -1, sym_index = 0; sym_index < r->m_table_sizes[r->m_type]; ++sym_index) + { + mz_uint rev_code = 0, l, cur_code, code_size = pTable->m_code_size[sym_index]; if (!code_size) continue; + cur_code = next_code[code_size]++; for (l = code_size; l > 0; l--, cur_code >>= 1) rev_code = (rev_code << 1) | (cur_code & 1); + if (code_size <= TINFL_FAST_LOOKUP_BITS) { mz_int16 k = (mz_int16)((code_size << 9) | sym_index); while (rev_code < TINFL_FAST_LOOKUP_SIZE) { pTable->m_look_up[rev_code] = k; rev_code += (1 << code_size); } continue; } + if (0 == (tree_cur = pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)])) { pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)] = (mz_int16)tree_next; tree_cur = tree_next; tree_next -= 2; } + rev_code >>= (TINFL_FAST_LOOKUP_BITS - 1); + for (j = code_size; j > (TINFL_FAST_LOOKUP_BITS + 1); j--) + { + tree_cur -= ((rev_code >>= 1) & 1); + if (!pTable->m_tree[-tree_cur - 1]) { pTable->m_tree[-tree_cur - 1] = (mz_int16)tree_next; tree_cur = tree_next; tree_next -= 2; } else tree_cur = pTable->m_tree[-tree_cur - 1]; + } + tree_cur -= ((rev_code >>= 1) & 1); pTable->m_tree[-tree_cur - 1] = (mz_int16)sym_index; + } + if (r->m_type == 2) + { + for (counter = 0; counter < (r->m_table_sizes[0] + r->m_table_sizes[1]); ) + { + mz_uint s; TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]); if (dist < 16) { r->m_len_codes[counter++] = (mz_uint8)dist; continue; } + if ((dist == 16) && (!counter)) + { + TINFL_CR_RETURN_FOREVER(17, TINFL_STATUS_FAILED); + } + num_extra = "\02\03\07"[dist - 16]; TINFL_GET_BITS(18, s, num_extra); s += "\03\03\013"[dist - 16]; + TINFL_MEMSET(r->m_len_codes + counter, (dist == 16) ? r->m_len_codes[counter - 1] : 0, s); counter += s; + } + if ((r->m_table_sizes[0] + r->m_table_sizes[1]) != counter) + { + TINFL_CR_RETURN_FOREVER(21, TINFL_STATUS_FAILED); + } + TINFL_MEMCPY(r->m_tables[0].m_code_size, r->m_len_codes, r->m_table_sizes[0]); TINFL_MEMCPY(r->m_tables[1].m_code_size, r->m_len_codes + r->m_table_sizes[0], r->m_table_sizes[1]); + } + } + for ( ; ; ) + { + mz_uint8 *pSrc; + for ( ; ; ) + { + if (((pIn_buf_end - pIn_buf_cur) < 4) || ((pOut_buf_end - pOut_buf_cur) < 2)) + { + TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]); + if (counter >= 256) + break; + while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(24, TINFL_STATUS_HAS_MORE_OUTPUT); } + *pOut_buf_cur++ = (mz_uint8)counter; + } + else + { + int sym2; mz_uint code_len; +#if TINFL_USE_64BIT_BITBUF + if (num_bits < 30) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE32(pIn_buf_cur)) << num_bits); pIn_buf_cur += 4; num_bits += 32; } +#else + if (num_bits < 15) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits); pIn_buf_cur += 2; num_bits += 16; } +#endif + if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) + code_len = sym2 >> 9; + else + { + code_len = TINFL_FAST_LOOKUP_BITS; do { sym2 = r->m_tables[0].m_tree[~sym2 + ((bit_buf >> code_len++) & 1)]; } while (sym2 < 0); + } + counter = sym2; bit_buf >>= code_len; num_bits -= code_len; + if (counter & 256) + break; + +#if !TINFL_USE_64BIT_BITBUF + if (num_bits < 15) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits); pIn_buf_cur += 2; num_bits += 16; } +#endif + if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) + code_len = sym2 >> 9; + else + { + code_len = TINFL_FAST_LOOKUP_BITS; do { sym2 = r->m_tables[0].m_tree[~sym2 + ((bit_buf >> code_len++) & 1)]; } while (sym2 < 0); + } + bit_buf >>= code_len; num_bits -= code_len; + + pOut_buf_cur[0] = (mz_uint8)counter; + if (sym2 & 256) + { + pOut_buf_cur++; + counter = sym2; + break; + } + pOut_buf_cur[1] = (mz_uint8)sym2; + pOut_buf_cur += 2; + } + } + if ((counter &= 511) == 256) break; + + num_extra = s_length_extra[counter - 257]; counter = s_length_base[counter - 257]; + if (num_extra) { mz_uint extra_bits; TINFL_GET_BITS(25, extra_bits, num_extra); counter += extra_bits; } + + TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]); + num_extra = s_dist_extra[dist]; dist = s_dist_base[dist]; + if (num_extra) { mz_uint extra_bits; TINFL_GET_BITS(27, extra_bits, num_extra); dist += extra_bits; } + + dist_from_out_buf_start = pOut_buf_cur - pOut_buf_start; + if ((dist > dist_from_out_buf_start) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) + { + TINFL_CR_RETURN_FOREVER(37, TINFL_STATUS_FAILED); + } + + pSrc = pOut_buf_start + ((dist_from_out_buf_start - dist) & out_buf_size_mask); + + if ((MZ_MAX(pOut_buf_cur, pSrc) + counter) > pOut_buf_end) + { + while (counter--) + { + while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(53, TINFL_STATUS_HAS_MORE_OUTPUT); } + *pOut_buf_cur++ = pOut_buf_start[(dist_from_out_buf_start++ - dist) & out_buf_size_mask]; + } + continue; + } +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES + else if ((counter >= 9) && (counter <= dist)) + { + const mz_uint8 *pSrc_end = pSrc + (counter & ~7); + do + { + ((mz_uint32 *)pOut_buf_cur)[0] = ((const mz_uint32 *)pSrc)[0]; + ((mz_uint32 *)pOut_buf_cur)[1] = ((const mz_uint32 *)pSrc)[1]; + pOut_buf_cur += 8; + } while ((pSrc += 8) < pSrc_end); + if ((counter &= 7) < 3) + { + if (counter) + { + pOut_buf_cur[0] = pSrc[0]; + if (counter > 1) + pOut_buf_cur[1] = pSrc[1]; + pOut_buf_cur += counter; + } + continue; + } + } +#endif + do + { + pOut_buf_cur[0] = pSrc[0]; + pOut_buf_cur[1] = pSrc[1]; + pOut_buf_cur[2] = pSrc[2]; + pOut_buf_cur += 3; pSrc += 3; + } while ((int)(counter -= 3) > 2); + if ((int)counter > 0) + { + pOut_buf_cur[0] = pSrc[0]; + if ((int)counter > 1) + pOut_buf_cur[1] = pSrc[1]; + pOut_buf_cur += counter; + } + } + } + } while (!(r->m_final & 1)); + if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) + { + TINFL_SKIP_BITS(32, num_bits & 7); for (counter = 0; counter < 4; ++counter) { mz_uint s; if (num_bits) TINFL_GET_BITS(41, s, 8); else TINFL_GET_BYTE(42, s); r->m_z_adler32 = (r->m_z_adler32 << 8) | s; } + } + TINFL_CR_RETURN_FOREVER(34, TINFL_STATUS_DONE); + TINFL_CR_FINISH + +common_exit: + r->m_num_bits = num_bits; r->m_bit_buf = bit_buf; r->m_dist = dist; r->m_counter = counter; r->m_num_extra = num_extra; r->m_dist_from_out_buf_start = dist_from_out_buf_start; + *pIn_buf_size = pIn_buf_cur - pIn_buf_next; *pOut_buf_size = pOut_buf_cur - pOut_buf_next; + if ((decomp_flags & (TINFL_FLAG_PARSE_ZLIB_HEADER | TINFL_FLAG_COMPUTE_ADLER32)) && (status >= 0)) + { + const mz_uint8 *ptr = pOut_buf_next; size_t buf_len = *pOut_buf_size; + mz_uint32 i, s1 = r->m_check_adler32 & 0xffff, s2 = r->m_check_adler32 >> 16; size_t block_len = buf_len % 5552; + while (buf_len) + { + for (i = 0; i + 7 < block_len; i += 8, ptr += 8) + { + s1 += ptr[0], s2 += s1; s1 += ptr[1], s2 += s1; s1 += ptr[2], s2 += s1; s1 += ptr[3], s2 += s1; + s1 += ptr[4], s2 += s1; s1 += ptr[5], s2 += s1; s1 += ptr[6], s2 += s1; s1 += ptr[7], s2 += s1; + } + for ( ; i < block_len; ++i) s1 += *ptr++, s2 += s1; + s1 %= 65521U, s2 %= 65521U; buf_len -= block_len; block_len = 5552; + } + r->m_check_adler32 = (s2 << 16) + s1; if ((status == TINFL_STATUS_DONE) && (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) && (r->m_check_adler32 != r->m_z_adler32)) status = TINFL_STATUS_ADLER32_MISMATCH; + } + return status; +} + +/* Flush values. For typical usage you only need MZ_NO_FLUSH and MZ_FINISH. The other stuff is for advanced use. */ +enum { MZ_NO_FLUSH = 0, MZ_PARTIAL_FLUSH = 1, MZ_SYNC_FLUSH = 2, MZ_FULL_FLUSH = 3, MZ_FINISH = 4, MZ_BLOCK = 5 }; + +/* Return status codes. MZ_PARAM_ERROR is non-standard. */ +enum { MZ_OK = 0, MZ_STREAM_END = 1, MZ_NEED_DICT = 2, MZ_ERRNO = -1, MZ_STREAM_ERROR = -2, MZ_DATA_ERROR = -3, MZ_MEM_ERROR = -4, MZ_BUF_ERROR = -5, MZ_VERSION_ERROR = -6, MZ_PARAM_ERROR = -10000 }; + +/* Compression levels. */ +enum { MZ_NO_COMPRESSION = 0, MZ_BEST_SPEED = 1, MZ_BEST_COMPRESSION = 9, MZ_DEFAULT_COMPRESSION = -1 }; + +/* Window bits */ +#define MZ_DEFAULT_WINDOW_BITS 15 + +struct mz_internal_state; + +/* Compression/decompression stream struct. */ +typedef struct mz_stream_s +{ + const unsigned char *next_in; /* pointer to next byte to read */ + unsigned int avail_in; /* number of bytes available at next_in */ + mz_ulong total_in; /* total number of bytes consumed so far */ + + unsigned char *next_out; /* pointer to next byte to write */ + unsigned int avail_out; /* number of bytes that can be written to next_out */ + mz_ulong total_out; /* total number of bytes produced so far */ + + char *msg; /* error msg (unused) */ + struct mz_internal_state *state; /* internal state, allocated by zalloc/zfree */ + + mz_alloc_func zalloc; /* optional heap allocation function (defaults to malloc) */ + mz_free_func zfree; /* optional heap free function (defaults to free) */ + void *opaque; /* heap alloc function user pointer */ + + int data_type; /* data_type (unused) */ + mz_ulong adler; /* adler32 of the source or uncompressed data */ + mz_ulong reserved; /* not used */ +} mz_stream; + +typedef mz_stream *mz_streamp; + + +typedef struct +{ + tinfl_decompressor m_decomp; + mz_uint m_dict_ofs, m_dict_avail, m_first_call, m_has_flushed; int m_window_bits; + mz_uint8 m_dict[TINFL_LZ_DICT_SIZE]; + tinfl_status m_last_status; +} inflate_state; + +static int mz_inflateInit2(mz_streamp pStream, int window_bits) +{ + inflate_state *pDecomp; + if (!pStream) return MZ_STREAM_ERROR; + if ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS)) return MZ_PARAM_ERROR; + + pStream->data_type = 0; + pStream->adler = 0; + pStream->msg = NULL; + pStream->total_in = 0; + pStream->total_out = 0; + pStream->reserved = 0; + if (!pStream->zalloc) pStream->zalloc = tinfl_def_alloc_func; + if (!pStream->zfree) pStream->zfree = tinfl_def_free_func; + + pDecomp = (inflate_state*)pStream->zalloc(pStream->opaque, 1, sizeof(inflate_state)); + if (!pDecomp) return MZ_MEM_ERROR; + + pStream->state = (struct mz_internal_state *)pDecomp; + + tinfl_init(&pDecomp->m_decomp); + pDecomp->m_dict_ofs = 0; + pDecomp->m_dict_avail = 0; + pDecomp->m_last_status = TINFL_STATUS_NEEDS_MORE_INPUT; + pDecomp->m_first_call = 1; + pDecomp->m_has_flushed = 0; + pDecomp->m_window_bits = window_bits; + + return MZ_OK; +} + +static int mz_inflate(mz_streamp pStream, int flush) +{ + inflate_state* pState; + mz_uint n, first_call, decomp_flags = TINFL_FLAG_COMPUTE_ADLER32; + size_t in_bytes, out_bytes, orig_avail_in; + tinfl_status status; + + if ((!pStream) || (!pStream->state)) return MZ_STREAM_ERROR; + if (flush == MZ_PARTIAL_FLUSH) flush = MZ_SYNC_FLUSH; + if ((flush) && (flush != MZ_SYNC_FLUSH) && (flush != MZ_FINISH)) return MZ_STREAM_ERROR; + + pState = (inflate_state*)pStream->state; + if (pState->m_window_bits > 0) decomp_flags |= TINFL_FLAG_PARSE_ZLIB_HEADER; + orig_avail_in = pStream->avail_in; + + first_call = pState->m_first_call; pState->m_first_call = 0; + if (pState->m_last_status < 0) return MZ_DATA_ERROR; + + if (pState->m_has_flushed && (flush != MZ_FINISH)) return MZ_STREAM_ERROR; + pState->m_has_flushed |= (flush == MZ_FINISH); + + if ((flush == MZ_FINISH) && (first_call)) + { + /* MZ_FINISH on the first call implies that the input and output buffers are large enough to hold the entire compressed/decompressed file. */ + decomp_flags |= TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF; + in_bytes = pStream->avail_in; out_bytes = pStream->avail_out; + status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pStream->next_out, pStream->next_out, &out_bytes, decomp_flags); + pState->m_last_status = status; + pStream->next_in += (mz_uint)in_bytes; pStream->avail_in -= (mz_uint)in_bytes; pStream->total_in += (mz_uint)in_bytes; + pStream->adler = tinfl_get_adler32(&pState->m_decomp); + pStream->next_out += (mz_uint)out_bytes; pStream->avail_out -= (mz_uint)out_bytes; pStream->total_out += (mz_uint)out_bytes; + + if (status < 0) + return MZ_DATA_ERROR; + else if (status != TINFL_STATUS_DONE) + { + pState->m_last_status = TINFL_STATUS_FAILED; + return MZ_BUF_ERROR; + } + return MZ_STREAM_END; + } + /* flush != MZ_FINISH then we must assume there's more input. */ + if (flush != MZ_FINISH) decomp_flags |= TINFL_FLAG_HAS_MORE_INPUT; + + if (pState->m_dict_avail) + { + n = MZ_MIN(pState->m_dict_avail, pStream->avail_out); + memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n); + pStream->next_out += n; pStream->avail_out -= n; pStream->total_out += n; + pState->m_dict_avail -= n; pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1); + return ((pState->m_last_status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK; + } + + for ( ; ; ) + { + in_bytes = pStream->avail_in; + out_bytes = TINFL_LZ_DICT_SIZE - pState->m_dict_ofs; + + status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pState->m_dict, pState->m_dict + pState->m_dict_ofs, &out_bytes, decomp_flags); + pState->m_last_status = status; + + pStream->next_in += (mz_uint)in_bytes; pStream->avail_in -= (mz_uint)in_bytes; + pStream->total_in += (mz_uint)in_bytes; pStream->adler = tinfl_get_adler32(&pState->m_decomp); + + pState->m_dict_avail = (mz_uint)out_bytes; + + n = MZ_MIN(pState->m_dict_avail, pStream->avail_out); + memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n); + pStream->next_out += n; pStream->avail_out -= n; pStream->total_out += n; + pState->m_dict_avail -= n; pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1); + + if (status < 0) + return MZ_DATA_ERROR; /* Stream is corrupted (there could be some uncompressed data left in the output dictionary - oh well). */ + else if ((status == TINFL_STATUS_NEEDS_MORE_INPUT) && (!orig_avail_in)) + return MZ_BUF_ERROR; /* Signal caller that we can't make forward progress without supplying more input or by setting flush to MZ_FINISH. */ + else if (flush == MZ_FINISH) + { + /* The output buffer MUST be large to hold the remaining uncompressed data when flush==MZ_FINISH. */ + if (status == TINFL_STATUS_DONE) + return pState->m_dict_avail ? MZ_BUF_ERROR : MZ_STREAM_END; + /* status here must be TINFL_STATUS_HAS_MORE_OUTPUT, which means there's at least 1 more byte on the way. If there's no more room left in the output buffer then something is wrong. */ + else if (!pStream->avail_out) + return MZ_BUF_ERROR; + } + else if ((status == TINFL_STATUS_DONE) || (!pStream->avail_in) || (!pStream->avail_out) || (pState->m_dict_avail)) + break; + } + + return ((status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK; +} + +static int mz_inflateEnd(mz_streamp pStream) +{ + if (!pStream) + return MZ_STREAM_ERROR; + if (pStream->state) + { + pStream->zfree(pStream->opaque, pStream->state); + pStream->state = NULL; + } + return MZ_OK; +} + +/* make this a drop-in replacement for zlib... */ + #define voidpf void* + #define uInt unsigned int + #define z_stream mz_stream + #define inflateInit2 mz_inflateInit2 + #define inflate mz_inflate + #define inflateEnd mz_inflateEnd + #define Z_SYNC_FLUSH MZ_SYNC_FLUSH + #define Z_FINISH MZ_FINISH + #define Z_OK MZ_OK + #define Z_STREAM_END MZ_STREAM_END + #define Z_NEED_DICT MZ_NEED_DICT + #define Z_ERRNO MZ_ERRNO + #define Z_STREAM_ERROR MZ_STREAM_ERROR + #define Z_DATA_ERROR MZ_DATA_ERROR + #define Z_MEM_ERROR MZ_MEM_ERROR + #define Z_BUF_ERROR MZ_BUF_ERROR + #define Z_VERSION_ERROR MZ_VERSION_ERROR + #define MAX_WBITS 15 + +#endif /* #ifndef TINFL_HEADER_FILE_ONLY */ + +/* + This is free and unencumbered software released into the public domain. + + Anyone is free to copy, modify, publish, use, compile, sell, or + distribute this software, either in source code form or as a compiled + binary, for any purpose, commercial or non-commercial, and by any + means. + + In jurisdictions that recognize copyright laws, the author or authors + of this software dedicate any and all copyright interest in the + software to the public domain. We make this dedication for the benefit + of the public at large and to the detriment of our heirs and + successors. We intend this dedication to be an overt act of + relinquishment in perpetuity of all present and future rights to this + software under copyright law. + + 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 THE AUTHORS 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. + + For more information, please refer to +*/ + diff --git a/include/types.h b/include/types.h index d866d097..b3dc27e2 100644 --- a/include/types.h +++ b/include/types.h @@ -1,12 +1,12 @@ -#ifndef TYPES_H -#define TYPES_H +#ifndef _SM64_TYPES_H_ +#define _SM64_TYPES_H_ // This file contains various data types used in Super Mario 64 that don't yet // have an appropriate header. #include #include "macros.h" -#include + // Certain functions are marked as having return values, but do not // actually return a value. This causes undefined behavior, which we'd rather @@ -30,9 +30,9 @@ struct Controller /*0x12*/ u16 buttonPressed; /*0x14*/ OSContStatus *statusData; /*0x18*/ OSContPad *controllerData; -#ifdef VERSION_SH /*0x1C*/ int port; -#endif + /*ext */ s16 extStickX; // additional (right) stick values + /*ext */ s16 extStickY; }; typedef f32 Vec2f[2]; @@ -204,7 +204,6 @@ struct Object /*0x218*/ void *collisionData; /*0x21C*/ Mat4 transform; /*0x25C*/ void *respawnInfo; - std::shared_ptr wrapper; }; struct ObjectHitbox @@ -347,4 +346,4 @@ struct MarioState /*0xC4*/ f32 unkC4; }; -#endif // TYPES_H +#endif // _SM64_TYPES_H_ diff --git a/include/ultra64.h b/include/ultra64.h index 409a3cf7..e78ded49 100644 --- a/include/ultra64.h +++ b/include/ultra64.h @@ -30,4 +30,13 @@ #include #include +#if defined(__MINGW32__) +#include <_mingw.h> +#if !defined(__MINGW64_VERSION_MAJOR) +#include +#define bzero(b,len) (memset((b), '\0', (len)), (void) 0) +#define bcopy(s1, s2, n) memmove((s2), (s1), (n)) +#endif +#endif + #endif diff --git a/levels/bbh/leveldata.c b/levels/bbh/leveldata.c index c9310133..74440b9b 100644 --- a/levels/bbh/leveldata.c +++ b/levels/bbh/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/bitdw/leveldata.c b/levels/bitdw/leveldata.c index 9d5276e6..de889e20 100644 --- a/levels/bitdw/leveldata.c +++ b/levels/bitdw/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/bitfs/leveldata.c b/levels/bitfs/leveldata.c index 68e0835c..1d22a4f8 100644 --- a/levels/bitfs/leveldata.c +++ b/levels/bitfs/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/bits/leveldata.c b/levels/bits/leveldata.c index 2a22ff4f..50b749ab 100644 --- a/levels/bits/leveldata.c +++ b/levels/bits/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/bob/leveldata.c b/levels/bob/leveldata.c index f49abe52..3c0befd1 100644 --- a/levels/bob/leveldata.c +++ b/levels/bob/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/bowser_1/leveldata.c b/levels/bowser_1/leveldata.c index 78e980ae..d198f19a 100644 --- a/levels/bowser_1/leveldata.c +++ b/levels/bowser_1/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/bowser_2/leveldata.c b/levels/bowser_2/leveldata.c index a781c151..7c9e48bf 100644 --- a/levels/bowser_2/leveldata.c +++ b/levels/bowser_2/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/bowser_3/leveldata.c b/levels/bowser_3/leveldata.c index f4fdbddf..3505aed3 100644 --- a/levels/bowser_3/leveldata.c +++ b/levels/bowser_3/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/castle_courtyard/header.h b/levels/castle_courtyard/header.h index 78430f0f..d5a7e18c 100644 --- a/levels/castle_courtyard/header.h +++ b/levels/castle_courtyard/header.h @@ -1,7 +1,6 @@ -#pragma once +#ifndef CASTLE_COURTYARD_HEADER_H +#define CASTLE_COURTYARD_HEADER_H -#include -#include "common/scripts/dynamic_level_script_builder.hpp" #include "types.h" #include "game/moving_texture.h" @@ -19,4 +18,6 @@ extern const MacroObject castle_courtyard_seg7_macro_objs[]; extern const struct MovtexQuadCollection castle_courtyard_movtex_star_statue_water[]; // script -extern std::shared_ptr get_level_castle_courtyard_entry(); \ No newline at end of file +extern const LevelScript level_castle_courtyard_entry[]; + +#endif diff --git a/levels/castle_courtyard/leveldata.c b/levels/castle_courtyard/leveldata.c index 8bd49e20..6d14ac59 100644 --- a/levels/castle_courtyard/leveldata.c +++ b/levels/castle_courtyard/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/castle_courtyard/script.c b/levels/castle_courtyard/script.c index e97ca1c7..c17cc21a 100644 --- a/levels/castle_courtyard/script.c +++ b/levels/castle_courtyard/script.c @@ -13,10 +13,7 @@ #include "actors/common1.h" #include "make_const_nonconst.h" -#include "header.h" - -#include -#include "common/scripts/dynamic_level_script_builder.hpp" +#include "levels/castle_courtyard/header.h" static const LevelScript script_func_local_1[] = { OBJECT(/*model*/ MODEL_NONE, /*pos*/ 0, 200, -1652, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvAmbientSounds), @@ -32,69 +29,45 @@ static const LevelScript script_func_local_2[] = { RETURN(), }; -std::shared_ptr get_level_castle_courtyard_entry() { - const LevelScript level_entry[] = { - INIT_LEVEL(), - LOAD_MIO0(/*seg*/ 0x07, _castle_courtyard_segment_7SegmentRomStart, - _castle_courtyard_segment_7SegmentRomEnd), - LOAD_MIO0(/*seg*/ 0x0A, _water_skybox_mio0SegmentRomStart, - _water_skybox_mio0SegmentRomEnd), - LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _outside_mio0SegmentRomStart, - _outside_mio0SegmentRomEnd), - LOAD_MIO0(/*seg*/ 0x05, _group9_mio0SegmentRomStart, - _group9_mio0SegmentRomEnd), - LOAD_RAW(/*seg*/ 0x0C, _group9_geoSegmentRomStart, - _group9_geoSegmentRomEnd), - LOAD_MIO0(/*seg*/ 0x08, _common0_mio0SegmentRomStart, - _common0_mio0SegmentRomEnd), - LOAD_RAW(/*seg*/ 0x0F, _common0_geoSegmentRomStart, - _common0_geoSegmentRomEnd), - ALLOC_LEVEL_POOL(), - MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario), - JUMP_LINK(script_func_global_1), - JUMP_LINK(script_func_global_10), - LOAD_MODEL_FROM_GEO(MODEL_COURTYARD_SPIKY_TREE, spiky_tree_geo), - LOAD_MODEL_FROM_GEO(MODEL_COURTYARD_WOODEN_DOOR, wooden_door_geo), - LOAD_MODEL_FROM_GEO(MODEL_LEVEL_GEOMETRY_03, castle_courtyard_geo_000200), +const LevelScript level_castle_courtyard_entry[] = { + INIT_LEVEL(), + LOAD_MIO0( /*seg*/ 0x07, _castle_courtyard_segment_7SegmentRomStart, _castle_courtyard_segment_7SegmentRomEnd), + LOAD_MIO0( /*seg*/ 0x0A, _water_skybox_mio0SegmentRomStart, _water_skybox_mio0SegmentRomEnd), + LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _outside_mio0SegmentRomStart, _outside_mio0SegmentRomEnd), + LOAD_MIO0( /*seg*/ 0x05, _group9_mio0SegmentRomStart, _group9_mio0SegmentRomEnd), + LOAD_RAW( /*seg*/ 0x0C, _group9_geoSegmentRomStart, _group9_geoSegmentRomEnd), + LOAD_MIO0( /*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd), + LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd), + ALLOC_LEVEL_POOL(), + MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario), + JUMP_LINK(script_func_global_1), + JUMP_LINK(script_func_global_10), + LOAD_MODEL_FROM_GEO(MODEL_COURTYARD_SPIKY_TREE, spiky_tree_geo), + LOAD_MODEL_FROM_GEO(MODEL_COURTYARD_WOODEN_DOOR, wooden_door_geo), + LOAD_MODEL_FROM_GEO(MODEL_LEVEL_GEOMETRY_03, castle_courtyard_geo_000200), - AREA(/*index*/ 1, castle_courtyard_geo_000218), - OBJECT(/*model*/ MODEL_BOO, /*pos*/ -2360, -100, -2712, /*angle*/ 0, 0, 0, - /*behParam*/ 0x01050000, /*beh*/ bhvBooWithCage), - OBJECT(/*model*/ MODEL_NONE, /*pos*/ 0, 51, -1000, /*angle*/ 0, 180, 0, - /*behParam*/ 0x000A0000, /*beh*/ bhvLaunchStarCollectWarp), - OBJECT(/*model*/ MODEL_NONE, /*pos*/ 0, 51, -1000, /*angle*/ 0, 180, 0, - /*behParam*/ 0x000B0000, /*beh*/ bhvLaunchDeathWarp), - WARP_NODE(/*id*/ 0x05, /*destLevel*/ LEVEL_BBH, /*destArea*/ 0x01, - /*destNode*/ 0x0A, /*flags*/ WARP_NO_CHECKPOINT), - WARP_NODE(/*id*/ 0x0A, /*destLevel*/ LEVEL_CASTLE_COURTYARD, - /*destArea*/ 0x01, /*destNode*/ 0x0A, - /*flags*/ WARP_NO_CHECKPOINT), - WARP_NODE(/*id*/ 0x0B, /*destLevel*/ LEVEL_CASTLE_COURTYARD, - /*destArea*/ 0x01, /*destNode*/ 0x0B, - /*flags*/ WARP_NO_CHECKPOINT), - WARP_NODE(/*id*/ 0x01, /*destLevel*/ LEVEL_CASTLE, /*destArea*/ 0x01, - /*destNode*/ 0x02, /*flags*/ WARP_NO_CHECKPOINT), - WARP_NODE(/*id*/ 0xF1, /*destLevel*/ LEVEL_CASTLE_GROUNDS, - /*destArea*/ 0x01, /*destNode*/ 0x03, - /*flags*/ WARP_NO_CHECKPOINT), - JUMP_LINK(script_func_local_1), - JUMP_LINK(script_func_local_2), - TERRAIN(/*terrainData*/ castle_courtyard_seg7_collision), - MACRO_OBJECTS(/*objList*/ castle_courtyard_seg7_macro_objs), - SET_BACKGROUND_MUSIC(/*settingsPreset*/ 0x0000, /*seq*/ SEQ_SOUND_PLAYER), - TERRAIN_TYPE(/*terrainType*/ TERRAIN_STONE), - END_AREA(), + AREA(/*index*/ 1, castle_courtyard_geo_000218), + OBJECT(/*model*/ MODEL_BOO, /*pos*/ -2360, -100, -2712, /*angle*/ 0, 0, 0, /*behParam*/ 0x01050000, /*beh*/ bhvBooWithCage), + OBJECT(/*model*/ MODEL_NONE, /*pos*/ 0, 51, -1000, /*angle*/ 0, 180, 0, /*behParam*/ 0x000A0000, /*beh*/ bhvLaunchStarCollectWarp), + OBJECT(/*model*/ MODEL_NONE, /*pos*/ 0, 51, -1000, /*angle*/ 0, 180, 0, /*behParam*/ 0x000B0000, /*beh*/ bhvLaunchDeathWarp), + WARP_NODE(/*id*/ 0x05, /*destLevel*/ LEVEL_BBH, /*destArea*/ 0x01, /*destNode*/ 0x0A, /*flags*/ WARP_NO_CHECKPOINT), + WARP_NODE(/*id*/ 0x0A, /*destLevel*/ LEVEL_CASTLE_COURTYARD, /*destArea*/ 0x01, /*destNode*/ 0x0A, /*flags*/ WARP_NO_CHECKPOINT), + WARP_NODE(/*id*/ 0x0B, /*destLevel*/ LEVEL_CASTLE_COURTYARD, /*destArea*/ 0x01, /*destNode*/ 0x0B, /*flags*/ WARP_NO_CHECKPOINT), + WARP_NODE(/*id*/ 0x01, /*destLevel*/ LEVEL_CASTLE, /*destArea*/ 0x01, /*destNode*/ 0x02, /*flags*/ WARP_NO_CHECKPOINT), + WARP_NODE(/*id*/ 0xF1, /*destLevel*/ LEVEL_CASTLE_GROUNDS, /*destArea*/ 0x01, /*destNode*/ 0x03, /*flags*/ WARP_NO_CHECKPOINT), + JUMP_LINK(script_func_local_1), + JUMP_LINK(script_func_local_2), + TERRAIN(/*terrainData*/ castle_courtyard_seg7_collision), + MACRO_OBJECTS(/*objList*/ castle_courtyard_seg7_macro_objs), + SET_BACKGROUND_MUSIC(/*settingsPreset*/ 0x0000, /*seq*/ SEQ_SOUND_PLAYER), + TERRAIN_TYPE(/*terrainType*/ TERRAIN_STONE), + END_AREA(), - FREE_LEVEL_POOL(), - MARIO_POS(/*area*/ 1, /*yaw*/ 0, /*pos*/ -14, 0, -201), - CALL(/*arg*/ 0, /*func*/ lvl_init_or_update), - CALL_LOOP(/*arg*/ 1, /*func*/ lvl_init_or_update), - CLEAR_LEVEL(), - SLEEP_BEFORE_EXIT(/*frames*/ 1), - EXIT(), - }; - - auto builder = new DynamicLevelScriptBuilder(); - builder->add_scripts(level_entry, 89); - return std::shared_ptr(builder); -} + FREE_LEVEL_POOL(), + MARIO_POS(/*area*/ 1, /*yaw*/ 0, /*pos*/ -14, 0, -201), + CALL(/*arg*/ 0, /*func*/ lvl_init_or_update), + CALL_LOOP(/*arg*/ 1, /*func*/ lvl_init_or_update), + CLEAR_LEVEL(), + SLEEP_BEFORE_EXIT(/*frames*/ 1), + EXIT(), +}; diff --git a/levels/castle_grounds/header.h b/levels/castle_grounds/header.h index d17cbab5..5e32ed94 100644 --- a/levels/castle_grounds/header.h +++ b/levels/castle_grounds/header.h @@ -1,8 +1,6 @@ #ifndef CASTLE_GROUNDS_HEADER_H #define CASTLE_GROUNDS_HEADER_H -#include -#include "common/scripts/dynamic_level_script_builder.hpp" #include "types.h" #include "game/moving_texture.h" @@ -41,6 +39,6 @@ extern Movtex castle_grounds_movtex_tris_waterfall[]; extern const Gfx castle_grounds_dl_waterfall[]; // script -extern std::shared_ptr get_level_castle_grounds_entry(); +extern const LevelScript level_castle_grounds_entry[]; #endif diff --git a/levels/castle_grounds/leveldata.c b/levels/castle_grounds/leveldata.c index e9b49472..1263f062 100644 --- a/levels/castle_grounds/leveldata.c +++ b/levels/castle_grounds/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/castle_grounds/script.c b/levels/castle_grounds/script.c index 8ed4c780..8d197f93 100644 --- a/levels/castle_grounds/script.c +++ b/levels/castle_grounds/script.c @@ -1,25 +1,19 @@ -#include #include +#include "sm64.h" +#include "behavior_data.h" +#include "model_ids.h" +#include "seq_ids.h" +#include "segment_symbols.h" +#include "level_commands.h" -#include "actors/common1.h" -#include "common/level/area_builder.hpp" -#include "common/scripts/dynamic_level_script_builder.hpp" -#include "common/level/object_builder_params.hpp" -#include "common/level/original_object_builder.hpp" -#include "common/level/wrapped_object_builder.hpp" -#include "game/behavior_actions.h" -#include "game/behaviors/butterfly/blueprint.hpp" #include "game/level_update.h" -#include "include/behavior_data.h" -#include "include/level_commands.h" -#include "include/make_const_nonconst.h" -#include "include/model_ids.h" -#include "include/segment_symbols.h" -#include "include/seq_ids.h" -#include "include/sm64.h" + #include "levels/scripts.h" -#include "header.h" +#include "actors/common1.h" + +#include "make_const_nonconst.h" +#include "levels/castle_grounds/header.h" static const LevelScript script_func_local_1[] = { WARP_NODE(/*id*/ 0x00, /*destLevel*/ LEVEL_CASTLE, /*destArea*/ 0x01, /*destNode*/ 0x00, /*flags*/ WARP_NO_CHECKPOINT), @@ -82,6 +76,7 @@ static const LevelScript script_func_local_3[] = { }; static const LevelScript script_func_local_4[] = { + OBJECT(/*model*/ MODEL_BUTTERFLY, /*pos*/ -4508, 406, 4400, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvButterfly), OBJECT(/*model*/ MODEL_BUTTERFLY, /*pos*/ -4408, 406, 4500, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvButterfly), OBJECT(/*model*/ MODEL_BUTTERFLY, /*pos*/ -4708, 406, 4100, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvButterfly), OBJECT(/*model*/ MODEL_BUTTERFLY, /*pos*/ -6003, 473, -2621, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvButterfly), @@ -91,110 +86,54 @@ static const LevelScript script_func_local_4[] = { OBJECT(/*model*/ MODEL_BUTTERFLY, /*pos*/ 5773, 775, -5722, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvButterfly), OBJECT(/*model*/ MODEL_BUTTERFLY, /*pos*/ 5873, 775, -5622, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvButterfly), OBJECT(/*model*/ MODEL_BUTTERFLY, /*pos*/ 5473, 775, -5322, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvButterfly), + OBJECT(/*model*/ MODEL_BUTTERFLY, /*pos*/ -1504, 326, 3196, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvButterfly), + OBJECT(/*model*/ MODEL_BUTTERFLY, /*pos*/ -1204, 326, 3296, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvButterfly), OBJECT(/*model*/ MODEL_YOSHI, /*pos*/ 0, 3174, -5625, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvYoshi), + RETURN(), }; -std::shared_ptr get_level_castle_grounds_entry() { - auto flag_bp = std::make_shared( - MODEL_CASTLE_GROUNDS_FLAG, bhvCastleFlagWaving); - //auto butterfly_bp = - // std::make_shared(MODEL_BUTTERFLY, bhvButterfly); - auto butterfly_bp = get_butterfly_blueprint(); +const LevelScript level_castle_grounds_entry[] = { + INIT_LEVEL(), + LOAD_MIO0( /*seg*/ 0x07, _castle_grounds_segment_7SegmentRomStart, _castle_grounds_segment_7SegmentRomEnd), + LOAD_MIO0( /*seg*/ 0x0A, _water_skybox_mio0SegmentRomStart, _water_skybox_mio0SegmentRomEnd), + LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _outside_mio0SegmentRomStart, _outside_mio0SegmentRomEnd), + LOAD_MIO0( /*seg*/ 0x05, _group10_mio0SegmentRomStart, _group10_mio0SegmentRomEnd), + LOAD_RAW( /*seg*/ 0x0C, _group10_geoSegmentRomStart, _group10_geoSegmentRomEnd), + LOAD_MIO0( /*seg*/ 0x06, _group15_mio0SegmentRomStart, _group15_mio0SegmentRomEnd), + LOAD_RAW( /*seg*/ 0x0D, _group15_geoSegmentRomStart, _group15_geoSegmentRomEnd), + LOAD_MIO0( /*seg*/ 0x08, _common0_mio0SegmentRomStart, _common0_mio0SegmentRomEnd), + LOAD_RAW( /*seg*/ 0x0F, _common0_geoSegmentRomStart, _common0_geoSegmentRomEnd), + ALLOC_LEVEL_POOL(), + MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ bhvMario), + JUMP_LINK(script_func_global_1), + JUMP_LINK(script_func_global_11), + JUMP_LINK(script_func_global_16), + LOAD_MODEL_FROM_GEO(MODEL_LEVEL_GEOMETRY_03, castle_grounds_geo_0006F4), + LOAD_MODEL_FROM_GEO(MODEL_CASTLE_GROUNDS_BUBBLY_TREE, bubbly_tree_geo), + LOAD_MODEL_FROM_GEO(MODEL_CASTLE_GROUNDS_WARP_PIPE, warp_pipe_geo), + LOAD_MODEL_FROM_GEO(MODEL_CASTLE_GROUNDS_CASTLE_DOOR, castle_door_geo), + LOAD_MODEL_FROM_GEO(MODEL_CASTLE_GROUNDS_METAL_DOOR, metal_door_geo), + LOAD_MODEL_FROM_GEO(MODEL_CASTLE_GROUNDS_VCUTM_GRILL, castle_grounds_geo_00070C), + LOAD_MODEL_FROM_GEO(MODEL_CASTLE_GROUNDS_FLAG, castle_grounds_geo_000660), + LOAD_MODEL_FROM_GEO(MODEL_CASTLE_GROUNDS_CANNON_GRILL, castle_grounds_geo_000724), - auto area_builder = - std::make_shared(1, castle_grounds_geo_00073C); - (*area_builder) - .add_scripts({ - WARP_NODE(/*id*/ 0xF1, /*destLevel*/ LEVEL_CASTLE_GROUNDS, - /*destArea*/ 0x01, /*destNode*/ 0x03, - /*flags*/ WARP_NO_CHECKPOINT), - JUMP_LINK(script_func_local_1), - JUMP_LINK(script_func_local_2), - JUMP_LINK(script_func_local_3), - }); + AREA(/*index*/ 1, castle_grounds_geo_00073C), + WARP_NODE(/*id*/ 0xF1, /*destLevel*/ LEVEL_CASTLE_GROUNDS, /*destArea*/ 0x01, /*destNode*/ 0x03, /*flags*/ WARP_NO_CHECKPOINT), + JUMP_LINK(script_func_local_1), + JUMP_LINK(script_func_local_2), + JUMP_LINK(script_func_local_3), + JUMP_LINK(script_func_local_4), + TERRAIN(/*terrainData*/ castle_grounds_seg7_collision_level), + MACRO_OBJECTS(/*objList*/ castle_grounds_seg7_macro_objs), + SET_BACKGROUND_MUSIC(/*settingsPreset*/ 0x0000, /*seq*/ SEQ_SOUND_PLAYER), + TERRAIN_TYPE(/*terrainType*/ TERRAIN_GRASS), + END_AREA(), - /*const auto d = 2000; - - for (auto i = 0; i < 30; ++i) { - const auto rand_xf = rand() * 1. / RAND_MAX; - const auto rand_yf = rand() * 1. / RAND_MAX; - const auto rand_zf = rand() * 1. / RAND_MAX; - - const auto x = -4508 + d * (rand_xf - .5); - const auto y = 406 + d * (rand_yf - .5); - const auto z = 4400 + d * (rand_zf - .5); - - (*area_builder) - .add_object(flag_bp, [x, y, z](auto& o) {o.set_pos(x, y, z);}); - }*/ - - (*area_builder) - .add_scripts(script_func_local_4, 60) - .add_object(butterfly_bp, [](auto& o) {o.set_pos(-4508, 406, 4400);}) - .add_object(butterfly_bp, [](auto& o) {o.set_pos(-1504, 326, 3196);}) - .add_object(butterfly_bp, [](auto& o) {o.set_pos(-1204, 326, 3296);}) - .add_scripts({ - TERRAIN( - /*terrainData*/ castle_grounds_seg7_collision_level), - MACRO_OBJECTS(/*objList*/ castle_grounds_seg7_macro_objs), - SET_BACKGROUND_MUSIC( - /*settingsPreset*/ 0x0000, /*seq*/ SEQ_SOUND_PLAYER), - TERRAIN_TYPE(/*terrainType*/ TERRAIN_GRASS), - }); - - auto builder = std::make_shared(); - builder->add_scripts({ - INIT_LEVEL(), - LOAD_MIO0(/*seg*/ 0x07, _castle_grounds_segment_7SegmentRomStart, - _castle_grounds_segment_7SegmentRomEnd), - LOAD_MIO0(/*seg*/ 0x0A, _water_skybox_mio0SegmentRomStart, - _water_skybox_mio0SegmentRomEnd), - LOAD_MIO0_TEXTURE(/*seg*/ 0x09, _outside_mio0SegmentRomStart, - _outside_mio0SegmentRomEnd), - LOAD_MIO0(/*seg*/ 0x05, _group10_mio0SegmentRomStart, - _group10_mio0SegmentRomEnd), - LOAD_RAW(/*seg*/ 0x0C, _group10_geoSegmentRomStart, - _group10_geoSegmentRomEnd), - LOAD_MIO0(/*seg*/ 0x06, _group15_mio0SegmentRomStart, - _group15_mio0SegmentRomEnd), - LOAD_RAW(/*seg*/ 0x0D, _group15_geoSegmentRomStart, - _group15_geoSegmentRomEnd), - LOAD_MIO0(/*seg*/ 0x08, _common0_mio0SegmentRomStart, - _common0_mio0SegmentRomEnd), - LOAD_RAW(/*seg*/ 0x0F, _common0_geoSegmentRomStart, - _common0_geoSegmentRomEnd), - ALLOC_LEVEL_POOL(), - MARIO(/*model*/ MODEL_MARIO, /*behParam*/ 0x00000001, /*beh*/ - bhvMario), - JUMP_LINK(script_func_global_1), - JUMP_LINK(script_func_global_11), - JUMP_LINK(script_func_global_16), - LOAD_MODEL_FROM_GEO(MODEL_LEVEL_GEOMETRY_03, - castle_grounds_geo_0006F4), - LOAD_MODEL_FROM_GEO(MODEL_CASTLE_GROUNDS_BUBBLY_TREE, - bubbly_tree_geo), - LOAD_MODEL_FROM_GEO(MODEL_CASTLE_GROUNDS_WARP_PIPE, - warp_pipe_geo), - LOAD_MODEL_FROM_GEO(MODEL_CASTLE_GROUNDS_CASTLE_DOOR, - castle_door_geo), - LOAD_MODEL_FROM_GEO(MODEL_CASTLE_GROUNDS_METAL_DOOR, - metal_door_geo), - LOAD_MODEL_FROM_GEO(MODEL_CASTLE_GROUNDS_VCUTM_GRILL, - castle_grounds_geo_00070C), - LOAD_MODEL_FROM_GEO(MODEL_CASTLE_GROUNDS_FLAG, - castle_grounds_geo_000660), - LOAD_MODEL_FROM_GEO(MODEL_CASTLE_GROUNDS_CANNON_GRILL, - castle_grounds_geo_000724), - }) - .add_builder(area_builder) - .add_scripts({ - FREE_LEVEL_POOL(), - MARIO_POS(/*area*/ 1, /*yaw*/ 180, /*pos*/ -1328, 260, 4664), - CALL(/*arg*/ 0, /*func*/ lvl_init_or_update), - CALL_LOOP(/*arg*/ 1, /*func*/ lvl_init_or_update), - CLEAR_LEVEL(), - SLEEP_BEFORE_EXIT(/*frames*/ 1), - EXIT() - }); - return builder; -} + FREE_LEVEL_POOL(), + MARIO_POS(/*area*/ 1, /*yaw*/ 180, /*pos*/ -1328, 260, 4664), + CALL(/*arg*/ 0, /*func*/ lvl_init_or_update), + CALL_LOOP(/*arg*/ 1, /*func*/ lvl_init_or_update), + CLEAR_LEVEL(), + SLEEP_BEFORE_EXIT(/*frames*/ 1), + EXIT(), +}; diff --git a/levels/castle_inside/leveldata.c b/levels/castle_inside/leveldata.c index 28a39799..7052031c 100644 --- a/levels/castle_inside/leveldata.c +++ b/levels/castle_inside/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/ccm/leveldata.c b/levels/ccm/leveldata.c index 0b9052d8..fef53ddd 100644 --- a/levels/ccm/leveldata.c +++ b/levels/ccm/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/cotmc/leveldata.c b/levels/cotmc/leveldata.c index 9e4a650f..ae5abbea 100644 --- a/levels/cotmc/leveldata.c +++ b/levels/cotmc/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/ddd/leveldata.c b/levels/ddd/leveldata.c index 9961a3ff..4b0434c5 100644 --- a/levels/ddd/leveldata.c +++ b/levels/ddd/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/ending/leveldata.c b/levels/ending/leveldata.c index 1c2aeada..0ea6be6f 100644 --- a/levels/ending/leveldata.c +++ b/levels/ending/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/entry.c b/levels/entry.c index b07f7c5b..015eeb6b 100644 --- a/levels/entry.c +++ b/levels/entry.c @@ -1,64 +1,17 @@ -#include "entry.h" - -#include #include - -#include "common/scripts/dynamic_level_script_builder.hpp" -#include "levels/intro/header.h" -#include "util/unused.hpp" - -#include "level_commands.h" -#include "make_const_nonconst.h" -#include "segment_symbols.h" #include "sm64.h" +#include "segment_symbols.h" +#include "level_commands.h" -void callback() { - std::ofstream myfile; - myfile.open("file.txt"); - myfile << "This is a line.\n"; +#include "levels/intro/header.h" - myfile.close(); -} +#include "make_const_nonconst.h" -class Printer{ - public: - void print() { - auto text = "This is a line from a printer.\n"; - std::ofstream myfile; - myfile.open("file.txt"); - myfile << text; - - myfile.close(); - } +const LevelScript level_script_entry[] = { + INIT_LEVEL(), + SLEEP(/*frames*/ 2), + BLACKOUT(/*active*/ FALSE), + SET_REG(/*value*/ 0), + EXECUTE(/*seg*/ 0x14, /*script*/ _introSegmentRomStart, /*scriptEnd*/ _introSegmentRomEnd, /*entry*/ level_intro_entry_1), + JUMP(/*target*/ level_script_entry), }; - -const LevelScript* get_level_script_entry(int& out_count = unused_int) { - auto lambda = [] { - auto text = "This is a line.\n"; - std::ofstream myfile; - myfile.open("file.txt"); - myfile << text; - - myfile.close(); - }; - - auto call_printer = [](Printer * printer) { - printer->print(); - }; - - return DynamicLevelScriptBuilder() - .add_call(call_printer, new Printer()) - .add_scripts({ - INIT_LEVEL(), - SLEEP(/*frames*/ 2), - BLACKOUT(/*active*/ FALSE), - SET_REG(/*value*/ 0), - EXECUTE( - /*seg*/ 0x14, /*script*/ - _introSegmentRomStart, /*scriptEnd*/ - _introSegmentRomEnd, - /*entry*/ level_intro_entry_1), - }) - .add_jump_to_top_of_this_builder() - .get_entry_pointer(out_count); -} diff --git a/levels/entry.h b/levels/entry.h index 75404d54..2bfc2021 100644 --- a/levels/entry.h +++ b/levels/entry.h @@ -4,6 +4,6 @@ #include "types.h" // script -extern const LevelScript* get_level_script_entry(int& out_count); +extern const LevelScript level_script_entry[]; #endif diff --git a/levels/hmc/leveldata.c b/levels/hmc/leveldata.c index f0b386e3..ec169436 100644 --- a/levels/hmc/leveldata.c +++ b/levels/hmc/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/intro/header.h b/levels/intro/header.h index e0f6292d..2fc66c03 100644 --- a/levels/intro/header.h +++ b/levels/intro/header.h @@ -10,7 +10,17 @@ extern const GeoLayout intro_geo_0003B8[]; extern const GeoLayout intro_geo_000414[]; // leveldata -extern const Gfx intro_seg7_dl_0700B3A0[]; +extern Vtx titletest_test_mesh_vtx_0[133]; +extern Gfx titletest_test_mesh_tri_0[]; +extern Vtx titletest_test_mesh_vtx_1[407]; +extern Gfx titletest_test_mesh_tri_1[]; +extern Vtx titletest_test_mesh_vtx_2[183]; +extern Gfx titletest_test_mesh_tri_2[]; +extern Vtx titletest_test_mesh_vtx_3[568]; +extern Gfx titletest_test_mesh_tri_3[]; + +extern Gfx titletest_test_mesh[]; + extern const Gfx intro_seg7_dl_0700C6A0[]; extern const f32 intro_seg7_table_0700C790[]; extern const f32 intro_seg7_table_0700C880[]; diff --git a/levels/intro/leveldata.c b/levels/intro/leveldata.c index ce4351a7..d5471c85 100644 --- a/levels/intro/leveldata.c +++ b/levels/intro/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" @@ -3303,23 +3301,2530 @@ static const Gfx intro_seg7_dl_0700ADC0[] = { }; // 0x0700B3A0 - 0x0700B420 -const Gfx intro_seg7_dl_0700B3A0[] = { - gsDPPipeSync(), - gsDPSetCombineMode(G_CC_MODULATERGB, G_CC_MODULATERGB), - gsSPClearGeometryMode(G_LIGHTING), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD), - gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), - gsDPTileSync(), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD), - gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), - gsSPDisplayList(intro_seg7_dl_07008EA0), - gsSPDisplayList(intro_seg7_dl_07009E38), - gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), - gsDPPipeSync(), - gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), - gsSPDisplayList(intro_seg7_dl_0700ADC0), - gsSPSetGeometryMode(G_LIGHTING), - gsSPEndDisplayList(), +Lights1 titletest_sm64_material_lights = gdSPDefLights1( + 0x7F, 0x7F, 0x7F, + 0xFE, 0xFE, 0xFE, 0x28, 0x28, 0x28); + +Lights1 titletest_sm64_material_001_lights = gdSPDefLights1( + 0x7F, 0x7F, 0x7F, + 0xFE, 0xFE, 0xFE, 0x28, 0x28, 0x28); + +Lights1 titletest_sm64_material_002_lights = gdSPDefLights1( + 0x7F, 0x7F, 0x7F, + 0xFE, 0xFE, 0xFE, 0x28, 0x28, 0x28); + +Lights1 titletest_sm64_material_003_lights = gdSPDefLights1( + 0x7F, 0x7F, 0x7F, + 0xFE, 0xFE, 0xFE, 0x28, 0x28, 0x28); + +u8 titletest_blue_rgba16[] = { + #include "levels/intro/blue.rgba16.inc.c" +}; +u8 titletest_darkerblue_rgba16[] = { + #include "levels/intro/darkerblue.rgba16.inc.c" +}; +u8 titletest_white_rgba16[] = { + #include "levels/intro/white.rgba16.inc.c" +}; +u8 titletest_grey_rgba16[] = { + #include "levels/intro/grey.rgba16.inc.c" +}; +Vtx titletest_test_mesh_vtx_0[133] = { + {{{1221, 451, -274},0, {-16, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1434, 440, -267},0, {38, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1328, 481, -292},0, {11, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1146, 292, -178},0, {361, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1299, 275, -167},0, {92, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1130, 68, -41},0, {334, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1255, 210, -128},0, {119, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1249, 148, -90},0, {146, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1376, 141, -86},0, {173, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1426, -11, 6},0, {200, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1282, -47, 29},0, {388, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1255, -72, 44},0, {415, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1130, -209, 127},0, {307, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1256, -137, 83},0, {442, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1302, -137, 83},0, {469, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1425, -209, 127},0, {227, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1210, -340, 207},0, {280, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1425, -209, 127},0, {227, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1130, -209, 127},0, {307, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1354, -340, 207},0, {253, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1302, -137, 83},0, {469, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1312, -67, 41},0, {496, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1426, -11, 6},0, {200, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1282, -47, 29},0, {388, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1299, 275, -167},0, {92, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1394, 209, -127},0, {65, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1434, 440, -267},0, {38, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{819, 405, -246},0, {325, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1113, 312, -190},0, {18, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{978, 482, -293},0, {-16, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{964, 276, -168},0, {462, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{798, 169, -103},0, {291, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{798, 169, -103},0, {291, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{931, 239, -146},0, {496, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{964, 276, -168},0, {462, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{931, 188, -114},0, {359, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{982, 188, -114},0, {394, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1107, 11, -7},0, {52, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{986, 19, -12},0, {223, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{879, 4, -2},0, {257, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{954, -88, 53},0, {189, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1062, -201, 122},0, {86, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{798, -164, 99},0, {155, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{866, -340, 207},0, {121, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{987, 239, -146},0, {428, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{1113, 312, -190},0, {18, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{397, 438, -266},0, {338, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{752, 324, -197},0, {23, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{643, 473, -288},0, {-16, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{548, 245, -149},0, {378, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{432, -342, 208},0, {299, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{544, 89, -54},0, {417, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{580, 80, -48},0, {457, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{548, -130, 79},0, {220, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{568, -342, 208},0, {260, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{762, 68, -41},0, {63, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{701, -60, 37},0, {102, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{810, -240, 146},0, {142, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{682, -343, 209},0, {181, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{616, 177, -107},0, {496, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{59, 189, -115},0, {496, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{380, 480, -292},0, {27, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{91, 480, -292},0, {-16, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{356, 252, -153},0, {69, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{214, 211, -128},0, {112, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{212, 155, -94},0, {155, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{91, -338, 205},0, {453, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{220, -57, 35},0, {283, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{230, -116, 71},0, {325, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{366, -119, 72},0, {368, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{416, -338, 205},0, {411, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{338, 137, -83},0, {197, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{332, -38, 23},0, {240, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-316, 429, -261},0, {268, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{25, 289, -176},0, {41, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-99, 479, -291},0, {-16, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-181, 184, -112},0, {325, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{25, 289, -176},0, {41, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-316, 429, -261},0, {268, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-316, -339, 206},0, {212, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-181, -56, 34},0, {382, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{51, -153, 93},0, {98, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-72, -339, 206},0, {155, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-101, -4, 2},0, {439, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-101, 116, -71},0, {496, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-723, -327, 199},0, {-16, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-555, 476, -290},0, {98, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-644, 476, -290},0, {41, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-471, 221, -134},0, {155, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-557, -74, 45},0, {439, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-582, -338, 205},0, {496, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-356, -337, 205},0, {325, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-470, -323, 197},0, {382, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-356, -337, 205},0, {325, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-557, -74, 45},0, {439, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-471, 221, -134},0, {155, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-327, 437, -265},0, {268, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-464, 476, -290},0, {212, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1061, 189, -115},0, {496, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-740, 480, -292},0, {27, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1029, 480, -292},0, {-16, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-764, 252, -153},0, {69, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-906, 211, -128},0, {112, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-908, 155, -94},0, {155, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1029, -338, 205},0, {453, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-900, -57, 35},0, {283, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-890, -116, 71},0, {325, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-754, -119, 72},0, {368, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1029, -338, 205},0, {453, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-704, -338, 205},0, {411, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-754, -119, 72},0, {368, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-900, -57, 35},0, {283, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-782, 137, -83},0, {197, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-908, 155, -94},0, {155, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-788, -38, 23},0, {240, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1461, 438, -266},0, {338, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1107, 324, -197},0, {23, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1216, 473, -288},0, {-16, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1311, 245, -149},0, {378, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1427, -342, 208},0, {299, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1315, 89, -54},0, {417, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1279, 80, -48},0, {457, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1311, -130, 79},0, {220, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1291, -342, 208},0, {260, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1311, -130, 79},0, {220, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1097, 68, -41},0, {63, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1279, 80, -48},0, {457, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1158, -60, 37},0, {102, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1049, -240, 146},0, {142, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1177, -343, 209},0, {181, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1243, 177, -107},0, {496, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1311, 245, -149},0, {378, 496},{0x0, 0x42, 0x6D, 0xFF}}}, + {{{-1107, 324, -197},0, {23, 496},{0x0, 0x42, 0x6D, 0xFF}}}, +}; + +Gfx titletest_test_mesh_tri_0[] = { + gsSPVertex(titletest_test_mesh_vtx_0 + 0, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 1, 0, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(5, 4, 3, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(5, 8, 7, 0), + gsSP1Triangle(5, 9, 8, 0), + gsSP1Triangle(10, 9, 5, 0), + gsSP1Triangle(11, 10, 5, 0), + gsSP1Triangle(12, 11, 5, 0), + gsSP1Triangle(12, 13, 11, 0), + gsSP1Triangle(12, 14, 13, 0), + gsSP1Triangle(12, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_0 + 16, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(4, 1, 5, 0), + gsSP1Triangle(5, 1, 6, 0), + gsSP1Triangle(7, 5, 6, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(11, 12, 13, 0), + gsSP1Triangle(14, 12, 11, 0), + gsSP1Triangle(15, 14, 11, 0), + gsSPVertex(titletest_test_mesh_vtx_0 + 32, 14, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(0, 4, 3, 0), + gsSP1Triangle(0, 5, 4, 0), + gsSP1Triangle(6, 5, 0, 0), + gsSP1Triangle(7, 6, 0, 0), + gsSP1Triangle(8, 5, 6, 0), + gsSP1Triangle(8, 9, 5, 0), + gsSP1Triangle(10, 9, 8, 0), + gsSP1Triangle(11, 9, 10, 0), + gsSP1Triangle(2, 12, 13, 0), + gsSP1Triangle(12, 5, 13, 0), + gsSP1Triangle(4, 5, 12, 0), + gsSPVertex(titletest_test_mesh_vtx_0 + 46, 14, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 1, 0, 0), + gsSP1Triangle(4, 3, 0, 0), + gsSP1Triangle(4, 5, 3, 0), + gsSP1Triangle(4, 6, 5, 0), + gsSP1Triangle(4, 7, 6, 0), + gsSP1Triangle(4, 8, 7, 0), + gsSP1Triangle(7, 9, 6, 0), + gsSP1Triangle(7, 10, 9, 0), + gsSP1Triangle(7, 11, 10, 0), + gsSP1Triangle(12, 11, 7, 0), + gsSP1Triangle(6, 9, 13, 0), + gsSP1Triangle(13, 9, 3, 0), + gsSP1Triangle(3, 9, 1, 0), + gsSPVertex(titletest_test_mesh_vtx_0 + 60, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(0, 4, 3, 0), + gsSP1Triangle(0, 5, 4, 0), + gsSP1Triangle(6, 5, 0, 0), + gsSP1Triangle(6, 7, 5, 0), + gsSP1Triangle(6, 8, 7, 0), + gsSP1Triangle(6, 9, 8, 0), + gsSP1Triangle(6, 10, 9, 0), + gsSP1Triangle(7, 11, 5, 0), + gsSP1Triangle(7, 12, 11, 0), + gsSP1Triangle(13, 14, 15, 0), + gsSPVertex(titletest_test_mesh_vtx_0 + 76, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 0, 2, 0), + gsSP1Triangle(3, 4, 0, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(3, 6, 5, 0), + gsSP1Triangle(4, 5, 7, 0), + gsSP1Triangle(7, 5, 8, 0), + gsSP1Triangle(8, 5, 1, 0), + gsSP1Triangle(0, 8, 1, 0), + gsSP1Triangle(9, 10, 11, 0), + gsSP1Triangle(9, 12, 10, 0), + gsSP1Triangle(9, 13, 12, 0), + gsSP1Triangle(9, 14, 13, 0), + gsSP1Triangle(13, 15, 12, 0), + gsSPVertex(titletest_test_mesh_vtx_0 + 92, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 1, 4, 0), + gsSP1Triangle(3, 4, 5, 0), + gsSP1Triangle(6, 7, 8, 0), + gsSP1Triangle(6, 9, 7, 0), + gsSP1Triangle(6, 10, 9, 0), + gsSP1Triangle(6, 11, 10, 0), + gsSP1Triangle(12, 11, 6, 0), + gsSP1Triangle(12, 13, 11, 0), + gsSP1Triangle(12, 14, 13, 0), + gsSP1Triangle(12, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_0 + 108, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 4, 5, 0), + gsSP1Triangle(3, 6, 4, 0), + gsSP1Triangle(7, 8, 9, 0), + gsSP1Triangle(10, 8, 7, 0), + gsSP1Triangle(11, 10, 7, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(11, 14, 13, 0), + gsSP1Triangle(11, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_0 + 124, 9, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(0, 4, 3, 0), + gsSP1Triangle(5, 4, 0, 0), + gsSP1Triangle(2, 1, 6, 0), + gsSP1Triangle(6, 1, 7, 0), + gsSP1Triangle(7, 1, 8, 0), + gsSPEndDisplayList(), +};Vtx titletest_test_mesh_vtx_1[407] = { + {{{1434, 307, -486},0, {471, 66},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1221, 318, -493},0, {433, 66},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1328, 348, -511},0, {452, 69},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1146, 159, -396},0, {421, 50},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1299, 142, -386},0, {448, 49},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1394, 76, -345},0, {465, 44},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1130, -65, -260},0, {418, 29},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1255, 77, -346},0, {440, 43},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1249, 15, -309},0, {439, 37},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1376, 9, -305},0, {461, 37},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1426, -143, -212},0, {471, 23},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1282, -180, -190},0, {445, 19},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1312, -200, -178},0, {451, 17},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1425, -342, -92},0, {471, 4},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1302, -270, -135},0, {449, 10},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1130, -342, -92},0, {419, 3},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1425, -342, -92},0, {471, 4},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1210, -473, -12},0, {433, -9},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1130, -342, -92},0, {419, 3},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1354, -473, -12},0, {459, -9},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1302, -270, -135},0, {449, 10},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1256, -270, -135},0, {441, 10},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1255, -205, -175},0, {441, 16},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1130, -65, -260},0, {418, 29},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1282, -180, -190},0, {445, 19},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1113, 179, -408},0, {397, 58},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{819, 272, -465},0, {345, 65},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{978, 349, -512},0, {373, 73},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{964, 143, -386},0, {371, 53},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{987, 107, -364},0, {375, 50},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1107, -121, -226},0, {397, 29},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{982, 55, -333},0, {374, 45},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1107, -121, -226},0, {397, 29},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{798, 36, -321},0, {342, 42},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{982, 55, -333},0, {374, 45},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{986, -114, -230},0, {376, 29},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{954, -221, -165},0, {370, 19},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{1062, -334, -96},0, {390, 9},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{798, -297, -119},0, {343, 11},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{866, -473, -12},0, {356, -5},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{879, -129, -221},0, {357, 27},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{964, 143, -386},0, {371, 53},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{819, 272, -465},0, {345, 65},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{931, 107, -364},0, {365, 50},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{931, 55, -333},0, {365, 45},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{752, 191, -416},0, {356, 89},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{397, 305, -485},0, {418, 73},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{643, 340, -506},0, {374, 74},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{752, 191, -416},0, {356, 89},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{548, 112, -368},0, {393, 94},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{397, 305, -485},0, {418, 73},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{762, -65, -260},0, {356, 114},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{616, 44, -326},0, {381, 101},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{580, -53, -267},0, {388, 110},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{548, -262, -140},0, {396, 129},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{701, -193, -182},0, {368, 125},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{810, -373, -73},0, {350, 143},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{682, -476, -10},0, {374, 151},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{432, -475, -11},0, {418, 148},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{568, -475, -11},0, {394, 150},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{544, -44, -272},0, {395, 109},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{380, 347, -510},0, {477, 147},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{59, 56, -333},0, {418, 124},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{91, 347, -510},0, {426, 151},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{356, 119, -372},0, {471, 126},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{59, 56, -333},0, {418, 124},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{380, 347, -510},0, {477, 147},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{214, 78, -347},0, {446, 124},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{212, 22, -313},0, {445, 119},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{91, -471, -13},0, {420, 74},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{220, -190, -184},0, {445, 99},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{338, 4, -302},0, {467, 115},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{332, -171, -195},0, {465, 99},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{230, -249, -148},0, {446, 93},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{366, -251, -147},0, {470, 91},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{416, -471, -13},0, {477, 69},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{25, 156, -394},0, {422, 179},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-316, 296, -479},0, {483, 165},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-99, 346, -509},0, {444, 161},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-181, 52, -331},0, {459, 189},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-101, -17, -289},0, {445, 195},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-181, 52, -331},0, {459, 189},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{25, 156, -394},0, {422, 179},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{51, -286, -126},0, {418, 221},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-101, -137, -216},0, {445, 207},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-181, -189, -185},0, {459, 211},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-316, -472, -13},0, {483, 238},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-72, -472, -13},0, {439, 238},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-316, 296, -479},0, {483, 165},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-555, 343, -508},0, {442, 317},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-723, -460, -20},0, {418, 239},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-644, 343, -508},0, {426, 316},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-471, 88, -353},0, {458, 294},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-557, -207, -173},0, {445, 265},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-356, -470, -14},0, {482, 242},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-327, 304, -484},0, {482, 316},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-327, 304, -484},0, {482, 316},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-471, 88, -353},0, {458, 294},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-464, 343, -508},0, {458, 318},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-356, -470, -14},0, {482, 242},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-470, -456, -22},0, {462, 242},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-557, -207, -173},0, {445, 265},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-582, -471, -13},0, {442, 239},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-723, -460, -20},0, {418, 239},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-740, 347, -510},0, {341, 69},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1061, 56, -333},0, {283, 46},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1029, 347, -510},0, {290, 73},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-764, 119, -372},0, {335, 48},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-906, 78, -347},0, {310, 46},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-908, 22, -313},0, {309, 41},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1029, -471, -13},0, {284, -4},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-900, -190, -184},0, {309, 21},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-782, 4, -302},0, {331, 37},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-900, -190, -184},0, {309, 21},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-908, 22, -313},0, {309, 41},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-788, -171, -195},0, {329, 21},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-890, -249, -148},0, {310, 15},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1029, -471, -13},0, {284, -4},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-754, -251, -147},0, {334, 13},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-704, -471, -13},0, {341, -9},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1107, 191, -416},0, {288, 89},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1461, 305, -485},0, {350, 73},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1216, 340, -506},0, {307, 74},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1311, 112, -368},0, {325, 94},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1097, -65, -260},0, {289, 114},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1243, 44, -326},0, {313, 101},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1279, -53, -267},0, {321, 110},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1311, -262, -140},0, {328, 129},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1158, -193, -182},0, {300, 125},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1311, -262, -140},0, {328, 129},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1097, -65, -260},0, {289, 114},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1049, -373, -73},0, {283, 143},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1177, -476, -10},0, {306, 151},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1427, -475, -11},0, {350, 148},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1279, -53, -267},0, {321, 110},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1291, -475, -11},0, {326, 150},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1315, -44, -272},0, {327, 109},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1311, 112, -368},0, {325, 94},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1461, 305, -485},0, {350, 73},{0x0, 0xBE, 0x93, 0xFF}}}, + {{{-1216, 473, -288},0, {333, 152},{0x34, 0x63, 0xC4, 0xFF}}}, + {{{-1107, 324, -197},0, {295, 180},{0x79, 0x20, 0xED, 0xFF}}}, + {{{-1107, 191, -416},0, {336, 214},{0x79, 0x20, 0xED, 0xFF}}}, + {{{-1097, -65, -260},0, {333, 231},{0x7D, 0xED, 0xC, 0xFF}}}, + {{{-1097, 68, -41},0, {283, 224},{0x7D, 0xED, 0xC, 0xFF}}}, + {{{-1097, 68, -41},0, {283, 224},{0x7D, 0xED, 0xC, 0xFF}}}, + {{{-1158, -193, -182},0, {341, 241},{0x7F, 0x5, 0xFD, 0xFF}}}, + {{{-1097, -65, -260},0, {333, 231},{0x7D, 0xED, 0xC, 0xFF}}}, + {{{-1158, -60, 37},0, {286, 250},{0x7F, 0x5, 0xFD, 0xFF}}}, + {{{-1049, -373, -73},0, {335, 263},{0x7D, 0xEE, 0xB, 0xFF}}}, + {{{-1049, -240, 146},0, {296, 281},{0x7D, 0xEE, 0xB, 0xFF}}}, + {{{-1177, -476, -10},0, {349, 268},{0xEC, 0x95, 0x41, 0xFF}}}, + {{{-1177, -343, 209},0, {326, 307},{0xEC, 0x95, 0x41, 0xFF}}}, + {{{-1311, -262, -140},0, {363, 277},{0x24, 0x98, 0x3F, 0xFF}}}, + {{{-1311, -130, 79},0, {365, 318},{0x24, 0x98, 0x3F, 0xFF}}}, + {{{-1291, -475, -11},0, {367, 264},{0x5D, 0xB6, 0x2D, 0xFF}}}, + {{{-1291, -342, 208},0, {396, 304},{0x5D, 0xB6, 0x2D, 0xFF}}}, + {{{-1427, -475, -11},0, {380, 260},{0xA8, 0xB2, 0x30, 0xFF}}}, + {{{-1427, -342, 208},0, {417, 288},{0xA8, 0xB2, 0x30, 0xFF}}}, + {{{-1461, 305, -485},0, {370, 210},{0x9E, 0x45, 0xD6, 0xFF}}}, + {{{-1461, 438, -266},0, {417, 172},{0x9E, 0x45, 0xD6, 0xFF}}}, + {{{-1461, 438, -266},0, {417, 172},{0x9E, 0x45, 0xD6, 0xFF}}}, + {{{-1216, 340, -506},0, {347, 206},{0x34, 0x63, 0xC4, 0xFF}}}, + {{{-1461, 305, -485},0, {370, 210},{0x9E, 0x45, 0xD6, 0xFF}}}, + {{{-1216, 473, -288},0, {333, 152},{0x34, 0x63, 0xC4, 0xFF}}}, + {{{-1107, 191, -416},0, {336, 214},{0x79, 0x20, 0xED, 0xFF}}}, + {{{-1311, 245, -149},0, {130, 152},{0x2B, 0x9A, 0x3E, 0xFF}}}, + {{{-1315, 89, -54},0, {120, 136},{0x66, 0x40, 0xD8, 0xFF}}}, + {{{-1315, -44, -272},0, {139, 167},{0x66, 0x40, 0xD8, 0xFF}}}, + {{{-1279, -53, -267},0, {124, 167},{0xC4, 0x60, 0xC5, 0xFF}}}, + {{{-1279, 80, -48},0, {124, 132},{0xC4, 0x60, 0xC5, 0xFF}}}, + {{{-1243, 44, -326},0, {110, 141},{0x84, 0xEA, 0xD, 0xFF}}}, + {{{-1243, 177, -107},0, {136, 137},{0x84, 0xEA, 0xD, 0xFF}}}, + {{{-1311, 112, -368},0, {139, 126},{0x2B, 0x9A, 0x3E, 0xFF}}}, + {{{-1029, 480, -292},0, {140, 469},{0xAB, 0x50, 0xCF, 0xFF}}}, + {{{-740, 480, -292},0, {140, 377},{0x5E, 0x49, 0xD4, 0xFF}}}, + {{{-740, 347, -510},0, {95, 395},{0x5E, 0x49, 0xD4, 0xFF}}}, + {{{-740, 480, -292},0, {140, 377},{0x5E, 0x49, 0xD4, 0xFF}}}, + {{{-764, 119, -372},0, {81, 388},{0x63, 0xBC, 0x29, 0xFF}}}, + {{{-740, 347, -510},0, {95, 395},{0x5E, 0x49, 0xD4, 0xFF}}}, + {{{-764, 252, -153},0, {117, 351},{0x63, 0xBC, 0x29, 0xFF}}}, + {{{-906, 78, -347},0, {72, 366},{0x66, 0xC0, 0x28, 0xFF}}}, + {{{-906, 211, -128},0, {91, 333},{0x66, 0xC0, 0x28, 0xFF}}}, + {{{-908, 22, -313},0, {68, 365},{0x62, 0x45, 0xD6, 0xFF}}}, + {{{-908, 155, -94},0, {85, 330},{0x62, 0x45, 0xD6, 0xFF}}}, + {{{-782, 4, -302},0, {54, 359},{0x62, 0x45, 0xD6, 0xFF}}}, + {{{-782, 137, -83},0, {60, 322},{0x62, 0x45, 0xD6, 0xFF}}}, + {{{-788, -171, -195},0, {44, 363},{0x61, 0xBA, 0x2B, 0xFF}}}, + {{{-788, -38, 23},0, {41, 323},{0x61, 0xBA, 0x2B, 0xFF}}}, + {{{-900, -190, -184},0, {34, 354},{0x68, 0xC1, 0x26, 0xFF}}}, + {{{-900, -57, 35},0, {22, 326},{0x68, 0xC1, 0x26, 0xFF}}}, + {{{-890, -249, -148},0, {32, 356},{0x54, 0x51, 0xCE, 0xFF}}}, + {{{-890, -116, 71},0, {16, 329},{0x54, 0x51, 0xCE, 0xFF}}}, + {{{-890, -116, 71},0, {16, 329},{0x54, 0x51, 0xCE, 0xFF}}}, + {{{-754, -251, -147},0, {39, 373},{0x51, 0x53, 0xCD, 0xFF}}}, + {{{-890, -249, -148},0, {32, 356},{0x54, 0x51, 0xCE, 0xFF}}}, + {{{-754, -119, 72},0, {-5, 353},{0x51, 0x53, 0xCD, 0xFF}}}, + {{{-704, -471, -13},0, {30, 387},{0x62, 0xBB, 0x2A, 0xFF}}}, + {{{-704, -338, 205},0, {-16, 378},{0x62, 0xBB, 0x2A, 0xFF}}}, + {{{-1029, -471, -13},0, {44, 431},{0xA8, 0xB1, 0x30, 0xFF}}}, + {{{-1029, -338, 205},0, {1, 469},{0xA8, 0xB1, 0x30, 0xFF}}}, + {{{-1061, 56, -333},0, {79, 435},{0x81, 0x2, 0xFF, 0xFF}}}, + {{{-1061, 189, -115},0, {91, 496},{0x81, 0x2, 0xFF, 0xFF}}}, + {{{-1029, 347, -510},0, {99, 426},{0xAB, 0x50, 0xCF, 0xFF}}}, + {{{-1029, 480, -292},0, {140, 469},{0xAB, 0x50, 0xCF, 0xFF}}}, + {{{-740, 347, -510},0, {95, 395},{0x5E, 0x49, 0xD4, 0xFF}}}, + {{{-723, -327, 199},0, {122, 167},{0x9F, 0xBA, 0x2B, 0xFF}}}, + {{{-644, 476, -290},0, {4, 171},{0xAA, 0x50, 0xD0, 0xFF}}}, + {{{-644, 343, -508},0, {36, 209},{0xAA, 0x50, 0xD0, 0xFF}}}, + {{{-644, 476, -290},0, {4, 171},{0xAA, 0x50, 0xD0, 0xFF}}}, + {{{-555, 343, -508},0, {32, 222},{0x4D, 0x57, 0xCB, 0xFF}}}, + {{{-644, 343, -508},0, {36, 209},{0xAA, 0x50, 0xD0, 0xFF}}}, + {{{-555, 476, -290},0, {-11, 194},{0x4D, 0x57, 0xCB, 0xFF}}}, + {{{-471, 88, -353},0, {43, 240},{0xF0, 0x6C, 0xBF, 0xFF}}}, + {{{-471, 221, -134},0, {-15, 239},{0xF0, 0x6C, 0xBF, 0xFF}}}, + {{{-464, 343, -508},0, {29, 254},{0xB7, 0x59, 0xCA, 0xFF}}}, + {{{-464, 476, -290},0, {-16, 262},{0xB7, 0x59, 0xCA, 0xFF}}}, + {{{-327, 304, -484},0, {39, 271},{0x68, 0x3E, 0xDA, 0xFF}}}, + {{{-327, 437, -265},0, {-2, 299},{0x68, 0x3E, 0xDA, 0xFF}}}, + {{{-356, -470, -14},0, {74, 276},{0x52, 0xAD, 0x32, 0xFF}}}, + {{{-356, -337, 205},0, {96, 322},{0x52, 0xAD, 0x32, 0xFF}}}, + {{{-470, -456, -22},0, {82, 267},{0xAE, 0xAE, 0x33, 0xFF}}}, + {{{-470, -323, 197},0, {124, 298},{0xAE, 0xAE, 0x33, 0xFF}}}, + {{{-557, -207, -173},0, {77, 242},{0xD, 0x94, 0x41, 0xFF}}}, + {{{-557, -74, 45},0, {139, 249},{0xD, 0x94, 0x41, 0xFF}}}, + {{{-557, -74, 45},0, {139, 249},{0xD, 0x94, 0x41, 0xFF}}}, + {{{-582, -471, -13},0, {84, 221},{0x51, 0xAD, 0x33, 0xFF}}}, + {{{-557, -207, -173},0, {77, 242},{0xD, 0x94, 0x41, 0xFF}}}, + {{{-582, -338, 205},0, {139, 210},{0x51, 0xAD, 0x33, 0xFF}}}, + {{{-723, -460, -20},0, {77, 204},{0x9F, 0xBA, 0x2B, 0xFF}}}, + {{{-723, -327, 199},0, {122, 167},{0x9F, 0xBA, 0x2B, 0xFF}}}, + {{{-644, 343, -508},0, {36, 209},{0xAA, 0x50, 0xD0, 0xFF}}}, + {{{-99, 479, -291},0, {185, 6},{0x32, 0x64, 0xC4, 0xFF}}}, + {{{25, 289, -176},0, {141, 41},{0x7A, 0x1E, 0xEE, 0xFF}}}, + {{{25, 156, -394},0, {190, 73},{0x7A, 0x1E, 0xEE, 0xFF}}}, + {{{51, -286, -126},0, {192, 94},{0x7C, 0xE7, 0xF, 0xFF}}}, + {{{51, -153, 93},0, {142, 121},{0x7C, 0xE7, 0xF, 0xFF}}}, + {{{-72, -472, -13},0, {204, 100},{0x41, 0xA3, 0x39, 0xFF}}}, + {{{-72, -339, 206},0, {185, 155},{0x41, 0xA3, 0x39, 0xFF}}}, + {{{-316, -472, -13},0, {223, 93},{0xA6, 0xB4, 0x2F, 0xFF}}}, + {{{-316, -339, 206},0, {263, 138},{0xA6, 0xB4, 0x2F, 0xFF}}}, + {{{-316, -339, 206},0, {263, 138},{0xA6, 0xB4, 0x2F, 0xFF}}}, + {{{-316, 296, -479},0, {219, 62},{0x9B, 0x42, 0xD8, 0xFF}}}, + {{{-316, -472, -13},0, {223, 93},{0xA6, 0xB4, 0x2F, 0xFF}}}, + {{{-316, 429, -261},0, {263, 22},{0x9B, 0x42, 0xD8, 0xFF}}}, + {{{-99, 346, -509},0, {201, 62},{0x32, 0x64, 0xC4, 0xFF}}}, + {{{-99, 479, -291},0, {185, 6},{0x32, 0x64, 0xC4, 0xFF}}}, + {{{25, 156, -394},0, {190, 73},{0x7A, 0x1E, 0xEE, 0xFF}}}, + {{{-181, 184, -112},0, {475, 405},{0x31, 0x9C, 0x3D, 0xFF}}}, + {{{-181, -56, 34},0, {466, 390},{0x38, 0x61, 0xC5, 0xFF}}}, + {{{-181, -189, -185},0, {482, 431},{0x38, 0x61, 0xC5, 0xFF}}}, + {{{-101, -137, -216},0, {443, 413},{0x8E, 0x30, 0xE2, 0xFF}}}, + {{{-101, -4, 2},0, {478, 387},{0x8E, 0x30, 0xE2, 0xFF}}}, + {{{-101, -17, -289},0, {446, 386},{0x8B, 0xD6, 0x19, 0xFF}}}, + {{{-101, 116, -71},0, {482, 395},{0x8B, 0xD6, 0x19, 0xFF}}}, + {{{-181, 52, -331},0, {479, 379},{0x31, 0x9C, 0x3D, 0xFF}}}, + {{{91, 480, -292},0, {246, 384},{0xAB, 0x50, 0xCF, 0xFF}}}, + {{{380, 480, -292},0, {250, 417},{0x5E, 0x49, 0xD4, 0xFF}}}, + {{{380, 347, -510},0, {293, 437},{0x5E, 0x49, 0xD4, 0xFF}}}, + {{{356, 119, -372},0, {277, 458},{0x63, 0xBC, 0x29, 0xFF}}}, + {{{356, 252, -153},0, {236, 427},{0x63, 0xBC, 0x29, 0xFF}}}, + {{{214, 78, -347},0, {251, 483},{0x66, 0xC0, 0x28, 0xFF}}}, + {{{214, 211, -128},0, {230, 448},{0x66, 0xC0, 0x28, 0xFF}}}, + {{{212, 22, -313},0, {246, 486},{0x62, 0x45, 0xD6, 0xFF}}}, + {{{212, 155, -94},0, {226, 450},{0x62, 0x45, 0xD6, 0xFF}}}, + {{{338, 4, -302},0, {219, 495},{0x62, 0x45, 0xD6, 0xFF}}}, + {{{338, 137, -83},0, {213, 457},{0x62, 0x45, 0xD6, 0xFF}}}, + {{{332, -171, -195},0, {203, 496},{0x61, 0xBA, 0x2B, 0xFF}}}, + {{{332, -38, 23},0, {202, 454},{0x61, 0xBA, 0x2B, 0xFF}}}, + {{{220, -190, -184},0, {178, 491},{0x68, 0xC1, 0x26, 0xFF}}}, + {{{220, -57, 35},0, {194, 465},{0x68, 0xC1, 0x26, 0xFF}}}, + {{{230, -249, -148},0, {173, 488},{0x54, 0x51, 0xCE, 0xFF}}}, + {{{220, -57, 35},0, {194, 465},{0x68, 0xC1, 0x26, 0xFF}}}, + {{{230, -116, 71},0, {192, 463},{0x54, 0x51, 0xCE, 0xFF}}}, + {{{230, -249, -148},0, {173, 488},{0x54, 0x51, 0xCE, 0xFF}}}, + {{{366, -251, -147},0, {157, 468},{0x51, 0x53, 0xCD, 0xFF}}}, + {{{366, -119, 72},0, {196, 445},{0x51, 0x53, 0xCD, 0xFF}}}, + {{{416, -471, -13},0, {141, 441},{0x62, 0xBB, 0x2A, 0xFF}}}, + {{{416, -338, 205},0, {186, 432},{0x62, 0xBB, 0x2A, 0xFF}}}, + {{{91, -471, -13},0, {151, 345},{0xA8, 0xB1, 0x30, 0xFF}}}, + {{{91, -338, 205},0, {190, 391},{0xA8, 0xB1, 0x30, 0xFF}}}, + {{{59, 56, -333},0, {243, 318},{0x81, 0x2, 0xFF, 0xFF}}}, + {{{59, 189, -115},0, {225, 379},{0x81, 0x2, 0xFF, 0xFF}}}, + {{{91, 347, -510},0, {293, 352},{0xAB, 0x50, 0xCF, 0xFF}}}, + {{{91, 480, -292},0, {246, 384},{0xAB, 0x50, 0xCF, 0xFF}}}, + {{{380, 347, -510},0, {293, 437},{0x5E, 0x49, 0xD4, 0xFF}}}, + {{{643, 473, -288},0, {215, 200},{0x34, 0x63, 0xC4, 0xFF}}}, + {{{752, 324, -197},0, {226, 207},{0x79, 0x20, 0xED, 0xFF}}}, + {{{752, 191, -416},0, {267, 181},{0x79, 0x20, 0xED, 0xFF}}}, + {{{762, -65, -260},0, {280, 217},{0x7D, 0xED, 0xC, 0xFF}}}, + {{{762, 68, -41},0, {227, 222},{0x7D, 0xED, 0xC, 0xFF}}}, + {{{701, -193, -182},0, {282, 236},{0x7F, 0x5, 0xFD, 0xFF}}}, + {{{701, -60, 37},0, {222, 234},{0x7F, 0x5, 0xFD, 0xFF}}}, + {{{810, -373, -73},0, {282, 278},{0x7D, 0xEE, 0xB, 0xFF}}}, + {{{810, -240, 146},0, {239, 258},{0x7D, 0xEE, 0xB, 0xFF}}}, + {{{682, -476, -10},0, {256, 312},{0xEC, 0x95, 0x41, 0xFF}}}, + {{{682, -343, 209},0, {234, 270},{0xEC, 0x95, 0x41, 0xFF}}}, + {{{548, -262, -140},0, {201, 318},{0x24, 0x98, 0x3F, 0xFF}}}, + {{{548, -130, 79},0, {218, 271},{0x24, 0x98, 0x3F, 0xFF}}}, + {{{568, -475, -11},0, {175, 305},{0x5D, 0xB6, 0x2D, 0xFF}}}, + {{{568, -342, 208},0, {207, 257},{0x5D, 0xB6, 0x2D, 0xFF}}}, + {{{432, -475, -11},0, {141, 273},{0xA8, 0xB2, 0x30, 0xFF}}}, + {{{568, -342, 208},0, {207, 257},{0x5D, 0xB6, 0x2D, 0xFF}}}, + {{{432, -342, 208},0, {191, 252},{0xA8, 0xB2, 0x30, 0xFF}}}, + {{{432, -475, -11},0, {141, 273},{0xA8, 0xB2, 0x30, 0xFF}}}, + {{{397, 305, -485},0, {166, 156},{0x9E, 0x45, 0xD6, 0xFF}}}, + {{{397, 438, -266},0, {198, 204},{0x9E, 0x45, 0xD6, 0xFF}}}, + {{{643, 340, -506},0, {238, 155},{0x34, 0x63, 0xC4, 0xFF}}}, + {{{643, 473, -288},0, {215, 200},{0x34, 0x63, 0xC4, 0xFF}}}, + {{{752, 191, -416},0, {267, 181},{0x79, 0x20, 0xED, 0xFF}}}, + {{{548, 245, -149},0, {496, 431},{0x2B, 0x9A, 0x3E, 0xFF}}}, + {{{544, 89, -54},0, {443, 468},{0x66, 0x40, 0xD8, 0xFF}}}, + {{{544, -44, -272},0, {475, 464},{0x66, 0x40, 0xD8, 0xFF}}}, + {{{580, -53, -267},0, {476, 463},{0xC4, 0x60, 0xC5, 0xFF}}}, + {{{580, 80, -48},0, {449, 487},{0xC4, 0x60, 0xC5, 0xFF}}}, + {{{616, 44, -326},0, {475, 463},{0x84, 0xEA, 0xD, 0xFF}}}, + {{{616, 177, -107},0, {496, 496},{0x84, 0xEA, 0xD, 0xFF}}}, + {{{548, 112, -368},0, {475, 463},{0x2B, 0x9A, 0x3E, 0xFF}}}, + {{{978, 482, -293},0, {80, 159},{0x1D, 0x69, 0xBF, 0xFF}}}, + {{{1113, 312, -190},0, {110, 123},{0x7A, 0x1F, 0xED, 0xFF}}}, + {{{1113, 179, -408},0, {63, 106},{0x7A, 0x1F, 0xED, 0xFF}}}, + {{{1107, -121, -226},0, {60, 90},{0x7E, 0xF5, 0x7, 0xFF}}}, + {{{1107, 11, -7},0, {110, 73},{0x7E, 0xF5, 0x7, 0xFF}}}, + {{{1062, -334, -96},0, {53, 78},{0x6D, 0xC9, 0x22, 0xFF}}}, + {{{1062, -201, 122},0, {92, 40},{0x6D, 0xC9, 0x22, 0xFF}}}, + {{{866, -473, -12},0, {32, 63},{0xDD, 0x98, 0x40, 0xFF}}}, + {{{866, -340, 207},0, {25, 14},{0xDD, 0x98, 0x40, 0xFF}}}, + {{{798, -297, -119},0, {23, 70},{0x89, 0x27, 0xE8, 0xFF}}}, + {{{798, -164, 99},0, {-10, 34},{0x89, 0x27, 0xE8, 0xFF}}}, + {{{954, -221, -165},0, {35, 83},{0x9B, 0x42, 0xD8, 0xFF}}}, + {{{954, -88, 53},0, {-16, 87},{0x9B, 0x42, 0xD8, 0xFF}}}, + {{{986, -114, -230},0, {36, 94},{0xA3, 0xB6, 0x2D, 0xFF}}}, + {{{986, 19, -12},0, {-14, 99},{0xA3, 0xB6, 0x2D, 0xFF}}}, + {{{879, -129, -221},0, {32, 109},{0xC3, 0xA1, 0x39, 0xFF}}}, + {{{986, 19, -12},0, {-14, 99},{0xA3, 0xB6, 0x2D, 0xFF}}}, + {{{879, 4, -2},0, {-10, 121},{0xC3, 0xA1, 0x39, 0xFF}}}, + {{{879, -129, -221},0, {32, 109},{0xC3, 0xA1, 0x39, 0xFF}}}, + {{{798, 36, -321},0, {36, 120},{0x83, 0xEF, 0xB, 0xFF}}}, + {{{798, 169, -103},0, {4, 148},{0x83, 0xEF, 0xB, 0xFF}}}, + {{{819, 272, -465},0, {44, 125},{0x95, 0x3A, 0xDC, 0xFF}}}, + {{{819, 405, -246},0, {33, 167},{0x95, 0x3A, 0xDC, 0xFF}}}, + {{{978, 349, -512},0, {55, 118},{0x1D, 0x69, 0xBF, 0xFF}}}, + {{{978, 482, -293},0, {80, 159},{0x1D, 0x69, 0xBF, 0xFF}}}, + {{{1113, 179, -408},0, {63, 106},{0x7A, 0x1F, 0xED, 0xFF}}}, + {{{931, 188, -114},0, {264, 146},{0x5A, 0x4C, 0xD1, 0xFF}}}, + {{{982, 188, -114},0, {272, 155},{0xAB, 0x50, 0xCF, 0xFF}}}, + {{{982, 55, -333},0, {272, 36},{0xAB, 0x50, 0xCF, 0xFF}}}, + {{{987, 107, -364},0, {269, 40},{0x84, 0xE9, 0xE, 0xFF}}}, + {{{987, 239, -146},0, {270, 147},{0x84, 0xE9, 0xE, 0xFF}}}, + {{{964, 143, -386},0, {267, 42},{0xF6, 0x94, 0x42, 0xFF}}}, + {{{987, 239, -146},0, {270, 147},{0x84, 0xE9, 0xE, 0xFF}}}, + {{{964, 276, -168},0, {267, 142},{0xF6, 0x94, 0x42, 0xFF}}}, + {{{964, 143, -386},0, {267, 42},{0xF6, 0x94, 0x42, 0xFF}}}, + {{{931, 107, -364},0, {269, 43},{0x78, 0xDC, 0x16, 0xFF}}}, + {{{931, 239, -146},0, {267, 142},{0x78, 0xDC, 0x16, 0xFF}}}, + {{{931, 55, -333},0, {268, 42},{0x5A, 0x4C, 0xD1, 0xFF}}}, + {{{931, 188, -114},0, {264, 146},{0x5A, 0x4C, 0xD1, 0xFF}}}, + {{{982, 55, -333},0, {272, 36},{0xAB, 0x50, 0xCF, 0xFF}}}, + {{{1221, 451, -274},0, {394, 495},{0xAA, 0x4F, 0xCF, 0xFF}}}, + {{{1328, 481, -292},0, {425, 477},{0x7, 0x6C, 0xBE, 0xFF}}}, + {{{1328, 348, -511},0, {395, 436},{0x7, 0x6C, 0xBE, 0xFF}}}, + {{{1434, 307, -486},0, {404, 426},{0x6F, 0x35, 0xE0, 0xFF}}}, + {{{1434, 440, -267},0, {443, 450},{0x6F, 0x35, 0xE0, 0xFF}}}, + {{{1394, 76, -345},0, {399, 417},{0x2E, 0x9B, 0x3E, 0xFF}}}, + {{{1394, 209, -127},0, {443, 414},{0x2E, 0x9B, 0x3E, 0xFF}}}, + {{{1299, 142, -386},0, {409, 406},{0x17, 0x95, 0x40, 0xFF}}}, + {{{1394, 209, -127},0, {443, 414},{0x2E, 0x9B, 0x3E, 0xFF}}}, + {{{1299, 275, -167},0, {439, 397},{0x17, 0x95, 0x40, 0xFF}}}, + {{{1299, 142, -386},0, {409, 406},{0x17, 0x95, 0x40, 0xFF}}}, + {{{1255, 77, -346},0, {409, 402},{0x79, 0xE0, 0x14, 0xFF}}}, + {{{1255, 210, -128},0, {435, 387},{0x79, 0xE0, 0x14, 0xFF}}}, + {{{1249, 15, -309},0, {407, 400},{0x5F, 0x48, 0xD4, 0xFF}}}, + {{{1249, 148, -90},0, {432, 382},{0x5F, 0x48, 0xD4, 0xFF}}}, + {{{1376, 9, -305},0, {394, 411},{0x50, 0x54, 0xCC, 0xFF}}}, + {{{1376, 141, -86},0, {406, 364},{0x50, 0x54, 0xCC, 0xFF}}}, + {{{1426, -143, -212},0, {382, 409},{0x7E, 0xF, 0xF7, 0xFF}}}, + {{{1426, -11, 6},0, {387, 360},{0x7E, 0xF, 0xF7, 0xFF}}}, + {{{1425, -342, -92},0, {367, 398},{0x7C, 0xE8, 0xE, 0xFF}}}, + {{{1425, -209, 127},0, {362, 357},{0x7C, 0xE8, 0xE, 0xFF}}}, + {{{1354, -473, -12},0, {355, 400},{0x45, 0xA5, 0x38, 0xFF}}}, + {{{1354, -340, 207},0, {335, 361},{0x45, 0xA5, 0x38, 0xFF}}}, + {{{1210, -473, -12},0, {346, 411},{0xBF, 0xA3, 0x38, 0xFF}}}, + {{{1354, -340, 207},0, {335, 361},{0x45, 0xA5, 0x38, 0xFF}}}, + {{{1210, -340, 207},0, {300, 392},{0xBF, 0xA3, 0x38, 0xFF}}}, + {{{1210, -473, -12},0, {346, 411},{0xBF, 0xA3, 0x38, 0xFF}}}, + {{{1130, -342, -92},0, {347, 422},{0x85, 0xE6, 0x10, 0xFF}}}, + {{{1130, -209, 127},0, {293, 428},{0x85, 0xE6, 0x10, 0xFF}}}, + {{{1130, -65, -260},0, {358, 435},{0x81, 0x3, 0xFE, 0xFF}}}, + {{{1130, 68, -41},0, {318, 476},{0x81, 0x3, 0xFE, 0xFF}}}, + {{{1146, 159, -396},0, {370, 443},{0x84, 0x18, 0xF1, 0xFF}}}, + {{{1146, 292, -178},0, {355, 496},{0x84, 0x18, 0xF1, 0xFF}}}, + {{{1221, 318, -493},0, {384, 443},{0xAA, 0x4F, 0xCF, 0xFF}}}, + {{{1221, 451, -274},0, {394, 495},{0xAA, 0x4F, 0xCF, 0xFF}}}, + {{{1328, 348, -511},0, {395, 436},{0x7, 0x6C, 0xBE, 0xFF}}}, + {{{1282, -47, 29},0, {466, 379},{0xA, 0x94, 0x42, 0xFF}}}, + {{{1255, -72, 44},0, {485, 367},{0x77, 0xD9, 0x18, 0xFF}}}, + {{{1255, -205, -175},0, {463, 353},{0x77, 0xD9, 0x18, 0xFF}}}, + {{{1256, -270, -135},0, {463, 353},{0x59, 0x4D, 0xD1, 0xFF}}}, + {{{1255, -72, 44},0, {485, 367},{0x77, 0xD9, 0x18, 0xFF}}}, + {{{1256, -137, 83},0, {485, 338},{0x59, 0x4D, 0xD1, 0xFF}}}, + {{{1256, -270, -135},0, {463, 353},{0x59, 0x4D, 0xD1, 0xFF}}}, + {{{1302, -270, -135},0, {463, 353},{0xAC, 0x51, 0xCE, 0xFF}}}, + {{{1302, -137, 83},0, {443, 338},{0xAC, 0x51, 0xCE, 0xFF}}}, + {{{1312, -200, -178},0, {463, 353},{0x8B, 0xD6, 0x1A, 0xFF}}}, + {{{1312, -67, 41},0, {445, 370},{0x8B, 0xD6, 0x1A, 0xFF}}}, + {{{1282, -180, -190},0, {463, 353},{0xA, 0x94, 0x42, 0xFF}}}, + {{{1282, -47, 29},0, {466, 379},{0xA, 0x94, 0x42, 0xFF}}}, + {{{1255, -205, -175},0, {463, 353},{0x77, 0xD9, 0x18, 0xFF}}}, +}; + +Gfx titletest_test_mesh_tri_1[] = { + gsSPVertex(titletest_test_mesh_vtx_1 + 0, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(4, 3, 0, 0), + gsSP1Triangle(5, 4, 0, 0), + gsSP1Triangle(4, 6, 3, 0), + gsSP1Triangle(7, 6, 4, 0), + gsSP1Triangle(8, 6, 7, 0), + gsSP1Triangle(9, 6, 8, 0), + gsSP1Triangle(10, 6, 9, 0), + gsSP1Triangle(10, 11, 6, 0), + gsSP1Triangle(12, 11, 10, 0), + gsSP1Triangle(13, 12, 10, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 16, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 1, 0, 0), + gsSP1Triangle(4, 2, 5, 0), + gsSP1Triangle(5, 2, 6, 0), + gsSP1Triangle(6, 2, 7, 0), + gsSP1Triangle(8, 6, 7, 0), + gsSP1Triangle(9, 10, 11, 0), + gsSP1Triangle(9, 12, 10, 0), + gsSP1Triangle(13, 12, 9, 0), + gsSP1Triangle(14, 13, 9, 0), + gsSP1Triangle(14, 15, 13, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 32, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(0, 4, 3, 0), + gsSP1Triangle(5, 4, 0, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(3, 8, 1, 0), + gsSP1Triangle(9, 1, 10, 0), + gsSP1Triangle(11, 1, 9, 0), + gsSP1Triangle(12, 1, 11, 0), + gsSP1Triangle(2, 1, 12, 0), + gsSP1Triangle(13, 14, 15, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 48, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 1, 0, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(3, 6, 5, 0), + gsSP1Triangle(7, 6, 3, 0), + gsSP1Triangle(8, 6, 7, 0), + gsSP1Triangle(8, 9, 6, 0), + gsSP1Triangle(6, 10, 5, 0), + gsSP1Triangle(11, 10, 6, 0), + gsSP1Triangle(5, 10, 12, 0), + gsSP1Triangle(12, 10, 1, 0), + gsSP1Triangle(1, 10, 2, 0), + gsSP1Triangle(13, 14, 15, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 64, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 1, 0, 0), + gsSP1Triangle(4, 1, 3, 0), + gsSP1Triangle(4, 5, 1, 0), + gsSP1Triangle(6, 5, 4, 0), + gsSP1Triangle(7, 6, 4, 0), + gsSP1Triangle(8, 6, 7, 0), + gsSP1Triangle(9, 5, 6, 0), + gsSP1Triangle(10, 5, 9, 0), + gsSP1Triangle(11, 5, 10, 0), + gsSP1Triangle(12, 13, 14, 0), + gsSP1Triangle(12, 15, 13, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 80, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 0, 2, 0), + gsSP1Triangle(3, 4, 0, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(3, 6, 5, 0), + gsSP1Triangle(7, 6, 3, 0), + gsSP1Triangle(5, 6, 1, 0), + gsSP1Triangle(1, 6, 8, 0), + gsSP1Triangle(9, 10, 11, 0), + gsSP1Triangle(12, 10, 9, 0), + gsSP1Triangle(13, 10, 12, 0), + gsSP1Triangle(14, 13, 12, 0), + gsSP1Triangle(14, 12, 15, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 96, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 4, 5, 0), + gsSP1Triangle(6, 7, 5, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(11, 9, 8, 0), + gsSP1Triangle(12, 9, 11, 0), + gsSP1Triangle(13, 9, 12, 0), + gsSP1Triangle(13, 14, 9, 0), + gsSP1Triangle(15, 14, 13, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 112, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 1, 0, 0), + gsSP1Triangle(4, 5, 1, 0), + gsSP1Triangle(6, 5, 4, 0), + gsSP1Triangle(7, 5, 6, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(8, 11, 9, 0), + gsSP1Triangle(12, 11, 8, 0), + gsSP1Triangle(12, 13, 11, 0), + gsSP1Triangle(12, 14, 13, 0), + gsSP1Triangle(12, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 128, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 1, 0, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(1, 5, 6, 0), + gsSP1Triangle(7, 5, 1, 0), + gsSP1Triangle(6, 5, 8, 0), + gsSP1Triangle(8, 5, 9, 0), + gsSP1Triangle(9, 5, 10, 0), + gsSP1Triangle(11, 12, 13, 0), + gsSP1Triangle(12, 14, 13, 0), + gsSP1Triangle(12, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 144, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 160, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(5, 6, 7, 0), + gsSP1Triangle(6, 8, 7, 0), + gsSP1Triangle(6, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 5, 12, 0), + gsSP1Triangle(5, 7, 12, 0), + gsSP1Triangle(13, 14, 15, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 176, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 192, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(13, 14, 15, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 208, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 224, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(7, 8, 9, 0), + gsSP1Triangle(8, 10, 9, 0), + gsSP1Triangle(8, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 240, 15, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(7, 8, 9, 0), + gsSP1Triangle(8, 10, 9, 0), + gsSP1Triangle(8, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 7, 14, 0), + gsSP1Triangle(7, 9, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 255, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(1, 3, 2, 0), + gsSP1Triangle(1, 4, 3, 0), + gsSP1Triangle(4, 5, 3, 0), + gsSP1Triangle(4, 6, 5, 0), + gsSP1Triangle(6, 7, 5, 0), + gsSP1Triangle(6, 8, 7, 0), + gsSP1Triangle(8, 9, 7, 0), + gsSP1Triangle(8, 10, 9, 0), + gsSP1Triangle(10, 11, 9, 0), + gsSP1Triangle(10, 12, 11, 0), + gsSP1Triangle(12, 13, 11, 0), + gsSP1Triangle(12, 14, 13, 0), + gsSP1Triangle(14, 15, 13, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 271, 14, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(1, 3, 2, 0), + gsSP1Triangle(1, 4, 3, 0), + gsSP1Triangle(4, 5, 3, 0), + gsSP1Triangle(4, 6, 5, 0), + gsSP1Triangle(6, 7, 5, 0), + gsSP1Triangle(6, 8, 7, 0), + gsSP1Triangle(8, 9, 7, 0), + gsSP1Triangle(8, 10, 9, 0), + gsSP1Triangle(10, 11, 9, 0), + gsSP1Triangle(10, 12, 11, 0), + gsSP1Triangle(12, 13, 11, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 285, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(1, 3, 2, 0), + gsSP1Triangle(1, 4, 3, 0), + gsSP1Triangle(4, 5, 3, 0), + gsSP1Triangle(4, 6, 5, 0), + gsSP1Triangle(6, 7, 5, 0), + gsSP1Triangle(6, 8, 7, 0), + gsSP1Triangle(8, 9, 7, 0), + gsSP1Triangle(8, 10, 9, 0), + gsSP1Triangle(10, 11, 9, 0), + gsSP1Triangle(10, 12, 11, 0), + gsSP1Triangle(12, 13, 11, 0), + gsSP1Triangle(12, 14, 13, 0), + gsSP1Triangle(14, 15, 13, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 301, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(1, 3, 2, 0), + gsSP1Triangle(1, 4, 3, 0), + gsSP1Triangle(4, 5, 3, 0), + gsSP1Triangle(4, 6, 5, 0), + gsSP1Triangle(6, 7, 5, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(9, 12, 11, 0), + gsSP1Triangle(12, 13, 11, 0), + gsSP1Triangle(12, 14, 13, 0), + gsSP1Triangle(14, 15, 13, 0), + gsSP1Triangle(14, 8, 15, 0), + gsSP1Triangle(8, 10, 15, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 317, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(1, 3, 2, 0), + gsSP1Triangle(1, 4, 3, 0), + gsSP1Triangle(4, 5, 3, 0), + gsSP1Triangle(4, 6, 5, 0), + gsSP1Triangle(6, 7, 5, 0), + gsSP1Triangle(6, 8, 7, 0), + gsSP1Triangle(8, 9, 7, 0), + gsSP1Triangle(8, 10, 9, 0), + gsSP1Triangle(10, 11, 9, 0), + gsSP1Triangle(10, 12, 11, 0), + gsSP1Triangle(12, 13, 11, 0), + gsSP1Triangle(12, 14, 13, 0), + gsSP1Triangle(14, 15, 13, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 333, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(1, 3, 2, 0), + gsSP1Triangle(1, 4, 3, 0), + gsSP1Triangle(4, 5, 3, 0), + gsSP1Triangle(4, 6, 5, 0), + gsSP1Triangle(6, 7, 5, 0), + gsSP1Triangle(6, 8, 7, 0), + gsSP1Triangle(8, 9, 7, 0), + gsSP1Triangle(10, 11, 12, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(11, 14, 13, 0), + gsSP1Triangle(14, 15, 13, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 349, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(1, 3, 2, 0), + gsSP1Triangle(1, 4, 3, 0), + gsSP1Triangle(4, 5, 3, 0), + gsSP1Triangle(4, 6, 5, 0), + gsSP1Triangle(6, 7, 5, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(9, 12, 11, 0), + gsSP1Triangle(12, 13, 11, 0), + gsSP1Triangle(12, 14, 13, 0), + gsSP1Triangle(14, 15, 13, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 365, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(1, 3, 2, 0), + gsSP1Triangle(1, 4, 3, 0), + gsSP1Triangle(4, 5, 3, 0), + gsSP1Triangle(4, 6, 5, 0), + gsSP1Triangle(6, 7, 5, 0), + gsSP1Triangle(6, 8, 7, 0), + gsSP1Triangle(8, 9, 7, 0), + gsSP1Triangle(8, 10, 9, 0), + gsSP1Triangle(10, 11, 9, 0), + gsSP1Triangle(10, 12, 11, 0), + gsSP1Triangle(12, 13, 11, 0), + gsSP1Triangle(12, 14, 13, 0), + gsSP1Triangle(14, 15, 13, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 381, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(1, 3, 2, 0), + gsSP1Triangle(1, 4, 3, 0), + gsSP1Triangle(4, 5, 3, 0), + gsSP1Triangle(4, 6, 5, 0), + gsSP1Triangle(6, 7, 5, 0), + gsSP1Triangle(6, 8, 7, 0), + gsSP1Triangle(8, 9, 7, 0), + gsSP1Triangle(8, 10, 9, 0), + gsSP1Triangle(10, 11, 9, 0), + gsSP1Triangle(12, 13, 14, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_1 + 397, 10, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(1, 3, 2, 0), + gsSP1Triangle(1, 4, 3, 0), + gsSP1Triangle(4, 5, 3, 0), + gsSP1Triangle(4, 6, 5, 0), + gsSP1Triangle(6, 7, 5, 0), + gsSP1Triangle(6, 8, 7, 0), + gsSP1Triangle(8, 9, 7, 0), + gsSPEndDisplayList(), +};Vtx titletest_test_mesh_vtx_2[183] = { + {{{882, 571, -427},0, {220, 496},{0x0, 0x0, 0x7F, 0xFF}}}, + {{{932, 571, -427},0, {102, 496},{0x0, 0x0, 0x7F, 0xFF}}}, + {{{816, 571, -427},0, {260, 496},{0x0, 0x0, 0x7F, 0xFF}}}, + {{{815, 604, -449},0, {299, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{919, 663, -488},0, {378, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{859, 667, -490},0, {338, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{878, 625, -463},0, {496, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{861, 606, -450},0, {417, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{880, 606, -450},0, {457, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{929, 606, -450},0, {-16, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{963, 605, -450},0, {23, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{963, 572, -429},0, {63, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{816, 571, -427},0, {260, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{932, 571, -427},0, {102, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{883, 533, -403},0, {181, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{882, 571, -427},0, {220, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{883, 533, -403},0, {181, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{938, 538, -406},0, {142, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{932, 571, -427},0, {102, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{719, 662, -487},0, {-16, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{797, 660, -486},0, {38, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{758, 667, -490},0, {11, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{692, 636, -470},0, {361, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{748, 633, -468},0, {92, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{686, 599, -446},0, {334, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{732, 622, -461},0, {119, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{730, 612, -455},0, {146, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{776, 611, -454},0, {173, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{794, 586, -438},0, {200, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{742, 580, -434},0, {388, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{732, 576, -431},0, {415, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{686, 554, -416},0, {307, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{686, 554, -416},0, {307, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{732, 566, -424},0, {442, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{732, 576, -431},0, {415, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{749, 566, -424},0, {469, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{794, 554, -416},0, {227, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{715, 532, -402},0, {280, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{768, 532, -402},0, {253, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{752, 577, -432},0, {496, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{794, 586, -438},0, {200, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{742, 580, -434},0, {388, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{748, 633, -468},0, {92, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{782, 622, -461},0, {65, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{797, 660, -486},0, {38, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{418, 639, -472},0, {217, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{527, 664, -489},0, {-16, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{469, 666, -490},0, {263, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{418, 639, -472},0, {217, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{574, 615, -457},0, {31, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{527, 664, -489},0, {-16, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{481, 619, -459},0, {310, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{408, 583, -435},0, {170, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{470, 598, -446},0, {356, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{489, 588, -439},0, {403, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{561, 551, -415},0, {77, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{476, 533, -402},0, {124, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{509, 594, -443},0, {449, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{508, 614, -456},0, {496, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{337, 665, -489},0, {-16, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{411, 540, -407},0, {325, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{379, 668, -491},0, {155, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{343, 534, -403},0, {496, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{190, 660, -486},0, {338, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{319, 641, -474},0, {23, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{279, 665, -489},0, {-16, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{245, 628, -465},0, {378, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{202, 532, -402},0, {299, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{243, 602, -448},0, {417, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{257, 601, -447},0, {457, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{245, 567, -425},0, {220, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{252, 532, -402},0, {260, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{323, 599, -446},0, {63, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{301, 578, -432},0, {102, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{340, 549, -413},0, {142, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{294, 532, -402},0, {181, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{270, 617, -458},0, {496, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{89, 662, -487},0, {310, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{200, 542, -408},0, {31, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{132, 666, -490},0, {-16, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{116, 618, -458},0, {496, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{100, 619, -459},0, {356, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{3, 541, -408},0, {263, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{91, 600, -447},0, {403, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{124, 599, -446},0, {449, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{77, 566, -424},0, {170, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{65, 532, -402},0, {217, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{130, 565, -424},0, {124, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{135, 533, -403},0, {77, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-50, 665, -489},0, {155, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{35, 536, -405},0, {240, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-10, 666, -490},0, {197, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-77, 629, -466},0, {112, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-47, 597, -445},0, {368, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{35, 536, -405},0, {240, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-77, 629, -466},0, {112, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-117, 601, -447},0, {453, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-214, 546, -411},0, {-16, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-92, 665, -489},0, {69, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-137, 665, -489},0, {27, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-154, 536, -405},0, {496, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-87, 567, -425},0, {411, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-34, 565, -424},0, {325, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-23, 532, -402},0, {283, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-468, 660, -486},0, {338, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-339, 641, -474},0, {23, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-378, 665, -489},0, {-16, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-413, 628, -465},0, {378, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-455, 532, -402},0, {299, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-455, 532, -402},0, {299, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-414, 602, -448},0, {417, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-413, 628, -465},0, {378, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-401, 601, -447},0, {457, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-413, 567, -425},0, {220, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-406, 532, -402},0, {260, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-335, 599, -446},0, {63, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-357, 578, -432},0, {102, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-317, 549, -413},0, {142, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-364, 532, -402},0, {181, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-388, 617, -458},0, {496, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-339, 641, -474},0, {23, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-591, 619, -459},0, {496, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-474, 666, -490},0, {27, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-580, 666, -490},0, {-16, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-483, 629, -466},0, {69, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-591, 619, -459},0, {496, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-535, 622, -461},0, {112, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-483, 629, -466},0, {69, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-536, 613, -455},0, {155, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-580, 533, -403},0, {453, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-533, 579, -433},0, {283, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-529, 569, -426},0, {325, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-479, 569, -426},0, {368, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-461, 533, -403},0, {411, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-490, 610, -453},0, {197, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-492, 582, -435},0, {240, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-678, 557, -418},0, {170, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-631, 559, -420},0, {124, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-592, 590, -440},0, {77, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-657, 601, -447},0, {449, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-639, 619, -459},0, {496, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-639, 619, -459},0, {496, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-592, 590, -440},0, {77, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-595, 644, -475},0, {31, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-669, 624, -463},0, {356, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-633, 666, -490},0, {-16, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-721, 666, -490},0, {310, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-729, 531, -402},0, {263, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-671, 603, -448},0, {403, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-657, 601, -447},0, {449, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-678, 557, -418},0, {170, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-678, 531, -402},0, {217, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-888, 564, -423},0, {496, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-818, 665, -489},0, {41, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-888, 665, -489},0, {-16, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-821, 574, -430},0, {98, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-736, 568, -426},0, {325, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-888, 564, -423},0, {496, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-775, 532, -402},0, {382, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-736, 568, -426},0, {325, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-856, 532, -402},0, {439, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-821, 574, -430},0, {98, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-794, 591, -440},0, {155, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-736, 656, -483},0, {268, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-802, 656, -483},0, {212, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-1035, 613, -455},0, {417, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-925, 667, -490},0, {496, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-977, 667, -490},0, {457, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-887, 632, -468},0, {-16, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-947, 621, -461},0, {63, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-955, 613, -455},0, {102, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-974, 582, -435},0, {378, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-897, 577, -431},0, {142, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-980, 574, -430},0, {338, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-897, 577, -431},0, {142, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-974, 582, -435},0, {378, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-925, 532, -402},0, {181, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-1043, 564, -423},0, {260, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-1022, 594, -443},0, {299, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-994, 532, -402},0, {220, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-947, 621, -461},0, {63, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-914, 604, -449},0, {23, 496},{0x0, 0x46, 0x6A, 0xFF}}}, + {{{-887, 632, -468},0, {-16, 496},{0x0, 0x46, 0x6A, 0xFF}}}, +}; + +Gfx titletest_test_mesh_tri_2[] = { + gsSPVertex(titletest_test_mesh_vtx_2 + 0, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 4, 5, 0), + gsSP1Triangle(3, 6, 4, 0), + gsSP1Triangle(3, 7, 6, 0), + gsSP1Triangle(3, 8, 7, 0), + gsSP1Triangle(3, 9, 8, 0), + gsSP1Triangle(3, 10, 9, 0), + gsSP1Triangle(3, 11, 10, 0), + gsSP1Triangle(12, 11, 3, 0), + gsSP1Triangle(12, 13, 11, 0), + gsSP1Triangle(8, 9, 6, 0), + gsSP1Triangle(6, 9, 4, 0), + gsSP1Triangle(14, 13, 15, 0), + gsSPVertex(titletest_test_mesh_vtx_2 + 16, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 4, 5, 0), + gsSP1Triangle(6, 4, 3, 0), + gsSP1Triangle(6, 7, 4, 0), + gsSP1Triangle(8, 7, 6, 0), + gsSP1Triangle(8, 9, 7, 0), + gsSP1Triangle(8, 10, 9, 0), + gsSP1Triangle(8, 11, 10, 0), + gsSP1Triangle(8, 12, 11, 0), + gsSP1Triangle(13, 12, 8, 0), + gsSP1Triangle(14, 13, 8, 0), + gsSP1Triangle(15, 14, 8, 0), + gsSPVertex(titletest_test_mesh_vtx_2 + 32, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(0, 4, 3, 0), + gsSP1Triangle(5, 4, 0, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(3, 4, 7, 0), + gsSP1Triangle(7, 4, 8, 0), + gsSP1Triangle(9, 7, 8, 0), + gsSP1Triangle(10, 11, 12, 0), + gsSP1Triangle(13, 14, 15, 0), + gsSPVertex(titletest_test_mesh_vtx_2 + 48, 15, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 1, 0, 0), + gsSP1Triangle(4, 3, 0, 0), + gsSP1Triangle(4, 5, 3, 0), + gsSP1Triangle(4, 6, 5, 0), + gsSP1Triangle(4, 7, 6, 0), + gsSP1Triangle(8, 7, 4, 0), + gsSP1Triangle(6, 7, 9, 0), + gsSP1Triangle(9, 7, 10, 0), + gsSP1Triangle(10, 7, 1, 0), + gsSP1Triangle(10, 1, 3, 0), + gsSP1Triangle(11, 12, 13, 0), + gsSP1Triangle(14, 12, 11, 0), + gsSPVertex(titletest_test_mesh_vtx_2 + 63, 14, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 1, 0, 0), + gsSP1Triangle(4, 3, 0, 0), + gsSP1Triangle(4, 5, 3, 0), + gsSP1Triangle(4, 6, 5, 0), + gsSP1Triangle(4, 7, 6, 0), + gsSP1Triangle(4, 8, 7, 0), + gsSP1Triangle(7, 9, 6, 0), + gsSP1Triangle(7, 10, 9, 0), + gsSP1Triangle(7, 11, 10, 0), + gsSP1Triangle(12, 11, 7, 0), + gsSP1Triangle(6, 9, 13, 0), + gsSP1Triangle(13, 9, 3, 0), + gsSP1Triangle(3, 9, 1, 0), + gsSPVertex(titletest_test_mesh_vtx_2 + 77, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 1, 0, 0), + gsSP1Triangle(4, 3, 0, 0), + gsSP1Triangle(5, 4, 0, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(5, 8, 7, 0), + gsSP1Triangle(5, 9, 8, 0), + gsSP1Triangle(8, 10, 7, 0), + gsSP1Triangle(10, 1, 7, 0), + gsSP1Triangle(11, 1, 10, 0), + gsSP1Triangle(7, 1, 3, 0), + gsSP1Triangle(12, 13, 14, 0), + gsSP1Triangle(15, 13, 12, 0), + gsSPVertex(titletest_test_mesh_vtx_2 + 93, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 0, 2, 0), + gsSP1Triangle(4, 3, 2, 0), + gsSP1Triangle(4, 2, 5, 0), + gsSP1Triangle(4, 5, 6, 0), + gsSP1Triangle(4, 7, 3, 0), + gsSP1Triangle(8, 0, 3, 0), + gsSP1Triangle(9, 1, 0, 0), + gsSP1Triangle(10, 1, 9, 0), + gsSP1Triangle(11, 12, 13, 0), + gsSP1Triangle(14, 12, 11, 0), + gsSP1Triangle(15, 14, 11, 0), + gsSPVertex(titletest_test_mesh_vtx_2 + 109, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(0, 4, 3, 0), + gsSP1Triangle(0, 5, 4, 0), + gsSP1Triangle(4, 6, 3, 0), + gsSP1Triangle(4, 7, 6, 0), + gsSP1Triangle(4, 8, 7, 0), + gsSP1Triangle(9, 8, 4, 0), + gsSP1Triangle(3, 6, 10, 0), + gsSP1Triangle(10, 6, 2, 0), + gsSP1Triangle(2, 6, 11, 0), + gsSP1Triangle(12, 13, 14, 0), + gsSP1Triangle(12, 15, 13, 0), + gsSPVertex(titletest_test_mesh_vtx_2 + 125, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(4, 3, 0, 0), + gsSP1Triangle(4, 5, 3, 0), + gsSP1Triangle(4, 6, 5, 0), + gsSP1Triangle(4, 7, 6, 0), + gsSP1Triangle(4, 8, 7, 0), + gsSP1Triangle(5, 9, 3, 0), + gsSP1Triangle(5, 10, 9, 0), + gsSP1Triangle(11, 12, 13, 0), + gsSP1Triangle(11, 13, 14, 0), + gsSP1Triangle(14, 13, 15, 0), + gsSPVertex(titletest_test_mesh_vtx_2 + 141, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 0, 2, 0), + gsSP1Triangle(3, 2, 4, 0), + gsSP1Triangle(3, 4, 5, 0), + gsSP1Triangle(6, 3, 5, 0), + gsSP1Triangle(6, 7, 3, 0), + gsSP1Triangle(6, 8, 7, 0), + gsSP1Triangle(6, 9, 8, 0), + gsSP1Triangle(6, 10, 9, 0), + gsSP1Triangle(11, 12, 13, 0), + gsSP1Triangle(11, 14, 12, 0), + gsSP1Triangle(11, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_2 + 157, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 1, 0, 0), + gsSP1Triangle(4, 2, 5, 0), + gsSP1Triangle(5, 2, 6, 0), + gsSP1Triangle(5, 6, 7, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(8, 11, 9, 0), + gsSP1Triangle(8, 12, 11, 0), + gsSP1Triangle(8, 13, 12, 0), + gsSP1Triangle(14, 13, 8, 0), + gsSP1Triangle(14, 15, 13, 0), + gsSPVertex(titletest_test_mesh_vtx_2 + 173, 10, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(4, 3, 0, 0), + gsSP1Triangle(4, 0, 5, 0), + gsSP1Triangle(6, 3, 4, 0), + gsSP1Triangle(7, 8, 9, 0), + gsSPEndDisplayList(), +};Vtx titletest_test_mesh_vtx_3[568] = { + {{{932, 547, -463},0, {102, 496},{0x0, 0x0, 0x7F, 0xFF}}}, + {{{882, 547, -463},0, {220, 496},{0x0, 0x0, 0x7F, 0xFF}}}, + {{{816, 547, -463},0, {260, 496},{0x0, 0x0, 0x7F, 0xFF}}}, + {{{919, 640, -524},0, {378, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{815, 581, -485},0, {299, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{859, 644, -526},0, {338, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{878, 601, -498},0, {496, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{929, 583, -486},0, {-16, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{880, 583, -486},0, {457, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{963, 581, -485},0, {23, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{963, 549, -464},0, {63, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{816, 547, -463},0, {260, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{932, 547, -463},0, {102, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{861, 583, -486},0, {417, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{883, 510, -438},0, {181, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{882, 547, -463},0, {220, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{938, 514, -441},0, {142, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{883, 510, -438},0, {181, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{932, 547, -463},0, {102, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{797, 637, -522},0, {38, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{719, 638, -523},0, {-16, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{758, 643, -526},0, {11, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{692, 613, -506},0, {361, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{748, 610, -504},0, {92, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{782, 599, -497},0, {65, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{686, 576, -482},0, {334, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{732, 599, -497},0, {119, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{730, 589, -490},0, {146, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{776, 588, -489},0, {173, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{794, 563, -473},0, {200, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{742, 557, -469},0, {388, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{752, 554, -467},0, {496, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{794, 530, -452},0, {227, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{752, 554, -467},0, {496, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{794, 563, -473},0, {200, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{749, 542, -460},0, {469, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{686, 530, -452},0, {307, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{715, 509, -438},0, {280, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{768, 509, -438},0, {253, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{732, 542, -460},0, {442, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{732, 553, -467},0, {415, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{686, 576, -482},0, {334, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{742, 557, -469},0, {388, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{527, 641, -524},0, {-16, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{418, 616, -508},0, {217, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{469, 643, -525},0, {263, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{574, 592, -492},0, {31, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{481, 596, -495},0, {310, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{574, 592, -492},0, {31, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{508, 591, -491},0, {496, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{481, 596, -495},0, {310, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{561, 528, -450},0, {77, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{509, 571, -478},0, {449, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{489, 564, -474},0, {403, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{408, 559, -471},0, {170, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{476, 509, -438},0, {124, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{470, 575, -481},0, {356, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{418, 616, -508},0, {217, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{411, 517, -443},0, {325, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{337, 642, -525},0, {-16, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{379, 644, -526},0, {155, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{343, 510, -439},0, {496, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{319, 618, -509},0, {23, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{190, 636, -521},0, {338, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{279, 642, -525},0, {-16, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{245, 605, -501},0, {378, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{323, 576, -482},0, {63, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{270, 594, -493},0, {496, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{257, 578, -483},0, {457, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{245, 543, -460},0, {220, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{301, 555, -468},0, {102, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{340, 525, -449},0, {142, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{294, 508, -438},0, {181, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{202, 509, -438},0, {299, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{252, 509, -438},0, {260, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{243, 579, -484},0, {417, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{200, 518, -444},0, {31, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{89, 639, -523},0, {310, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{132, 642, -525},0, {-16, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{116, 595, -494},0, {496, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{124, 576, -482},0, {449, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{130, 541, -459},0, {124, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{135, 510, -438},0, {77, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{77, 543, -460},0, {170, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{3, 518, -444},0, {263, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{65, 508, -438},0, {217, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{91, 577, -482},0, {403, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{100, 595, -494},0, {356, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{35, 513, -440},0, {240, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-50, 642, -525},0, {155, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-10, 643, -525},0, {197, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-77, 606, -501},0, {112, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{35, 513, -440},0, {240, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-47, 574, -480},0, {368, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-77, 606, -501},0, {112, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-34, 542, -459},0, {325, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-23, 509, -438},0, {283, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-117, 578, -483},0, {453, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-87, 544, -461},0, {411, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-214, 523, -447},0, {-16, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-154, 513, -440},0, {496, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-92, 642, -525},0, {69, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-137, 642, -525},0, {27, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-339, 618, -509},0, {23, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-468, 636, -521},0, {338, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-378, 642, -525},0, {-16, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-413, 605, -501},0, {378, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-335, 576, -482},0, {63, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-335, 576, -482},0, {63, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-388, 594, -493},0, {496, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-413, 605, -501},0, {378, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-401, 578, -483},0, {457, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-413, 543, -460},0, {220, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-357, 555, -468},0, {102, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-317, 525, -449},0, {142, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-364, 508, -438},0, {181, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-455, 509, -438},0, {299, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-406, 509, -438},0, {260, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-414, 579, -484},0, {417, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-468, 636, -521},0, {338, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-474, 643, -526},0, {27, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-591, 596, -495},0, {496, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-580, 643, -526},0, {-16, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-483, 606, -501},0, {69, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-535, 599, -497},0, {112, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-591, 596, -495},0, {496, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-483, 606, -501},0, {69, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-536, 590, -491},0, {155, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-580, 509, -438},0, {453, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-533, 555, -468},0, {283, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-490, 587, -489},0, {197, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-492, 558, -470},0, {240, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-529, 546, -462},0, {325, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-479, 545, -462},0, {368, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-461, 509, -438},0, {411, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-631, 536, -456},0, {124, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-678, 534, -454},0, {170, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-592, 567, -476},0, {77, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-657, 578, -483},0, {449, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-729, 508, -437},0, {263, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-678, 508, -437},0, {217, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-729, 508, -437},0, {263, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-678, 534, -454},0, {170, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-657, 578, -483},0, {449, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-671, 579, -484},0, {403, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-669, 601, -498},0, {356, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-721, 642, -525},0, {310, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-633, 642, -525},0, {-16, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-595, 620, -511},0, {31, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-639, 596, -495},0, {496, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-592, 567, -476},0, {77, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-818, 642, -525},0, {41, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-888, 541, -459},0, {496, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-888, 642, -525},0, {-16, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-821, 551, -465},0, {98, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-736, 545, -461},0, {325, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-736, 545, -461},0, {325, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-821, 551, -465},0, {98, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-794, 567, -476},0, {155, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-736, 632, -519},0, {268, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-802, 632, -519},0, {212, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-775, 508, -437},0, {382, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-888, 541, -459},0, {496, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-856, 508, -437},0, {439, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-925, 643, -526},0, {496, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-1035, 589, -490},0, {417, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-977, 643, -526},0, {457, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-887, 609, -503},0, {-16, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-947, 598, -496},0, {63, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-914, 580, -485},0, {23, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-955, 589, -490},0, {102, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-974, 559, -471},0, {378, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-897, 554, -467},0, {142, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-974, 559, -471},0, {378, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-955, 589, -490},0, {102, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-980, 551, -465},0, {338, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-925, 509, -438},0, {181, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-1043, 541, -459},0, {260, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-994, 509, -438},0, {220, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-1022, 571, -478},0, {299, 496},{0x0, 0xBA, 0x96, 0xFF}}}, + {{{-887, 632, -468},0, {-16, -16},{0x7F, 0x4, 0xFD, 0xFF}}}, + {{{-914, 580, -485},0, {21, 496},{0x14, 0x97, 0x44, 0xFF}}}, + {{{-887, 609, -503},0, {-16, 496},{0x7F, 0x4, 0xFD, 0xFF}}}, + {{{-914, 604, -449},0, {21, -16},{0x14, 0x97, 0x44, 0xFF}}}, + {{{-947, 598, -496},0, {57, 496},{0x15, 0x97, 0x44, 0xFF}}}, + {{{-947, 621, -461},0, {57, -16},{0x15, 0x97, 0x44, 0xFF}}}, + {{{-955, 589, -490},0, {94, 496},{0x7E, 0xE, 0xF7, 0xFF}}}, + {{{-955, 613, -455},0, {94, -16},{0x7E, 0xE, 0xF7, 0xFF}}}, + {{{-955, 613, -455},0, {94, -16},{0x7E, 0xE, 0xF7, 0xFF}}}, + {{{-897, 554, -467},0, {130, 496},{0x7C, 0x18, 0xF0, 0xFF}}}, + {{{-955, 589, -490},0, {94, 496},{0x7E, 0xE, 0xF7, 0xFF}}}, + {{{-897, 577, -431},0, {130, -16},{0x7C, 0x18, 0xF0, 0xFF}}}, + {{{-925, 509, -438},0, {167, 496},{0x41, 0xA5, 0x3B, 0xFF}}}, + {{{-925, 532, -402},0, {167, -16},{0x41, 0xA5, 0x3B, 0xFF}}}, + {{{-994, 509, -438},0, {203, 496},{0xD6, 0x9C, 0x42, 0xFF}}}, + {{{-994, 532, -402},0, {203, -16},{0xD6, 0x9C, 0x42, 0xFF}}}, + {{{-1043, 541, -459},0, {240, 496},{0x83, 0xED, 0xD, 0xFF}}}, + {{{-1043, 564, -423},0, {240, -16},{0x83, 0xED, 0xD, 0xFF}}}, + {{{-1022, 571, -478},0, {277, 496},{0xDF, 0x66, 0xBC, 0xFF}}}, + {{{-1022, 594, -443},0, {277, -16},{0xDF, 0x66, 0xBC, 0xFF}}}, + {{{-980, 551, -465},0, {313, 496},{0xE1, 0x67, 0xBD, 0xFF}}}, + {{{-980, 574, -430},0, {313, -16},{0xE1, 0x67, 0xBD, 0xFF}}}, + {{{-974, 559, -471},0, {350, 496},{0x84, 0xE7, 0x10, 0xFF}}}, + {{{-974, 582, -435},0, {350, -16},{0x84, 0xE7, 0x10, 0xFF}}}, + {{{-974, 582, -435},0, {350, -16},{0x84, 0xE7, 0x10, 0xFF}}}, + {{{-1035, 589, -490},0, {386, 496},{0x82, 0xF0, 0xB, 0xFF}}}, + {{{-974, 559, -471},0, {350, 496},{0x84, 0xE7, 0x10, 0xFF}}}, + {{{-1035, 613, -455},0, {386, -16},{0x82, 0xF0, 0xB, 0xFF}}}, + {{{-977, 643, -526},0, {423, 496},{0xCC, 0x61, 0xC1, 0xFF}}}, + {{{-977, 667, -490},0, {423, -16},{0xCC, 0x61, 0xC1, 0xFF}}}, + {{{-925, 643, -526},0, {459, 496},{0x33, 0x61, 0xC0, 0xFF}}}, + {{{-925, 667, -490},0, {459, -16},{0x33, 0x61, 0xC0, 0xFF}}}, + {{{-887, 609, -503},0, {496, 496},{0x7F, 0x4, 0xFD, 0xFF}}}, + {{{-887, 632, -468},0, {496, -16},{0x7F, 0x4, 0xFD, 0xFF}}}, + {{{-888, 665, -489},0, {-16, -16},{0xA6, 0x4B, 0xCF, 0xFF}}}, + {{{-818, 642, -525},0, {35, 496},{0x5B, 0x4A, 0xD0, 0xFF}}}, + {{{-888, 642, -525},0, {-16, 496},{0xA6, 0x4B, 0xCF, 0xFF}}}, + {{{-818, 665, -489},0, {35, -16},{0x5B, 0x4A, 0xD0, 0xFF}}}, + {{{-821, 551, -465},0, {86, 496},{0x3B, 0x5E, 0xC3, 0xFF}}}, + {{{-821, 574, -430},0, {86, -16},{0x3B, 0x5E, 0xC3, 0xFF}}}, + {{{-821, 574, -430},0, {86, -16},{0x3B, 0x5E, 0xC3, 0xFF}}}, + {{{-794, 567, -476},0, {138, 496},{0x8C, 0x2C, 0xE3, 0xFF}}}, + {{{-821, 551, -465},0, {86, 496},{0x3B, 0x5E, 0xC3, 0xFF}}}, + {{{-794, 591, -440},0, {138, -16},{0x8C, 0x2C, 0xE3, 0xFF}}}, + {{{-802, 632, -519},0, {189, 496},{0xA2, 0x47, 0xD1, 0xFF}}}, + {{{-802, 656, -483},0, {189, -16},{0xA2, 0x47, 0xD1, 0xFF}}}, + {{{-736, 632, -519},0, {240, 496},{0x5A, 0x4B, 0xCF, 0xFF}}}, + {{{-736, 656, -483},0, {240, -16},{0x5A, 0x4B, 0xCF, 0xFF}}}, + {{{-736, 545, -461},0, {291, 496},{0x77, 0xDA, 0x19, 0xFF}}}, + {{{-736, 568, -426},0, {291, -16},{0x77, 0xDA, 0x19, 0xFF}}}, + {{{-775, 508, -437},0, {342, 496},{0x34, 0x9F, 0x3F, 0xFF}}}, + {{{-775, 532, -402},0, {342, -16},{0x34, 0x9F, 0x3F, 0xFF}}}, + {{{-856, 508, -437},0, {394, 496},{0xC9, 0xA0, 0x3E, 0xFF}}}, + {{{-856, 532, -402},0, {394, -16},{0xC9, 0xA0, 0x3E, 0xFF}}}, + {{{-888, 541, -459},0, {445, 496},{0x88, 0xDC, 0x18, 0xFF}}}, + {{{-888, 564, -423},0, {445, -16},{0x88, 0xDC, 0x18, 0xFF}}}, + {{{-888, 564, -423},0, {445, -16},{0x88, 0xDC, 0x18, 0xFF}}}, + {{{-888, 642, -525},0, {496, 496},{0xA6, 0x4B, 0xCF, 0xFF}}}, + {{{-888, 541, -459},0, {445, 496},{0x88, 0xDC, 0x18, 0xFF}}}, + {{{-888, 665, -489},0, {496, -16},{0xA6, 0x4B, 0xCF, 0xFF}}}, + {{{-633, 666, -490},0, {-16, -16},{0x26, 0x65, 0xBD, 0xFF}}}, + {{{-595, 620, -511},0, {48, 496},{0x6F, 0x34, 0xDE, 0xFF}}}, + {{{-633, 642, -525},0, {-16, 496},{0x26, 0x65, 0xBD, 0xFF}}}, + {{{-595, 644, -475},0, {48, -16},{0x6F, 0x34, 0xDE, 0xFF}}}, + {{{-592, 567, -476},0, {112, 496},{0x76, 0xD9, 0x1A, 0xFF}}}, + {{{-592, 590, -440},0, {112, -16},{0x76, 0xD9, 0x1A, 0xFF}}}, + {{{-631, 536, -456},0, {176, 496},{0x34, 0x9F, 0x3F, 0xFF}}}, + {{{-631, 559, -420},0, {176, -16},{0x34, 0x9F, 0x3F, 0xFF}}}, + {{{-678, 534, -454},0, {240, 496},{0x5D, 0xB7, 0x30, 0xFF}}}, + {{{-678, 557, -418},0, {240, -16},{0x5D, 0xB7, 0x30, 0xFF}}}, + {{{-678, 508, -437},0, {304, 496},{0x5A, 0xB5, 0x31, 0xFF}}}, + {{{-678, 531, -402},0, {304, -16},{0x5A, 0xB5, 0x31, 0xFF}}}, + {{{-678, 531, -402},0, {304, -16},{0x5A, 0xB5, 0x31, 0xFF}}}, + {{{-729, 508, -437},0, {368, 496},{0xA4, 0xB7, 0x30, 0xFF}}}, + {{{-678, 508, -437},0, {304, 496},{0x5A, 0xB5, 0x31, 0xFF}}}, + {{{-729, 531, -402},0, {368, -16},{0xA4, 0xB7, 0x30, 0xFF}}}, + {{{-721, 642, -525},0, {432, 496},{0xA9, 0x4D, 0xCD, 0xFF}}}, + {{{-721, 666, -490},0, {432, -16},{0xA9, 0x4D, 0xCD, 0xFF}}}, + {{{-633, 642, -525},0, {496, 496},{0x26, 0x65, 0xBD, 0xFF}}}, + {{{-633, 666, -490},0, {496, -16},{0x26, 0x65, 0xBD, 0xFF}}}, + {{{-669, 624, -463},0, {-16, -16},{0x4D, 0xAB, 0x38, 0xFF}}}, + {{{-671, 579, -484},0, {112, 496},{0x62, 0x43, 0xD3, 0xFF}}}, + {{{-669, 601, -498},0, {-16, 496},{0x4D, 0xAB, 0x38, 0xFF}}}, + {{{-671, 603, -448},0, {112, -16},{0x62, 0x43, 0xD3, 0xFF}}}, + {{{-657, 578, -483},0, {240, 496},{0xD2, 0x63, 0xBF, 0xFF}}}, + {{{-657, 601, -447},0, {240, -16},{0xD2, 0x63, 0xBF, 0xFF}}}, + {{{-639, 596, -495},0, {368, 496},{0x88, 0xDE, 0x17, 0xFF}}}, + {{{-639, 619, -459},0, {368, -16},{0x88, 0xDE, 0x17, 0xFF}}}, + {{{-639, 619, -459},0, {368, -16},{0x88, 0xDE, 0x17, 0xFF}}}, + {{{-669, 601, -498},0, {496, 496},{0x4D, 0xAB, 0x38, 0xFF}}}, + {{{-639, 596, -495},0, {368, 496},{0x88, 0xDE, 0x17, 0xFF}}}, + {{{-669, 624, -463},0, {496, -16},{0x4D, 0xAB, 0x38, 0xFF}}}, + {{{-580, 666, -490},0, {-16, -16},{0xB0, 0x52, 0xCA, 0xFF}}}, + {{{-474, 643, -526},0, {23, 496},{0x62, 0x43, 0xD3, 0xFF}}}, + {{{-580, 643, -526},0, {-16, 496},{0xB0, 0x52, 0xCA, 0xFF}}}, + {{{-474, 666, -490},0, {23, -16},{0x62, 0x43, 0xD3, 0xFF}}}, + {{{-483, 606, -501},0, {63, 496},{0x58, 0xB4, 0x32, 0xFF}}}, + {{{-483, 629, -466},0, {63, -16},{0x58, 0xB4, 0x32, 0xFF}}}, + {{{-535, 599, -497},0, {102, 496},{0x5E, 0xB9, 0x2F, 0xFF}}}, + {{{-535, 622, -461},0, {102, -16},{0x5E, 0xB9, 0x2F, 0xFF}}}, + {{{-536, 590, -491},0, {142, 496},{0x60, 0x46, 0xD2, 0xFF}}}, + {{{-536, 613, -455},0, {142, -16},{0x60, 0x46, 0xD2, 0xFF}}}, + {{{-490, 587, -489},0, {181, 496},{0x60, 0x45, 0xD2, 0xFF}}}, + {{{-490, 610, -453},0, {181, -16},{0x60, 0x45, 0xD2, 0xFF}}}, + {{{-490, 610, -453},0, {181, -16},{0x60, 0x45, 0xD2, 0xFF}}}, + {{{-492, 558, -470},0, {220, 496},{0x5B, 0xB6, 0x30, 0xFF}}}, + {{{-490, 587, -489},0, {181, 496},{0x60, 0x45, 0xD2, 0xFF}}}, + {{{-492, 582, -435},0, {220, -16},{0x5B, 0xB6, 0x30, 0xFF}}}, + {{{-533, 555, -468},0, {260, 496},{0x6A, 0xC5, 0x27, 0xFF}}}, + {{{-533, 579, -433},0, {260, -16},{0x6A, 0xC5, 0x27, 0xFF}}}, + {{{-529, 546, -462},0, {299, 496},{0x4C, 0x56, 0xC8, 0xFF}}}, + {{{-529, 569, -426},0, {299, -16},{0x4C, 0x56, 0xC8, 0xFF}}}, + {{{-479, 545, -462},0, {338, 496},{0x47, 0x58, 0xC6, 0xFF}}}, + {{{-479, 569, -426},0, {338, -16},{0x47, 0x58, 0xC6, 0xFF}}}, + {{{-461, 509, -438},0, {378, 496},{0x6A, 0xC6, 0x27, 0xFF}}}, + {{{-461, 533, -403},0, {378, -16},{0x6A, 0xC6, 0x27, 0xFF}}}, + {{{-580, 509, -438},0, {417, 496},{0xAC, 0xB0, 0x34, 0xFF}}}, + {{{-580, 533, -403},0, {417, -16},{0xAC, 0xB0, 0x34, 0xFF}}}, + {{{-591, 596, -495},0, {457, 496},{0x81, 0x5, 0xFD, 0xFF}}}, + {{{-591, 619, -459},0, {457, -16},{0x81, 0x5, 0xFD, 0xFF}}}, + {{{-591, 619, -459},0, {457, -16},{0x81, 0x5, 0xFD, 0xFF}}}, + {{{-580, 643, -526},0, {496, 496},{0xB0, 0x52, 0xCA, 0xFF}}}, + {{{-591, 596, -495},0, {457, 496},{0x81, 0x5, 0xFD, 0xFF}}}, + {{{-580, 666, -490},0, {496, -16},{0xB0, 0x52, 0xCA, 0xFF}}}, + {{{-378, 665, -489},0, {-16, -16},{0x23, 0x66, 0xBD, 0xFF}}}, + {{{-339, 618, -509},0, {35, 496},{0x6F, 0x34, 0xDE, 0xFF}}}, + {{{-378, 642, -525},0, {-16, 496},{0x23, 0x66, 0xBD, 0xFF}}}, + {{{-339, 641, -474},0, {35, -16},{0x6F, 0x34, 0xDE, 0xFF}}}, + {{{-335, 576, -482},0, {86, 496},{0x78, 0xDD, 0x17, 0xFF}}}, + {{{-335, 599, -446},0, {86, -16},{0x78, 0xDD, 0x17, 0xFF}}}, + {{{-357, 555, -468},0, {138, 496},{0x7F, 0x6, 0xFC, 0xFF}}}, + {{{-357, 578, -432},0, {138, -16},{0x7F, 0x6, 0xFC, 0xFF}}}, + {{{-317, 525, -449},0, {189, 496},{0x7D, 0xEF, 0xB, 0xFF}}}, + {{{-317, 549, -413},0, {189, -16},{0x7D, 0xEF, 0xB, 0xFF}}}, + {{{-364, 508, -438},0, {240, 496},{0xED, 0x97, 0x45, 0xFF}}}, + {{{-364, 532, -402},0, {240, -16},{0xED, 0x97, 0x45, 0xFF}}}, + {{{-364, 532, -402},0, {240, -16},{0xED, 0x97, 0x45, 0xFF}}}, + {{{-413, 543, -460},0, {291, 496},{0x3F, 0xA4, 0x3D, 0xFF}}}, + {{{-364, 508, -438},0, {240, 496},{0xED, 0x97, 0x45, 0xFF}}}, + {{{-413, 567, -425},0, {291, -16},{0x3F, 0xA4, 0x3D, 0xFF}}}, + {{{-406, 509, -438},0, {342, 496},{0x61, 0xBC, 0x2D, 0xFF}}}, + {{{-406, 532, -402},0, {342, -16},{0x61, 0xBC, 0x2D, 0xFF}}}, + {{{-455, 509, -438},0, {394, 496},{0xAA, 0xB2, 0x33, 0xFF}}}, + {{{-455, 532, -402},0, {394, -16},{0xAA, 0xB2, 0x33, 0xFF}}}, + {{{-468, 636, -521},0, {445, 496},{0x9F, 0x45, 0xD2, 0xFF}}}, + {{{-468, 660, -486},0, {445, -16},{0x9F, 0x45, 0xD2, 0xFF}}}, + {{{-378, 642, -525},0, {496, 496},{0x23, 0x66, 0xBD, 0xFF}}}, + {{{-378, 665, -489},0, {496, -16},{0x23, 0x66, 0xBD, 0xFF}}}, + {{{-413, 628, -465},0, {-16, -16},{0x3F, 0xA4, 0x3D, 0xFF}}}, + {{{-414, 579, -484},0, {112, 496},{0x61, 0x44, 0xD3, 0xFF}}}, + {{{-413, 605, -501},0, {-16, 496},{0x3F, 0xA4, 0x3D, 0xFF}}}, + {{{-414, 602, -448},0, {112, -16},{0x61, 0x44, 0xD3, 0xFF}}}, + {{{-414, 602, -448},0, {112, -16},{0x61, 0x44, 0xD3, 0xFF}}}, + {{{-401, 578, -483},0, {240, 496},{0xCC, 0x61, 0xC1, 0xFF}}}, + {{{-414, 579, -484},0, {112, 496},{0x61, 0x44, 0xD3, 0xFF}}}, + {{{-401, 601, -447},0, {240, -16},{0xCC, 0x61, 0xC1, 0xFF}}}, + {{{-388, 594, -493},0, {368, 496},{0x84, 0xE7, 0x10, 0xFF}}}, + {{{-388, 617, -458},0, {368, -16},{0x84, 0xE7, 0x10, 0xFF}}}, + {{{-413, 605, -501},0, {496, 496},{0x3F, 0xA4, 0x3D, 0xFF}}}, + {{{-413, 628, -465},0, {496, -16},{0x3F, 0xA4, 0x3D, 0xFF}}}, + {{{-214, 546, -411},0, {-16, -16},{0x8D, 0xD2, 0x1E, 0xFF}}}, + {{{-137, 642, -525},0, {23, 496},{0xBF, 0x5B, 0xC5, 0xFF}}}, + {{{-214, 523, -447},0, {-16, 496},{0x8D, 0xD2, 0x1E, 0xFF}}}, + {{{-137, 665, -489},0, {23, -16},{0xBF, 0x5B, 0xC5, 0xFF}}}, + {{{-92, 642, -525},0, {63, 496},{0x4A, 0x57, 0xC7, 0xFF}}}, + {{{-92, 665, -489},0, {63, -16},{0x4A, 0x57, 0xC7, 0xFF}}}, + {{{-77, 606, -501},0, {102, 496},{0xE, 0x69, 0xBA, 0xFF}}}, + {{{-77, 629, -466},0, {102, -16},{0xE, 0x69, 0xBA, 0xFF}}}, + {{{-77, 629, -466},0, {102, -16},{0xE, 0x69, 0xBA, 0xFF}}}, + {{{-50, 642, -525},0, {142, 496},{0xC1, 0x5C, 0xC4, 0xFF}}}, + {{{-77, 606, -501},0, {102, 496},{0xE, 0x69, 0xBA, 0xFF}}}, + {{{-50, 665, -489},0, {142, -16},{0xC1, 0x5C, 0xC4, 0xFF}}}, + {{{-10, 643, -525},0, {181, 496},{0x4C, 0x56, 0xC8, 0xFF}}}, + {{{-10, 666, -490},0, {181, -16},{0x4C, 0x56, 0xC8, 0xFF}}}, + {{{35, 513, -440},0, {220, 496},{0x68, 0xC3, 0x28, 0xFF}}}, + {{{35, 536, -405},0, {220, -16},{0x68, 0xC3, 0x28, 0xFF}}}, + {{{-23, 509, -438},0, {260, 496},{0xB8, 0xA9, 0x39, 0xFF}}}, + {{{-23, 532, -402},0, {260, -16},{0xB8, 0xA9, 0x39, 0xFF}}}, + {{{-34, 542, -459},0, {299, 496},{0x87, 0xE0, 0x15, 0xFF}}}, + {{{-34, 565, -424},0, {299, -16},{0x87, 0xE0, 0x15, 0xFF}}}, + {{{-47, 574, -480},0, {338, 496},{0xE0, 0x99, 0x43, 0xFF}}}, + {{{-47, 597, -445},0, {338, -16},{0xE0, 0x99, 0x43, 0xFF}}}, + {{{-87, 544, -461},0, {378, 496},{0xF3, 0x96, 0x45, 0xFF}}}, + {{{-87, 567, -425},0, {378, -16},{0xF3, 0x96, 0x45, 0xFF}}}, + {{{-87, 567, -425},0, {378, -16},{0xF3, 0x96, 0x45, 0xFF}}}, + {{{-117, 578, -483},0, {417, 496},{0xD, 0x96, 0x45, 0xFF}}}, + {{{-87, 544, -461},0, {378, 496},{0xF3, 0x96, 0x45, 0xFF}}}, + {{{-117, 601, -447},0, {417, -16},{0xD, 0x96, 0x45, 0xFF}}}, + {{{-154, 513, -440},0, {457, 496},{0x3A, 0xA1, 0x3E, 0xFF}}}, + {{{-154, 536, -405},0, {457, -16},{0x3A, 0xA1, 0x3E, 0xFF}}}, + {{{-214, 523, -447},0, {496, 496},{0x8D, 0xD2, 0x1E, 0xFF}}}, + {{{-214, 546, -411},0, {496, -16},{0x8D, 0xD2, 0x1E, 0xFF}}}, + {{{132, 666, -490},0, {-16, -16},{0x3F, 0x5C, 0xC4, 0xFF}}}, + {{{200, 518, -444},0, {48, 496},{0x70, 0xCE, 0x21, 0xFF}}}, + {{{132, 642, -525},0, {-16, 496},{0x3F, 0x5C, 0xC4, 0xFF}}}, + {{{200, 542, -408},0, {48, -16},{0x70, 0xCE, 0x21, 0xFF}}}, + {{{135, 510, -438},0, {112, 496},{0xB4, 0xAA, 0x38, 0xFF}}}, + {{{135, 533, -403},0, {112, -16},{0xB4, 0xAA, 0x38, 0xFF}}}, + {{{130, 541, -459},0, {176, 496},{0xAC, 0xB0, 0x34, 0xFF}}}, + {{{130, 565, -424},0, {176, -16},{0xAC, 0xB0, 0x34, 0xFF}}}, + {{{130, 565, -424},0, {176, -16},{0xAC, 0xB0, 0x34, 0xFF}}}, + {{{77, 543, -460},0, {240, 496},{0x4B, 0xAB, 0x38, 0xFF}}}, + {{{130, 541, -459},0, {176, 496},{0xAC, 0xB0, 0x34, 0xFF}}}, + {{{77, 566, -424},0, {240, -16},{0x4B, 0xAB, 0x38, 0xFF}}}, + {{{65, 508, -438},0, {304, 496},{0x43, 0xA6, 0x3C, 0xFF}}}, + {{{65, 532, -402},0, {304, -16},{0x43, 0xA6, 0x3C, 0xFF}}}, + {{{3, 518, -444},0, {368, 496},{0x8D, 0xD3, 0x1D, 0xFF}}}, + {{{3, 541, -408},0, {368, -16},{0x8D, 0xD3, 0x1D, 0xFF}}}, + {{{89, 639, -523},0, {432, 496},{0xBB, 0x59, 0xC5, 0xFF}}}, + {{{89, 662, -487},0, {432, -16},{0xBB, 0x59, 0xC5, 0xFF}}}, + {{{132, 642, -525},0, {496, 496},{0x3F, 0x5C, 0xC4, 0xFF}}}, + {{{132, 666, -490},0, {496, -16},{0x3F, 0x5C, 0xC4, 0xFF}}}, + {{{100, 619, -459},0, {-16, -16},{0x45, 0xA7, 0x3A, 0xFF}}}, + {{{91, 577, -482},0, {112, 496},{0x6A, 0x3A, 0xD9, 0xFF}}}, + {{{100, 595, -494},0, {-16, 496},{0x45, 0xA7, 0x3A, 0xFF}}}, + {{{91, 600, -447},0, {112, -16},{0x6A, 0x3A, 0xD9, 0xFF}}}, + {{{91, 600, -447},0, {112, -16},{0x6A, 0x3A, 0xD9, 0xFF}}}, + {{{124, 576, -482},0, {240, 496},{0x9A, 0x3F, 0xD6, 0xFF}}}, + {{{91, 577, -482},0, {112, 496},{0x6A, 0x3A, 0xD9, 0xFF}}}, + {{{124, 599, -446},0, {240, -16},{0x9A, 0x3F, 0xD6, 0xFF}}}, + {{{116, 595, -494},0, {368, 496},{0xB4, 0xAB, 0x37, 0xFF}}}, + {{{116, 618, -458},0, {368, -16},{0xB4, 0xAB, 0x37, 0xFF}}}, + {{{100, 595, -494},0, {496, 496},{0x45, 0xA7, 0x3A, 0xFF}}}, + {{{100, 619, -459},0, {496, -16},{0x45, 0xA7, 0x3A, 0xFF}}}, + {{{279, 665, -489},0, {-16, -16},{0x23, 0x66, 0xBD, 0xFF}}}, + {{{319, 618, -509},0, {35, 496},{0x6F, 0x34, 0xDE, 0xFF}}}, + {{{279, 642, -525},0, {-16, 496},{0x23, 0x66, 0xBD, 0xFF}}}, + {{{319, 641, -474},0, {35, -16},{0x6F, 0x34, 0xDE, 0xFF}}}, + {{{323, 576, -482},0, {86, 496},{0x78, 0xDD, 0x17, 0xFF}}}, + {{{323, 599, -446},0, {86, -16},{0x78, 0xDD, 0x17, 0xFF}}}, + {{{301, 555, -468},0, {138, 496},{0x7F, 0x6, 0xFC, 0xFF}}}, + {{{301, 578, -432},0, {138, -16},{0x7F, 0x6, 0xFC, 0xFF}}}, + {{{301, 578, -432},0, {138, -16},{0x7F, 0x6, 0xFC, 0xFF}}}, + {{{340, 525, -449},0, {189, 496},{0x7D, 0xEF, 0xB, 0xFF}}}, + {{{301, 555, -468},0, {138, 496},{0x7F, 0x6, 0xFC, 0xFF}}}, + {{{340, 549, -413},0, {189, -16},{0x7D, 0xEF, 0xB, 0xFF}}}, + {{{294, 508, -438},0, {240, 496},{0xED, 0x97, 0x45, 0xFF}}}, + {{{294, 532, -402},0, {240, -16},{0xED, 0x97, 0x45, 0xFF}}}, + {{{245, 543, -460},0, {291, 496},{0x3F, 0xA4, 0x3D, 0xFF}}}, + {{{245, 567, -425},0, {291, -16},{0x3F, 0xA4, 0x3D, 0xFF}}}, + {{{252, 509, -438},0, {342, 496},{0x61, 0xBC, 0x2D, 0xFF}}}, + {{{252, 532, -402},0, {342, -16},{0x61, 0xBC, 0x2D, 0xFF}}}, + {{{202, 509, -438},0, {394, 496},{0xAA, 0xB2, 0x33, 0xFF}}}, + {{{202, 532, -402},0, {394, -16},{0xAA, 0xB2, 0x33, 0xFF}}}, + {{{190, 636, -521},0, {445, 496},{0x9F, 0x45, 0xD2, 0xFF}}}, + {{{190, 660, -486},0, {445, -16},{0x9F, 0x45, 0xD2, 0xFF}}}, + {{{279, 642, -525},0, {496, 496},{0x23, 0x66, 0xBD, 0xFF}}}, + {{{279, 665, -489},0, {496, -16},{0x23, 0x66, 0xBD, 0xFF}}}, + {{{245, 628, -465},0, {-16, -16},{0x3F, 0xA4, 0x3D, 0xFF}}}, + {{{243, 579, -484},0, {112, 496},{0x61, 0x44, 0xD3, 0xFF}}}, + {{{245, 605, -501},0, {-16, 496},{0x3F, 0xA4, 0x3D, 0xFF}}}, + {{{243, 602, -448},0, {112, -16},{0x61, 0x44, 0xD3, 0xFF}}}, + {{{257, 578, -483},0, {240, 496},{0xCC, 0x61, 0xC1, 0xFF}}}, + {{{257, 601, -447},0, {240, -16},{0xCC, 0x61, 0xC1, 0xFF}}}, + {{{270, 594, -493},0, {368, 496},{0x84, 0xE7, 0x10, 0xFF}}}, + {{{270, 617, -458},0, {368, -16},{0x84, 0xE7, 0x10, 0xFF}}}, + {{{245, 605, -501},0, {496, 496},{0x3F, 0xA4, 0x3D, 0xFF}}}, + {{{245, 628, -465},0, {496, -16},{0x3F, 0xA4, 0x3D, 0xFF}}}, + {{{337, 665, -489},0, {-16, -16},{0xA2, 0x47, 0xD1, 0xFF}}}, + {{{379, 644, -526},0, {112, 496},{0x4D, 0x55, 0xC8, 0xFF}}}, + {{{337, 642, -525},0, {-16, 496},{0xA2, 0x47, 0xD1, 0xFF}}}, + {{{379, 668, -491},0, {112, -16},{0x4D, 0x55, 0xC8, 0xFF}}}, + {{{411, 517, -443},0, {240, 496},{0x67, 0xC2, 0x29, 0xFF}}}, + {{{411, 540, -407},0, {240, -16},{0x67, 0xC2, 0x29, 0xFF}}}, + {{{411, 540, -407},0, {240, -16},{0x67, 0xC2, 0x29, 0xFF}}}, + {{{343, 510, -439},0, {368, 496},{0xAD, 0xB0, 0x35, 0xFF}}}, + {{{411, 517, -443},0, {240, 496},{0x67, 0xC2, 0x29, 0xFF}}}, + {{{343, 534, -403},0, {368, -16},{0xAD, 0xB0, 0x35, 0xFF}}}, + {{{337, 642, -525},0, {496, 496},{0xA2, 0x47, 0xD1, 0xFF}}}, + {{{337, 665, -489},0, {496, -16},{0xA2, 0x47, 0xD1, 0xFF}}}, + {{{527, 664, -489},0, {-16, -16},{0x38, 0x5F, 0xC2, 0xFF}}}, + {{{574, 592, -492},0, {57, 496},{0x7B, 0x1B, 0xEE, 0xFF}}}, + {{{527, 641, -524},0, {-16, 496},{0x38, 0x5F, 0xC2, 0xFF}}}, + {{{574, 615, -457},0, {57, -16},{0x7B, 0x1B, 0xEE, 0xFF}}}, + {{{561, 528, -450},0, {130, 496},{0x5E, 0xB8, 0x2F, 0xFF}}}, + {{{561, 551, -415},0, {130, -16},{0x5E, 0xB8, 0x2F, 0xFF}}}, + {{{476, 509, -438},0, {203, 496},{0xE2, 0x99, 0x44, 0xFF}}}, + {{{476, 533, -402},0, {203, -16},{0xE2, 0x99, 0x44, 0xFF}}}, + {{{408, 559, -471},0, {277, 496},{0x89, 0xDB, 0x18, 0xFF}}}, + {{{408, 583, -435},0, {277, -16},{0x89, 0xDB, 0x18, 0xFF}}}, + {{{408, 583, -435},0, {277, -16},{0x89, 0xDB, 0x18, 0xFF}}}, + {{{418, 616, -508},0, {350, 496},{0x95, 0x3A, 0xDA, 0xFF}}}, + {{{408, 559, -471},0, {277, 496},{0x89, 0xDB, 0x18, 0xFF}}}, + {{{418, 639, -472},0, {350, -16},{0x95, 0x3A, 0xDA, 0xFF}}}, + {{{469, 643, -525},0, {423, 496},{0xDE, 0x66, 0xBD, 0xFF}}}, + {{{469, 666, -490},0, {423, -16},{0xDE, 0x66, 0xBD, 0xFF}}}, + {{{527, 641, -524},0, {496, 496},{0x38, 0x5F, 0xC2, 0xFF}}}, + {{{527, 664, -489},0, {496, -16},{0x38, 0x5F, 0xC2, 0xFF}}}, + {{{481, 619, -459},0, {-16, -16},{0x38, 0xA1, 0x3E, 0xFF}}}, + {{{470, 575, -481},0, {86, 496},{0x7A, 0x1E, 0xED, 0xFF}}}, + {{{481, 596, -495},0, {-16, 496},{0x38, 0xA1, 0x3E, 0xFF}}}, + {{{470, 598, -446},0, {86, -16},{0x7A, 0x1E, 0xED, 0xFF}}}, + {{{489, 564, -474},0, {189, 496},{0xF, 0x69, 0xBA, 0xFF}}}, + {{{489, 588, -439},0, {189, -16},{0xF, 0x69, 0xBA, 0xFF}}}, + {{{509, 571, -478},0, {291, 496},{0x96, 0x3A, 0xD9, 0xFF}}}, + {{{509, 594, -443},0, {291, -16},{0x96, 0x3A, 0xD9, 0xFF}}}, + {{{509, 594, -443},0, {291, -16},{0x96, 0x3A, 0xD9, 0xFF}}}, + {{{508, 591, -491},0, {394, 496},{0x9F, 0xBC, 0x2D, 0xFF}}}, + {{{509, 571, -478},0, {291, 496},{0x96, 0x3A, 0xD9, 0xFF}}}, + {{{508, 614, -456},0, {394, -16},{0x9F, 0xBC, 0x2D, 0xFF}}}, + {{{481, 596, -495},0, {496, 496},{0x38, 0xA1, 0x3E, 0xFF}}}, + {{{481, 619, -459},0, {496, -16},{0x38, 0xA1, 0x3E, 0xFF}}}, + {{{719, 662, -487},0, {-16, -16},{0xC4, 0x5D, 0xC3, 0xFF}}}, + {{{758, 643, -526},0, {18, 496},{0x3, 0x6A, 0xBA, 0xFF}}}, + {{{719, 638, -523},0, {-16, 496},{0xC4, 0x5D, 0xC3, 0xFF}}}, + {{{758, 667, -490},0, {18, -16},{0x3, 0x6A, 0xBA, 0xFF}}}, + {{{797, 637, -522},0, {52, 496},{0x6E, 0x35, 0xDD, 0xFF}}}, + {{{797, 660, -486},0, {52, -16},{0x6E, 0x35, 0xDD, 0xFF}}}, + {{{782, 599, -497},0, {86, 496},{0x38, 0xA1, 0x3F, 0xFF}}}, + {{{782, 622, -461},0, {86, -16},{0x38, 0xA1, 0x3F, 0xFF}}}, + {{{748, 610, -504},0, {121, 496},{0x14, 0x97, 0x44, 0xFF}}}, + {{{748, 633, -468},0, {121, -16},{0x14, 0x97, 0x44, 0xFF}}}, + {{{748, 633, -468},0, {121, -16},{0x14, 0x97, 0x44, 0xFF}}}, + {{{732, 599, -497},0, {155, 496},{0x6D, 0xCA, 0x24, 0xFF}}}, + {{{748, 610, -504},0, {121, 496},{0x14, 0x97, 0x44, 0xFF}}}, + {{{732, 622, -461},0, {155, -16},{0x6D, 0xCA, 0x24, 0xFF}}}, + {{{730, 589, -490},0, {189, 496},{0x62, 0x43, 0xD3, 0xFF}}}, + {{{730, 612, -455},0, {189, -16},{0x62, 0x43, 0xD3, 0xFF}}}, + {{{776, 588, -489},0, {223, 496},{0x3F, 0x5C, 0xC4, 0xFF}}}, + {{{776, 611, -454},0, {223, -16},{0x3F, 0x5C, 0xC4, 0xFF}}}, + {{{794, 563, -473},0, {257, 496},{0x7A, 0x1D, 0xED, 0xFF}}}, + {{{794, 586, -438},0, {257, -16},{0x7A, 0x1D, 0xED, 0xFF}}}, + {{{794, 530, -452},0, {291, 496},{0x75, 0xD6, 0x1B, 0xFF}}}, + {{{794, 554, -416},0, {291, -16},{0x75, 0xD6, 0x1B, 0xFF}}}, + {{{768, 509, -438},0, {325, 496},{0x31, 0x9E, 0x40, 0xFF}}}, + {{{768, 532, -402},0, {325, -16},{0x31, 0x9E, 0x40, 0xFF}}}, + {{{715, 509, -438},0, {359, 496},{0xD3, 0x9D, 0x41, 0xFF}}}, + {{{715, 532, -402},0, {359, -16},{0xD3, 0x9D, 0x41, 0xFF}}}, + {{{715, 532, -402},0, {359, -16},{0xD3, 0x9D, 0x41, 0xFF}}}, + {{{686, 530, -452},0, {394, 496},{0x8C, 0xD4, 0x1D, 0xFF}}}, + {{{715, 509, -438},0, {359, 496},{0xD3, 0x9D, 0x41, 0xFF}}}, + {{{686, 554, -416},0, {394, -16},{0x8C, 0xD4, 0x1D, 0xFF}}}, + {{{686, 576, -482},0, {428, 496},{0x81, 0x7, 0xFB, 0xFF}}}, + {{{686, 599, -446},0, {428, -16},{0x81, 0x7, 0xFB, 0xFF}}}, + {{{692, 613, -506},0, {462, 496},{0x8C, 0x2C, 0xE3, 0xFF}}}, + {{{692, 636, -470},0, {462, -16},{0x8C, 0x2C, 0xE3, 0xFF}}}, + {{{719, 638, -523},0, {496, 496},{0xC4, 0x5D, 0xC3, 0xFF}}}, + {{{719, 662, -487},0, {496, -16},{0xC4, 0x5D, 0xC3, 0xFF}}}, + {{{742, 580, -434},0, {-16, -16},{0x7, 0x96, 0x45, 0xFF}}}, + {{{732, 553, -467},0, {86, 496},{0x6D, 0xC9, 0x24, 0xFF}}}, + {{{742, 557, -469},0, {-16, 496},{0x7, 0x96, 0x45, 0xFF}}}, + {{{732, 576, -431},0, {86, -16},{0x6D, 0xC9, 0x24, 0xFF}}}, + {{{732, 542, -460},0, {189, 496},{0x58, 0x4C, 0xCE, 0xFF}}}, + {{{732, 566, -424},0, {189, -16},{0x58, 0x4C, 0xCE, 0xFF}}}, + {{{732, 566, -424},0, {189, -16},{0x58, 0x4C, 0xCE, 0xFF}}}, + {{{749, 542, -460},0, {291, 496},{0xB1, 0x54, 0xC9, 0xFF}}}, + {{{732, 542, -460},0, {189, 496},{0x58, 0x4C, 0xCE, 0xFF}}}, + {{{749, 566, -424},0, {291, -16},{0xB1, 0x54, 0xC9, 0xFF}}}, + {{{752, 554, -467},0, {394, 496},{0x90, 0xCE, 0x21, 0xFF}}}, + {{{752, 577, -432},0, {394, -16},{0x90, 0xCE, 0x21, 0xFF}}}, + {{{742, 557, -469},0, {496, 496},{0x7, 0x96, 0x45, 0xFF}}}, + {{{742, 580, -434},0, {496, -16},{0x7, 0x96, 0x45, 0xFF}}}, + {{{929, 606, -450},0, {-16, -16},{0x55, 0x4E, 0xCC, 0xFF}}}, + {{{963, 581, -485},0, {31, 496},{0x5C, 0x4A, 0xD0, 0xFF}}}, + {{{929, 583, -486},0, {-16, 496},{0x55, 0x4E, 0xCC, 0xFF}}}, + {{{963, 605, -450},0, {31, -16},{0x5C, 0x4A, 0xD0, 0xFF}}}, + {{{963, 549, -464},0, {77, 496},{0x5D, 0xB7, 0x30, 0xFF}}}, + {{{963, 572, -429},0, {77, -16},{0x5D, 0xB7, 0x30, 0xFF}}}, + {{{932, 547, -463},0, {124, 496},{0x63, 0xBE, 0x2C, 0xFF}}}, + {{{932, 571, -427},0, {124, -16},{0x63, 0xBE, 0x2C, 0xFF}}}, + {{{932, 571, -427},0, {124, -16},{0x63, 0xBE, 0x2C, 0xFF}}}, + {{{938, 514, -441},0, {170, 496},{0x64, 0xBF, 0x2B, 0xFF}}}, + {{{932, 547, -463},0, {124, 496},{0x63, 0xBE, 0x2C, 0xFF}}}, + {{{938, 538, -406},0, {170, -16},{0x64, 0xBF, 0x2B, 0xFF}}}, + {{{883, 510, -438},0, {217, 496},{0xAC, 0xB1, 0x35, 0xFF}}}, + {{{883, 533, -403},0, {217, -16},{0xAC, 0xB1, 0x35, 0xFF}}}, + {{{882, 547, -463},0, {263, 496},{0xA7, 0xB5, 0x32, 0xFF}}}, + {{{882, 571, -427},0, {263, -16},{0xA7, 0xB5, 0x32, 0xFF}}}, + {{{816, 547, -463},0, {310, 496},{0xA7, 0xB4, 0x31, 0xFF}}}, + {{{816, 571, -427},0, {310, -16},{0xA7, 0xB4, 0x31, 0xFF}}}, + {{{815, 581, -485},0, {356, 496},{0x85, 0x1B, 0xEE, 0xFF}}}, + {{{815, 604, -449},0, {356, -16},{0x85, 0x1B, 0xEE, 0xFF}}}, + {{{859, 644, -526},0, {403, 496},{0xC5, 0x5E, 0xC3, 0xFF}}}, + {{{859, 667, -490},0, {403, -16},{0xC5, 0x5E, 0xC3, 0xFF}}}, + {{{919, 640, -524},0, {449, 496},{0x57, 0x4E, 0xCD, 0xFF}}}, + {{{919, 663, -488},0, {449, -16},{0x57, 0x4E, 0xCD, 0xFF}}}, + {{{919, 663, -488},0, {449, -16},{0x57, 0x4E, 0xCD, 0xFF}}}, + {{{929, 583, -486},0, {496, 496},{0x55, 0x4E, 0xCC, 0xFF}}}, + {{{919, 640, -524},0, {449, 496},{0x57, 0x4E, 0xCD, 0xFF}}}, + {{{929, 606, -450},0, {496, -16},{0x55, 0x4E, 0xCC, 0xFF}}}, + {{{861, 606, -450},0, {-16, -16},{0x72, 0x2F, 0xE1, 0xFF}}}, + {{{880, 583, -486},0, {155, 496},{0xA3, 0x48, 0xD0, 0xFF}}}, + {{{861, 583, -486},0, {-16, 496},{0x72, 0x2F, 0xE1, 0xFF}}}, + {{{880, 606, -450},0, {155, -16},{0xA3, 0x48, 0xD0, 0xFF}}}, + {{{878, 601, -498},0, {325, 496},{0xDB, 0x9A, 0x42, 0xFF}}}, + {{{878, 625, -463},0, {325, -16},{0xDB, 0x9A, 0x42, 0xFF}}}, + {{{861, 583, -486},0, {496, 496},{0x72, 0x2F, 0xE1, 0xFF}}}, + {{{861, 606, -450},0, {496, -16},{0x72, 0x2F, 0xE1, 0xFF}}}, +}; + +Gfx titletest_test_mesh_tri_3[] = { + gsSPVertex(titletest_test_mesh_vtx_3 + 0, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 4, 5, 0), + gsSP1Triangle(6, 4, 3, 0), + gsSP1Triangle(7, 6, 3, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 4, 8, 0), + gsSP1Triangle(9, 4, 7, 0), + gsSP1Triangle(10, 4, 9, 0), + gsSP1Triangle(10, 11, 4, 0), + gsSP1Triangle(12, 11, 10, 0), + gsSP1Triangle(8, 4, 13, 0), + gsSP1Triangle(13, 4, 6, 0), + gsSP1Triangle(12, 14, 15, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 16, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 4, 5, 0), + gsSP1Triangle(3, 6, 4, 0), + gsSP1Triangle(7, 6, 3, 0), + gsSP1Triangle(8, 7, 3, 0), + gsSP1Triangle(7, 9, 6, 0), + gsSP1Triangle(10, 9, 7, 0), + gsSP1Triangle(11, 9, 10, 0), + gsSP1Triangle(12, 9, 11, 0), + gsSP1Triangle(13, 9, 12, 0), + gsSP1Triangle(13, 14, 9, 0), + gsSP1Triangle(15, 14, 13, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 32, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(0, 4, 3, 0), + gsSP1Triangle(0, 5, 4, 0), + gsSP1Triangle(6, 5, 0, 0), + gsSP1Triangle(3, 4, 7, 0), + gsSP1Triangle(7, 4, 8, 0), + gsSP1Triangle(8, 4, 9, 0), + gsSP1Triangle(10, 8, 9, 0), + gsSP1Triangle(11, 12, 13, 0), + gsSP1Triangle(14, 12, 11, 0), + gsSP1Triangle(14, 15, 12, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 48, 14, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 1, 0, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(3, 6, 5, 0), + gsSP1Triangle(3, 7, 6, 0), + gsSP1Triangle(5, 6, 8, 0), + gsSP1Triangle(8, 6, 2, 0), + gsSP1Triangle(2, 6, 9, 0), + gsSP1Triangle(10, 11, 12, 0), + gsSP1Triangle(10, 13, 11, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 62, 14, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(4, 3, 0, 0), + gsSP1Triangle(4, 5, 3, 0), + gsSP1Triangle(4, 6, 5, 0), + gsSP1Triangle(4, 7, 6, 0), + gsSP1Triangle(8, 7, 4, 0), + gsSP1Triangle(9, 7, 8, 0), + gsSP1Triangle(9, 10, 7, 0), + gsSP1Triangle(7, 11, 6, 0), + gsSP1Triangle(12, 11, 7, 0), + gsSP1Triangle(6, 11, 13, 0), + gsSP1Triangle(13, 11, 3, 0), + gsSP1Triangle(3, 11, 1, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 76, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(0, 4, 3, 0), + gsSP1Triangle(0, 5, 4, 0), + gsSP1Triangle(0, 6, 5, 0), + gsSP1Triangle(5, 7, 4, 0), + gsSP1Triangle(7, 8, 4, 0), + gsSP1Triangle(9, 8, 7, 0), + gsSP1Triangle(4, 8, 10, 0), + gsSP1Triangle(10, 8, 11, 0), + gsSP1Triangle(11, 8, 1, 0), + gsSP1Triangle(3, 11, 1, 0), + gsSP1Triangle(12, 13, 14, 0), + gsSP1Triangle(12, 15, 13, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 92, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(0, 4, 3, 0), + gsSP1Triangle(1, 5, 2, 0), + gsSP1Triangle(1, 6, 5, 0), + gsSP1Triangle(5, 7, 2, 0), + gsSP1Triangle(8, 7, 5, 0), + gsSP1Triangle(2, 7, 9, 0), + gsSP1Triangle(9, 7, 10, 0), + gsSP1Triangle(11, 12, 13, 0), + gsSP1Triangle(11, 14, 12, 0), + gsSP1Triangle(15, 14, 11, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 108, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(0, 4, 3, 0), + gsSP1Triangle(5, 4, 0, 0), + gsSP1Triangle(6, 4, 5, 0), + gsSP1Triangle(6, 7, 4, 0), + gsSP1Triangle(4, 8, 3, 0), + gsSP1Triangle(9, 8, 4, 0), + gsSP1Triangle(3, 8, 10, 0), + gsSP1Triangle(10, 8, 2, 0), + gsSP1Triangle(2, 8, 11, 0), + gsSP1Triangle(12, 13, 14, 0), + gsSP1Triangle(15, 13, 12, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 124, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 1, 0, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(5, 4, 3, 0), + gsSP1Triangle(6, 5, 3, 0), + gsSP1Triangle(7, 5, 6, 0), + gsSP1Triangle(8, 4, 5, 0), + gsSP1Triangle(9, 4, 8, 0), + gsSP1Triangle(10, 4, 9, 0), + gsSP1Triangle(11, 12, 13, 0), + gsSP1Triangle(13, 12, 14, 0), + gsSP1Triangle(12, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 140, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(3, 1, 4, 0), + gsSP1Triangle(4, 1, 5, 0), + gsSP1Triangle(5, 1, 6, 0), + gsSP1Triangle(7, 5, 6, 0), + gsSP1Triangle(8, 5, 7, 0), + gsSP1Triangle(9, 5, 8, 0), + gsSP1Triangle(10, 9, 8, 0), + gsSP1Triangle(10, 3, 9, 0), + gsSP1Triangle(11, 12, 13, 0), + gsSP1Triangle(14, 12, 11, 0), + gsSP1Triangle(15, 12, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 156, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 2, 3, 0), + gsSP1Triangle(3, 2, 4, 0), + gsSP1Triangle(5, 6, 0, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(11, 9, 8, 0), + gsSP1Triangle(12, 9, 11, 0), + gsSP1Triangle(13, 12, 11, 0), + gsSP1Triangle(14, 9, 12, 0), + gsSP1Triangle(14, 15, 9, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 172, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(4, 3, 0, 0), + gsSP1Triangle(4, 5, 3, 0), + gsSP1Triangle(4, 6, 5, 0), + gsSP1Triangle(3, 5, 7, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(8, 11, 9, 0), + gsSP1Triangle(11, 12, 9, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 188, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 204, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(10, 11, 12, 0), + gsSP1Triangle(10, 13, 11, 0), + gsSP1Triangle(13, 14, 11, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 220, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 236, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(4, 5, 6, 0), + gsSP1Triangle(4, 7, 5, 0), + gsSP1Triangle(7, 8, 5, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 252, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(8, 11, 9, 0), + gsSP1Triangle(11, 12, 9, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 268, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(4, 5, 6, 0), + gsSP1Triangle(4, 7, 5, 0), + gsSP1Triangle(7, 8, 5, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 284, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 300, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(4, 5, 6, 0), + gsSP1Triangle(4, 7, 5, 0), + gsSP1Triangle(7, 8, 5, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 316, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(12, 13, 14, 0), + gsSP1Triangle(12, 15, 13, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 332, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(8, 11, 9, 0), + gsSP1Triangle(11, 12, 9, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 348, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 364, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(8, 11, 9, 0), + gsSP1Triangle(11, 12, 9, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 380, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(12, 13, 14, 0), + gsSP1Triangle(12, 15, 13, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 396, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(8, 11, 9, 0), + gsSP1Triangle(11, 12, 9, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 412, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 428, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(10, 11, 12, 0), + gsSP1Triangle(10, 13, 11, 0), + gsSP1Triangle(13, 14, 11, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 444, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(6, 7, 8, 0), + gsSP1Triangle(6, 9, 7, 0), + gsSP1Triangle(9, 10, 7, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 460, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(8, 11, 9, 0), + gsSP1Triangle(11, 12, 9, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 476, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(6, 7, 8, 0), + gsSP1Triangle(6, 9, 7, 0), + gsSP1Triangle(9, 10, 7, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 492, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 508, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(10, 11, 12, 0), + gsSP1Triangle(10, 13, 11, 0), + gsSP1Triangle(13, 14, 11, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 524, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(8, 9, 10, 0), + gsSP1Triangle(8, 11, 9, 0), + gsSP1Triangle(11, 12, 9, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 540, 16, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(3, 4, 1, 0), + gsSP1Triangle(3, 5, 4, 0), + gsSP1Triangle(5, 6, 4, 0), + gsSP1Triangle(5, 7, 6, 0), + gsSP1Triangle(7, 8, 6, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSP1Triangle(11, 12, 10, 0), + gsSP1Triangle(11, 13, 12, 0), + gsSP1Triangle(13, 14, 12, 0), + gsSP1Triangle(13, 15, 14, 0), + gsSPVertex(titletest_test_mesh_vtx_3 + 556, 12, 0), + gsSP1Triangle(0, 1, 2, 0), + gsSP1Triangle(0, 3, 1, 0), + gsSP1Triangle(4, 5, 6, 0), + gsSP1Triangle(4, 7, 5, 0), + gsSP1Triangle(7, 8, 5, 0), + gsSP1Triangle(7, 9, 8, 0), + gsSP1Triangle(9, 10, 8, 0), + gsSP1Triangle(9, 11, 10, 0), + gsSPEndDisplayList(), +}; + + +Gfx mat_titletest_sm64_material[] = { + gsDPPipeSync(), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), + gsSPTexture(65535, 65535, 0, 0, 1), + gsDPTileSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, titletest_blue_rgba16), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 7, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, 0), + gsDPLoadSync(), + gsDPLoadTile(7, 0, 0, 60, 60), + gsDPPipeSync(), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 0, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, 0), + gsDPSetTileSize(0, 0, 0, 60, 60), + gsSPSetLights1(titletest_sm64_material_lights), + gsSPEndDisplayList(), +}; + + +Gfx mat_titletest_sm64_material_001[] = { + gsDPPipeSync(), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), + gsSPTexture(65535, 65535, 0, 0, 1), + gsDPTileSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, titletest_darkerblue_rgba16), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 7, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, 0), + gsDPLoadSync(), + gsDPLoadTile(7, 0, 0, 60, 60), + gsDPPipeSync(), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 0, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, 0), + gsDPSetTileSize(0, 0, 0, 60, 60), + gsSPSetLights1(titletest_sm64_material_001_lights), + gsSPEndDisplayList(), +}; + + +Gfx mat_titletest_sm64_material_002[] = { + gsDPPipeSync(), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), + gsSPTexture(65535, 65535, 0, 0, 1), + gsDPTileSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, titletest_white_rgba16), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 7, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, 0), + gsDPLoadSync(), + gsDPLoadTile(7, 0, 0, 60, 60), + gsDPPipeSync(), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 0, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, 0), + gsDPSetTileSize(0, 0, 0, 60, 60), + gsSPSetLights1(titletest_sm64_material_002_lights), + gsSPEndDisplayList(), +}; + + +Gfx mat_titletest_sm64_material_003[] = { + gsDPPipeSync(), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), + gsSPTexture(65535, 65535, 0, 0, 1), + gsDPTileSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, titletest_grey_rgba16), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 7, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, 0), + gsDPLoadSync(), + gsDPLoadTile(7, 0, 0, 60, 60), + gsDPPipeSync(), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0, 0, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, 0, G_TX_WRAP | G_TX_NOMIRROR, 4, 0), + gsDPSetTileSize(0, 0, 0, 60, 60), + gsSPSetLights1(titletest_sm64_material_003_lights), + gsSPEndDisplayList(), +}; + + +Gfx titletest_test_mesh[] = { + gsSPDisplayList(mat_titletest_sm64_material), + gsSPDisplayList(titletest_test_mesh_tri_0), + gsSPDisplayList(mat_titletest_sm64_material_001), + gsSPDisplayList(titletest_test_mesh_tri_1), + gsSPDisplayList(mat_titletest_sm64_material_002), + gsSPDisplayList(titletest_test_mesh_tri_2), + gsSPDisplayList(mat_titletest_sm64_material_003), + gsSPDisplayList(titletest_test_mesh_tri_3), + gsDPPipeSync(), + gsSPSetGeometryMode(G_LIGHTING), + gsSPClearGeometryMode(G_TEXTURE_GEN), + gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT), + gsSPTexture(65535, 65535, 0, 0, 0), + gsSPEndDisplayList(), }; // 0x0700B420 - 0x0700B460 diff --git a/levels/jrb/leveldata.c b/levels/jrb/leveldata.c index 365d69a0..12cc6b72 100644 --- a/levels/jrb/leveldata.c +++ b/levels/jrb/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/level_defines.h b/levels/level_defines.h index 5e4fdc06..c14f2523 100644 --- a/levels/level_defines.h +++ b/levels/level_defines.h @@ -1,2 +1,57 @@ -#include "processed_level_defines.h" -#include "unprocessed_level_defines.h" \ No newline at end of file +#ifdef VERSION_JP +#define VAL_DIFF 25000 +#else +#define VAL_DIFF 60000 +#endif + +// Define lists for list of level for macros. Each of the following fields are described: +// Argument 1: Internal ROM name of the level. +// Argument 2: Level enumerator for enum used to identify the level ID. +// Argument 3: Course enumerator for enum used to identify the course ID. +// Argument 4: Shorthand name of the level which should be the name of the levels/ folder of the level. +// Argument 5: The shared texture bin used. +// Argument 6: Acoustic reaches for each levels. +// Argument 7, 8, 9: Echo levels for individual areas. +// Argument 10: Specify dynamic music tables for levels, if specified. _ for none. +// Argument 11: Specify level camera table, if specified. _ for none. + +// NOTE: Be sure to edit sZoomOutAreaMasks in camera.c, as there isnt a good way to macro those right now. +// TODO: Figure something out for sZoomOutAreaMasks? +STUB_LEVEL( "", LEVEL_UNKNOWN_1, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _) +STUB_LEVEL( "", LEVEL_UNKNOWN_2, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _) +STUB_LEVEL( "", LEVEL_UNKNOWN_3, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _) +DEFINE_LEVEL("TERESA OBAKE", LEVEL_BBH, COURSE_BBH, bbh, spooky, 28000, 0x28, 0x28, 0x28, sDynBbh, sCamBBH) +DEFINE_LEVEL("YYAMA1 % YSLD1", LEVEL_CCM, COURSE_CCM, ccm, snow, 17000, 0x10, 0x38, 0x38, _, sCamCCM) +DEFINE_LEVEL("SELECT ROOM", LEVEL_CASTLE, COURSE_NONE, castle_inside, inside, 20000, 0x20, 0x20, 0x30, _, sCamCastle) +DEFINE_LEVEL("HORROR DUNGEON", LEVEL_HMC, COURSE_HMC, hmc, cave, 16000, 0x28, 0x28, 0x28, sDynHmc, sCamHMC) +DEFINE_LEVEL("SABAKU % PYRMD", LEVEL_SSL, COURSE_SSL, ssl, generic, 15000, 0x08, 0x30, 0x30, _, sCamSSL) +DEFINE_LEVEL("BATTLE FIELD", LEVEL_BOB, COURSE_BOB, bob, generic, 15000, 0x08, 0x08, 0x08, _, _) +DEFINE_LEVEL("YUKIYAMA2", LEVEL_SL, COURSE_SL, sl, snow, 14000, 0x10, 0x28, 0x28, _, sCamSL) +DEFINE_LEVEL("POOL KAI", LEVEL_WDW, COURSE_WDW, wdw, grass, 17000, 0x10, 0x18, 0x18, sDynWdw, _) +DEFINE_LEVEL("WTDG % TINBOTU", LEVEL_JRB, COURSE_JRB, jrb, water, 20000, 0x10, 0x18, 0x18, sDynJrb, _) +DEFINE_LEVEL("BIG WORLD", LEVEL_THI, COURSE_THI, thi, grass, 20000, 0x0c, 0x0c, 0x20, _, sCamTHI) +DEFINE_LEVEL("CLOCK TOWER", LEVEL_TTC, COURSE_TTC, ttc, machine, 18000, 0x18, 0x18, 0x18, _, _) +DEFINE_LEVEL("RAINBOW CRUISE", LEVEL_RR, COURSE_RR, rr, sky, 20000, 0x20, 0x20, 0x20, _, sCamRR) +DEFINE_LEVEL("MAIN MAP", LEVEL_CASTLE_GROUNDS, COURSE_NONE, castle_grounds, outside, 25000, 0x08, 0x08, 0x08, _, _) +DEFINE_LEVEL("EXT1 YOKO SCRL", LEVEL_BITDW, COURSE_BITDW, bitdw, sky, 16000, 0x28, 0x28, 0x28, _, _) +DEFINE_LEVEL("EXT7 HORI MINI", LEVEL_VCUTM, COURSE_VCUTM, vcutm, outside, 30000, 0x28, 0x28, 0x28, _, _) +DEFINE_LEVEL("EXT2 TIKA LAVA", LEVEL_BITFS, COURSE_BITFS, bitfs, sky, 16000, 0x28, 0x28, 0x28, _, _) +DEFINE_LEVEL("EXT9 SUISOU", LEVEL_SA, COURSE_SA, sa, inside, 20000, 0x10, 0x10, 0x10, _, _) +DEFINE_LEVEL("EXT3 HEAVEN", LEVEL_BITS, COURSE_BITS, bits, sky, 16000, 0x28, 0x28, 0x28, _, _) +DEFINE_LEVEL("FIREB1 % INVLC", LEVEL_LLL, COURSE_LLL, lll, fire, 22000, 0x08, 0x30, 0x30, _, _) +DEFINE_LEVEL("WATER LAND", LEVEL_DDD, COURSE_DDD, ddd, water, 17000, 0x10, 0x20, 0x20, sDynDdd, _) +DEFINE_LEVEL("MOUNTAIN", LEVEL_WF, COURSE_WF, wf, grass, 13000, 0x08, 0x08, 0x08, _, _) +DEFINE_LEVEL("ENDING", LEVEL_ENDING, COURSE_CAKE_END, ending, generic, 20000, 0x00, 0x00, 0x00, _, _) +DEFINE_LEVEL("URANIWA", LEVEL_CASTLE_COURTYARD, COURSE_NONE, castle_courtyard, outside, 20000, 0x08, 0x08, 0x08, _, _) +DEFINE_LEVEL("EXT4 MINI SLID", LEVEL_PSS, COURSE_PSS, pss, mountain, 20000, 0x28, 0x28, 0x28, _, _) +DEFINE_LEVEL("IN THE FALL", LEVEL_COTMC, COURSE_COTMC, cotmc, cave, 18000, 0x28, 0x28, 0x28, _, sCamCotMC) +DEFINE_LEVEL("EXT6 MARIO FLY", LEVEL_TOTWC, COURSE_TOTWC, totwc, sky, 20000, 0x20, 0x20, 0x20, _, _) +DEFINE_LEVEL("KUPPA1", LEVEL_BOWSER_1, COURSE_BITDW, bowser_1, generic, VAL_DIFF, 0x40, 0x40, 0x40, _, _) +DEFINE_LEVEL("EXT8 BLUE SKY", LEVEL_WMOTR, COURSE_WMOTR, wmotr, generic, 20000, 0x28, 0x28, 0x28, _, _) +STUB_LEVEL( "", LEVEL_UNKNOWN_32, COURSE_NONE, 20000, 0x70, 0x00, 0x00, _, _) +DEFINE_LEVEL("KUPPA2", LEVEL_BOWSER_2, COURSE_BITFS, bowser_2, fire, VAL_DIFF, 0x40, 0x40, 0x40, _, _) +DEFINE_LEVEL("KUPPA3", LEVEL_BOWSER_3, COURSE_BITS, bowser_3, generic, VAL_DIFF, 0x40, 0x40, 0x40, _, _) +STUB_LEVEL( "", LEVEL_UNKNOWN_35, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _) +DEFINE_LEVEL("DONKEY % SLID2", LEVEL_TTM, COURSE_TTM, ttm, mountain, 15000, 0x08, 0x08, 0x08, _, _) +STUB_LEVEL( "", LEVEL_UNKNOWN_37, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _) +STUB_LEVEL( "", LEVEL_UNKNOWN_38, COURSE_NONE, 20000, 0x00, 0x00, 0x00, sDynUnk38, _) diff --git a/levels/lll/leveldata.c b/levels/lll/leveldata.c index 0cdae0fa..17596093 100644 --- a/levels/lll/leveldata.c +++ b/levels/lll/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/menu/geo.c b/levels/menu/geo.c index 32b8e492..466b85d4 100644 --- a/levels/menu/geo.c +++ b/levels/menu/geo.c @@ -8,7 +8,7 @@ #include "game/moving_texture.h" #include "game/screen_transition.h" #include "game/paintings.h" -#include "menu/file_select.hpp" +#include "menu/file_select.h" #include "menu/star_select.h" #include "make_const_nonconst.h" diff --git a/levels/menu/leveldata.c b/levels/menu/leveldata.c index 31d5ec04..4ccfea80 100644 --- a/levels/menu/leveldata.c +++ b/levels/menu/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/menu/script.c b/levels/menu/script.c index cd0f829b..4e955c12 100644 --- a/levels/menu/script.c +++ b/levels/menu/script.c @@ -8,7 +8,7 @@ #include "game/area.h" #include "game/level_update.h" -#include "menu/file_select.hpp" +#include "menu/file_select.h" #include "menu/star_select.h" #include "levels/scripts.h" @@ -72,18 +72,16 @@ const LevelScript level_main_menu_entry_2[] = { /*25*/ FREE_LEVEL_POOL(), /*26*/ LOAD_AREA(/*area*/ 2), -#ifdef NO_SEGMENTED_MEMORY - // sVisibleStars is set to 0 during FIXED_LOAD above on N64, but not when NO_SEGMENTED_MEMORY is used. - // lvl_init_act_selector_values_and_stars must be called here otherwise the previous - // value is retained and causes incorrect drawing during the 16 transition frames. + + // sVisibleStars is set to 0 during FIXED_LOAD above on N64, but not on PC-port. + // lvl_init_act_selector_values_and_stars must be called here otherwise the + // previous value is retained and causes incorrect drawing during the 16 transition + // frames. CALL(/*arg*/ 0, /*func*/ lvl_init_act_selector_values_and_stars), -#endif + /*27*/ TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF), /*29*/ SLEEP(/*frames*/ 16), /*30*/ SET_MENU_MUSIC(/*seq*/ 0x000D), -#ifndef NO_SEGMENTED_MEMORY - /*31*/ CALL(/*arg*/ 0, /*func*/ lvl_init_act_selector_values_and_stars), -#endif /*33*/ CALL_LOOP(/*arg*/ 0, /*func*/ lvl_update_obj_and_load_act_button_actions), /*35*/ GET_OR_SET(/*op*/ OP_SET, /*var*/ VAR_CURR_ACT_NUM), /*36*/ STOP_MUSIC(/*fadeOutTime*/ 0x00BE), diff --git a/levels/processed_level_defines.h b/levels/processed_level_defines.h deleted file mode 100644 index b9560a8c..00000000 --- a/levels/processed_level_defines.h +++ /dev/null @@ -1,4 +0,0 @@ -DEFINE_LEVEL("URANIWA", LEVEL_CASTLE_COURTYARD, COURSE_NONE, castle_courtyard, - outside, 20000, 0x08, 0x08, 0x08, _, _) -DEFINE_LEVEL("MAIN MAP", LEVEL_CASTLE_GROUNDS, COURSE_NONE, castle_grounds, - outside, 25000, 0x08, 0x08, 0x08, _, _) diff --git a/levels/pss/leveldata.c b/levels/pss/leveldata.c index 16fd5f88..8f98eff1 100644 --- a/levels/pss/leveldata.c +++ b/levels/pss/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/rr/leveldata.c b/levels/rr/leveldata.c index fdcc2cde..218f1e34 100644 --- a/levels/rr/leveldata.c +++ b/levels/rr/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/sa/leveldata.c b/levels/sa/leveldata.c index 7ac83e1e..a36715ee 100644 --- a/levels/sa/leveldata.c +++ b/levels/sa/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/scripts.c b/levels/scripts.c index 81dff792..972c9ad0 100644 --- a/levels/scripts.c +++ b/levels/scripts.c @@ -1,21 +1,17 @@ -#include "scripts.h" - #include +#include "sm64.h" +#include "game/level_update.h" +#include "level_commands.h" +#include "game/area.h" -#include +#include "make_const_nonconst.h" + +#include "segment_symbols.h" #include "actors/common0.h" #include "actors/common1.h" #include "actors/group0.h" #include "actors/group1.h" -#include "actors/group10.h" -#include "actors/group11.h" -#include "actors/group12.h" -#include "actors/group13.h" -#include "actors/group14.h" -#include "actors/group15.h" -#include "actors/group16.h" -#include "actors/group17.h" #include "actors/group2.h" #include "actors/group3.h" #include "actors/group4.h" @@ -24,380 +20,332 @@ #include "actors/group7.h" #include "actors/group8.h" #include "actors/group9.h" -#include "common/scripts/dynamic_level_script_builder.hpp" -#include "game/area.h" -#include "game/level_update.h" -#include "level_commands.h" -#include "level_headers.h" -#include "level_table.h" -#include "levels/intro/header.h" +#include "actors/group10.h" +#include "actors/group11.h" +#include "actors/group12.h" +#include "actors/group13.h" +#include "actors/group14.h" +#include "actors/group15.h" +#include "actors/group16.h" +#include "actors/group17.h" + #include "levels/menu/header.h" -#include "make_const_nonconst.h" -#include "segment_symbols.h" -#include "sm64.h" -#include "util/unused.hpp" +#include "levels/intro/header.h" -LevelScript level_main_scripts_entry[138]; +#include "level_headers.h" -const LevelScript* get_level_main_scripts_entry() { - const LevelScript level_main_scripts_entry_before[] = { - LOAD_MIO0(/*seg*/ 0x04, _group0_mio0SegmentRomStart, - _group0_mio0SegmentRomEnd), - LOAD_MIO0(/*seg*/ 0x03, _common1_mio0SegmentRomStart, - _common1_mio0SegmentRomEnd), - LOAD_RAW(/*seg*/ 0x17, _group0_geoSegmentRomStart, - _group0_geoSegmentRomEnd), - LOAD_RAW(/*seg*/ 0x16, _common1_geoSegmentRomStart, - _common1_geoSegmentRomEnd), - LOAD_RAW(/*seg*/ 0x13, _behaviorSegmentRomStart, _behaviorSegmentRomEnd), - ALLOC_LEVEL_POOL(), - LOAD_MODEL_FROM_GEO(MODEL_MARIO, mario_geo), - LOAD_MODEL_FROM_GEO(MODEL_SMOKE, smoke_geo), - LOAD_MODEL_FROM_GEO(MODEL_SPARKLES, sparkles_geo), - LOAD_MODEL_FROM_GEO(MODEL_BUBBLE, bubble_geo), - LOAD_MODEL_FROM_GEO(MODEL_SMALL_WATER_SPLASH, small_water_splash_geo), - LOAD_MODEL_FROM_GEO(MODEL_IDLE_WATER_WAVE, idle_water_wave_geo), - LOAD_MODEL_FROM_GEO(MODEL_WATER_SPLASH, water_splash_geo), - LOAD_MODEL_FROM_GEO(MODEL_WAVE_TRAIL, wave_trail_geo), - LOAD_MODEL_FROM_GEO(MODEL_YELLOW_COIN, yellow_coin_geo), - LOAD_MODEL_FROM_GEO(MODEL_STAR, star_geo), - LOAD_MODEL_FROM_GEO(MODEL_TRANSPARENT_STAR, transparent_star_geo), - LOAD_MODEL_FROM_GEO(MODEL_WOODEN_SIGNPOST, wooden_signpost_geo), - LOAD_MODEL_FROM_DL(MODEL_WHITE_PARTICLE_SMALL, white_particle_small_dl, - LAYER_ALPHA), - LOAD_MODEL_FROM_GEO(MODEL_RED_FLAME, red_flame_geo), - LOAD_MODEL_FROM_GEO(MODEL_BLUE_FLAME, blue_flame_geo), - LOAD_MODEL_FROM_GEO(MODEL_BURN_SMOKE, burn_smoke_geo), - LOAD_MODEL_FROM_GEO(MODEL_LEAVES, leaves_geo), - LOAD_MODEL_FROM_GEO(MODEL_PURPLE_MARBLE, purple_marble_geo), - LOAD_MODEL_FROM_GEO(MODEL_FISH, fish_geo), - LOAD_MODEL_FROM_GEO(MODEL_FISH_SHADOW, fish_shadow_geo), - LOAD_MODEL_FROM_GEO(MODEL_SPARKLES_ANIMATION, sparkles_animation_geo), - LOAD_MODEL_FROM_DL(MODEL_SAND_DUST, sand_seg3_dl_0302BCD0, LAYER_ALPHA), - LOAD_MODEL_FROM_GEO(MODEL_BUTTERFLY, butterfly_geo), - LOAD_MODEL_FROM_GEO(MODEL_BURN_SMOKE_UNUSED, burn_smoke_geo), - LOAD_MODEL_FROM_DL(MODEL_PEBBLE, pebble_seg3_dl_0301CB00, LAYER_ALPHA), - LOAD_MODEL_FROM_GEO(MODEL_MIST, mist_geo), - LOAD_MODEL_FROM_GEO(MODEL_WHITE_PUFF, white_puff_geo), - LOAD_MODEL_FROM_DL(MODEL_WHITE_PARTICLE_DL, white_particle_dl, - LAYER_ALPHA), - LOAD_MODEL_FROM_GEO(MODEL_WHITE_PARTICLE, white_particle_geo), - LOAD_MODEL_FROM_GEO(MODEL_YELLOW_COIN_NO_SHADOW, - yellow_coin_no_shadow_geo), - LOAD_MODEL_FROM_GEO(MODEL_BLUE_COIN, blue_coin_geo), - LOAD_MODEL_FROM_GEO(MODEL_BLUE_COIN_NO_SHADOW, blue_coin_no_shadow_geo), - LOAD_MODEL_FROM_GEO(MODEL_MARIOS_WINGED_METAL_CAP, - marios_winged_metal_cap_geo), - LOAD_MODEL_FROM_GEO(MODEL_MARIOS_METAL_CAP, marios_metal_cap_geo), - LOAD_MODEL_FROM_GEO(MODEL_MARIOS_WING_CAP, marios_wing_cap_geo), - LOAD_MODEL_FROM_GEO(MODEL_MARIOS_CAP, marios_cap_geo), - LOAD_MODEL_FROM_GEO(MODEL_MARIOS_CAP, marios_cap_geo), // repeated - LOAD_MODEL_FROM_GEO(MODEL_BOWSER_KEY_CUTSCENE, bowser_key_cutscene_geo), - LOAD_MODEL_FROM_GEO(MODEL_BOWSER_KEY, bowser_key_geo), - LOAD_MODEL_FROM_GEO(MODEL_RED_FLAME_SHADOW, red_flame_shadow_geo), - LOAD_MODEL_FROM_GEO(MODEL_1UP, mushroom_1up_geo), - LOAD_MODEL_FROM_GEO(MODEL_RED_COIN, red_coin_geo), - LOAD_MODEL_FROM_GEO(MODEL_RED_COIN_NO_SHADOW, red_coin_no_shadow_geo), - LOAD_MODEL_FROM_GEO(MODEL_NUMBER, number_geo), - LOAD_MODEL_FROM_GEO(MODEL_EXPLOSION, explosion_geo), - LOAD_MODEL_FROM_GEO(MODEL_DIRT_ANIMATION, dirt_animation_geo), - LOAD_MODEL_FROM_GEO(MODEL_CARTOON_STAR, cartoon_star_geo), - FREE_LEVEL_POOL(), - CALL(/*arg*/ 0, /*func*/ lvl_init_from_save_file), - LOOP_BEGIN(), - EXECUTE(/*seg*/ 0x14, _menuSegmentRomStart, _menuSegmentRomEnd, - level_main_menu_entry_2), - }; +#include "level_table.h" - const LevelScript level_main_scripts_entry_after[] = { - SLEEP(/*frames*/ 1), - LOOP_UNTIL(/*op*/ OP_LT, /*arg*/ 0), - JUMP_IF(/*op*/ OP_EQ, /*arg*/ -1, script_L2), - JUMP_IF(/*op*/ OP_EQ, /*arg*/ -2, script_L3), - JUMP_IF(/*op*/ OP_EQ, /*arg*/ -3, script_L4), - JUMP_IF(/*op*/ OP_EQ, /*arg*/ -8, script_L1), - JUMP_IF(/*op*/ OP_EQ, /*arg*/ -9, script_L5), - }; +#define STUB_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8) +#define DEFINE_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) + 3 +static const LevelScript script_exec_level_table[2 + #include "level_defines.h" +]; +#undef DEFINE_LEVEL +#undef STUB_LEVEL - int script_count; - auto scripts = DynamicLevelScriptBuilder() - .add_scripts(level_main_scripts_entry_before, 118) - .add_jump_link(get_script_exec_level_table()) - .add_scripts(level_main_scripts_entry_after, 18) - .get_entry_pointer(script_count); +static const LevelScript script_L1[4]; +static const LevelScript script_L2[4]; +static const LevelScript script_L3[4]; +static const LevelScript script_L4[4]; +static const LevelScript script_L5[4]; - for (auto i = 0; i < script_count; ++i) { - level_main_scripts_entry[i] = scripts[i]; - } +#define STUB_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8) +#define DEFINE_LEVEL(_0, _1, _2, folder, _4, _5, _6, _7, _8, _9, _10) static const LevelScript script_exec_ ## folder [4 + 1]; - return level_main_scripts_entry; -} +#include "level_defines.h" -const LevelScript script_L1[] = { - EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, - level_intro_entry_1), +#undef DEFINE_LEVEL +#undef STUB_LEVEL + +const LevelScript level_main_scripts_entry[] = { + LOAD_MIO0(/*seg*/ 0x04, _group0_mio0SegmentRomStart, _group0_mio0SegmentRomEnd), + LOAD_MIO0(/*seg*/ 0x03, _common1_mio0SegmentRomStart, _common1_mio0SegmentRomEnd), + LOAD_RAW( /*seg*/ 0x17, _group0_geoSegmentRomStart, _group0_geoSegmentRomEnd), + LOAD_RAW( /*seg*/ 0x16, _common1_geoSegmentRomStart, _common1_geoSegmentRomEnd), + LOAD_RAW( /*seg*/ 0x13, _behaviorSegmentRomStart, _behaviorSegmentRomEnd), + ALLOC_LEVEL_POOL(), + LOAD_MODEL_FROM_GEO(MODEL_MARIO, mario_geo), + LOAD_MODEL_FROM_GEO(MODEL_SMOKE, smoke_geo), + LOAD_MODEL_FROM_GEO(MODEL_SPARKLES, sparkles_geo), + LOAD_MODEL_FROM_GEO(MODEL_BUBBLE, bubble_geo), + LOAD_MODEL_FROM_GEO(MODEL_SMALL_WATER_SPLASH, small_water_splash_geo), + LOAD_MODEL_FROM_GEO(MODEL_IDLE_WATER_WAVE, idle_water_wave_geo), + LOAD_MODEL_FROM_GEO(MODEL_WATER_SPLASH, water_splash_geo), + LOAD_MODEL_FROM_GEO(MODEL_WAVE_TRAIL, wave_trail_geo), + LOAD_MODEL_FROM_GEO(MODEL_YELLOW_COIN, yellow_coin_geo), + LOAD_MODEL_FROM_GEO(MODEL_STAR, star_geo), + LOAD_MODEL_FROM_GEO(MODEL_TRANSPARENT_STAR, transparent_star_geo), + LOAD_MODEL_FROM_GEO(MODEL_WOODEN_SIGNPOST, wooden_signpost_geo), + LOAD_MODEL_FROM_DL( MODEL_WHITE_PARTICLE_SMALL, white_particle_small_dl, LAYER_ALPHA), + LOAD_MODEL_FROM_GEO(MODEL_RED_FLAME, red_flame_geo), + LOAD_MODEL_FROM_GEO(MODEL_BLUE_FLAME, blue_flame_geo), + LOAD_MODEL_FROM_GEO(MODEL_BURN_SMOKE, burn_smoke_geo), + LOAD_MODEL_FROM_GEO(MODEL_LEAVES, leaves_geo), + LOAD_MODEL_FROM_GEO(MODEL_PURPLE_MARBLE, purple_marble_geo), + LOAD_MODEL_FROM_GEO(MODEL_FISH, fish_geo), + LOAD_MODEL_FROM_GEO(MODEL_FISH_SHADOW, fish_shadow_geo), + LOAD_MODEL_FROM_GEO(MODEL_SPARKLES_ANIMATION, sparkles_animation_geo), + LOAD_MODEL_FROM_DL( MODEL_SAND_DUST, sand_seg3_dl_0302BCD0, LAYER_ALPHA), + LOAD_MODEL_FROM_GEO(MODEL_BUTTERFLY, butterfly_geo), + LOAD_MODEL_FROM_GEO(MODEL_BURN_SMOKE_UNUSED, burn_smoke_geo), + LOAD_MODEL_FROM_DL( MODEL_PEBBLE, pebble_seg3_dl_0301CB00, LAYER_ALPHA), + LOAD_MODEL_FROM_GEO(MODEL_MIST, mist_geo), + LOAD_MODEL_FROM_GEO(MODEL_WHITE_PUFF, white_puff_geo), + LOAD_MODEL_FROM_DL( MODEL_WHITE_PARTICLE_DL, white_particle_dl, LAYER_ALPHA), + LOAD_MODEL_FROM_GEO(MODEL_WHITE_PARTICLE, white_particle_geo), + LOAD_MODEL_FROM_GEO(MODEL_YELLOW_COIN_NO_SHADOW, yellow_coin_no_shadow_geo), + LOAD_MODEL_FROM_GEO(MODEL_BLUE_COIN, blue_coin_geo), + LOAD_MODEL_FROM_GEO(MODEL_BLUE_COIN_NO_SHADOW, blue_coin_no_shadow_geo), + LOAD_MODEL_FROM_GEO(MODEL_MARIOS_WINGED_METAL_CAP, marios_winged_metal_cap_geo), + LOAD_MODEL_FROM_GEO(MODEL_MARIOS_METAL_CAP, marios_metal_cap_geo), + LOAD_MODEL_FROM_GEO(MODEL_MARIOS_WING_CAP, marios_wing_cap_geo), + LOAD_MODEL_FROM_GEO(MODEL_MARIOS_CAP, marios_cap_geo), + LOAD_MODEL_FROM_GEO(MODEL_MARIOS_CAP, marios_cap_geo), // repeated + LOAD_MODEL_FROM_GEO(MODEL_BOWSER_KEY_CUTSCENE, bowser_key_cutscene_geo), + LOAD_MODEL_FROM_GEO(MODEL_BOWSER_KEY, bowser_key_geo), + LOAD_MODEL_FROM_GEO(MODEL_RED_FLAME_SHADOW, red_flame_shadow_geo), + LOAD_MODEL_FROM_GEO(MODEL_1UP, mushroom_1up_geo), + LOAD_MODEL_FROM_GEO(MODEL_RED_COIN, red_coin_geo), + LOAD_MODEL_FROM_GEO(MODEL_RED_COIN_NO_SHADOW, red_coin_no_shadow_geo), + LOAD_MODEL_FROM_GEO(MODEL_NUMBER, number_geo), + LOAD_MODEL_FROM_GEO(MODEL_EXPLOSION, explosion_geo), + LOAD_MODEL_FROM_GEO(MODEL_DIRT_ANIMATION, dirt_animation_geo), + LOAD_MODEL_FROM_GEO(MODEL_CARTOON_STAR, cartoon_star_geo), + FREE_LEVEL_POOL(), + CALL(/*arg*/ 0, /*func*/ lvl_init_from_save_file), + LOOP_BEGIN(), + EXECUTE(/*seg*/ 0x14, _menuSegmentRomStart, _menuSegmentRomEnd, level_main_menu_entry_2), + JUMP_LINK(script_exec_level_table), + SLEEP(/*frames*/ 1), + LOOP_UNTIL(/*op*/ OP_LT, /*arg*/ 0), + JUMP_IF(/*op*/ OP_EQ, /*arg*/ -1, script_L2), + JUMP_IF(/*op*/ OP_EQ, /*arg*/ -2, script_L3), + JUMP_IF(/*op*/ OP_EQ, /*arg*/ -3, script_L4), + JUMP_IF(/*op*/ OP_EQ, /*arg*/ -8, script_L1), + JUMP_IF(/*op*/ OP_EQ, /*arg*/ -9, script_L5), }; -const LevelScript script_L2[] = { - EXIT_AND_EXECUTE(/*seg*/ 0x0E, _endingSegmentRomStart, _endingSegmentRomEnd, - level_ending_entry), +static const LevelScript script_L1[] = { + EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_1), }; -const LevelScript script_L3[] = { - EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, - level_intro_entry_2), +static const LevelScript script_L2[] = { + EXIT_AND_EXECUTE(/*seg*/ 0x0E, _endingSegmentRomStart, _endingSegmentRomEnd, level_ending_entry), }; -const LevelScript script_L4[] = { - EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, - level_intro_entry_3), +static const LevelScript script_L3[] = { + EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_2), }; -const LevelScript script_L5[] = { - EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, - level_intro_entry_4), +static const LevelScript script_L4[] = { + EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_3), +}; + +static const LevelScript script_L5[] = { + EXIT_AND_EXECUTE(/*seg*/ 0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_4), }; // Include the level jumptable. #define STUB_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8) -std::shared_ptr get_script_exec_level_table() { - auto builder = new DynamicLevelScriptBuilder(); - - builder->add_script(GET_OR_SET(/*op*/ OP_GET, /*var*/ VAR_CURR_LEVEL_NUM)); - - #define DEFINE_LEVEL(_0, levelenum, _2, folder, _4, _5, _6, _7, _8, _9, _10) \ - builder->add_jump_if_equal(levelenum, get_script_exec_##folder()); - #include "processed_level_defines.h" - #undef DEFINE_LEVEL - - #define DEFINE_LEVEL(_0, levelenum, _2, folder, _4, _5, _6, _7, _8, _9, _10) \ - builder->add_jump_if_equal(levelenum, script_exec_##folder); - #include "unprocessed_level_defines.h" - #undef DEFINE_LEVEL - - builder->add_script(EXIT()); - - return std::shared_ptr(builder); -} +#define DEFINE_LEVEL(_0, levelenum, _2, folder, _4, _5, _6, _7, _8, _9, _10) JUMP_IF(OP_EQ, levelenum, script_exec_ ## folder), +static const LevelScript script_exec_level_table[] = { + GET_OR_SET(/*op*/ OP_GET, /*var*/ VAR_CURR_LEVEL_NUM), + #include "levels/level_defines.h" + EXIT(), +}; +#undef DEFINE_LEVEL #define DEFINE_LEVEL(_0, _1, _2, folder, _4, _5, _6, _7, _8, _9, _10) \ - const u8* _##folder##SegmentRomStart_ = nullptr; \ - const u8* _##folder##SegmentRomEnd_ = nullptr; \ - \ - std::shared_ptr get_script_exec_##folder() { \ - auto script_exec = new DynamicLevelScriptBuilder(); \ - script_exec->add_execute(0x0E, \ - _##folder##SegmentRomStart_, \ - _##folder##SegmentRomEnd_, \ - get_level_##folder##_entry()); \ - script_exec->add_script(RETURN()); \ - \ - return std::shared_ptr(script_exec); \ - } -#include "processed_level_defines.h" -#undef DEFINE_LEVEL - - -#define DEFINE_LEVEL(_0, _1, _2, folder, _4, _5, _6, _7, _8, _9, _10) \ - const LevelScript script_exec_##folder[] = { \ - EXECUTE(0x0E, _##folder##SegmentRomStart, _##folder##SegmentRomEnd, \ - level_##folder##_entry), \ - RETURN(), \ - }; -#include "unprocessed_level_defines.h" -#undef DEFINE_LEVEL +static const LevelScript script_exec_ ## folder [] = { \ + EXECUTE(0x0E, _ ## folder ## SegmentRomStart, _ ## folder ## SegmentRomEnd, level_ ## folder ## _entry), \ + RETURN(), \ +}; +#include "levels/level_defines.h" #undef STUB_LEVEL - +#undef DEFINE_LEVEL const LevelScript script_func_global_1[] = { - LOAD_MODEL_FROM_GEO(MODEL_BLUE_COIN_SWITCH, blue_coin_switch_geo), - LOAD_MODEL_FROM_GEO(MODEL_AMP, amp_geo), - LOAD_MODEL_FROM_GEO(MODEL_PURPLE_SWITCH, purple_switch_geo), - LOAD_MODEL_FROM_GEO(MODEL_CHECKERBOARD_PLATFORM, checkerboard_platform_geo), - LOAD_MODEL_FROM_GEO(MODEL_BREAKABLE_BOX, breakable_box_geo), - LOAD_MODEL_FROM_GEO(MODEL_BREAKABLE_BOX_SMALL, breakable_box_small_geo), - LOAD_MODEL_FROM_GEO(MODEL_EXCLAMATION_BOX_OUTLINE, - exclamation_box_outline_geo), - LOAD_MODEL_FROM_GEO(MODEL_EXCLAMATION_BOX, exclamation_box_geo), - LOAD_MODEL_FROM_GEO(MODEL_GOOMBA, goomba_geo), - LOAD_MODEL_FROM_DL(MODEL_EXCLAMATION_POINT, - exclamation_box_outline_seg8_dl_08025F08, LAYER_ALPHA), - LOAD_MODEL_FROM_GEO(MODEL_KOOPA_SHELL, koopa_shell_geo), - LOAD_MODEL_FROM_GEO(MODEL_METAL_BOX, metal_box_geo), - LOAD_MODEL_FROM_DL(MODEL_METAL_BOX_DL, metal_box_dl, LAYER_OPAQUE), - LOAD_MODEL_FROM_GEO(MODEL_BLACK_BOBOMB, black_bobomb_geo), - LOAD_MODEL_FROM_GEO(MODEL_BOBOMB_BUDDY, bobomb_buddy_geo), - LOAD_MODEL_FROM_DL(MODEL_DL_CANNON_LID, cannon_lid_seg8_dl_080048E0, - LAYER_OPAQUE), - LOAD_MODEL_FROM_GEO(MODEL_BOWLING_BALL, bowling_ball_geo), - LOAD_MODEL_FROM_GEO(MODEL_CANNON_BARREL, cannon_barrel_geo), - LOAD_MODEL_FROM_GEO(MODEL_CANNON_BASE, cannon_base_geo), - LOAD_MODEL_FROM_GEO(MODEL_HEART, heart_geo), - LOAD_MODEL_FROM_GEO(MODEL_FLYGUY, flyguy_geo), - LOAD_MODEL_FROM_GEO(MODEL_CHUCKYA, chuckya_geo), - LOAD_MODEL_FROM_GEO(MODEL_TRAJECTORY_MARKER_BALL, bowling_ball_track_geo), + LOAD_MODEL_FROM_GEO(MODEL_BLUE_COIN_SWITCH, blue_coin_switch_geo), + LOAD_MODEL_FROM_GEO(MODEL_AMP, amp_geo), + LOAD_MODEL_FROM_GEO(MODEL_PURPLE_SWITCH, purple_switch_geo), + LOAD_MODEL_FROM_GEO(MODEL_CHECKERBOARD_PLATFORM, checkerboard_platform_geo), + LOAD_MODEL_FROM_GEO(MODEL_BREAKABLE_BOX, breakable_box_geo), + LOAD_MODEL_FROM_GEO(MODEL_BREAKABLE_BOX_SMALL, breakable_box_small_geo), + LOAD_MODEL_FROM_GEO(MODEL_EXCLAMATION_BOX_OUTLINE, exclamation_box_outline_geo), + LOAD_MODEL_FROM_GEO(MODEL_EXCLAMATION_BOX, exclamation_box_geo), + LOAD_MODEL_FROM_GEO(MODEL_GOOMBA, goomba_geo), + LOAD_MODEL_FROM_DL( MODEL_EXCLAMATION_POINT, exclamation_box_outline_seg8_dl_08025F08, LAYER_ALPHA), + LOAD_MODEL_FROM_GEO(MODEL_KOOPA_SHELL, koopa_shell_geo), + LOAD_MODEL_FROM_GEO(MODEL_METAL_BOX, metal_box_geo), + LOAD_MODEL_FROM_DL( MODEL_METAL_BOX_DL, metal_box_dl, LAYER_OPAQUE), + LOAD_MODEL_FROM_GEO(MODEL_BLACK_BOBOMB, black_bobomb_geo), + LOAD_MODEL_FROM_GEO(MODEL_BOBOMB_BUDDY, bobomb_buddy_geo), + LOAD_MODEL_FROM_DL( MODEL_DL_CANNON_LID, cannon_lid_seg8_dl_080048E0, LAYER_OPAQUE), + LOAD_MODEL_FROM_GEO(MODEL_BOWLING_BALL, bowling_ball_geo), + LOAD_MODEL_FROM_GEO(MODEL_CANNON_BARREL, cannon_barrel_geo), + LOAD_MODEL_FROM_GEO(MODEL_CANNON_BASE, cannon_base_geo), + LOAD_MODEL_FROM_GEO(MODEL_HEART, heart_geo), + LOAD_MODEL_FROM_GEO(MODEL_FLYGUY, flyguy_geo), + LOAD_MODEL_FROM_GEO(MODEL_CHUCKYA, chuckya_geo), + LOAD_MODEL_FROM_GEO(MODEL_TRAJECTORY_MARKER_BALL, bowling_ball_track_geo), RETURN(), }; const LevelScript script_func_global_2[] = { - LOAD_MODEL_FROM_GEO(MODEL_BULLET_BILL, bullet_bill_geo), - LOAD_MODEL_FROM_GEO(MODEL_YELLOW_SPHERE, yellow_sphere_geo), - LOAD_MODEL_FROM_GEO(MODEL_HOOT, hoot_geo), - LOAD_MODEL_FROM_GEO(MODEL_YOSHI_EGG, yoshi_egg_geo), - LOAD_MODEL_FROM_GEO(MODEL_THWOMP, thwomp_geo), - LOAD_MODEL_FROM_GEO(MODEL_HEAVE_HO, heave_ho_geo), + LOAD_MODEL_FROM_GEO(MODEL_BULLET_BILL, bullet_bill_geo), + LOAD_MODEL_FROM_GEO(MODEL_YELLOW_SPHERE, yellow_sphere_geo), + LOAD_MODEL_FROM_GEO(MODEL_HOOT, hoot_geo), + LOAD_MODEL_FROM_GEO(MODEL_YOSHI_EGG, yoshi_egg_geo), + LOAD_MODEL_FROM_GEO(MODEL_THWOMP, thwomp_geo), + LOAD_MODEL_FROM_GEO(MODEL_HEAVE_HO, heave_ho_geo), RETURN(), }; const LevelScript script_func_global_3[] = { - LOAD_MODEL_FROM_GEO(MODEL_BLARGG, blargg_geo), - LOAD_MODEL_FROM_GEO(MODEL_BULLY, bully_geo), - LOAD_MODEL_FROM_GEO(MODEL_BULLY_BOSS, bully_boss_geo), + LOAD_MODEL_FROM_GEO(MODEL_BLARGG, blargg_geo), + LOAD_MODEL_FROM_GEO(MODEL_BULLY, bully_geo), + LOAD_MODEL_FROM_GEO(MODEL_BULLY_BOSS, bully_boss_geo), RETURN(), }; const LevelScript script_func_global_4[] = { - LOAD_MODEL_FROM_GEO(MODEL_WATER_BOMB, water_bomb_geo), - LOAD_MODEL_FROM_GEO(MODEL_WATER_BOMB_SHADOW, water_bomb_shadow_geo), - LOAD_MODEL_FROM_GEO(MODEL_KING_BOBOMB, king_bobomb_geo), + LOAD_MODEL_FROM_GEO(MODEL_WATER_BOMB, water_bomb_geo), + LOAD_MODEL_FROM_GEO(MODEL_WATER_BOMB_SHADOW, water_bomb_shadow_geo), + LOAD_MODEL_FROM_GEO(MODEL_KING_BOBOMB, king_bobomb_geo), RETURN(), }; const LevelScript script_func_global_5[] = { - LOAD_MODEL_FROM_GEO(MODEL_MANTA_RAY, manta_seg5_geo_05008D14), - LOAD_MODEL_FROM_GEO(MODEL_UNAGI, unagi_geo), - LOAD_MODEL_FROM_GEO(MODEL_SUSHI, sushi_geo), - LOAD_MODEL_FROM_DL(MODEL_DL_WHIRLPOOL, whirlpool_seg5_dl_05013CB8, - LAYER_TRANSPARENT), - LOAD_MODEL_FROM_GEO(MODEL_CLAM_SHELL, clam_shell_geo), + LOAD_MODEL_FROM_GEO(MODEL_MANTA_RAY, manta_seg5_geo_05008D14), + LOAD_MODEL_FROM_GEO(MODEL_UNAGI, unagi_geo), + LOAD_MODEL_FROM_GEO(MODEL_SUSHI, sushi_geo), + LOAD_MODEL_FROM_DL( MODEL_DL_WHIRLPOOL, whirlpool_seg5_dl_05013CB8, LAYER_TRANSPARENT), + LOAD_MODEL_FROM_GEO(MODEL_CLAM_SHELL, clam_shell_geo), RETURN(), }; const LevelScript script_func_global_6[] = { - LOAD_MODEL_FROM_GEO(MODEL_POKEY_HEAD, pokey_head_geo), - LOAD_MODEL_FROM_GEO(MODEL_POKEY_BODY_PART, pokey_body_part_geo), - LOAD_MODEL_FROM_GEO(MODEL_TWEESTER, tweester_geo), - LOAD_MODEL_FROM_GEO(MODEL_KLEPTO, klepto_geo), - LOAD_MODEL_FROM_GEO(MODEL_EYEROK_LEFT_HAND, eyerok_left_hand_geo), - LOAD_MODEL_FROM_GEO(MODEL_EYEROK_RIGHT_HAND, eyerok_right_hand_geo), + LOAD_MODEL_FROM_GEO(MODEL_POKEY_HEAD, pokey_head_geo), + LOAD_MODEL_FROM_GEO(MODEL_POKEY_BODY_PART, pokey_body_part_geo), + LOAD_MODEL_FROM_GEO(MODEL_TWEESTER, tweester_geo), + LOAD_MODEL_FROM_GEO(MODEL_KLEPTO, klepto_geo), + LOAD_MODEL_FROM_GEO(MODEL_EYEROK_LEFT_HAND, eyerok_left_hand_geo), + LOAD_MODEL_FROM_GEO(MODEL_EYEROK_RIGHT_HAND, eyerok_right_hand_geo), RETURN(), }; const LevelScript script_func_global_7[] = { - LOAD_MODEL_FROM_DL(MODEL_DL_MONTY_MOLE_HOLE, - monty_mole_hole_seg5_dl_05000840, - LAYER_TRANSPARENT_DECAL), - LOAD_MODEL_FROM_GEO(MODEL_MONTY_MOLE, monty_mole_geo), - LOAD_MODEL_FROM_GEO(MODEL_UKIKI, ukiki_geo), - LOAD_MODEL_FROM_GEO(MODEL_FWOOSH, fwoosh_geo), + LOAD_MODEL_FROM_DL( MODEL_DL_MONTY_MOLE_HOLE, monty_mole_hole_seg5_dl_05000840, LAYER_TRANSPARENT_DECAL), + LOAD_MODEL_FROM_GEO(MODEL_MONTY_MOLE, monty_mole_geo), + LOAD_MODEL_FROM_GEO(MODEL_UKIKI, ukiki_geo), + LOAD_MODEL_FROM_GEO(MODEL_FWOOSH, fwoosh_geo), RETURN(), }; const LevelScript script_func_global_8[] = { - LOAD_MODEL_FROM_GEO(MODEL_SPINDRIFT, spindrift_geo), - LOAD_MODEL_FROM_GEO(MODEL_MR_BLIZZARD_HIDDEN, mr_blizzard_hidden_geo), - LOAD_MODEL_FROM_GEO(MODEL_MR_BLIZZARD, mr_blizzard_geo), - LOAD_MODEL_FROM_GEO(MODEL_PENGUIN, penguin_geo), + LOAD_MODEL_FROM_GEO(MODEL_SPINDRIFT, spindrift_geo), + LOAD_MODEL_FROM_GEO(MODEL_MR_BLIZZARD_HIDDEN, mr_blizzard_hidden_geo), + LOAD_MODEL_FROM_GEO(MODEL_MR_BLIZZARD, mr_blizzard_geo), + LOAD_MODEL_FROM_GEO(MODEL_PENGUIN, penguin_geo), RETURN(), }; const LevelScript script_func_global_9[] = { - LOAD_MODEL_FROM_DL(MODEL_CAP_SWITCH_EXCLAMATION, - cap_switch_exclamation_seg5_dl_05002E00, LAYER_ALPHA), - LOAD_MODEL_FROM_GEO(MODEL_CAP_SWITCH, cap_switch_geo), - LOAD_MODEL_FROM_DL(MODEL_CAP_SWITCH_BASE, cap_switch_base_seg5_dl_05003120, - LAYER_OPAQUE), + LOAD_MODEL_FROM_DL( MODEL_CAP_SWITCH_EXCLAMATION, cap_switch_exclamation_seg5_dl_05002E00, LAYER_ALPHA), + LOAD_MODEL_FROM_GEO(MODEL_CAP_SWITCH, cap_switch_geo), + LOAD_MODEL_FROM_DL( MODEL_CAP_SWITCH_BASE, cap_switch_base_seg5_dl_05003120, LAYER_OPAQUE), RETURN(), }; const LevelScript script_func_global_10[] = { - LOAD_MODEL_FROM_GEO(MODEL_BOO, boo_geo), - LOAD_MODEL_FROM_GEO(MODEL_BETA_BOO_KEY, small_key_geo), - LOAD_MODEL_FROM_GEO(MODEL_HAUNTED_CHAIR, haunted_chair_geo), - LOAD_MODEL_FROM_GEO(MODEL_MAD_PIANO, mad_piano_geo), - LOAD_MODEL_FROM_GEO(MODEL_BOOKEND_PART, bookend_part_geo), - LOAD_MODEL_FROM_GEO(MODEL_BOOKEND, bookend_geo), - LOAD_MODEL_FROM_GEO(MODEL_HAUNTED_CAGE, haunted_cage_geo), + LOAD_MODEL_FROM_GEO(MODEL_BOO, boo_geo), + LOAD_MODEL_FROM_GEO(MODEL_BETA_BOO_KEY, small_key_geo), + LOAD_MODEL_FROM_GEO(MODEL_HAUNTED_CHAIR, haunted_chair_geo), + LOAD_MODEL_FROM_GEO(MODEL_MAD_PIANO, mad_piano_geo), + LOAD_MODEL_FROM_GEO(MODEL_BOOKEND_PART, bookend_part_geo), + LOAD_MODEL_FROM_GEO(MODEL_BOOKEND, bookend_geo), + LOAD_MODEL_FROM_GEO(MODEL_HAUNTED_CAGE, haunted_cage_geo), RETURN(), }; const LevelScript script_func_global_11[] = { - LOAD_MODEL_FROM_GEO(MODEL_BIRDS, birds_geo), - LOAD_MODEL_FROM_GEO(MODEL_PEACH, peach_geo), - LOAD_MODEL_FROM_GEO(MODEL_YOSHI, yoshi_geo), + LOAD_MODEL_FROM_GEO(MODEL_BIRDS, birds_geo), + LOAD_MODEL_FROM_GEO(MODEL_PEACH, peach_geo), + LOAD_MODEL_FROM_GEO(MODEL_YOSHI, yoshi_geo), RETURN(), }; const LevelScript script_func_global_12[] = { - LOAD_MODEL_FROM_GEO(MODEL_ENEMY_LAKITU, enemy_lakitu_geo), - LOAD_MODEL_FROM_GEO(MODEL_SPINY_BALL, spiny_ball_geo), - LOAD_MODEL_FROM_GEO(MODEL_SPINY, spiny_geo), - LOAD_MODEL_FROM_GEO(MODEL_WIGGLER_HEAD, wiggler_head_geo), - LOAD_MODEL_FROM_GEO(MODEL_WIGGLER_BODY, wiggler_body_geo), - LOAD_MODEL_FROM_GEO(MODEL_BUBBA, bubba_geo), + LOAD_MODEL_FROM_GEO(MODEL_ENEMY_LAKITU, enemy_lakitu_geo), + LOAD_MODEL_FROM_GEO(MODEL_SPINY_BALL, spiny_ball_geo), + LOAD_MODEL_FROM_GEO(MODEL_SPINY, spiny_geo), + LOAD_MODEL_FROM_GEO(MODEL_WIGGLER_HEAD, wiggler_head_geo), + LOAD_MODEL_FROM_GEO(MODEL_WIGGLER_BODY, wiggler_body_geo), + LOAD_MODEL_FROM_GEO(MODEL_BUBBA, bubba_geo), RETURN(), }; const LevelScript script_func_global_13[] = { - LOAD_MODEL_FROM_GEO(MODEL_BOWSER, bowser_geo), - LOAD_MODEL_FROM_GEO(MODEL_BOWSER_BOMB_CHILD_OBJ, bowser_bomb_geo), - LOAD_MODEL_FROM_GEO(MODEL_BOWSER_BOMB, bowser_bomb_geo), - LOAD_MODEL_FROM_GEO(MODEL_BOWSER_SMOKE, bowser_impact_smoke_geo), - LOAD_MODEL_FROM_GEO(MODEL_BOWSER_FLAMES, bowser_flames_geo), - LOAD_MODEL_FROM_GEO(MODEL_BOWSER_WAVE, invisible_bowser_accessory_geo), - LOAD_MODEL_FROM_GEO(MODEL_BOWSER2, bowser2_geo), + LOAD_MODEL_FROM_GEO(MODEL_BOWSER, bowser_geo), + LOAD_MODEL_FROM_GEO(MODEL_BOWSER_BOMB_CHILD_OBJ, bowser_bomb_geo), + LOAD_MODEL_FROM_GEO(MODEL_BOWSER_BOMB, bowser_bomb_geo), + LOAD_MODEL_FROM_GEO(MODEL_BOWSER_SMOKE, bowser_impact_smoke_geo), + LOAD_MODEL_FROM_GEO(MODEL_BOWSER_FLAMES, bowser_flames_geo), + LOAD_MODEL_FROM_GEO(MODEL_BOWSER_WAVE, invisible_bowser_accessory_geo), + LOAD_MODEL_FROM_GEO(MODEL_BOWSER2, bowser2_geo), RETURN(), }; const LevelScript script_func_global_14[] = { - LOAD_MODEL_FROM_GEO(MODEL_BUB, bub_geo), - LOAD_MODEL_FROM_GEO(MODEL_TREASURE_CHEST_BASE, treasure_chest_base_geo), - LOAD_MODEL_FROM_GEO(MODEL_TREASURE_CHEST_LID, treasure_chest_lid_geo), - LOAD_MODEL_FROM_GEO(MODEL_CYAN_FISH, cyan_fish_geo), - LOAD_MODEL_FROM_GEO(MODEL_WATER_RING, water_ring_geo), - LOAD_MODEL_FROM_GEO(MODEL_WATER_MINE, water_mine_geo), - LOAD_MODEL_FROM_GEO(MODEL_SEAWEED, seaweed_geo), - LOAD_MODEL_FROM_GEO(MODEL_SKEETER, skeeter_geo), + LOAD_MODEL_FROM_GEO(MODEL_BUB, bub_geo), + LOAD_MODEL_FROM_GEO(MODEL_TREASURE_CHEST_BASE, treasure_chest_base_geo), + LOAD_MODEL_FROM_GEO(MODEL_TREASURE_CHEST_LID, treasure_chest_lid_geo), + LOAD_MODEL_FROM_GEO(MODEL_CYAN_FISH, cyan_fish_geo), + LOAD_MODEL_FROM_GEO(MODEL_WATER_RING, water_ring_geo), + LOAD_MODEL_FROM_GEO(MODEL_WATER_MINE, water_mine_geo), + LOAD_MODEL_FROM_GEO(MODEL_SEAWEED, seaweed_geo), + LOAD_MODEL_FROM_GEO(MODEL_SKEETER, skeeter_geo), RETURN(), }; const LevelScript script_func_global_15[] = { - LOAD_MODEL_FROM_GEO(MODEL_PIRANHA_PLANT, piranha_plant_geo), - LOAD_MODEL_FROM_GEO(MODEL_WHOMP, whomp_geo), - LOAD_MODEL_FROM_GEO(MODEL_KOOPA_WITH_SHELL, koopa_with_shell_geo), - LOAD_MODEL_FROM_GEO(MODEL_KOOPA_WITHOUT_SHELL, koopa_without_shell_geo), - LOAD_MODEL_FROM_GEO(MODEL_METALLIC_BALL, metallic_ball_geo), - LOAD_MODEL_FROM_GEO(MODEL_CHAIN_CHOMP, chain_chomp_geo), - LOAD_MODEL_FROM_GEO(MODEL_KOOPA_FLAG, koopa_flag_geo), - LOAD_MODEL_FROM_GEO(MODEL_WOODEN_POST, wooden_post_geo), + LOAD_MODEL_FROM_GEO(MODEL_PIRANHA_PLANT, piranha_plant_geo), + LOAD_MODEL_FROM_GEO(MODEL_WHOMP, whomp_geo), + LOAD_MODEL_FROM_GEO(MODEL_KOOPA_WITH_SHELL, koopa_with_shell_geo), + LOAD_MODEL_FROM_GEO(MODEL_KOOPA_WITHOUT_SHELL, koopa_without_shell_geo), + LOAD_MODEL_FROM_GEO(MODEL_METALLIC_BALL, metallic_ball_geo), + LOAD_MODEL_FROM_GEO(MODEL_CHAIN_CHOMP, chain_chomp_geo), + LOAD_MODEL_FROM_GEO(MODEL_KOOPA_FLAG, koopa_flag_geo), + LOAD_MODEL_FROM_GEO(MODEL_WOODEN_POST, wooden_post_geo), RETURN(), }; const LevelScript script_func_global_16[] = { - LOAD_MODEL_FROM_GEO(MODEL_MIPS, mips_geo), - LOAD_MODEL_FROM_GEO(MODEL_BOO_CASTLE, boo_castle_geo), - LOAD_MODEL_FROM_GEO(MODEL_LAKITU, lakitu_geo), - LOAD_MODEL_FROM_GEO(MODEL_TOAD, toad_geo), + LOAD_MODEL_FROM_GEO(MODEL_MIPS, mips_geo), + LOAD_MODEL_FROM_GEO(MODEL_BOO_CASTLE, boo_castle_geo), + LOAD_MODEL_FROM_GEO(MODEL_LAKITU, lakitu_geo), + LOAD_MODEL_FROM_GEO(MODEL_TOAD, toad_geo), RETURN(), }; const LevelScript script_func_global_17[] = { - LOAD_MODEL_FROM_GEO(MODEL_CHILL_BULLY, chilly_chief_geo), - LOAD_MODEL_FROM_GEO(MODEL_BIG_CHILL_BULLY, chilly_chief_big_geo), - LOAD_MODEL_FROM_GEO(MODEL_MONEYBAG, moneybag_geo), + LOAD_MODEL_FROM_GEO(MODEL_CHILL_BULLY, chilly_chief_geo), + LOAD_MODEL_FROM_GEO(MODEL_BIG_CHILL_BULLY, chilly_chief_big_geo), + LOAD_MODEL_FROM_GEO(MODEL_MONEYBAG, moneybag_geo), RETURN(), }; const LevelScript script_func_global_18[] = { - LOAD_MODEL_FROM_GEO(MODEL_SWOOP, swoop_geo), - LOAD_MODEL_FROM_GEO(MODEL_SCUTTLEBUG, scuttlebug_geo), - LOAD_MODEL_FROM_GEO(MODEL_MR_I_IRIS, mr_i_iris_geo), - LOAD_MODEL_FROM_GEO(MODEL_MR_I, mr_i_geo), - LOAD_MODEL_FROM_GEO(MODEL_DORRIE, dorrie_geo), - LOAD_MODEL_FROM_GEO(MODEL_SNUFIT, snufit_geo), + LOAD_MODEL_FROM_GEO(MODEL_SWOOP, swoop_geo), + LOAD_MODEL_FROM_GEO(MODEL_SCUTTLEBUG, scuttlebug_geo), + LOAD_MODEL_FROM_GEO(MODEL_MR_I_IRIS, mr_i_iris_geo), + LOAD_MODEL_FROM_GEO(MODEL_MR_I, mr_i_geo), + LOAD_MODEL_FROM_GEO(MODEL_DORRIE, dorrie_geo), + LOAD_MODEL_FROM_GEO(MODEL_SNUFIT, snufit_geo), RETURN(), }; diff --git a/levels/scripts.h b/levels/scripts.h index 1ee3784b..24bdec37 100644 --- a/levels/scripts.h +++ b/levels/scripts.h @@ -1,47 +1,10 @@ #ifndef SCRIPTS_H #define SCRIPTS_H -#include -#include "common/scripts/dynamic_level_script_builder.hpp" #include "types.h" -extern std::shared_ptr get_script_exec_level_table(); - -#define STUB_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8) - -#define DEFINE_LEVEL(_0, _1, _2, folder, _4, _5, _6, _7, _8, _9, _10) \ - extern std::shared_ptr get_script_exec_##folder(); -#include "processed_level_defines.h" -#undef DEFINE_LEVEL - -#define DEFINE_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) +3 -const int script_exec_level_table_size_ = 2 - #include "unprocessed_level_defines.h" -; -#undef DEFINE_LEVEL - -#define DEFINE_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) +3 -extern const LevelScript script_exec_level_table_[2 - #include "unprocessed_level_defines.h" -]; -#undef DEFINE_LEVEL - -#define DEFINE_LEVEL(_0, _1, _2, folder, _4, _5, _6, _7, _8, _9, _10) \ - extern const LevelScript script_exec_##folder[4 + 1]; -#include "unprocessed_level_defines.h" -#undef DEFINE_LEVEL - -#undef STUB_LEVEL - -extern const LevelScript script_L1[4]; -extern const LevelScript script_L2[4]; -extern const LevelScript script_L3[4]; -extern const LevelScript script_L4[4]; -extern const LevelScript script_L5[4]; - // scripts -extern LevelScript level_main_scripts_entry[]; -extern const LevelScript* get_level_main_scripts_entry(); +extern const LevelScript level_main_scripts_entry[]; extern const LevelScript script_func_global_1[]; extern const LevelScript script_func_global_2[]; extern const LevelScript script_func_global_3[]; diff --git a/levels/sl/leveldata.c b/levels/sl/leveldata.c index b4ed4aed..c7132a5a 100644 --- a/levels/sl/leveldata.c +++ b/levels/sl/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/ssl/leveldata.c b/levels/ssl/leveldata.c index 82063d92..9d432753 100644 --- a/levels/ssl/leveldata.c +++ b/levels/ssl/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/thi/leveldata.c b/levels/thi/leveldata.c index 64ee5410..f00bbf30 100644 --- a/levels/thi/leveldata.c +++ b/levels/thi/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/totwc/leveldata.c b/levels/totwc/leveldata.c index 4d0db5e0..910f4e23 100644 --- a/levels/totwc/leveldata.c +++ b/levels/totwc/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/ttc/leveldata.c b/levels/ttc/leveldata.c index a9d9e212..1f5ee226 100644 --- a/levels/ttc/leveldata.c +++ b/levels/ttc/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/ttm/leveldata.c b/levels/ttm/leveldata.c index 33383b4f..c8fb72ff 100644 --- a/levels/ttm/leveldata.c +++ b/levels/ttm/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/unprocessed_level_defines.h b/levels/unprocessed_level_defines.h deleted file mode 100644 index 3bd26c95..00000000 --- a/levels/unprocessed_level_defines.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifdef VERSION_JP -#define VAL_DIFF 25000 -#else -#define VAL_DIFF 60000 -#endif - -// Define lists for list of level for macros. Each of the following fields are -// described: Argument 1: Internal ROM name of the level. Argument 2: Level -// enumerator for enum used to identify the level ID. Argument 3: Course -// enumerator for enum used to identify the course ID. Argument 4: Shorthand -// name of the level which should be the name of the levels/ folder of the -// level. Argument 5: The shared texture bin used. Argument 6: Acoustic reaches -// for each levels. Argument 7, 8, 9: Echo levels for individual areas. Argument -// 10: Specify dynamic music tables for levels, if specified. _ for none. -// Argument 11: Specify level camera table, if specified. _ for none. - -// NOTE: Be sure to edit sZoomOutAreaMasks in camera.c, as there isnt a good way -// to macro those right now. -// TODO: Figure something out for sZoomOutAreaMasks? -STUB_LEVEL("", LEVEL_UNKNOWN_1, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _) -STUB_LEVEL("", LEVEL_UNKNOWN_2, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _) -STUB_LEVEL("", LEVEL_UNKNOWN_3, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _) -DEFINE_LEVEL("TERESA OBAKE", LEVEL_BBH, COURSE_BBH, bbh, spooky, 28000, 0x28, - 0x28, 0x28, sDynBbh, sCamBBH) -DEFINE_LEVEL("YYAMA1 % YSLD1", LEVEL_CCM, COURSE_CCM, ccm, snow, 17000, 0x10, - 0x38, 0x38, _, sCamCCM) -DEFINE_LEVEL("SELECT ROOM", LEVEL_CASTLE, COURSE_NONE, castle_inside, inside, - 20000, 0x20, 0x20, 0x30, _, sCamCastle) -DEFINE_LEVEL("HORROR DUNGEON", LEVEL_HMC, COURSE_HMC, hmc, cave, 16000, 0x28, - 0x28, 0x28, sDynHmc, sCamHMC) -DEFINE_LEVEL("SABAKU % PYRMD", LEVEL_SSL, COURSE_SSL, ssl, generic, 15000, 0x08, - 0x30, 0x30, _, sCamSSL) -DEFINE_LEVEL("BATTLE FIELD", LEVEL_BOB, COURSE_BOB, bob, generic, 15000, 0x08, - 0x08, 0x08, _, _) -DEFINE_LEVEL("YUKIYAMA2", LEVEL_SL, COURSE_SL, sl, snow, 14000, 0x10, 0x28, - 0x28, _, sCamSL) -DEFINE_LEVEL("POOL KAI", LEVEL_WDW, COURSE_WDW, wdw, grass, 17000, 0x10, 0x18, - 0x18, sDynWdw, _) -DEFINE_LEVEL("WTDG % TINBOTU", LEVEL_JRB, COURSE_JRB, jrb, water, 20000, 0x10, - 0x18, 0x18, sDynJrb, _) -DEFINE_LEVEL("BIG WORLD", LEVEL_THI, COURSE_THI, thi, grass, 20000, 0x0c, 0x0c, - 0x20, _, sCamTHI) -DEFINE_LEVEL("CLOCK TOWER", LEVEL_TTC, COURSE_TTC, ttc, machine, 18000, 0x18, - 0x18, 0x18, _, _) -DEFINE_LEVEL("RAINBOW CRUISE", LEVEL_RR, COURSE_RR, rr, sky, 20000, 0x20, 0x20, - 0x20, _, sCamRR) -DEFINE_LEVEL("EXT1 YOKO SCRL", LEVEL_BITDW, COURSE_BITDW, bitdw, sky, 16000, - 0x28, 0x28, 0x28, _, _) -DEFINE_LEVEL("EXT7 HORI MINI", LEVEL_VCUTM, COURSE_VCUTM, vcutm, outside, 30000, - 0x28, 0x28, 0x28, _, _) -DEFINE_LEVEL("EXT2 TIKA LAVA", LEVEL_BITFS, COURSE_BITFS, bitfs, sky, 16000, - 0x28, 0x28, 0x28, _, _) -DEFINE_LEVEL("EXT9 SUISOU", LEVEL_SA, COURSE_SA, sa, inside, 20000, 0x10, 0x10, - 0x10, _, _) -DEFINE_LEVEL("EXT3 HEAVEN", LEVEL_BITS, COURSE_BITS, bits, sky, 16000, 0x28, - 0x28, 0x28, _, _) -DEFINE_LEVEL("FIREB1 % INVLC", LEVEL_LLL, COURSE_LLL, lll, fire, 22000, 0x08, - 0x30, 0x30, _, _) -DEFINE_LEVEL("WATER LAND", LEVEL_DDD, COURSE_DDD, ddd, water, 17000, 0x10, 0x20, - 0x20, sDynDdd, _) -DEFINE_LEVEL("MOUNTAIN", LEVEL_WF, COURSE_WF, wf, grass, 13000, 0x08, 0x08, - 0x08, _, _) -DEFINE_LEVEL("ENDING", LEVEL_ENDING, COURSE_CAKE_END, ending, generic, 20000, - 0x00, 0x00, 0x00, _, _) -DEFINE_LEVEL("EXT4 MINI SLID", LEVEL_PSS, COURSE_PSS, pss, mountain, 20000, - 0x28, 0x28, 0x28, _, _) -DEFINE_LEVEL("IN THE FALL", LEVEL_COTMC, COURSE_COTMC, cotmc, cave, 18000, 0x28, - 0x28, 0x28, _, sCamCotMC) -DEFINE_LEVEL("EXT6 MARIO FLY", LEVEL_TOTWC, COURSE_TOTWC, totwc, sky, 20000, - 0x20, 0x20, 0x20, _, _) -DEFINE_LEVEL("KUPPA1", LEVEL_BOWSER_1, COURSE_BITDW, bowser_1, generic, - VAL_DIFF, 0x40, 0x40, 0x40, _, _) -DEFINE_LEVEL("EXT8 BLUE SKY", LEVEL_WMOTR, COURSE_WMOTR, wmotr, generic, 20000, - 0x28, 0x28, 0x28, _, _) -STUB_LEVEL("", LEVEL_UNKNOWN_32, COURSE_NONE, 20000, 0x70, 0x00, 0x00, _, _) -DEFINE_LEVEL("KUPPA2", LEVEL_BOWSER_2, COURSE_BITFS, bowser_2, fire, VAL_DIFF, - 0x40, 0x40, 0x40, _, _) -DEFINE_LEVEL("KUPPA3", LEVEL_BOWSER_3, COURSE_BITS, bowser_3, generic, VAL_DIFF, - 0x40, 0x40, 0x40, _, _) -STUB_LEVEL("", LEVEL_UNKNOWN_35, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _) -DEFINE_LEVEL("DONKEY % SLID2", LEVEL_TTM, COURSE_TTM, ttm, mountain, 15000, - 0x08, 0x08, 0x08, _, _) -STUB_LEVEL("", LEVEL_UNKNOWN_37, COURSE_NONE, 20000, 0x00, 0x00, 0x00, _, _) -STUB_LEVEL("", LEVEL_UNKNOWN_38, COURSE_NONE, 20000, 0x00, 0x00, 0x00, - sDynUnk38, _) diff --git a/levels/vcutm/leveldata.c b/levels/vcutm/leveldata.c index bdfb15d9..bb2aa0ec 100644 --- a/levels/vcutm/leveldata.c +++ b/levels/vcutm/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/wdw/leveldata.c b/levels/wdw/leveldata.c index a3b1c8a5..6eba89e8 100644 --- a/levels/wdw/leveldata.c +++ b/levels/wdw/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/wf/leveldata.c b/levels/wf/leveldata.c index a63c0f9b..071a395a 100644 --- a/levels/wf/leveldata.c +++ b/levels/wf/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/levels/wmotr/leveldata.c b/levels/wmotr/leveldata.c index 649befa2..d80b826c 100644 --- a/levels/wmotr/leveldata.c +++ b/levels/wmotr/leveldata.c @@ -1,5 +1,3 @@ -#include "header.h" - #include #include "sm64.h" #include "surface_terrains.h" diff --git a/lib/PR/f3dex/F3DEX.bin b/lib/PR/f3dex/F3DEX.bin deleted file mode 100644 index 8308862c..00000000 Binary files a/lib/PR/f3dex/F3DEX.bin and /dev/null differ diff --git a/lib/PR/f3dex/F3DEX_NoN.bin b/lib/PR/f3dex/F3DEX_NoN.bin deleted file mode 100644 index a55a33b0..00000000 Binary files a/lib/PR/f3dex/F3DEX_NoN.bin and /dev/null differ diff --git a/lib/PR/f3dex/F3DEX_NoN_data.bin b/lib/PR/f3dex/F3DEX_NoN_data.bin deleted file mode 100644 index e1570d98..00000000 Binary files a/lib/PR/f3dex/F3DEX_NoN_data.bin and /dev/null differ diff --git a/lib/PR/f3dex/F3DEX_data.bin b/lib/PR/f3dex/F3DEX_data.bin deleted file mode 100644 index 212139c8..00000000 Binary files a/lib/PR/f3dex/F3DEX_data.bin and /dev/null differ diff --git a/lib/PR/f3dex/F3DLX.bin b/lib/PR/f3dex/F3DLX.bin deleted file mode 100644 index e94f2de6..00000000 Binary files a/lib/PR/f3dex/F3DLX.bin and /dev/null differ diff --git a/lib/PR/f3dex/F3DLX_NoN.bin b/lib/PR/f3dex/F3DLX_NoN.bin deleted file mode 100644 index 6c9814ac..00000000 Binary files a/lib/PR/f3dex/F3DLX_NoN.bin and /dev/null differ diff --git a/lib/PR/f3dex/F3DLX_NoN_data.bin b/lib/PR/f3dex/F3DLX_NoN_data.bin deleted file mode 100644 index 722968da..00000000 Binary files a/lib/PR/f3dex/F3DLX_NoN_data.bin and /dev/null differ diff --git a/lib/PR/f3dex/F3DLX_Rej.bin b/lib/PR/f3dex/F3DLX_Rej.bin deleted file mode 100644 index fad03ca5..00000000 Binary files a/lib/PR/f3dex/F3DLX_Rej.bin and /dev/null differ diff --git a/lib/PR/f3dex/F3DLX_Rej_data.bin b/lib/PR/f3dex/F3DLX_Rej_data.bin deleted file mode 100644 index fd66da74..00000000 Binary files a/lib/PR/f3dex/F3DLX_Rej_data.bin and /dev/null differ diff --git a/lib/PR/f3dex/F3DLX_data.bin b/lib/PR/f3dex/F3DLX_data.bin deleted file mode 100644 index 5a2ea93b..00000000 Binary files a/lib/PR/f3dex/F3DLX_data.bin and /dev/null differ diff --git a/lib/PR/f3dex/L3DEX.bin b/lib/PR/f3dex/L3DEX.bin deleted file mode 100644 index 7b84fb77..00000000 Binary files a/lib/PR/f3dex/L3DEX.bin and /dev/null differ diff --git a/lib/PR/f3dex/L3DEX_data.bin b/lib/PR/f3dex/L3DEX_data.bin deleted file mode 100644 index 1b9ca5c6..00000000 Binary files a/lib/PR/f3dex/L3DEX_data.bin and /dev/null differ diff --git a/lib/PR/f3dex2/F3DEX2.bin b/lib/PR/f3dex2/F3DEX2.bin deleted file mode 100644 index 71375694..00000000 Binary files a/lib/PR/f3dex2/F3DEX2.bin and /dev/null differ diff --git a/lib/PR/f3dex2/F3DEX2_NoN.bin b/lib/PR/f3dex2/F3DEX2_NoN.bin deleted file mode 100644 index e9a3b4cb..00000000 Binary files a/lib/PR/f3dex2/F3DEX2_NoN.bin and /dev/null differ diff --git a/lib/PR/f3dex2/F3DEX2_NoN_data.bin b/lib/PR/f3dex2/F3DEX2_NoN_data.bin deleted file mode 100644 index ac47c439..00000000 Binary files a/lib/PR/f3dex2/F3DEX2_NoN_data.bin and /dev/null differ diff --git a/lib/PR/f3dex2/F3DEX2_data.bin b/lib/PR/f3dex2/F3DEX2_data.bin deleted file mode 100644 index 70871391..00000000 Binary files a/lib/PR/f3dex2/F3DEX2_data.bin and /dev/null differ diff --git a/lib/PR/f3dex2/F3DLX2_Rej.bin b/lib/PR/f3dex2/F3DLX2_Rej.bin deleted file mode 100644 index 559bbb61..00000000 Binary files a/lib/PR/f3dex2/F3DLX2_Rej.bin and /dev/null differ diff --git a/lib/PR/f3dex2/F3DLX2_Rej_data.bin b/lib/PR/f3dex2/F3DLX2_Rej_data.bin deleted file mode 100644 index 57d0ccac..00000000 Binary files a/lib/PR/f3dex2/F3DLX2_Rej_data.bin and /dev/null differ diff --git a/lib/PR/f3dex2/F3DZEX.bin b/lib/PR/f3dex2/F3DZEX.bin deleted file mode 100644 index 86c0af48..00000000 Binary files a/lib/PR/f3dex2/F3DZEX.bin and /dev/null differ diff --git a/lib/PR/f3dex2/F3DZEX_data.bin b/lib/PR/f3dex2/F3DZEX_data.bin deleted file mode 100644 index 65678669..00000000 Binary files a/lib/PR/f3dex2/F3DZEX_data.bin and /dev/null differ diff --git a/lib/PR/f3dex2/L3DEX2.bin b/lib/PR/f3dex2/L3DEX2.bin deleted file mode 100644 index c24e9616..00000000 Binary files a/lib/PR/f3dex2/L3DEX2.bin and /dev/null differ diff --git a/lib/PR/f3dex2/L3DEX2_data.bin b/lib/PR/f3dex2/L3DEX2_data.bin deleted file mode 100644 index b052da6d..00000000 Binary files a/lib/PR/f3dex2/L3DEX2_data.bin and /dev/null differ diff --git a/lib/PR/s2dex/S2DEX.bin b/lib/PR/s2dex/S2DEX.bin deleted file mode 100644 index 72b5be52..00000000 Binary files a/lib/PR/s2dex/S2DEX.bin and /dev/null differ diff --git a/lib/PR/s2dex/S2DEX_data.bin b/lib/PR/s2dex/S2DEX_data.bin deleted file mode 100644 index 8d807f51..00000000 Binary files a/lib/PR/s2dex/S2DEX_data.bin and /dev/null differ diff --git a/lib/asm/__osDisableInt.s b/lib/asm/__osDisableInt.s deleted file mode 100644 index 4c759b4c..00000000 --- a/lib/asm/__osDisableInt.s +++ /dev/null @@ -1,18 +0,0 @@ -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - - -glabel __osDisableInt - mfc0 $t0, $12 - and $t1, $t0, -2 - mtc0 $t1, $12 - andi $v0, $t0, 1 - nop - jr $ra - nop - diff --git a/lib/asm/__osExceptionPreamble.s b/lib/asm/__osExceptionPreamble.s deleted file mode 100644 index 865273d9..00000000 --- a/lib/asm/__osExceptionPreamble.s +++ /dev/null @@ -1,806 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - -.ifdef VERSION_SH -.set VERSION_EU, 1 # HACK, someone fix this file, its poorly diff'd! -.endif - -.section .text, "ax" - -.ifdef AVOID_UB -.set D_80334890, D_80334890_fix -.endif - -glabel __osExceptionPreamble - lui $k0, %hi(__osException) - addiu $k0, %lo(__osException) - jr $k0 - nop - -glabel __osException - lui $k0, %hi(gInterruptedThread) - addiu $k0, %lo(gInterruptedThread) - sd $at, 0x20($k0) - mfc0 $k1, $12 - sw $k1, 0x118($k0) - li $at, -4 - and $k1, $k1, $at - mtc0 $k1, $12 - sd $t0, 0x58($k0) - sd $t1, 0x60($k0) - sd $t2, 0x68($k0) - sw $zero, 0x18($k0) - mfc0 $t0, $13 -.ifndef VERSION_EU - andi $t1, $t0, 0x7c - li $t2, 0 - bne $t1, $t2, .L80326750 - nop - and $t1, $k1, $t0 - andi $t2, $t1, 0x4000 - beqz $t2, .L80326734 - nop - li $t1, 1 - lui $at, %hi(D_80334934) - b .L80326794 - sw $t1, %lo(D_80334934)($at) -.L80326734: - andi $t2, $t1, 0x2000 - beqz $t2, .L80326750 - nop - li $t1, 1 - lui $at, %hi(D_80334938) - b .L80326794 - sw $t1, %lo(D_80334938)($at) -.L80326750: - lui $at, %hi(D_80334934) - sw $zero, %lo(D_80334934)($at) - lui $at, %hi(D_80334938) -.endif - move $t0, $k0 -.ifndef VERSION_EU - sw $zero, %lo(D_80334938)($at) -.endif - lui $k0, %hi(D_80334890 + 0x10) - lw $k0, %lo(D_80334890 + 0x10)($k0) - ld $t1, 0x20($t0) - sd $t1, 0x20($k0) - ld $t1, 0x118($t0) - sd $t1, 0x118($k0) - ld $t1, 0x58($t0) - sd $t1, 0x58($k0) - ld $t1, 0x60($t0) - sd $t1, 0x60($k0) - ld $t1, 0x68($t0) - sd $t1, 0x68($k0) -.ifdef VERSION_EU - lw $k1, 0x118($k0) -.else -.L80326794: -.endif - mflo $t0 - sd $t0, 0x108($k0) - mfhi $t0 -.ifdef VERSION_EU - andi $t1, $k1, 0xff00 -.endif - sd $v0, 0x28($k0) - sd $v1, 0x30($k0) - sd $a0, 0x38($k0) - sd $a1, 0x40($k0) - sd $a2, 0x48($k0) - sd $a3, 0x50($k0) - sd $t3, 0x70($k0) - sd $t4, 0x78($k0) - sd $t5, 0x80($k0) - sd $t6, 0x88($k0) - sd $t7, 0x90($k0) - sd $s0, 0x98($k0) - sd $s1, 0xa0($k0) - sd $s2, 0xa8($k0) - sd $s3, 0xb0($k0) - sd $s4, 0xb8($k0) - sd $s5, 0xc0($k0) - sd $s6, 0xc8($k0) - sd $s7, 0xd0($k0) - sd $t8, 0xd8($k0) - sd $t9, 0xe0($k0) - sd $gp, 0xe8($k0) - sd $sp, 0xf0($k0) - sd $fp, 0xf8($k0) - sd $ra, 0x100($k0) -.ifdef VERSION_EU - beqz $t1, .L802F3A18 - sd $t0, 0x110($k0) - lui $t0, %hi(D_8030208C) - addiu $t0, %lo(D_8030208C) - lw $t0, ($t0) - li $at, -1 - xor $t0, $t0, $at - lui $at, (0xFFFF00FF >> 16) - andi $t0, $t0, 0xff00 - ori $at, (0xFFFF00FF & 0xFFFF) - or $t1, $t1, $t0 - and $k1, $k1, $at - or $k1, $k1, $t1 - sw $k1, 0x118($k0) -.L802F3A18: - lui $t1, %hi(MI_INTR_MASK_REG) - lw $t1, %lo(MI_INTR_MASK_REG)($t1) - beqz $t1, .L802F3A50 - nop - lui $t0, %hi(D_8030208C) - addiu $t0, %lo(D_8030208C) - lw $t0, ($t0) - lw $t4, 0x128($k0) - li $at, -1 - srl $t0, $t0, 0x10 - xor $t0, $t0, $at - andi $t0, $t0, 0x3f - and $t0, $t0, $t4 - or $t1, $t1, $t0 -.L802F3A50: - sw $t1, 0x128($k0) -.else - sd $t0, 0x110($k0) -.endif - mfc0 $t0, $14 - sw $t0, 0x11c($k0) - lw $t0, 0x18($k0) - beqz $t0, .L80326868 - nop - cfc1 $t0, $31 - nop - sw $t0, 0x12c($k0) - sdc1 $f0, 0x130($k0) - sdc1 $f2, 0x138($k0) - sdc1 $f4, 0x140($k0) - sdc1 $f6, 0x148($k0) - sdc1 $f8, 0x150($k0) - sdc1 $f10, 0x158($k0) - sdc1 $f12, 0x160($k0) - sdc1 $f14, 0x168($k0) - sdc1 $f16, 0x170($k0) - sdc1 $f18, 0x178($k0) - sdc1 $f20, 0x180($k0) - sdc1 $f22, 0x188($k0) - sdc1 $f24, 0x190($k0) - sdc1 $f26, 0x198($k0) - sdc1 $f28, 0x1a0($k0) - sdc1 $f30, 0x1a8($k0) -.L80326868: - mfc0 $t0, $13 - sw $t0, 0x120($k0) -.ifndef VERSION_EU - lui $t1, %hi(MI_INTR_MASK_REG) - lw $t1, %lo(MI_INTR_MASK_REG)($t1) - sw $t1, 0x128($k0) -.endif - li $t1, 2 - sh $t1, 0x10($k0) -.ifndef VERSION_EU - lui $t1, %hi(D_80334934) - lw $t1, %lo(D_80334934)($t1) - beqz $t1, .L803268B4 - nop - lui $t2, %hi(D_C0000008) - sw $zero, %lo(D_C0000008)($t2) - lui $a0, %hi(D_C0000000) - addiu $t2, %lo(D_C0000008) - jal kdebugserver - lw $a0, %lo(D_C0000000)($a0) - b .L80326E08 - nop -.L803268B4: - lui $t1, %hi(D_80334938) - lw $t1, %lo(D_80334938)($t1) - beqz $t1, .L80326900 - nop - lui $t2, %hi(D_C000000C) - sw $zero, %lo(D_C000000C)($t2) - lui $t1, %hi(D_80334A40) - lw $t1, %lo(D_80334A40)($t1) - addiu $t2, %lo(D_C000000C) - beqz $t1, .L803268E8 - nop - jal send_mesg - li $a0, 120 -.L803268E8: - lui $t1, %hi(D_80334A44) - lw $t1, %lo(D_80334A44)($t1) - lui $at, %hi(D_80334A44) - addi $t1, $t1, 1 - b .L80326E08 - sw $t1, %lo(D_80334A44)($at) -.L80326900: -.endif - andi $t1, $t0, 0x7c - li $t2, 36 - beq $t1, $t2, .L80326B84 - nop - li $t2, 44 - beq $t1, $t2, .L80326CCC - nop - li $t2, 0 - bne $t1, $t2, .L80326BE8 - nop - and $s0, $k1, $t0 -.L8032692C: - andi $t1, $s0, 0xff00 - srl $t2, $t1, 0xc - bnez $t2, .L80326944 - nop - srl $t2, $t1, 8 - addi $t2, $t2, 0x10 -.L80326944: - lui $at, %hi(D_80338610) - addu $at, $at, $t2 - lbu $t2, %lo(D_80338610)($at) - lui $at, %hi(jtbl_80338630) - addu $at, $at, $t2 - lw $t2, %lo(jtbl_80338630)($at) - jr $t2 - nop -.ifdef VERSION_EU -glabel L802F3B28 - li $at, -8193 - b .L8032692C - and $s0, $s0, $at -glabel L802F3B34 - li $at, -16385 - b .L8032692C - and $s0, $s0, $at -.endif -glabel L80326964 - mfc0 $t1, $11 - mtc0 $t1, $11 - jal send_mesg - li $a0, 24 - lui $at, (0xFFFF7FFF >> 16) - ori $at, (0xFFFF7FFF & 0xFFFF) - b .L8032692C - and $s0, $s0, $at -glabel L80326984 -.ifdef VERSION_EU - li $at, -2049 - and $s0, $s0, $at -.endif - li $t2, 4 - lui $at, %hi(D_80334920) - addu $at, $at, $t2 - lw $t2, %lo(D_80334920)($at) -.ifdef VERSION_EU - lui $sp, %hi(D_80365E40) - addiu $sp, %lo(D_80365E40) - li $a0, 16 - beqz $t2, .L803269A4 - addiu $sp, $sp, 0xff0 -.else - beqz $t2, .L803269A4 - nop -.endif - jalr $t2 - nop -.ifdef VERSION_EU - beqz $v0, .L803269A4 - nop - b .L80326B9C - nop -.endif -.L803269A4: - jal send_mesg -.ifdef VERSION_EU - nop - b .L8032692C - nop -.else - li $a0, 16 - li $at, -2049 - b .L8032692C - and $s0, $s0, $at -.endif -glabel L803269B8 -.ifdef VERSION_EU - lui $t0, %hi(D_8030208C) - addiu $t0, %lo(D_8030208C) - lw $t0, ($t0) -.endif - lui $s1, %hi(MI_INTR_REG) - lw $s1, %lo(MI_INTR_REG)($s1) -.ifdef VERSION_EU - srl $t0, $t0, 0x10 - and $s1, $s1, $t0 -.else - andi $s1, $s1, 0x3f -.endif - andi $t1, $s1, 1 - beqz $t1, .L80326A18 - nop - lui $t4, %hi(SP_STATUS_REG) - lw $t4, %lo(SP_STATUS_REG)($t4) - li $t1, 8 - lui $at, %hi(SP_STATUS_REG) - andi $t4, $t4, 0x300 - andi $s1, $s1, 0x3e - beqz $t4, .L80326A08 - sw $t1, %lo(SP_STATUS_REG)($at) - jal send_mesg - li $a0, 32 - beqz $s1, .L80326ADC - nop - b .L80326A18 - nop -.L80326A08: - jal send_mesg - li $a0, 88 - beqz $s1, .L80326ADC - nop -.L80326A18: - andi $t1, $s1, 8 - beqz $t1, .L80326A3C - lui $at, %hi(VI_CURRENT_REG) - andi $s1, $s1, 0x37 - sw $zero, %lo(VI_CURRENT_REG)($at) - jal send_mesg - li $a0, 56 - beqz $s1, .L80326ADC - nop -.L80326A3C: - andi $t1, $s1, 4 - beqz $t1, .L80326A68 - nop - li $t1, 1 - lui $at, %hi(AI_STATUS_REG) - andi $s1, $s1, 0x3b - sw $t1, %lo(AI_STATUS_REG)($at) - jal send_mesg - li $a0, 48 - beqz $s1, .L80326ADC - nop -.L80326A68: - andi $t1, $s1, 2 - beqz $t1, .L80326A8C - lui $at, %hi(SI_STATUS_REG) - andi $s1, $s1, 0x3d - sw $zero, %lo(SI_STATUS_REG)($at) - jal send_mesg - li $a0, 40 - beqz $s1, .L80326ADC - nop -.L80326A8C: - andi $t1, $s1, 0x10 - beqz $t1, .L80326AB8 - nop - li $t1, 2 - lui $at, %hi(PI_STATUS_REG) - andi $s1, $s1, 0x2f - sw $t1, %lo(PI_STATUS_REG)($at) - jal send_mesg - li $a0, 64 - beqz $s1, .L80326ADC - nop -.L80326AB8: - andi $t1, $s1, 0x20 - beqz $t1, .L80326ADC - nop - li $t1, 2048 - lui $at, %hi(MI_MODE_REG) - andi $s1, $s1, 0x1f - sw $t1, %lo(MI_MODE_REG)($at) - jal send_mesg - li $a0, 72 -.L80326ADC: - li $at, -1025 - b .L8032692C - and $s0, $s0, $at -glabel L80326AE8 - lw $k1, 0x118($k0) - li $at, -4097 - lui $t1, %hi(D_80334808) - and $k1, $k1, $at - sw $k1, 0x118($k0) - addiu $t1, %lo(D_80334808) - lw $t2, ($t1) - beqz $t2, .L80326B14 - li $at, -4097 - b .L80326B9C - and $s0, $s0, $at -.L80326B14: - li $t2, 1 - sw $t2, ($t1) - jal send_mesg - li $a0, 112 - lui $t2, %hi(D_80334890 + 0x8) - lw $t2, %lo(D_80334890 + 0x8)($t2) - li $at, -4097 - and $s0, $s0, $at - lw $k1, 0x118($t2) - and $k1, $k1, $at - b .L80326B9C - sw $k1, 0x118($t2) -glabel L80326B44 - li $at, -513 - and $t0, $t0, $at - mtc0 $t0, $13 - jal send_mesg - li $a0, 8 - li $at, -513 - b .L8032692C - and $s0, $s0, $at -glabel L80326B64 - li $at, -257 - and $t0, $t0, $at - mtc0 $t0, $13 - jal send_mesg - li $a0, 0 - li $at, -257 - b .L8032692C - and $s0, $s0, $at -.L80326B84: - li $t1, 1 - sh $t1, 0x12($k0) - jal send_mesg - li $a0, 80 - b .L80326B9C - nop - -.L80326B9C: -glabel L80326B9C - lui $t2, %hi(D_80334890 + 0x8) - lw $t2, %lo(D_80334890 + 0x8)($t2) - lw $t1, 4($k0) - lw $t3, 4($t2) - slt $at, $t1, $t3 - beqz $at, .L80326BD0 - nop - lui $a0, %hi(D_80334890 + 0x8) - move $a1, $k0 - jal __osEnqueueThread - addiu $a0, %lo(D_80334890 + 0x8) - j __osDispatchThread - nop - -.L80326BD0: - lui $t1, %hi(D_80334890 + 0x8) - addiu $t1, %lo(D_80334890 + 0x8) - lw $t2, ($t1) - sw $t2, ($k0) - j __osDispatchThread - sw $k0, ($t1) - -.L80326BE8: -glabel L80326BE8 - lui $at, %hi(D_80334890 + 0x14) - sw $k0, %lo(D_80334890 + 0x14)($at) - li $t1, 1 - sh $t1, 0x10($k0) - li $t1, 2 - sh $t1, 0x12($k0) - mfc0 $t2, $8 - sw $t2, 0x124($k0) - jal send_mesg - li $a0, 96 - j __osDispatchThread - nop - -glabel send_mesg - lui $t2, %hi(D_80363830) - addiu $t2, %lo(D_80363830) - addu $t2, $t2, $a0 - lw $t1, ($t2) - move $s2, $ra - beqz $t1, .L80326CC4 - nop - lw $t3, 8($t1) - lw $t4, 0x10($t1) - slt $at, $t3, $t4 - beqz $at, .L80326CC4 - nop - lw $t5, 0xc($t1) - addu $t5, $t5, $t3 - div $zero, $t5, $t4 - bnez $t4, .L80326C60 - nop - break 7 -.L80326C60: - li $at, -1 - bne $t4, $at, .L80326C78 - lui $at, 0x8000 - bne $t5, $at, .L80326C78 - nop - break 6 -.L80326C78: - lw $t4, 0x14($t1) - mfhi $t5 - sll $t5, $t5, 2 - addu $t4, $t4, $t5 - lw $t5, 4($t2) - addiu $t2, $t3, 1 - sw $t5, ($t4) - sw $t2, 8($t1) - lw $t2, ($t1) - lw $t3, ($t2) - beqz $t3, .L80326CC4 - nop - jal __osPopThread - move $a0, $t1 - move $t2, $v0 - lui $a0, %hi(D_80334890 + 0x8) - move $a1, $t2 - jal __osEnqueueThread - addiu $a0, %lo(D_80334890 + 0x8) -.L80326CC4: - jr $s2 - nop -.L80326CCC: - lui $at, 0x3000 - and $t1, $t0, $at - srl $t1, $t1, 0x1c - li $t2, 1 - bne $t1, $t2, .L80326BE8 - nop - lw $k1, 0x118($k0) - lui $at, 0x2000 - li $t1, 1 - or $k1, $k1, $at - sw $t1, 0x18($k0) - b .L80326BD0 - sw $k1, 0x118($k0) - - -glabel __osEnqueueAndYield - lui $a1, %hi(D_80334890 + 0x10) - lw $a1, %lo(D_80334890 + 0x10)($a1) - mfc0 $t0, $12 - lw $k1, 0x18($a1) - ori $t0, $t0, 2 - sw $t0, 0x118($a1) - sd $s0, 0x98($a1) - sd $s1, 0xa0($a1) - sd $s2, 0xa8($a1) - sd $s3, 0xb0($a1) - sd $s4, 0xb8($a1) - sd $s5, 0xc0($a1) - sd $s6, 0xc8($a1) - sd $s7, 0xd0($a1) - sd $gp, 0xe8($a1) - sd $sp, 0xf0($a1) - sd $fp, 0xf8($a1) - sd $ra, 0x100($a1) - beqz $k1, .L80326D70 - sw $ra, 0x11c($a1) - cfc1 $k1, $31 - sdc1 $f20, 0x180($a1) - sdc1 $f22, 0x188($a1) - sdc1 $f24, 0x190($a1) - sdc1 $f26, 0x198($a1) - sdc1 $f28, 0x1a0($a1) - sdc1 $f30, 0x1a8($a1) - sw $k1, 0x12c($a1) - -.L80326D70: -.ifdef VERSION_EU - lw $k1, 0x118($a1) - andi $t1, $k1, 0xff00 - beqz $t1, .L802F3FBC - nop - lui $t0, %hi(D_8030208C) - addiu $t0, %lo(D_8030208C) - lw $t0, ($t0) - li $at, -1 - xor $t0, $t0, $at - lui $at, (0xFFFF00FF >> 16) - andi $t0, $t0, 0xff00 - ori $at, (0xFFFF00FF & 0xFFFF) - or $t1, $t1, $t0 - and $k1, $k1, $at - or $k1, $k1, $t1 - sw $k1, 0x118($a1) -.L802F3FBC: -.endif - lui $k1, %hi(MI_INTR_MASK_REG) - lw $k1, %lo(MI_INTR_MASK_REG)($k1) -.ifdef VERSION_EU - beqz $k1, .L802F3FF4 - nop - lui $k0, %hi(D_8030208C) - addiu $k0, %lo(D_8030208C) - lw $k0, ($k0) - lw $t0, 0x128($a1) - li $at, -1 - srl $k0, $k0, 0x10 - xor $k0, $k0, $at - andi $k0, $k0, 0x3f - and $k0, $k0, $t0 - or $k1, $k1, $k0 -.L802F3FF4: -.endif - beqz $a0, .L80326D88 - sw $k1, 0x128($a1) - jal __osEnqueueThread - nop -.L80326D88: - j __osDispatchThread - nop - -#enqueue and pop look like compiled functions? but there's no easy way to extract them -glabel __osEnqueueThread - lw $t8, ($a0) - lw $t7, 4($a1) - move $t9, $a0 - lw $t6, 4($t8) - slt $at, $t6, $t7 - bnez $at, .L80326DC4 - nop -.L80326DAC: - move $t9, $t8 - lw $t8, ($t8) - lw $t6, 4($t8) - slt $at, $t6, $t7 - beqz $at, .L80326DAC - nop -.L80326DC4: - lw $t8, ($t9) - sw $t8, ($a1) - sw $a1, ($t9) - jr $ra - sw $a0, 8($a1) - -glabel __osPopThread - lw $v0, ($a0) - lw $t9, ($v0) - jr $ra - sw $t9, ($a0) - -glabel __osDispatchThread - lui $a0, %hi(D_80334890 + 0x8) - jal __osPopThread - addiu $a0, %lo(D_80334890 + 0x8) - lui $at, %hi(D_80334890 + 0x10) - sw $v0, %lo(D_80334890 + 0x10)($at) - li $t0, 4 - sh $t0, 0x10($v0) - move $k0, $v0 -.ifdef VERSION_EU - lui $t0, %hi(D_8030208C) - lw $k1, 0x118($k0) - addiu $t0, %lo(D_8030208C) - lw $t0, ($t0) - lui $at, (0xFFFF00FF >> 16) - andi $t1, $k1, 0xff00 - ori $at, (0xFFFF00FF & 0xFFFF) - andi $t0, $t0, 0xff00 - and $t1, $t1, $t0 - and $k1, $k1, $at - or $k1, $k1, $t1 - mtc0 $k1, $12 -.endif -.L80326E08: - ld $k1, 0x108($k0) - ld $at, 0x20($k0) - ld $v0, 0x28($k0) - mtlo $k1 - ld $k1, 0x110($k0) - ld $v1, 0x30($k0) - ld $a0, 0x38($k0) - ld $a1, 0x40($k0) - ld $a2, 0x48($k0) - ld $a3, 0x50($k0) - ld $t0, 0x58($k0) - ld $t1, 0x60($k0) - ld $t2, 0x68($k0) - ld $t3, 0x70($k0) - ld $t4, 0x78($k0) - ld $t5, 0x80($k0) - ld $t6, 0x88($k0) - ld $t7, 0x90($k0) - ld $s0, 0x98($k0) - ld $s1, 0xa0($k0) - ld $s2, 0xa8($k0) - ld $s3, 0xb0($k0) - ld $s4, 0xb8($k0) - ld $s5, 0xc0($k0) - ld $s6, 0xc8($k0) - ld $s7, 0xd0($k0) - ld $t8, 0xd8($k0) - ld $t9, 0xe0($k0) - ld $gp, 0xe8($k0) - mthi $k1 - ld $sp, 0xf0($k0) - ld $fp, 0xf8($k0) - ld $ra, 0x100($k0) - lw $k1, 0x11c($k0) - mtc0 $k1, $14 -.ifndef VERSION_EU - lw $k1, 0x118($k0) - mtc0 $k1, $12 -.endif - lw $k1, 0x18($k0) - beqz $k1, .L80326EF0 - nop - lw $k1, 0x12c($k0) - ctc1 $k1, $31 - ldc1 $f0, 0x130($k0) - ldc1 $f2, 0x138($k0) - ldc1 $f4, 0x140($k0) - ldc1 $f6, 0x148($k0) - ldc1 $f8, 0x150($k0) - ldc1 $f10, 0x158($k0) - ldc1 $f12, 0x160($k0) - ldc1 $f14, 0x168($k0) - ldc1 $f16, 0x170($k0) - ldc1 $f18, 0x178($k0) - ldc1 $f20, 0x180($k0) - ldc1 $f22, 0x188($k0) - ldc1 $f24, 0x190($k0) - ldc1 $f26, 0x198($k0) - ldc1 $f28, 0x1a0($k0) - ldc1 $f30, 0x1a8($k0) -.L80326EF0: - lw $k1, 0x128($k0) -.ifdef VERSION_EU - lui $k0, %hi(D_8030208C) - addiu $k0, %lo(D_8030208C) - lw $k0, ($k0) - srl $k0, $k0, 0x10 - and $k1, $k1, $k0 -.endif - sll $k1, $k1, 1 - lui $k0, %hi(D_803386D0) - addiu $k0, %lo(D_803386D0) - addu $k1, $k1, $k0 - lhu $k1, ($k1) - lui $k0, %hi(MI_INTR_MASK_REG) - addiu $k0, %lo(MI_INTR_MASK_REG) - sw $k1, ($k0) - nop - nop - nop - nop - eret -glabel __osCleanupThread - jal osDestroyThread - move $a0, $zero - -.section .data - -glabel D_80334920 - .word 0 - .word 0 - .word 0 - .word 0 - .word 0 - -glabel D_80334934 - .word 0 - -glabel D_80334938 - .word 0 - .word 0 - -.section .rodata - -glabel D_80338610 - .byte 0x00,0x14,0x18,0x18,0x1C,0x1C,0x1C,0x1C,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x04,0x08,0x08,0x0C,0x0C,0x0C,0x0C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10 - -glabel jtbl_80338630 - .word L80326B9C - .word L80326B64 - .word L80326B44 - .word L803269B8 - .word L80326984 - .word L80326AE8 -.ifdef VERSION_EU - .word L802F3B28 - .word L802F3B34 -.else - .word L80326BE8 - .word L80326BE8 -.endif - .word L80326964 - .word 0 - .word 0 - .word 0 diff --git a/lib/asm/__osGetCause.s b/lib/asm/__osGetCause.s deleted file mode 100644 index 13fff167..00000000 --- a/lib/asm/__osGetCause.s +++ /dev/null @@ -1,15 +0,0 @@ -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel __osGetCause - mfc0 $v0, $13 - jr $ra - nop - - nop - diff --git a/lib/asm/__osGetSR.s b/lib/asm/__osGetSR.s deleted file mode 100644 index e2f74c76..00000000 --- a/lib/asm/__osGetSR.s +++ /dev/null @@ -1,15 +0,0 @@ -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel __osGetSR - mfc0 $v0, $12 - jr $ra - nop - - nop - diff --git a/lib/asm/__osProbeTLB.s b/lib/asm/__osProbeTLB.s deleted file mode 100644 index fe83ea16..00000000 --- a/lib/asm/__osProbeTLB.s +++ /dev/null @@ -1,64 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel __osProbeTLB - mfc0 $t0, $10 - andi $t1, $t0, 0xff - li $at, -8192 - and $t2, $a0, $at - or $t1, $t1, $t2 - mtc0 $t1, $10 - nop - nop - nop - tlbp - nop - nop - mfc0 $t3, $0 - lui $at, 0x8000 - and $t3, $t3, $at - bnez $t3, .L8032A0D8 - nop - tlbr - nop - nop - nop - mfc0 $t3, $5 - addi $t3, $t3, 0x2000 - srl $t3, $t3, 1 - and $t4, $t3, $a0 - bnez $t4, .L8032A0A8 - addi $t3, $t3, -1 - mfc0 $v0, $2 - b .L8032A0AC - nop -.L8032A0A8: - mfc0 $v0, $3 -.L8032A0AC: - andi $t5, $v0, 2 - beqz $t5, .L8032A0D8 - nop - lui $at, (0x3FFFFFC0 >> 16) # lui $at, 0x3fff - ori $at, (0x3FFFFFC0 & 0xFFFF) # ori $at, $at, 0xffc0 - and $v0, $v0, $at - sll $v0, $v0, 6 - and $t5, $a0, $t3 - add $v0, $v0, $t5 - b .L8032A0DC - nop -.L8032A0D8: - li $v0, -1 -.L8032A0DC: - mtc0 $t0, $10 - jr $ra - nop - - nop - nop - diff --git a/lib/asm/__osRestoreInt.s b/lib/asm/__osRestoreInt.s deleted file mode 100644 index f6ab98ef..00000000 --- a/lib/asm/__osRestoreInt.s +++ /dev/null @@ -1,19 +0,0 @@ -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel __osRestoreInt - mfc0 $t0, $12 - or $t0, $t0, $a0 - mtc0 $t0, $12 - nop - nop - jr $ra - nop - - nop - diff --git a/lib/asm/__osSetCompare.s b/lib/asm/__osSetCompare.s deleted file mode 100644 index a1dab931..00000000 --- a/lib/asm/__osSetCompare.s +++ /dev/null @@ -1,15 +0,0 @@ -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel __osSetCompare - mtc0 $a0, $11 - jr $ra - nop - - nop - diff --git a/lib/asm/__osSetFpcCsr.s b/lib/asm/__osSetFpcCsr.s deleted file mode 100644 index e644bc74..00000000 --- a/lib/asm/__osSetFpcCsr.s +++ /dev/null @@ -1,14 +0,0 @@ -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel __osSetFpcCsr - cfc1 $v0, $31 - ctc1 $a0, $31 - jr $ra - nop - diff --git a/lib/asm/__osSetSR.s b/lib/asm/__osSetSR.s deleted file mode 100644 index 3fba3e66..00000000 --- a/lib/asm/__osSetSR.s +++ /dev/null @@ -1,14 +0,0 @@ -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel __osSetSR - mtc0 $a0, $12 - nop - jr $ra - nop - diff --git a/lib/asm/__os_eu_802ef550.s b/lib/asm/__os_eu_802ef550.s deleted file mode 100644 index 99b328e2..00000000 --- a/lib/asm/__os_eu_802ef550.s +++ /dev/null @@ -1,22 +0,0 @@ -.set noreorder # don't insert nops after branches -.set gp=64 -.set noat - -.include "macros.inc" - - -.section .text, "ax" -# cache related -glabel __os_eu_802ef550 - lui $t0,0x8000 - li $t2,0x2000 - addu $t1,$t0,$t2 - addiu $t1,$t1,-0x10 -.L: cache 0x1,0($t0) - sltu $at,$t0,$t1 - bnez $at,.L - addiu $t0,$t0,0x10 - jr $ra - nop - nop - nop diff --git a/lib/asm/bcopy.s b/lib/asm/bcopy.s deleted file mode 100644 index d9dafd7b..00000000 --- a/lib/asm/bcopy.s +++ /dev/null @@ -1,231 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - -.section .text, "ax" - -glabel bcopy - beqz $a2, .L80323A4C - move $a3, $a1 - beq $a0, $a1, .L80323A4C - slt $at, $a1, $a0 - bnezl $at, .L80323A14 - slti $at, $a2, 0x10 - add $v0, $a0, $a2 - slt $at, $a1, $v0 - beql $at, $zero, .L80323A14 - slti $at, $a2, 0x10 - b .L80323B78 - slti $at, $a2, 0x10 - slti $at, $a2, 0x10 -.L80323A14: - bnez $at, .L80323A2C - nop - andi $v0, $a0, 3 - andi $v1, $a1, 3 - beq $v0, $v1, .L80323A54 - nop -.L80323A2C: - beqz $a2, .L80323A4C - nop - addu $v1, $a0, $a2 -.L80323A38: - lb $v0, ($a0) - addiu $a0, $a0, 1 - addiu $a1, $a1, 1 - bne $a0, $v1, .L80323A38 - sb $v0, -1($a1) -.L80323A4C: - jr $ra - move $v0, $a3 - -.L80323A54: - beqz $v0, .L80323AB8 - li $at, 1 - beq $v0, $at, .L80323A9C - li $at, 2 - beql $v0, $at, .L80323A88 - lh $v0, ($a0) - lb $v0, ($a0) - addiu $a0, $a0, 1 - addiu $a1, $a1, 1 - addiu $a2, $a2, -1 - b .L80323AB8 - sb $v0, -1($a1) - lh $v0, ($a0) -.L80323A88: - addiu $a0, $a0, 2 - addiu $a1, $a1, 2 - addiu $a2, $a2, -2 - b .L80323AB8 - sh $v0, -2($a1) -.L80323A9C: - lb $v0, ($a0) - lh $v1, 1($a0) - addiu $a0, $a0, 3 - addiu $a1, $a1, 3 - addiu $a2, $a2, -3 - sb $v0, -3($a1) - sh $v1, -2($a1) -.L80323AB8: - slti $at, $a2, 0x20 - bnezl $at, .L80323B18 - slti $at, $a2, 0x10 - lw $v0, ($a0) - lw $v1, 4($a0) - lw $t0, 8($a0) - lw $t1, 0xc($a0) - lw $t2, 0x10($a0) - lw $t3, 0x14($a0) - lw $t4, 0x18($a0) - lw $t5, 0x1c($a0) - addiu $a0, $a0, 0x20 - addiu $a1, $a1, 0x20 - addiu $a2, $a2, -0x20 - sw $v0, -0x20($a1) - sw $v1, -0x1c($a1) - sw $t0, -0x18($a1) - sw $t1, -0x14($a1) - sw $t2, -0x10($a1) - sw $t3, -0xc($a1) - sw $t4, -8($a1) - b .L80323AB8 - sw $t5, -4($a1) -.L80323B14: - slti $at, $a2, 0x10 -.L80323B18: - bnezl $at, .L80323B54 - slti $at, $a2, 4 - lw $v0, ($a0) - lw $v1, 4($a0) - lw $t0, 8($a0) - lw $t1, 0xc($a0) - addiu $a0, $a0, 0x10 - addiu $a1, $a1, 0x10 - addiu $a2, $a2, -0x10 - sw $v0, -0x10($a1) - sw $v1, -0xc($a1) - sw $t0, -8($a1) - b .L80323B14 - sw $t1, -4($a1) -.L80323B50: - slti $at, $a2, 4 -.L80323B54: - bnez $at, .L80323A2C - nop - lw $v0, ($a0) - addiu $a0, $a0, 4 - addiu $a1, $a1, 4 - addiu $a2, $a2, -4 - b .L80323B50 - sw $v0, -4($a1) - slti $at, $a2, 0x10 -.L80323B78: - add $a0, $a0, $a2 - bnez $at, .L80323B94 - add $a1, $a1, $a2 - andi $v0, $a0, 3 - andi $v1, $a1, 3 - beq $v0, $v1, .L80323BC4 - nop -.L80323B94: - beqz $a2, .L80323A4C - nop - addiu $a0, $a0, -1 - addiu $a1, $a1, -1 - subu $v1, $a0, $a2 -.L80323BA8: - lb $v0, ($a0) - addiu $a0, $a0, -1 - addiu $a1, $a1, -1 - bne $a0, $v1, .L80323BA8 - sb $v0, 1($a1) - jr $ra - move $v0, $a3 - -.L80323BC4: - beqz $v0, .L80323C28 - li $at, 3 - beq $v0, $at, .L80323C0C - li $at, 2 - beql $v0, $at, .L80323BF8 - lh $v0, -2($a0) - lb $v0, -1($a0) - addiu $a0, $a0, -1 - addiu $a1, $a1, -1 - addiu $a2, $a2, -1 - b .L80323C28 - sb $v0, ($a1) - lh $v0, -2($a0) -.L80323BF8: - addiu $a0, $a0, -2 - addiu $a1, $a1, -2 - addiu $a2, $a2, -2 - b .L80323C28 - sh $v0, ($a1) -.L80323C0C: - lb $v0, -1($a0) - lh $v1, -3($a0) - addiu $a0, $a0, -3 - addiu $a1, $a1, -3 - addiu $a2, $a2, -3 - sb $v0, 2($a1) - sh $v1, ($a1) -.L80323C28: - slti $at, $a2, 0x20 - bnezl $at, .L80323C88 - slti $at, $a2, 0x10 - lw $v0, -4($a0) - lw $v1, -8($a0) - lw $t0, -0xc($a0) - lw $t1, -0x10($a0) - lw $t2, -0x14($a0) - lw $t3, -0x18($a0) - lw $t4, -0x1c($a0) - lw $t5, -0x20($a0) - addiu $a0, $a0, -0x20 - addiu $a1, $a1, -0x20 - addiu $a2, $a2, -0x20 - sw $v0, 0x1c($a1) - sw $v1, 0x18($a1) - sw $t0, 0x14($a1) - sw $t1, 0x10($a1) - sw $t2, 0xc($a1) - sw $t3, 8($a1) - sw $t4, 4($a1) - b .L80323C28 - sw $t5, ($a1) -.L80323C84: - slti $at, $a2, 0x10 -.L80323C88: - bnezl $at, .L80323CC4 - slti $at, $a2, 4 - lw $v0, -4($a0) - lw $v1, -8($a0) - lw $t0, -0xc($a0) - lw $t1, -0x10($a0) - addiu $a0, $a0, -0x10 - addiu $a1, $a1, -0x10 - addiu $a2, $a2, -0x10 - sw $v0, 0xc($a1) - sw $v1, 8($a1) - sw $t0, 4($a1) - b .L80323C84 - sw $t1, ($a1) -.L80323CC0: - slti $at, $a2, 4 -.L80323CC4: - bnez $at, .L80323B94 - nop - lw $v0, -4($a0) - addiu $a0, $a0, -4 - addiu $a1, $a1, -4 - addiu $a2, $a2, -4 - b .L80323CC0 - sw $v0, ($a1) - nop - nop - nop - diff --git a/lib/asm/bzero.s b/lib/asm/bzero.s deleted file mode 100644 index 37053b7e..00000000 --- a/lib/asm/bzero.s +++ /dev/null @@ -1,53 +0,0 @@ -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - -#this file is probably handwritten - -.section .text, "ax" - -glabel bzero - blt $a1, 0xc, .L803236BC - negu $v1, $a0 - andi $v1, $v1, 3 - beqz $v1, .L80323660 - subu $a1, $a1, $v1 - swl $zero, ($a0) - addu $a0, $a0, $v1 -.L80323660: - and $a3, $a1, -32 - beqz $a3, .L8032369C - subu $a1, $a1, $a3 - addu $a3, $a3, $a0 -.L80323674: - addiu $a0, $a0, 0x20 - sw $zero, -0x20($a0) - sw $zero, -0x1c($a0) - sw $zero, -0x18($a0) - sw $zero, -0x14($a0) - sw $zero, -0x10($a0) - sw $zero, -0xc($a0) - sw $zero, -8($a0) - bne $a0, $a3, .L80323674 - sw $zero, -4($a0) -.L8032369C: - and $a3, $a1, -4 - beqz $a3, .L803236BC - subu $a1, $a1, $a3 - addu $a3, $a3, $a0 -.L803236B0: - addiu $a0, $a0, 4 - bne $a0, $a3, .L803236B0 - sw $zero, -4($a0) -.L803236BC: - blez $a1, .L803236D4 - nop - addu $a1, $a1, $a0 -.L803236C8: - addiu $a0, $a0, 1 - bne $a0, $a1, .L803236C8 - sb $zero, -1($a0) -.L803236D4: - jr $ra - diff --git a/lib/asm/llmuldiv_gcc.s b/lib/asm/llmuldiv_gcc.s deleted file mode 100644 index cf604929..00000000 --- a/lib/asm/llmuldiv_gcc.s +++ /dev/null @@ -1,100 +0,0 @@ -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -/* -------------------------------------------------------------------------------------- */ -/* need to asm these functions because lib32gcc-7-dev-mips-cross does not exist so we */ -/* cannot naturally link a libgcc variant for this target given this architecture and */ -/* compiler. Until we have a good workaround with a gcc target that doesn't involve */ -/* assuming a 32-bit to 64-bit change, we have to encode these functions as raw assembly */ -/* for it to compile. */ -/* -------------------------------------------------------------------------------------- */ - -/* TODO: Is there a non-insane way to fix this hack that doesn't involve the user compiling */ -/* a library themselves? */ -glabel __umoddi3 - sw $a0, ($sp) - sw $a1, 4($sp) - sw $a2, 8($sp) - sw $a3, 0xc($sp) - ld $t7, 8($sp) - ld $t6, ($sp) - ddivu $zero, $t6, $t7 - bnez $t7, .L80324144 - nop - break 7 -.L80324144: - mfhi $v0 - dsll32 $v1, $v0, 0 - dsra32 $v1, $v1, 0 - jr $ra - dsra32 $v0, $v0, 0 - -glabel __udivdi3 - sw $a0, ($sp) - sw $a1, 4($sp) - sw $a2, 8($sp) - sw $a3, 0xc($sp) - ld $t7, 8($sp) - ld $t6, ($sp) - ddivu $zero, $t6, $t7 - bnez $t7, .L80324180 - nop - break 7 -.L80324180: - mflo $v0 - dsll32 $v1, $v0, 0 - dsra32 $v1, $v1, 0 - jr $ra - dsra32 $v0, $v0, 0 - -glabel __moddi3 - sw $a0, ($sp) - sw $a1, 4($sp) - sw $a2, 8($sp) - sw $a3, 0xc($sp) - ld $t7, 8($sp) - ld $t6, ($sp) - ddivu $zero, $t6, $t7 - bnez $t7, .L803241E8 - nop - break 7 -.L803241E8: - mfhi $v0 - dsll32 $v1, $v0, 0 - dsra32 $v1, $v1, 0 - jr $ra - dsra32 $v0, $v0, 0 - -glabel __divdi3 - sw $a0, ($sp) - sw $a1, 4($sp) - sw $a2, 8($sp) - sw $a3, 0xc($sp) - ld $t7, 8($sp) - ld $t6, ($sp) - ddiv $zero, $t6, $t7 - nop - bnez $t7, .L80324228 - nop - break 7 -.L80324228: - daddiu $at, $zero, -1 - bne $t7, $at, .L80324244 - daddiu $at, $zero, 1 - dsll32 $at, $at, 0x1f - bne $t6, $at, .L80324244 - nop - break 6 -.L80324244: - mflo $v0 - dsll32 $v1, $v0, 0 - dsra32 $v1, $v1, 0 - jr $ra - dsra32 $v0, $v0, 0 diff --git a/lib/asm/osGetCount.s b/lib/asm/osGetCount.s deleted file mode 100644 index 58bd3629..00000000 --- a/lib/asm/osGetCount.s +++ /dev/null @@ -1,15 +0,0 @@ -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel osGetCount - mfc0 $v0, $9 - jr $ra - nop - - nop - diff --git a/lib/asm/osInvalDCache.s b/lib/asm/osInvalDCache.s deleted file mode 100644 index 452c4dd3..00000000 --- a/lib/asm/osInvalDCache.s +++ /dev/null @@ -1,59 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel osInvalDCache - blez $a1, .L80323500 - nop - li $t3, 8192 - sltu $at, $a1, $t3 - beqz $at, .L80323508 - nop - move $t0, $a0 - addu $t1, $a0, $a1 - sltu $at, $t0, $t1 - beqz $at, .L80323500 - nop - andi $t2, $t0, 0xf - beqz $t2, .L803234D0 - addiu $t1, $t1, -0x10 - subu $t0, $t0, $t2 - cache 0x15, ($t0) - sltu $at, $t0, $t1 - beqz $at, .L80323500 - nop - addiu $t0, $t0, 0x10 -.L803234D0: - andi $t2, $t1, 0xf - beqz $t2, .L803234F0 - nop - subu $t1, $t1, $t2 - cache 0x15, 0x10($t1) - sltu $at, $t1, $t0 - bnez $at, .L80323500 - nop -.L803234F0: - cache 0x11, ($t0) - sltu $at, $t0, $t1 - bnez $at, .L803234F0 - addiu $t0, $t0, 0x10 -.L80323500: - jr $ra - nop - -.L80323508: - li $t0, K0BASE - addu $t1, $t0, $t3 - addiu $t1, $t1, -0x10 -.L80323514: - cache 1, ($t0) - sltu $at, $t0, $t1 - bnez $at, .L80323514 - addiu $t0, $t0, 0x10 - jr $ra - nop diff --git a/lib/asm/osInvalICache.s b/lib/asm/osInvalICache.s deleted file mode 100644 index 8b8a03f0..00000000 --- a/lib/asm/osInvalICache.s +++ /dev/null @@ -1,44 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel osInvalICache - blez $a1, .L80323728 - nop - li $t3, 16384 - sltu $at, $a1, $t3 - beqz $at, .L80323730 - nop - move $t0, $a0 - addu $t1, $a0, $a1 - sltu $at, $t0, $t1 - beqz $at, .L80323728 - nop - andi $t2, $t0, 0x1f - addiu $t1, $t1, -0x20 - subu $t0, $t0, $t2 -.L80323718: - cache 0x10, ($t0) - sltu $at, $t0, $t1 - bnez $at, .L80323718 - addiu $t0, $t0, 0x20 -.L80323728: - jr $ra - nop - -.L80323730: - li $t0, K0BASE - addu $t1, $t0, $t3 - addiu $t1, $t1, -0x20 -.L8032373C: - cache 0, ($t0) - sltu $at, $t0, $t1 - bnez $at, .L8032373C - addiu $t0, $t0, 0x20 - jr $ra - nop diff --git a/lib/asm/osMapTLB.s b/lib/asm/osMapTLB.s deleted file mode 100644 index b9ee4364..00000000 --- a/lib/asm/osMapTLB.s +++ /dev/null @@ -1,63 +0,0 @@ -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -# This file is handwritten - -#void osMapTLB(s32 index, OSPageMask pm, void *vaddr, u32 evenpaddr, u32 oddpaddr, s32 asid); -glabel osMapTLB - mfc0 $t0, $10 - mtc0 $a0, $0 - mtc0 $a1, $5 - lw $t1, 0x14($sp) #asid - beq $t1, -1, .L803214D8 - li $t4, 1 - li $t2, 30 - b .L803214DC - or $a2, $a2, $t1 #vaddr -.L803214D8: - li $t2, 31 -.L803214DC: - mtc0 $a2, $10 #vaddr - beq $a3, -1, .L80321500 #even paddr - nop - srl $t3, $a3, 6 #evenpaddr - or $t3, $t3, $t2 - mtc0 $t3, $2 - b .L80321504 - nop -.L80321500: - mtc0 $t4, $2 -.L80321504: - lw $t3, 0x10($sp) #oddpaddr - beq $t3, -1, .L80321528 - nop - srl $t3, $t3, 6 - or $t3, $t3, $t2 - mtc0 $t3, $3 - b .L80321540 - nop -.L80321528: - mtc0 $t4, $3 - bne $a3, -1, .L80321540 #evenpaddr - nop - lui $t3, 0x8000 - mtc0 $t3, $10 -.L80321540: - nop - tlbwi - nop - nop - nop - nop - mtc0 $t0, $10 - jr $ra - nop #file gets padded but - nop - nop - nop - diff --git a/lib/asm/osMapTLBRdb.s b/lib/asm/osMapTLBRdb.s deleted file mode 100644 index 6753280d..00000000 --- a/lib/asm/osMapTLBRdb.s +++ /dev/null @@ -1,36 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel osMapTLBRdb - mfc0 $t0, $10 - li $t1, 31 - mtc0 $t1, $0 - mtc0 $zero, $5 - li $t2, 23 - lui $t1, 0xc000 - mtc0 $t1, $10 - lui $t1, 0x8000 - srl $t3, $t1, 6 - or $t3, $t3, $t2 - mtc0 $t3, $2 - li $t1, 1 - mtc0 $t1, $3 - nop - tlbwi - nop - nop - nop - nop - mtc0 $t0, $10 - jr $ra - nop - - nop - nop - diff --git a/lib/asm/osSetIntMask.s b/lib/asm/osSetIntMask.s deleted file mode 100644 index ccce609c..00000000 --- a/lib/asm/osSetIntMask.s +++ /dev/null @@ -1,138 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - -.eqv MI_INTR_MASK_REG, 0xA430000C - -.section .text, "ax" - -glabel osSetIntMask -.ifndef VERSION_EU - mfc0 $t1, $12 - andi $v0, $t1, 0xff01 -.else - mfc0 $t4, $12 - andi $v0, $t4, 0xff01 - lui $t0, %hi(D_8030208C) # $t0, 0x8030 - addiu $t0, %lo(D_8030208C) # addiu $t0, $t0, 0x208c - lw $t3, ($t0) - li $at, -1 - xor $t0, $t3, $at - andi $t0, $t0, 0xff00 - or $v0, $v0, $t0 -.endif - lui $t2, %hi(MI_INTR_MASK_REG) # $t2, 0xa430 - lw $t2, %lo(MI_INTR_MASK_REG)($t2) -.ifdef VERSION_EU - beqz $t2, .L80200074 - srl $t1, $t3, 0x10 - li $at, -1 - xor $t1, $t1, $at - andi $t1, $t1, 0x3f - or $t2, $t2, $t1 -.L80200074: -.endif - sll $t2, $t2, 0x10 - or $v0, $v0, $t2 - lui $at, 0x3f - and $t0, $a0, $at -.ifdef VERSION_EU - and $t0, $t0, $t3 -.endif - srl $t0, $t0, 0xf - lui $t2, %hi(D_803386D0) - addu $t2, $t2, $t0 - lhu $t2, %lo(D_803386D0)($t2) - lui $at, %hi(MI_INTR_MASK_REG) # $at, 0xa430 - sw $t2, %lo(MI_INTR_MASK_REG)($at) - andi $t0, $a0, 0xff01 -.ifdef VERSION_EU - andi $t1, $t3, 0xff00 - and $t0, $t0, $t1 -.endif - lui $at, (0xFFFF00FF >> 16) # lui $at, 0xffff - ori $at, (0xFFFF00FF & 0xFFFF) # ori $at, $at, 0xff -.ifndef VERSION_EU - and $t1, $t1, $at - or $t1, $t1, $t0 - mtc0 $t1, $12 -.else - and $t4, $t4, $at - or $t4, $t4, $t0 - mtc0 $t4, $12 -.endif - nop - nop - jr $ra - nop - - -.section .rodata - -glabel D_803386D0 -.half 0x0555 -.half 0x0556 -.half 0x0559 -.half 0x055A -.half 0x0565 -.half 0x0566 -.half 0x0569 -.half 0x056A -.half 0x0595 -.half 0x0596 -.half 0x0599 -.half 0x059A -.half 0x05A5 -.half 0x05A6 -.half 0x05A9 -.half 0x05AA -.half 0x0655 -.half 0x0656 -.half 0x0659 -.half 0x065A -.half 0x0665 -.half 0x0666 -.half 0x0669 -.half 0x066A -.half 0x0695 -.half 0x0696 -.half 0x0699 -.half 0x069A -.half 0x06A5 -.half 0x06A6 -.half 0x06A9 -.half 0x06AA -.half 0x0955 -.half 0x0956 -.half 0x0959 -.half 0x095A -.half 0x0965 -.half 0x0966 -.half 0x0969 -.half 0x096A -.half 0x0995 -.half 0x0996 -.half 0x0999 -.half 0x099A -.half 0x09A5 -.half 0x09A6 -.half 0x09A9 -.half 0x09AA -.half 0x0A55 -.half 0x0A56 -.half 0x0A59 -.half 0x0A5A -.half 0x0A65 -.half 0x0A66 -.half 0x0A69 -.half 0x0A6A -.half 0x0A95 -.half 0x0A96 -.half 0x0A99 -.half 0x0A9A -.half 0x0AA5 -.half 0x0AA6 -.half 0x0AA9 -.half 0x0AAA diff --git a/lib/asm/osUnmapTLBAll.s b/lib/asm/osUnmapTLBAll.s deleted file mode 100644 index 0bd9ad27..00000000 --- a/lib/asm/osUnmapTLBAll.s +++ /dev/null @@ -1,32 +0,0 @@ -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel osUnmapTLBAll - mfc0 $t0, $10 - li $t1, 31 - lui $t2, 0x8000 - mtc0 $t2, $10 - mtc0 $zero, $2 - mtc0 $zero, $3 -.L80321588: - mtc0 $t1, $0 - nop - tlbwi - nop - nop - addi $t1, $t1, -1 - bnezl $t1, .L80321588 #bnezl, bnez but with likely hint - nop - mtc0 $t0, $10 - jr $ra - nop - - nop - nop - nop - diff --git a/lib/asm/osWritebackDCache.s b/lib/asm/osWritebackDCache.s deleted file mode 100644 index 8e870168..00000000 --- a/lib/asm/osWritebackDCache.s +++ /dev/null @@ -1,39 +0,0 @@ -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel osWritebackDCache - blez $a1, .osWritebackDCacheReturn - nop - li $t3, 8192 - bgeu $a1, $t3, .L80324E40 - nop - move $t0, $a0 - addu $t1, $a0, $a1 - bgeu $t0, $t1, .osWritebackDCacheReturn - nop - andi $t2, $t0, 0xf - addiu $t1, $t1, -0x10 - subu $t0, $t0, $t2 -.L80324E28: - cache 0x19, ($t0) - bltu $t0, $t1, .L80324E28 - addiu $t0, $t0, 0x10 -.osWritebackDCacheReturn: - jr $ra - nop - -.L80324E40: - lui $t0, 0x8000 - addu $t1, $t0, $t3 - addiu $t1, $t1, -0x10 -.L80324E4C: - cache 1, ($t0) - bltu $t0, $t1, .L80324E4C - addiu $t0, 0x10 # addiu $t0, $t0, 0x10 - jr $ra - nop diff --git a/lib/asm/osWritebackDCacheAll.s b/lib/asm/osWritebackDCacheAll.s deleted file mode 100644 index 88707604..00000000 --- a/lib/asm/osWritebackDCacheAll.s +++ /dev/null @@ -1,24 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - - -.section .text, "ax" - -glabel osWritebackDCacheAll - li $t0, K0BASE - li $t2, 8192 - addu $t1, $t0, $t2 - addiu $t1, $t1, -0x10 -.L80322020: - cache 1, ($t0) - sltu $at, $t0, $t1 - bnez $at, .L80322020 - addiu $t0, $t0, 0x10 - jr $ra - nop - - nop - nop diff --git a/lib/asm/parameters.s b/lib/asm/parameters.s deleted file mode 100644 index d5106bfe..00000000 --- a/lib/asm/parameters.s +++ /dev/null @@ -1,18 +0,0 @@ -.macro gsymbol sym addr -.global \sym -.set \sym, \addr -.ifndef VERSION_JP -nop -nop -.endif -.endm - -.text -gsymbol osTvType 0x80000300 -gsymbol osRomType 0x80000304 -gsymbol osRomBase 0x80000308 -gsymbol osResetType 0x8000030C -gsymbol osCiCId 0x80000310 -gsymbol osVersion 0x80000314 -gsymbol osMemSize 0x80000318 -gsymbol osAppNmiBuffer 0x8000031C diff --git a/lib/asm/sqrtf.s b/lib/asm/sqrtf.s deleted file mode 100644 index a3ce7756..00000000 --- a/lib/asm/sqrtf.s +++ /dev/null @@ -1,11 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 - -.include "macros.inc" - -.section .text, "ax" - -glabel sqrtf - jr $ra - sqrt.s $f0, $f12 diff --git a/lib/rsp.s b/lib/rsp.s deleted file mode 100644 index ad1e3eec..00000000 --- a/lib/rsp.s +++ /dev/null @@ -1,236 +0,0 @@ -.include "macros.inc" -.set UCODE_SIZE, 0x800 - -.section .text - -.balign 16 -glabel rspF3DBootStart - .incbin "rsp/rspboot.bin" -.balign 16 -glabel rspF3DBootEnd - -.balign 16 -.ifndef F3DEX_GBI_SHARED -glabel rspF3DStart /* Use regular Fast3D bins (default) */ - .incbin "rsp/fast3d.bin" -glabel rspF3DEnd - -.else /* Use one of the Fast3DEX series grucodes. */ -glabel rspF3DStart - .if F3DEX_GBI_2 == 1 - .incbin "lib/PR/f3dex2/F3DEX2.bin" - .elseif F3DEX_GBI == 1 - .incbin "lib/PR/f3dex/F3DEX.bin" - .else /* Fast3DZEX */ - .incbin "lib/PR/f3dex2/F3DZEX.bin" - .endif -glabel rspF3DEnd -.endif - -/* Audio Bins */ - -.balign 16 -glabel rspAspMainStart - .incbin "rsp/audio.bin" -glabel rspAspMainEnd - -/* - * LESS COMMON MICROCODES - * These are setup to be loaded by G_LOAD_UCODE - */ - -/* Fast3DEX NoN Text */ -.ifdef F3DEX_NON_GBI -glabel rspF3DEXNoNStart - .balign 16 - .incbin "lib/PR/f3dex/F3DEX_NoN.bin" -glabel rspF3DEXNoNEnd -.endif - -/* Fast3DLX Text */ -.ifdef F3DLX_GBI -glabel rspF3DLXStart - .incbin "lib/PR/f3dex/F3DLX.bin" -glabel rspF3DLXEnd -.endif - -/* Fast3DLX NoN Text */ -.ifdef F3DLX_NON_GBI -glabel rspF3DLXNoNStart - .balign 16 - .incbin "lib/PR/f3dex/F3DLX_NoN.bin" -glabel rspF3DLXNoNEnd -.endif - -/* Fast3DLX Rej Text */ -.ifdef F3DLX_REJ_GBI -glabel rspF3DLXRejStart - .balign 16 - .incbin "lib/PR/f3dex/F3DLX_Rej.bin" -glabel rspF3DLXRejEnd -.endif - -/* Line3DEX Text */ -.ifdef L3DEX_GBI -glabel rspL3DEXStart - .balign 16 - .incbin "lib/PR/f3dex/L3DEX.bin" -glabel rspL3DEXEnd -.endif - -/* S2DEX Text */ -.ifdef S2DEX_GBI -glabel rspS2DEXStart - .balign 16 - .incbin "lib/PR/s2dex/S2DEX.bin" -glabel rspS2DEXEnd -.endif - -/* Fast3DEX2 series */ - -/* Fast3DEX2 NoN Text */ -.ifdef F3DEX2_NON_GBI -.balign 16 -glabel rspF3DEX2NoNStart - .incbin "lib/PR/f3dex2/F3DEX2_NoN.bin" -glabel rspF3DEX2NoNEnd -.endif - -/* Fast3DEX2 Rej Text */ -.ifdef F3DEX2_REJ_GBI -.balign 16 -glabel rspF3DEX2RejStart - .incbin "lib/PR/f3dex2/F3DEX2_Rej.bin" -glabel rspF3DEX2RejEnd -.endif - -/* Line3DEX2 Text */ -.ifdef L3DEX2_GBI -.balign 16 -glabel rspL3DEX2Start - .incbin "lib/PR/f3dex2/L3DEX2.bin" -glabel rspL3DEX2End -.endif - -/* S2DEX2 Text */ -.ifdef S2DEX_GBI_2 -.balign 16 -glabel rspS2DEXStart - .incbin "lib/PR/s2dex/S2DEX2.bin" -glabel rspS2DEXEnd -.endif - -/* DATA SECTION START */ - -.section .rodata - -.balign 16 -.ifndef F3DEX_GBI_SHARED /* Use regular Fast3D data (default) */ -glabel rspF3DDataStart - .incbin "rsp/fast3d_data.bin" -glabel rspF3DDataEnd - -.else /* Using one of the Fast3DEX series grucodes */ -glabel rspF3DDataStart - .if F3DEX_GBI_2 == 1 - .incbin "lib/PR/f3dex2/F3DEX2_data.bin" - .elseif F3DEX_GBI == 1 - .incbin "lib/PR/f3dex/F3DEX_data.bin" - .else /* Fast3DZEX */ - .incbin "lib/PR/f3dex2/F3DZEX_data.bin" - .endif -glabel rspF3DDataEnd -.endif - -/* Audio Data */ - -.balign 16 -glabel rspAspMainDataStart - .incbin "rsp/audio_data.bin" -glabel rspAspMainDataEnd - -/* LESS COMMON MICROCODES */ - -/* Fast3DEX Series */ - -/* Fast3DEX NoN Data */ -.ifdef F3DEX_NON_GBI -.balign 16 -glabel rspF3DEXNoNDataStart - .incbin "lib/PR/f3dex/F3DEX_NoN_data.bin" -glabel rspF3DEXNoNDataEnd -.endif - -/* Fast3DLX Data */ -.ifdef F3DLX_GBI -.balign 16 -glabel rspF3DLXDataStart - .incbin "lib/PR/f3dex/F3DLX_data.bin" -glabel rspF3DLXDataEnd -.endif - -/* Fast3DLX NoN Data */ -.ifdef F3DLX_NON_GBI -.balign 16 -glabel rspF3DLXNoNDataStart - .incbin "lib/PR/f3dex/F3DLX_NoN_data.bin" -glabel rspF3DLXNoNDataEnd -.endif - -/* Fast3DLX Rej Data */ -.ifdef F3DLX_REJ_GBI -.balign 16 -glabel rspF3DLXRejDataStart - .incbin "lib/PR/f3dex/F3DLX_Rej_data.bin" -glabel rspF3DLXRejDataEnd -.endif - -/* Line3DEX Data */ -.ifdef L3DEX_GBI -.balign 16 -glabel rspL3DEXDataStart - .incbin "lib/PR/f3dex/L3DEX_data.bin" -glabel rspL3DEXDataEnd -.endif - -/* S2DEX Data */ -.ifdef S2DEX_GBI -.balign 16 -glabel rspS2DEXDataStart - .incbin "lib/PR/s2dex/S2DEX_data.bin" -glabel rspS2DEXDataEnd -.endif - -/* Fast3DEX2 Series */ - -/* Fast3DEX2 NoN Data */ -.ifdef F3DEX2_NON_GBI -.balign 16 -glabel rspF3DEX2NoNStart - .incbin "lib/PR/f3dex2/F3DEX2_NoN_data.bin" -glabel rspF3DEX2NoNEnd -.endif - -/* Fast3DEX2 Rej Data */ -.ifdef F3DEX2_REJ_GBI -.balign 16 -glabel rspF3DEX2RejStart - .incbin "lib/PR/f3dex2/F3DEX2_Rej_data.bin" -glabel rspF3DEX2RejEnd -.endif - -/* Line3DEX2 Data */ -.ifdef L3DEX2_GBI -.balign 16 -glabel rspL3DEX2Start - .incbin "lib/PR/f3dex2/L3DEX2_data.bin" -glabel rspL3DEX2End -.endif - -/* S2DEX2 Data */ -.ifdef S2DEX_GBI_2 -.balign 16 -glabel rspS2DEXStart - .incbin "lib/PR/s2dex/S2DEX2_data.bin" -glabel rspS2DEXEnd -.endif diff --git a/lib/src/D_802F4380.c b/lib/src/D_802F4380.c deleted file mode 100644 index cfc1ae25..00000000 --- a/lib/src/D_802F4380.c +++ /dev/null @@ -1,147 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" -#include "new_func.h" -#include "macros.h" -#if defined(VERSION_EU) || defined(VERSION_SH) -u32 D_802F4380() { - u32 sp3c; - u32 sp38; - u32 sp34; - __OSTranxInfo *sp30; - __OSBlockInfo *sp2c; - u32 sp28; - UNUSED __OSBlockInfo *sp24; - if (!EU_D_80302090) { - return 0; - } - sp30 = &__osDiskHandle->transferInfo; - sp2c = &sp30->block[sp30->blockNum]; - sp38 = HW_REG(PI_STATUS_REG, u32); - if (sp38 & PI_STATUS_BUSY) { - HW_REG(PI_STATUS_REG, u32) = PI_STATUS_RESET_CONTROLLER | PI_STATUS_CLEAR_INTR; - WAIT_ON_IOBUSY(sp38); - sp3c = HW_REG(ASIC_STATUS, u32); - if (sp3c & MECHANIC_INTERRUPT) { - WAIT_ON_IOBUSY(sp38); - HW_REG(ASIC_BM_CTL, u32) = sp30->bmCtlShadow | MECHANIC_INTERRUPT_RESET; - } - sp30->unk10 = 75; - func_802F4A20(); - return 1; - } - WAIT_ON_IOBUSY(sp38); - sp3c = HW_REG(ASIC_STATUS, u32); - if (sp3c & MECHANIC_INTERRUPT) { - WAIT_ON_IOBUSY(sp38); - HW_REG(ASIC_BM_CTL, u32) = sp30->bmCtlShadow | MECHANIC_INTERRUPT_RESET; - sp30->unk10 = 0; - return 0; - } - if (sp3c & BUFFER_MANAGER_ERROR) { - sp30->unk10 = 3; - func_802F4A20(); - return 1; - } - if (sp30->cmdType == 1) { - if ((sp3c & DATA_REQUEST) == 0) { - if (sp30->sectorNum + 1 != sp30->transferMode * 85) { - sp30->unk10 = 6; - func_802F4A20(); - return 1; - } - HW_REG(PI_STATUS_REG, u32) = PI_STATUS_CLEAR_INTR; - D_8030208C |= 0x00100401; - sp30->unk10 = 0; - func_802F4B08(); - return 1; - } - sp2c->dramAddr = (void *) ((u32) sp2c->dramAddr + sp2c->sectorSize); - sp30->sectorNum += 1; - osEPiRawStartDma(__osDiskHandle, 1, 0x05000400, sp2c->dramAddr, sp2c->sectorSize); - return 1; - } - if (sp30->cmdType == 0) { - if (sp30->transferMode == 3) { - if ((s32)(sp2c->C1ErrNum + 17) < sp30->sectorNum) { - sp30->unk10 = 0; - func_802F4A20(); - return 1; - } - if ((sp3c & DATA_REQUEST) == 0) { - sp30->unk10 = 17; - func_802F4A20(); - return 1; - } - } else { - sp2c->dramAddr = (void *) ((u32) sp2c->dramAddr + sp2c->sectorSize); - } - sp34 = HW_REG(ASIC_BM_STATUS, u32); - if (((C1_SINGLE & sp34) && (C1_DOUBLE & sp34)) || (sp34 & MICRO_STATUS)) - { - if (sp2c->C1ErrNum > 3) { - if (sp30->transferMode != 3 || sp30->sectorNum > 0x52) { - sp30->unk10 = 17; - func_802F4A20(); - return 1; - } - } else { - sp28 = sp2c->C1ErrNum; - sp2c->C1ErrSector[sp28] = sp30->sectorNum + 1; - } - sp2c->C1ErrNum += 1; - } - if (sp3c & C2_TRANSFER) { - if (sp30->sectorNum != 87) { - sp30->unk10 = 6; - func_802F4A20(); - } - if (sp30->transferMode == 2 && sp30->blockNum == 0) { - sp30->blockNum = 1; - sp30->sectorNum = -1; - sp30->block[1].dramAddr = - (void *) ((u32) sp30->block[1].dramAddr - sp30->block[1].sectorSize); - } else { - HW_REG(PI_STATUS_REG, u32) = PI_STATUS_CLEAR_INTR; - D_8030208C |= 0x00100401; - } - osEPiRawStartDma(__osDiskHandle, 0, 0x5000000, sp2c->C2Addr, sp2c->sectorSize * 4); - sp30->unk10 = 0; - return 1; - } - - if (sp30->sectorNum == -1 && sp30->transferMode == 2 && sp30->blockNum == 1) { - sp24 = &sp30->block[0]; - if (sp30->block[0].C1ErrNum == 0) { - if (((u32 *) sp30->block[0].C2Addr)[0] | ((u32 *) sp30->block[0].C2Addr)[1] - | ((u32 *) sp30->block[0].C2Addr)[2] | ((u32 *) sp30->block[0].C2Addr)[3]) { - sp30->unk10 = 6; - func_802F4A20(); - return 1; - } - } - sp30->unk10 = 0; - func_802F4B08(); - } - sp30->sectorNum += 1; - if (sp3c & DATA_REQUEST) { - if (sp30->sectorNum > 0x54) { - sp30->unk10 = 6; - func_802F4A20(); - return 1; - } - osEPiRawStartDma(__osDiskHandle, 0, 0x05000400, sp2c->dramAddr, sp2c->sectorSize); - sp30->unk10 = 0; - return 1; - } - if (sp30->sectorNum <= 0x54) { - sp30->unk10 = 6; - func_802F4A20(); - return 1; - } - return 1; - } - sp30->unk10 = 75; - func_802F4A20(); - return 1; -} -#endif diff --git a/lib/src/EU_D_802f4330.c b/lib/src/EU_D_802f4330.c deleted file mode 100644 index ad9b3bac..00000000 --- a/lib/src/EU_D_802f4330.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "libultra_internal.h" - -// an array of pointers to functions taking no arguments and returning u32... -// this is only referenced in the exception handler and here. this function is called with a0=1 and -// then the same memory address is loaded. it's definitely an array access though.. -extern u32 (*D_80334920[8])(void) ; - -void EU_D_802f4330(u32 a0, u32 a1(void)) { - register u32 int_disabled = __osDisableInt(); - D_80334920[a0] = a1; - __osRestoreInt(int_disabled); -} diff --git a/lib/src/NaN.c b/lib/src/NaN.c deleted file mode 100644 index 05f4031c..00000000 --- a/lib/src/NaN.c +++ /dev/null @@ -1,5 +0,0 @@ -typedef union { - int i; - float f; -} fu; -const fu NAN = { 0x7f810000 }; diff --git a/lib/src/_Ldtob.c b/lib/src/_Ldtob.c deleted file mode 100644 index 3656bd45..00000000 --- a/lib/src/_Ldtob.c +++ /dev/null @@ -1,287 +0,0 @@ -#include "libultra_internal.h" -#include -#include -#include -#include "printf.h" - -#define BUFF_LEN 0x20 - -static s16 _Ldunscale(s16 *, printf_struct *); -static void _Genld(printf_struct *, u8, u8 *, s16, s16); - -const double D_80338670[] = { 10e0L, 10e1L, 10e3L, 10e7L, 10e15L, 10e31L, 10e63L, 10e127L, 10e255L }; - -/* float properties */ -#define _D0 0 -#define _DBIAS 0x3ff -#define _DLONG 1 -#define _DOFF 4 -#define _FBIAS 0x7e -#define _FOFF 7 -#define _FRND 1 -#define _LBIAS 0x3ffe -#define _LOFF 15 -/* integer properties */ -#define _C2 1 -#define _CSIGN 1 -#define _ILONG 0 -#define _MBMAX 8 -#define NAN 2 -#define INF 1 -#define FINITE -1 -#define _DFRAC ((1 << _DOFF) - 1) -#define _DMASK (0x7fff & ~_DFRAC) -#define _DMAX ((1 << (15 - _DOFF)) - 1) -#define _DNAN (0x8000 | _DMAX << _DOFF | 1 << (_DOFF - 1)) -#define _DSIGN 0x8000 -#if _D0 == 3 -#define _D1 2 /* little-endian order */ -#define _D2 1 -#define _D3 0 -#else -#define _D1 1 /* big-endian order */ -#define _D2 2 -#define _D3 3 -#endif - -void _Ldtob(printf_struct *args, u8 type) { - u8 buff[BUFF_LEN]; - u8 *ptr; - UNUSED u32 sp70; - f64 val; - /* maybe struct? */ - s16 err; - s16 nsig; - s16 exp; - - s32 i; - s32 n; - f64 factor; - s32 gen; - s32 j; - s32 lo; - ldiv_t qr; - u8 drop; - s32 n2; - /* */ - UNUSED u8 unused[0x4]; - ptr = buff; - val = args->value.f64; - if (args->precision < 0) { - args->precision = 6; - } else { - if (args->precision == 0 && (type == 'g' || type == 'G')) { - args->precision = 1; - } - } - err = _Ldunscale(&exp, args); - if (err > 0) { - memcpy(args->buff, err == 2 ? "NaN" : "Inf", args->part2_len = 3); - return; - } - if (err == 0) { - nsig = 0; - exp = 0; - } else { - if (val < 0) { - val = -val; - } - exp = exp * 30103 / 0x000186A0 - 4; - if (exp < 0) { - n = (3 - exp) & ~3; - exp = -n; - for (i = 0; n > 0; n >>= 1, i++) { - if ((n & 1) != 0) { - val *= D_80338670[i]; - } - } - } else { - if (exp > 0) { - factor = 1; - exp &= ~3; - for (n = exp, i = 0; n > 0; n >>= 1, i++) { - if ((n & 1) != 0) { - factor *= D_80338670[i]; - } - } - val /= factor; - } - } - gen = ((type == 'f') ? exp + 10 : 6) + args->precision; - if (gen > 0x13) { - gen = 0x13; - } - *ptr++ = '0'; - while (gen > 0 && 0 < val) { - lo = val; - if ((gen -= 8) > 0) { - val = (val - lo) * 1.0e8; - } - ptr = ptr + 8; - for (j = 8; lo > 0 && --j >= 0;) { - qr = ldiv(lo, 10); - *--ptr = qr.rem + '0'; - lo = qr.quot; - } - while (--j >= 0) { - ptr--; - *ptr = '0'; - } - ptr += 8; - } - - gen = ptr - &buff[1]; - for (ptr = &buff[1], exp += 7; *ptr == '0'; ptr++) { - --gen, --exp; - } - - nsig = ((type == 'f') ? exp + 1 : ((type == 'e' || type == 'E') ? 1 : 0)) + args->precision; - if (gen < nsig) { - nsig = gen; - } - if (nsig > 0) { - if (nsig < gen && ptr[nsig] > '4') { - drop = '9'; - } else { - drop = '0'; - } - - for (n2 = nsig; ptr[--n2] == drop;) { - nsig--; - } - if (drop == '9') { - ptr[n2]++; - } - if (n2 < 0) { - --ptr, ++nsig, ++exp; - } - } - } - _Genld(args, type, ptr, nsig, exp); -} - -static s16 _Ldunscale(s16 *pex, printf_struct *px) { - - unsigned short *ps = (unsigned short *) px; - short xchar = (ps[_D0] & _DMASK) >> _DOFF; - if (xchar == _DMAX) { /* NaN or INF */ - *pex = 0; - return (s16)(ps[_D0] & _DFRAC || ps[_D1] || ps[_D2] || ps[_D3] ? NAN : INF); - } else if (0 < xchar) { - ps[_D0] = (ps[_D0] & ~_DMASK) | (_DBIAS << _DOFF); - *pex = xchar - (_DBIAS - 1); - return (FINITE); - } - if (0 > xchar) { - return NAN; - } else { - *pex = 0; - return (0); - } -} - -static void _Genld(printf_struct *px, u8 code, u8 *p, s16 nsig, s16 xexp) { - u8 point = '.'; - if (nsig <= 0) { - nsig = 1, - - p = (u8 *) "0"; - } - - if (code == 'f' - || ((code == 'g' || code == 'G') && (-4 <= xexp) && (xexp < px->precision))) { /* 'f' format */ - ++xexp; /* change to leading digit count */ - if (code != 'f') { /* fixup for 'g' */ - if (!(px->flags & FLAGS_HASH) && nsig < px->precision) { - px->precision = nsig; - } - if ((px->precision -= xexp) < 0) { - px->precision = 0; - } - } - if (xexp <= 0) { /* digits only to right of point */ - px->buff[px->part2_len++] = '0'; - if (0 < px->precision || px->flags & FLAGS_HASH) { - px->buff[px->part2_len++] = point; - } - if (px->precision < -xexp) { - xexp = -px->precision; - } - px->num_mid_zeros = -xexp; - px->precision += xexp; - if (px->precision < nsig) { - nsig = px->precision; - } - memcpy(&px->buff[px->part2_len], p, px->part3_len = nsig); - px->num_trailing_zeros = px->precision - nsig; - } else if (nsig < xexp) { /* zeros before point */ - memcpy(&px->buff[px->part2_len], p, nsig); - px->part2_len += nsig; - px->num_mid_zeros = xexp - nsig; - if (0 < px->precision || px->flags & FLAGS_HASH) { - px->buff[px->part2_len] = point, ++px->part3_len; - } - px->num_trailing_zeros = px->precision; - } else { /* enough digits before point */ - memcpy(&px->buff[px->part2_len], p, xexp); - px->part2_len += xexp; - nsig -= xexp; - if (0 < px->precision || px->flags & FLAGS_HASH) { - px->buff[px->part2_len++] = point; - } - if (px->precision < nsig) { - nsig = px->precision; - } - memcpy(&px->buff[px->part2_len], p + xexp, nsig); - px->part2_len += nsig; - px->num_mid_zeros = px->precision - nsig; - } - } else { /* 'e' format */ - if (code == 'g' || code == 'G') { /* fixup for 'g' */ - if (nsig < px->precision) { - px->precision = nsig; - } - if (--px->precision < 0) { - px->precision = 0; - } - code = code == 'g' ? 'e' : 'E'; - } - px->buff[px->part2_len++] = *p++; - if (0 < px->precision || px->flags & FLAGS_HASH) { - px->buff[px->part2_len++] = point; - } - if (0 < px->precision) { /* put fraction digits */ - if (px->precision < --nsig) { - nsig = px->precision; - } - memcpy(&px->buff[px->part2_len], p, nsig); - px->part2_len += nsig; - px->num_mid_zeros = px->precision - nsig; - } - p = (u8 *) &px->buff[px->part2_len]; /* put exponent */ - *p++ = code; - if (0 <= xexp) { - *p++ = '+'; - } else { /* negative exponent */ - *p++ = '-'; - xexp = -xexp; - } - if (100 <= xexp) { /* put oversize exponent */ - if (1000 <= xexp) { - *p++ = xexp / 1000 + '0', xexp %= 1000; - } - *p++ = xexp / 100 + '0', xexp %= 100; - } - *p++ = xexp / 10 + '0', xexp %= 10; - *p++ = xexp + '0'; - px->part3_len = p - (u8 *) &px->buff[px->part2_len]; - } - if ((px->flags & (FLAGS_ZERO | FLAGS_MINUS)) == FLAGS_ZERO) { /* pad with leading zeros */ - int n = - px->part1_len + px->part2_len + px->num_mid_zeros + px->part3_len + px->num_trailing_zeros; - - if (n < px->width) { - px->num_leading_zeros = px->width - n; - } - } -} diff --git a/lib/src/_Litob.c b/lib/src/_Litob.c deleted file mode 100644 index 58ed081f..00000000 --- a/lib/src/_Litob.c +++ /dev/null @@ -1,59 +0,0 @@ -#include "libultra_internal.h" -#include -#include -#include "printf.h" - -#define BUFF_LEN 0x18 - -static u8 D_80334960[] = "0123456789abcdef"; -static u8 D_80334974[] = "0123456789ABCDEF"; - -void _Litob(printf_struct *args, u8 type) { - u8 buff[BUFF_LEN]; - const u8 *num_map; - s32 base; - s32 buff_ind; - u64 num; - lldiv_t quotrem; - - if (type == 'X') { - num_map = D_80334974; - } else { - num_map = D_80334960; - } - - base = (type == 'o') ? 8 : ((type != 'x' && type != 'X') ? 10 : 16); - buff_ind = BUFF_LEN; - num = args->value.s64; - - if ((type == 'd' || type == 'i') && args->value.s64 < 0) { - num = -num; - } - - if (num != 0 || args->precision != 0) { - buff[--buff_ind] = num_map[num % base]; - } - - args->value.s64 = num / base; - - while (args->value.s64 > 0 && buff_ind > 0) { - quotrem = lldiv(args->value.s64, base); - args->value.s64 = quotrem.quot; - buff[--buff_ind] = num_map[quotrem.rem]; - } - - args->part2_len = BUFF_LEN - buff_ind; - - memcpy(args->buff, buff + buff_ind, args->part2_len); - - if (args->part2_len < args->precision) { - args->num_leading_zeros = args->precision - args->part2_len; - } - - if (args->precision < 0 && (args->flags & (FLAGS_ZERO | FLAGS_MINUS)) == FLAGS_ZERO) { - buff_ind = args->width - args->part1_len - args->num_leading_zeros - args->part2_len; - if (buff_ind > 0) { - args->num_leading_zeros += buff_ind; - } - } -} diff --git a/lib/src/_Printf.c b/lib/src/_Printf.c deleted file mode 100644 index 743a788a..00000000 --- a/lib/src/_Printf.c +++ /dev/null @@ -1,229 +0,0 @@ -#include "libultra_internal.h" -#include -#include -#include "printf.h" - -#define ATOI(i, a) \ - for (i = 0; *a >= '0' && *a <= '9'; a++) \ - if (i < 999) \ - i = *a + i * 10 - '0'; -#define _PROUT(dst, fmt, _size) \ - if (_size > 0) { \ - dst = prout(dst, fmt, _size); \ - if (dst != 0) \ - sp78.size += _size; \ - else \ - return sp78.size; \ - } -#define _PAD(i, m, c, src, extracond) \ - if (extracond && m > 0) \ - for (i = m; i > 0; i -= c) { \ - if ((u32) i > 32) \ - c = 32; \ - else \ - c = i; \ - _PROUT(dst, src, c); \ - } - -const char length_str[] = "hlL"; -const char flags_str[] = " +-#0"; -const u32 flags_arr[] = { FLAGS_SPACE, FLAGS_PLUS, FLAGS_MINUS, FLAGS_HASH, FLAGS_ZERO, 0 }; -char _spaces[] = " "; -char _zeroes[] = "00000000000000000000000000000000"; - -static void _Putfld(printf_struct *, va_list *, u8, u8 *); - -s32 _Printf(char *(*prout)(char *, const char *, size_t), char *dst, const char *fmt, va_list args) { - printf_struct sp78; - const u8 *fmt_ptr; - u8 c; - const char *flag_index; - u8 sp4c[0x20]; // probably a buffer? - s32 sp48, sp44, sp40, sp3c, sp38, sp34, sp30, sp2c, sp28, sp24; - sp78.size = 0; - while (1) { - fmt_ptr = (u8 *) fmt; - while ((c = *fmt_ptr++) > 0) { - if (c == '%') { - fmt_ptr--; - break; - } - } - _PROUT(dst, fmt, fmt_ptr - (u8 *) fmt); - if (c == 0) { - return sp78.size; - } - fmt = (char *) ++fmt_ptr; - sp78.flags = 0; - for (; (flag_index = strchr(flags_str, *fmt_ptr)) != NULL; fmt_ptr++) { - sp78.flags |= flags_arr[flag_index - flags_str]; - } - if (*fmt_ptr == '*') { - sp78.width = va_arg(args, s32); - if (sp78.width < 0) { - sp78.width = -sp78.width; - sp78.flags |= FLAGS_MINUS; - } - fmt_ptr++; - } else { - ATOI(sp78.width, fmt_ptr); - } - if (*fmt_ptr != '.') { - sp78.precision = -1; - } else { - fmt_ptr++; - if (*fmt_ptr == '*') { - sp78.precision = va_arg(args, s32); - fmt_ptr++; - } else { - ATOI(sp78.precision, fmt_ptr); - } - } - if (strchr(length_str, *fmt_ptr) != NULL) { - sp78.length = *fmt_ptr++; - } else { - sp78.length = 0; - } - - if (sp78.length == 'l' && *fmt_ptr == 'l') { - sp78.length = 'L'; - fmt_ptr++; - } - _Putfld(&sp78, &args, *fmt_ptr, sp4c); - sp78.width -= sp78.part1_len + sp78.num_leading_zeros + sp78.part2_len + sp78.num_mid_zeros - + sp78.part3_len + sp78.num_trailing_zeros; - _PAD(sp44, sp78.width, sp48, _spaces, !(sp78.flags & FLAGS_MINUS)); - _PROUT(dst, (char *) sp4c, sp78.part1_len); - _PAD(sp3c, sp78.num_leading_zeros, sp40, _zeroes, 1); - _PROUT(dst, sp78.buff, sp78.part2_len); - _PAD(sp34, sp78.num_mid_zeros, sp38, _zeroes, 1); - _PROUT(dst, (char *) (&sp78.buff[sp78.part2_len]), sp78.part3_len) - _PAD(sp2c, sp78.num_trailing_zeros, sp30, _zeroes, 1); - _PAD(sp24, sp78.width, sp28, _spaces, sp78.flags & FLAGS_MINUS); - fmt = (char *) fmt_ptr + 1; - } -} - -static void _Putfld(printf_struct *a0, va_list *args, u8 type, u8 *buff) { - a0->part1_len = a0->num_leading_zeros = a0->part2_len = a0->num_mid_zeros = a0->part3_len = - a0->num_trailing_zeros = 0; - - switch (type) { - - case 'c': - buff[a0->part1_len++] = va_arg(*args, u32); - break; - - case 'd': - case 'i': - if (a0->length == 'l') { - a0->value.s64 = va_arg(*args, s32); - } else if (a0->length == 'L') { - a0->value.s64 = va_arg(*args, s64); - } else { - a0->value.s64 = va_arg(*args, s32); - } - - if (a0->length == 'h') { - a0->value.s64 = (s16) a0->value.s64; - } - - if (a0->value.s64 < 0) { - buff[a0->part1_len++] = '-'; - } else if (a0->flags & FLAGS_PLUS) { - buff[a0->part1_len++] = '+'; - } else if (a0->flags & FLAGS_SPACE) { - buff[a0->part1_len++] = ' '; - } - - a0->buff = (char *) &buff[a0->part1_len]; - - _Litob(a0, type); - break; - - case 'x': - case 'X': - case 'u': - case 'o': - if (a0->length == 'l') { - a0->value.s64 = va_arg(*args, s32); - } else if (a0->length == 'L') { - a0->value.s64 = va_arg(*args, s64); - } else { - a0->value.s64 = va_arg(*args, s32); - } - - if (a0->length == 'h') { - a0->value.s64 = (u16) a0->value.s64; - } else if (a0->length == 0) { - a0->value.s64 = (u32) a0->value.s64; - } - - if (a0->flags & FLAGS_HASH) { - buff[a0->part1_len++] = '0'; - if (type == 'x' || type == 'X') { - - buff[a0->part1_len++] = type; - } - } - a0->buff = (char *) &buff[a0->part1_len]; - _Litob(a0, type); - break; - - case 'e': - case 'f': - case 'g': - case 'E': - case 'G': - //... okay? - a0->value.f64 = a0->length == 'L' ? va_arg(*args, f64) : va_arg(*args, f64); - - if (a0->value.u16 & 0x8000) { - buff[a0->part1_len++] = '-'; - } else { - if (a0->flags & FLAGS_PLUS) { - buff[a0->part1_len++] = '+'; - } else if (a0->flags & FLAGS_SPACE) { - buff[a0->part1_len++] = ' '; - } - } - - a0->buff = (char *) &buff[a0->part1_len]; - _Ldtob(a0, type); - break; - - case 'n': - if (a0->length == 'h') { - *(va_arg(*args, u16 *)) = a0->size; - } else if (a0->length == 'l') { - *va_arg(*args, u32 *) = a0->size; - } else if (a0->length == 'L') { - *va_arg(*args, u64 *) = a0->size; - } else { - *va_arg(*args, u32 *) = a0->size; - } - break; - - case 'p': - a0->value.s64 = (intptr_t) va_arg(*args, void *); - a0->buff = (char *) &buff[a0->part1_len]; - _Litob(a0, 'x'); - break; - - case 's': - a0->buff = va_arg(*args, char *); - a0->part2_len = strlen(a0->buff); - if (a0->precision >= 0 && a0->part2_len > a0->precision) { - a0->part2_len = a0->precision; - } - break; - - case '%': - buff[a0->part1_len++] = '%'; - break; - - default: - buff[a0->part1_len++] = type; - break; - } -} diff --git a/lib/src/__osAiDeviceBusy.c b/lib/src/__osAiDeviceBusy.c deleted file mode 100644 index 261fcbab..00000000 --- a/lib/src/__osAiDeviceBusy.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" - -s32 __osAiDeviceBusy(void) { - register s32 status = HW_REG(AI_STATUS_REG, u32); - if ((status & AI_STATUS_AI_FULL) != 0) { - return 1; - } else { - return 0; - } -} diff --git a/lib/src/__osAtomicDec.c b/lib/src/__osAtomicDec.c deleted file mode 100644 index 87ff265e..00000000 --- a/lib/src/__osAtomicDec.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "libultra_internal.h" - -s32 __osAtomicDec(u32 *a0) { - s32 sp1c; - s32 sp18; - sp1c = __osDisableInt(); - - if (*a0 != 0) { - (*a0)--; - sp18 = 1; - } else { - sp18 = 0; - } - - __osRestoreInt(sp1c); - return sp18; -} diff --git a/lib/src/__osDequeueThread.c b/lib/src/__osDequeueThread.c deleted file mode 100644 index 08758378..00000000 --- a/lib/src/__osDequeueThread.c +++ /dev/null @@ -1,29 +0,0 @@ -#include "libultra_internal.h" - -// these don't feel like they belong here -// but it makes the most logical since there was printf data before -#ifndef AVOID_UB -OSThread *D_80334890 = NULL; -u32 D_80334894 = -1; -OSThread *D_80334898 = (OSThread *) &D_80334890; -OSThread *D_8033489C = (OSThread *) &D_80334890; -OSThread *D_803348A0 = NULL; -u32 D_803348A4 = 0; // UNKNOWN -#else -OSThread_ListHead D_80334890_fix = {NULL, -1, (OSThread *) &D_80334890_fix, (OSThread *) &D_80334890_fix, NULL, 0}; -#endif - -void __osDequeueThread(OSThread **queue, OSThread *thread) { - register OSThread **a2; - register OSThread *a3; - a2 = queue; - a3 = *a2; - while (a3 != NULL) { - if (a3 == thread) { - *a2 = thread->next; - return; - } - a2 = &a3->next; - a3 = *a2; - } -} diff --git a/lib/src/__osDevMgrMain.c b/lib/src/__osDevMgrMain.c deleted file mode 100644 index 3cfe19b7..00000000 --- a/lib/src/__osDevMgrMain.c +++ /dev/null @@ -1,121 +0,0 @@ -#include "libultra_internal.h" -#include "macros.h" -#if defined(VERSION_EU) -#include "new_func.h" -void __osDevMgrMain(void *args) { - OSIoMesg *sp44; - OSMesg sp40; - OSMesg sp3c; - s32 sp38; - OSMgrArgs *sp34; - UNUSED u32 sp30; - u32 sp2c; - __OSBlockInfo *sp28; - __OSTranxInfo *sp24; - sp30 = 0; - sp2c = 0; - sp44 = NULL; - sp38 = 0; - sp34 = (OSMgrArgs *) args; - while (1) { - osRecvMesg(sp34->unk08, (OSMesg) &sp44, OS_MESG_BLOCK); - if (sp44->piHandle != NULL && sp44->piHandle->type == 2 - && (sp44->piHandle->transferInfo.cmdType == 0 - || sp44->piHandle->transferInfo.cmdType == 1)) { - sp24 = &sp44->piHandle->transferInfo; - sp28 = &sp24->block[sp24->blockNum]; - sp24->sectorNum = -1; - if (sp24->transferMode != 3) { - sp28->dramAddr = (void *) ((u32) sp28->dramAddr - sp28->sectorSize); - } - if (sp24->transferMode == 2 && sp44->piHandle->transferInfo.cmdType == 0) - sp2c = 1; - else - sp2c = 0; - osRecvMesg(sp34->unk10, &sp3c, OS_MESG_BLOCK); - func_802F7140(0x00100401); // remove magic constant! - func_802F71A0(sp44->piHandle, 0x05000510, (sp24->bmCtlShadow | 0x80000000)); - while (1) { - osRecvMesg(sp34->unk0c, &sp40, OS_MESG_BLOCK); - sp30 = osSendMesg(sp44->hdr.retQueue, sp44, OS_MESG_NOBLOCK); - if (sp2c != 1 || sp44->piHandle->transferInfo.unk10 != 0) - break; - sp2c = 0; - } - osSendMesg(sp34->unk10, NULL, OS_MESG_NOBLOCK); - if (sp44->piHandle->transferInfo.blockNum == 1) - func_802F71F0(); - } else { - switch (sp44->hdr.type) { - case 11: - osRecvMesg(sp34->unk10, &sp3c, OS_MESG_BLOCK); - sp38 = sp34->dma_func(OS_READ, sp44->devAddr, sp44->dramAddr, sp44->size); - break; - case 12: - osRecvMesg(sp34->unk10, &sp3c, OS_MESG_BLOCK); - sp38 = sp34->dma_func(OS_WRITE, sp44->devAddr, sp44->dramAddr, sp44->size); - break; - case 15: - osRecvMesg(sp34->unk10, &sp3c, OS_MESG_BLOCK); - sp38 = sp34->edma_func(sp44->piHandle, OS_READ, sp44->devAddr, sp44->dramAddr, - sp44->size); - break; - case 16: - osRecvMesg(sp34->unk10, &sp3c, OS_MESG_BLOCK); - sp38 = sp34->edma_func(sp44->piHandle, OS_WRITE, sp44->devAddr, sp44->dramAddr, - sp44->size); - break; - case 10: - osSendMesg(sp44->hdr.retQueue, sp44, OS_MESG_NOBLOCK); - sp38 = -1; - break; - break; - default: - sp38 = -1; - break; - } - if (sp38 == 0) { - osRecvMesg(sp34->unk0c, &sp40, OS_MESG_BLOCK); - sp30 = osSendMesg(sp44->hdr.retQueue, sp44, OS_MESG_NOBLOCK); - osSendMesg(sp34->unk10, NULL, OS_MESG_NOBLOCK); - } - } - } -} -#else -void __osDevMgrMain(void *args) { - OSIoMesg *sp34; - OSMesg sp30; - OSMesg sp2c; - s32 sp28; - OSMgrArgs *sp24; - sp34 = NULL; - sp28 = 0; - sp24 = (OSMgrArgs *) args; - while (1) { - osRecvMesg(sp24->unk08, (OSMesg) &sp34, OS_MESG_BLOCK); - switch (sp34->hdr.type) { - case 11: - osRecvMesg(sp24->unk10, &sp2c, OS_MESG_BLOCK); - sp28 = sp24->dma_func(OS_READ, sp34->devAddr, sp34->dramAddr, sp34->size); - break; - case 12: - osRecvMesg(sp24->unk10, &sp2c, OS_MESG_BLOCK); - sp28 = sp24->dma_func(OS_WRITE, sp34->devAddr, sp34->dramAddr, sp34->size); - break; - case 10: - osSendMesg(sp34->hdr.retQueue, sp34, OS_MESG_NOBLOCK); - sp28 = -1; - break; - default: - sp28 = -1; - break; - } - if (sp28 == 0) { - osRecvMesg(sp24->unk0c, &sp30, OS_MESG_BLOCK); - osSendMesg(sp34->hdr.retQueue, sp34, OS_MESG_NOBLOCK); - osSendMesg(sp24->unk10, NULL, OS_MESG_NOBLOCK); - } - } -} -#endif diff --git a/lib/src/__osGetCurrFaultedThread.c b/lib/src/__osGetCurrFaultedThread.c deleted file mode 100644 index f4951ff1..00000000 --- a/lib/src/__osGetCurrFaultedThread.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "libultra_internal.h" - -OSThread *__osGetCurrFaultedThread() { - return D_8033489C; // 80302efc -} diff --git a/lib/src/__osPiCreateAccessQueue.c b/lib/src/__osPiCreateAccessQueue.c deleted file mode 100644 index 90d4c86a..00000000 --- a/lib/src/__osPiCreateAccessQueue.c +++ /dev/null @@ -1,25 +0,0 @@ -#include "libultra_internal.h" - -#define PIAccessQueueSize 2 - -OSMesg osPiMesgBuff[PIAccessQueueSize]; -OSMesgQueue gOsPiMessageQueue; -u32 gOsPiAccessQueueCreated = 0; - -void __osPiCreateAccessQueue(void) { - gOsPiAccessQueueCreated = 1; - osCreateMesgQueue(&gOsPiMessageQueue, &osPiMesgBuff[0], PIAccessQueueSize - 1); - osSendMesg(&gOsPiMessageQueue, NULL, OS_MESG_NOBLOCK); -} - -void __osPiGetAccess(void) { - OSMesg sp1c; - if (!gOsPiAccessQueueCreated) { - __osPiCreateAccessQueue(); - } - osRecvMesg(&gOsPiMessageQueue, &sp1c, OS_MESG_BLOCK); -} - -void __osPiRelAccess(void) { - osSendMesg(&gOsPiMessageQueue, NULL, OS_MESG_NOBLOCK); -} diff --git a/lib/src/__osSiCreateAccessQueue.c b/lib/src/__osSiCreateAccessQueue.c deleted file mode 100644 index 6c42b72a..00000000 --- a/lib/src/__osSiCreateAccessQueue.c +++ /dev/null @@ -1,23 +0,0 @@ -#include "libultra_internal.h" -#define SIAccessQueueSize 2 -OSMesg osSiMesgBuff[SIAccessQueueSize]; -OSMesgQueue gOsSiMessageQueue; - -u32 gOsSiAccessQueueCreated = 0; -void __osSiCreateAccessQueue() { - gOsSiAccessQueueCreated = 1; - osCreateMesgQueue(&gOsSiMessageQueue, &osSiMesgBuff[0], SIAccessQueueSize - 1); - osSendMesg(&gOsSiMessageQueue, NULL, OS_MESG_NOBLOCK); -} - -void __osSiGetAccess(void) { - OSMesg sp1c; - if (!gOsSiAccessQueueCreated) { - __osSiCreateAccessQueue(); - } - osRecvMesg(&gOsSiMessageQueue, &sp1c, OS_MESG_BLOCK); -} - -void __osSiRelAccess(void) { - osSendMesg(&gOsSiMessageQueue, NULL, OS_MESG_NOBLOCK); -} diff --git a/lib/src/__osSiDeviceBusy.c b/lib/src/__osSiDeviceBusy.c deleted file mode 100644 index 5872f134..00000000 --- a/lib/src/__osSiDeviceBusy.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" - -s32 __osSiDeviceBusy() { - register u32 status; - status = HW_REG(SI_STATUS_REG, u32); - if (status & (SI_STATUS_DMA_BUSY | SI_STATUS_IO_READ_BUSY)) { - return 1; - } else { - return 0; - } -} diff --git a/lib/src/__osSiRawReadIo.c b/lib/src/__osSiRawReadIo.c deleted file mode 100644 index 02a62ae5..00000000 --- a/lib/src/__osSiRawReadIo.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" -s32 __osSiRawReadIo(void *a0, u32 *a1) { - if (__osSiDeviceBusy()) { - return -1; - } - *a1 = HW_REG((uintptr_t) a0, u32); - return 0; -} diff --git a/lib/src/__osSiRawStartDma.c b/lib/src/__osSiRawStartDma.c deleted file mode 100644 index 965b7187..00000000 --- a/lib/src/__osSiRawStartDma.c +++ /dev/null @@ -1,25 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" - -s32 __osSiRawStartDma(s32 dir, void *addr) { - if (__osSiDeviceBusy()) { - return -1; - } - - if (dir == OS_WRITE) { - osWritebackDCache(addr, 64); - } - - HW_REG(SI_DRAM_ADDR_REG, void *) = (void *) osVirtualToPhysical(addr); - - if (dir == OS_READ) { - HW_REG(SI_PIF_ADDR_RD64B_REG, u32) = 0x1FC007C0; - } else { - HW_REG(SI_PIF_ADDR_WR64B_REG, u32) = 0x1FC007C0; - } - - if (dir == OS_READ) { - osInvalDCache(addr, 64); - } - return 0; -} diff --git a/lib/src/__osSiRawWriteIo.c b/lib/src/__osSiRawWriteIo.c deleted file mode 100644 index 49d83dad..00000000 --- a/lib/src/__osSiRawWriteIo.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" -s32 __osSiRawWriteIo(void *a0, u32 a1) { - if (__osSiDeviceBusy()) { - return -1; - } - HW_REG((uintptr_t) a0, u32) = a1; - return 0; -} diff --git a/lib/src/__osSpDeviceBusy.c b/lib/src/__osSpDeviceBusy.c deleted file mode 100644 index a40c402a..00000000 --- a/lib/src/__osSpDeviceBusy.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" - -s32 __osSpDeviceBusy() { - register u32 status = HW_REG(SP_STATUS_REG, u32); - if (status & (SPSTATUS_IO_FULL | SPSTATUS_DMA_FULL | SPSTATUS_DMA_BUSY)) { - return 1; - } - return 0; -} diff --git a/lib/src/__osSpGetStatus.c b/lib/src/__osSpGetStatus.c deleted file mode 100644 index fb71219a..00000000 --- a/lib/src/__osSpGetStatus.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" -u32 __osSpGetStatus() { - return HW_REG(SP_STATUS_REG, u32); -} diff --git a/lib/src/__osSpRawStartDma.c b/lib/src/__osSpRawStartDma.c deleted file mode 100644 index 3768a5fa..00000000 --- a/lib/src/__osSpRawStartDma.c +++ /dev/null @@ -1,16 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" - -s32 __osSpRawStartDma(u32 dir, void *sp_ptr, void *dram_ptr, size_t size) { - if (__osSpDeviceBusy()) { - return -1; - } - HW_REG(SP_MEM_ADDR_REG, void *) = sp_ptr; - HW_REG(SP_DRAM_ADDR_REG, void *) = (void *) osVirtualToPhysical(dram_ptr); - if (dir == 0) { - HW_REG(SP_WR_LEN_REG, u32) = size - 1; - } else { - HW_REG(SP_RD_LEN_REG, u32) = size - 1; - } - return 0; -} diff --git a/lib/src/__osSpSetPc.c b/lib/src/__osSpSetPc.c deleted file mode 100644 index d074590c..00000000 --- a/lib/src/__osSpSetPc.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" - -s32 __osSpSetPc(void *pc) { - register u32 status = HW_REG(SP_STATUS_REG, u32); - if (!(status & SPSTATUS_HALT)) { - return -1; - } else { - HW_REG(SP_PC_REG, void *) = pc; - return 0; - } -} diff --git a/lib/src/__osSpSetStatus.c b/lib/src/__osSpSetStatus.c deleted file mode 100644 index 2569271f..00000000 --- a/lib/src/__osSpSetStatus.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" -void __osSpSetStatus(u32 status) { - HW_REG(SP_STATUS_REG, u32) = status; -} diff --git a/lib/src/__osSyncPutChars.c b/lib/src/__osSyncPutChars.c deleted file mode 100644 index a27ef60f..00000000 --- a/lib/src/__osSyncPutChars.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "libultra_internal.h" - -typedef struct { - u8 unk00 : 2; - u8 pad : 4; - u8 unk01 : 2; - u8 unk2[3]; -} unkStruct; - -u32 D_80334A40 = 0; -u32 D_80334A44 = 1; - -void __osSyncPutChars(s32 a0, s32 a1, u8 *a2) { - unkStruct sp24; - s32 sp20; - u32 sp1c; - sp24.unk00 = a0; - sp24.unk01 = a1; - - for (sp20 = 0; sp20 < a1; sp20++) { - sp24.unk2[sp20] = a2[sp20]; - } - - while (!__osAtomicDec(&D_80334A44)) { - ; - } - - sp1c = __osDisableInt(); - - *(u32 *) 0xC0000000 = *(u32 *) &sp24; - while (!(__osGetCause() & 0x2000)) { - ; - } - *(u32 *) 0xC000000C = 0; - D_80334A44++; - - __osRestoreInt(sp1c); -} diff --git a/lib/src/__osViGetCurrentContext.c b/lib/src/__osViGetCurrentContext.c deleted file mode 100644 index 1482e048..00000000 --- a/lib/src/__osViGetCurrentContext.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "libultra_internal.h" -extern OSViContext *D_80334910; -OSViContext *__osViGetCurrentContext() { - return D_80334910; -} diff --git a/lib/src/__osViInit.c b/lib/src/__osViInit.c deleted file mode 100644 index 92d64958..00000000 --- a/lib/src/__osViInit.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" - -#ifndef VERSION_JP -extern u32 osTvType; -#endif - -OSViContext D_803348B0[2] = { 0 }; -OSViContext *D_80334910 = &D_803348B0[0]; -OSViContext *D_80334914 = &D_803348B0[1]; -#ifdef VERSION_EU -u32 D_8033491C = 0x02E6D354; -u32 D_80334918 = TV_TYPE_PAL; -#else -u32 D_80334918 = TV_TYPE_NTSC; -u32 D_8033491C = 0x02E6D354; -#endif - -extern OSViMode D_80334990; -extern OSViMode D_803349E0; -#ifdef VERSION_EU -extern OSViMode D_80302FD0; -#endif - -void __osViInit(void) { -//#ifdef VERSION_JP -#ifdef VERSION_US - D_80334918 = osTvType; -#endif - bzero(D_803348B0, sizeof(D_803348B0)); - D_80334910 = &D_803348B0[0]; - D_80334914 = &D_803348B0[1]; - D_80334914->retraceCount = 1; - D_80334910->retraceCount = 1; - -#ifdef VERSION_EU - - if (osTvType == TV_TYPE_PAL) { - D_80334914->unk08 = &D_80334990; - D_8033491C = 0x02F5B2D2; - } else if (osTvType == TV_TYPE_MPAL) { - D_80334914->unk08 = &D_803349E0; - D_8033491C = 0x02E6025C; - } else { - D_80334914->unk08 = &D_80302FD0; - D_8033491C = 0x02E6D354; - } - -#else -#ifdef VERSION_JP - if (D_80334918 != TV_TYPE_PAL) -#else - if (D_80334918 == TV_TYPE_NTSC) -#endif - { - D_80334914->unk08 = &D_80334990; - D_8033491C = 0x02E6D354; - } else { - D_80334914->unk08 = &D_803349E0; -#ifdef VERSION_JP - D_8033491C = 0x02F5B2D2; -#else - D_8033491C = 0x02E6025C; -#endif - } -#endif - D_80334914->unk00 = 32; - D_80334914->features = D_80334914->unk08->comRegs.ctrl; -#ifndef VERSION_JP - while (HW_REG(VI_CURRENT_REG, u32) > 0xa) { - ; - } - HW_REG(VI_STATUS_REG, u32) = 0; -#endif - __osViSwapContext(); -} diff --git a/lib/src/__osViSwapContext.c b/lib/src/__osViSwapContext.c deleted file mode 100644 index d7741994..00000000 --- a/lib/src/__osViSwapContext.c +++ /dev/null @@ -1,59 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" -extern OSViContext *D_80334914; -extern OSViContext *D_80334910; -void __osViSwapContext() { - register OSViMode *s0; - register OSViContext *s1; - u32 origin; - u32 hStart; - u32 sp34; - u32 field; - register u32 s2; - field = 0; - s1 = D_80334914; - s0 = s1->unk08; - field = HW_REG(VI_V_CURRENT_LINE_REG, u32) & 1; - s2 = osVirtualToPhysical(s1->buffer); - origin = (s0->fldRegs[field].origin) + s2; - if (s1->unk00 & 2) { - s1->unk20 |= s0->comRegs.xScale & ~0xfff; - } else { - s1->unk20 = s0->comRegs.xScale; - } - if (s1->unk00 & 4) { - sp34 = (u32)(s0->fldRegs[field].yScale & 0xfff); - s1->unk2c = s1->unk24 * sp34; - s1->unk2c |= s0->fldRegs[field].yScale & ~0xfff; - } else { - s1->unk2c = s0->fldRegs[field].yScale; - } - hStart = s0->comRegs.hStart; - if (s1->unk00 & 0x20) { - hStart = 0; - } - if (s1->unk00 & 0x40) { - s1->unk2c = 0; - origin = osVirtualToPhysical(s1->buffer); - } - if (s1->unk00 & 0x80) { - s1->unk2c = (s1->unk28 << 0x10) & 0x3ff0000; - origin = osVirtualToPhysical(s1->buffer); - } - HW_REG(VI_ORIGIN_REG, u32) = origin; - HW_REG(VI_WIDTH_REG, u32) = s0->comRegs.width; - HW_REG(VI_BURST_REG, u32) = s0->comRegs.burst; - HW_REG(VI_V_SYNC_REG, u32) = s0->comRegs.vSync; - HW_REG(VI_H_SYNC_REG, u32) = s0->comRegs.hSync; - HW_REG(VI_LEAP_REG, u32) = s0->comRegs.leap; - HW_REG(VI_H_START_REG, u32) = hStart; - HW_REG(VI_V_START_REG, u32) = s0->fldRegs[field].vStart; - HW_REG(VI_V_BURST_REG, u32) = s0->fldRegs[field].vBurst; - HW_REG(VI_INTR_REG, u32) = s0->fldRegs[field].vIntr; - HW_REG(VI_X_SCALE_REG, u32) = s1->unk20; - HW_REG(VI_Y_SCALE_REG, u32) = s1->unk2c; - HW_REG(VI_CONTROL_REG, u32) = s1->features; - D_80334914 = D_80334910; - D_80334910 = s1; - *D_80334914 = *D_80334910; -} diff --git a/lib/src/func_802F4A20.c b/lib/src/func_802F4A20.c deleted file mode 100644 index 3e253ec7..00000000 --- a/lib/src/func_802F4A20.c +++ /dev/null @@ -1,39 +0,0 @@ -#include "new_func.h" - -void func_802F4A20(void) { - __OSTranxInfo *sp1c; - volatile u32 sp18; - sp1c = &__osDiskHandle->transferInfo; - WAIT_ON_IOBUSY(sp18); - HW_REG(ASIC_BM_CTL, u32) = BUFFER_MANAGER_RESET | sp1c->bmCtlShadow; //should be unk10?? - WAIT_ON_IOBUSY(sp18); - HW_REG(ASIC_BM_CTL, u32) = sp1c->bmCtlShadow; - func_802F4B08(); - HW_REG(PI_STATUS_REG, u32) = PI_STATUS_CLEAR_INTR; - D_8030208C |= 0x00100401; //TODO: fix magic numbers -} - -typedef struct OSEventMessageStruct_0_s { - OSMesgQueue *queue; - OSMesg msg; -} OSEventMessageStruct_0; - -extern OSEventMessageStruct_0 D_80363830[16]; // should be OS_NUM_EVENTS + 1 I think - -void func_802F4B08(void) { - OSEventMessageStruct_0 *sp2c; - OSMesgQueue *sp28; - u32 sp24; - register OSThread *s0; - sp2c = &D_80363830[OS_EVENT_PI]; - sp28 = sp2c->queue; - if (!sp28 || sp28->validCount >= sp28->msgCount) - return; - sp24 = (sp28->first + sp28->validCount) % sp28->msgCount; - sp28->msg[sp24] = sp2c->msg; - sp28->validCount += 1; - if (sp28->mtqueue->next != NULL) { - s0 = __osPopThread(&sp28->mtqueue); - __osEnqueueThread(&D_80334898, s0); - } -} diff --git a/lib/src/func_802F7140.c b/lib/src/func_802F7140.c deleted file mode 100644 index 95475578..00000000 --- a/lib/src/func_802F7140.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "libultra_internal.h" -#include "new_func.h" - -void func_802F7140(u32 a0) { - register u32 s0; - s0 = __osDisableInt(); - D_8030208C &= ~(-0x402 & a0); - __osRestoreInt(s0); -} diff --git a/lib/src/func_802F71A0.c b/lib/src/func_802F71A0.c deleted file mode 100644 index 9823b93e..00000000 --- a/lib/src/func_802F71A0.c +++ /dev/null @@ -1,36 +0,0 @@ - -#include "libultra_internal.h" -#include "hardware.h" -//possibly osEpiWriteIo -s32 func_802F71A0(OSPiHandle *a0, u32 a1, u32 a2) { - register u32 a3 = HW_REG(PI_STATUS_REG, u32); - while (a3 & PI_STATUS_ERROR) - a3 = HW_REG(PI_STATUS_REG, u32); - HW_REG(a0->baseAddress | a1, u32) = a2; - return 0; -} -/* -/ 0B69A0 802F71A0 3C0EA460 / lui $t6, %hi(PI_STATUS_REG) # $t6, 0xa460 -/ 0B69A4 802F71A4 8DC70010 / lw $a3, %lo(PI_STATUS_REG)($t6) -/ 0B69A8 802F71A8 27BDFFF8 / addiu $sp, $sp, -8 -/ 0B69AC 802F71AC 30EF0003 / andi $t7, $a3, 3 - -/ 0B69B0 802F71B0 11E00006 / beqz $t7, .L802F71CC -/ 0B69B4 802F71B4 00000000 / nop -.L802F71B8: -/ 0B69B8 802F71B8 3C18A460 / lui $t8, %hi(PI_STATUS_REG) # $t8, 0xa460 -/ 0B69BC 802F71BC 8F070010 / lw $a3, %lo(PI_STATUS_REG)($t8) -/ 0B69C0 802F71C0 30F90003 / andi $t9, $a3, 3 -/ 0B69C4 802F71C4 1720FFFC / bnez $t9, .L802F71B8 -/ 0B69C8 802F71C8 00000000 / nop -.L802F71CC: -/ 0B69CC 802F71CC 8C88000C / lw $t0, 0xc($a0) -/ 0B69D0 802F71D0 3C01A000 / lui $at, 0xa000 -/ 0B69D4 802F71D4 27BD0008 / addiu $sp, $sp, 8 -/ 0B69D8 802F71D8 01054825 / or $t1, $t0, $a1 -/ 0B69DC 802F71DC 01215025 / or $t2, $t1, $at -/ 0B69E0 802F71E0 AD460000 / sw $a2, ($t2) -/ 0B69E4 802F71E4 03E00008 / jr $ra -/ 0B69E8 802F71E8 00001025 / move $v0, $zero - -/ 0B69EC 802F71EC 00000000 / nop */ diff --git a/lib/src/func_802F71F0.c b/lib/src/func_802F71F0.c deleted file mode 100644 index e829ae47..00000000 --- a/lib/src/func_802F71F0.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "libultra_internal.h" - -void func_802F71F0(void) { - register u32 s0 = __osDisableInt(); - D_803348A0->state = OS_STATE_RUNNABLE; - __osEnqueueAndYield(&D_80334898); - __osRestoreInt(s0); -} diff --git a/lib/src/guLookAtRef.c b/lib/src/guLookAtRef.c index c299cbfd..915b572f 100644 --- a/lib/src/guLookAtRef.c +++ b/lib/src/guLookAtRef.c @@ -1,11 +1,3 @@ -/* - * This file originates from the standard Nintendo 64 SDK libultra src - * directory, and it used exclusively when building with the Fast3DEX2 - * microcode. Not not using it breaks environment mapping. - * - * Apart from the modifications listed below, this file is unmodified. - */ - /************************************************************************** * * * Copyright (C) 1994, Silicon Graphics, Inc. * diff --git a/lib/src/guMtxF2L.c b/lib/src/guMtxF2L.c index 6aa626d4..e76ab6e7 100644 --- a/lib/src/guMtxF2L.c +++ b/lib/src/guMtxF2L.c @@ -1,49 +1,9 @@ #include "libultra_internal.h" -#ifdef GBI_FLOATS #include -#endif -#ifndef GBI_FLOATS void guMtxF2L(float mf[4][4], Mtx *m) { - int r, c; - s32 tmp1; - s32 tmp2; - s32 *m1 = &m->m[0][0]; - s32 *m2 = &m->m[2][0]; - for (r = 0; r < 4; r++) { - for (c = 0; c < 2; c++) { - tmp1 = mf[r][2 * c] * 65536.0f; - tmp2 = mf[r][2 * c + 1] * 65536.0f; - *m1++ = (tmp1 & 0xffff0000) | ((tmp2 >> 0x10) & 0xffff); - *m2++ = ((tmp1 << 0x10) & 0xffff0000) | (tmp2 & 0xffff); - } - } + memcpy(m->m, mf, sizeof(Mtx)); } -void guMtxL2F(float mf[4][4], Mtx *m) { - int r, c; - u32 tmp1; - u32 tmp2; - u32 *m1; - u32 *m2; - s32 stmp1, stmp2; - m1 = (u32 *) &m->m[0][0]; - m2 = (u32 *) &m->m[2][0]; - for (r = 0; r < 4; r++) { - for (c = 0; c < 2; c++) { - tmp1 = (*m1 & 0xffff0000) | ((*m2 >> 0x10) & 0xffff); - tmp2 = ((*m1++ << 0x10) & 0xffff0000) | (*m2++ & 0xffff); - stmp1 = *(s32 *) &tmp1; - stmp2 = *(s32 *) &tmp2; - mf[r][c * 2 + 0] = stmp1 / 65536.0f; - mf[r][c * 2 + 1] = stmp2 / 65536.0f; - } - } -} -#else -void guMtxF2L(float mf[4][4], Mtx *m) { - memcpy(m, mf, sizeof(Mtx)); -} -#endif void guMtxIdentF(float mf[4][4]) { int r, c; @@ -58,11 +18,6 @@ void guMtxIdentF(float mf[4][4]) { } } void guMtxIdent(Mtx *m) { -#ifndef GBI_FLOATS - float mf[4][4]; - guMtxIdentF(mf); - guMtxF2L(mf, m); -#else guMtxIdentF(m->m); -#endif } + diff --git a/lib/src/kdebugserver.c b/lib/src/kdebugserver.c deleted file mode 100644 index c4aba2b5..00000000 --- a/lib/src/kdebugserver.c +++ /dev/null @@ -1,133 +0,0 @@ -#include "libultra_internal.h" - -typedef struct { - u8 unk00 : 2; - u8 pad : 4; - u8 unk01 : 2; - u8 unk2[3]; -} unkStruct; - -extern u32 D_80334A44; - -u32 D_80334A30 = 0; -u32 D_80334A34 = 0; -s32 D_80334A38 = 0; - -extern u8 D_80365E40[0x1000]; - -OSThread gInterruptedThread; - -void u32_to_string(u32 i, u8 *str) { - str[0] = (i >> 0x18) & 0xff; - str[1] = (i >> 0x10) & 0xff; - str[2] = (i >> 0x8) & 0xff; - str[3] = i & 0xff; -} - -u32 string_to_u32(u8 *str) { - u32 i; - i = (str[0] & 0xff) << 0x18; - i |= (str[1] & 0xff) << 0x10; - i |= (str[2] & 0xff) << 0x8; - i |= (str[3] & 0xff); - return i; -} - -void send_packet(u8 *a0, s32 a1) { - unkStruct sp1c; - s32 i; - sp1c.unk00 = 2; - for (sp1c.unk01 = a1, i = 0; i < a1; i++) { - sp1c.unk2[i] = a0[i]; - } - *(volatile u32 *) 0xc0000000 = *(u32 *) &sp1c; - while (!(__osGetCause() & 0x2000)) { - ; - } - *(volatile u32 *) 0xc000000c = 0; -} - -void send(u8 *buff, s32 len) { - s32 i; - s32 end; - s32 rem; - if (!D_80334A44) { - while (!(__osGetCause() & 0x2000)) { - ; - } - *(volatile u32 *) 0xc000000c = 0; - D_80334A44 = 1; - } - i = 0; - rem = len % 3; - end = len - rem; - for (; i < end; i += 3) { - send_packet(&buff[i], 3); - } - if (rem > 0) { - send_packet(&buff[end], rem); - } -} - -void process_command_memory(void) { - u32 sp1c; - u32 sp18; - sp1c = string_to_u32(&D_80365E40[1]); - sp18 = string_to_u32(&D_80365E40[5]); - send((u8 *) (uintptr_t) sp1c, sp18); -} - -void process_command_register(void) { - send((u8 *) &gInterruptedThread.context, sizeof(__OSThreadContext)); -} - -void kdebugserver(u32 a0) { - u32 sp2c; - unkStruct sp28; - *(u32 *) &sp28 = a0; - for (sp2c = 0; sp2c < sp28.unk01; sp2c++) { - D_80365E40[D_80334A34] = sp28.unk2[sp2c]; - D_80334A34++; - } - D_80334A38 -= sp28.unk01; - switch (D_80334A30) { - case 0: - switch (sp28.unk2[0]) { - case 1: - D_80334A30 = 1; - D_80334A38 = 9 - sp28.unk01; - break; - case 2: - process_command_register(); - D_80334A30 = 0; - D_80334A34 = 0; - D_80334A38 = 0; - break; - default: - D_80334A30 = 0; - D_80334A34 = 0; - D_80334A38 = 0; - break; - } - break; - case 1: - if (D_80334A38 <= 0) { - if (D_80365E40[0] == 1) { - process_command_memory(); - D_80334A30 = 0; - D_80334A34 = 0; - D_80334A38 = 0; - } else { - D_80334A30 = 0; - D_80334A34 = 0; - D_80334A38 = 0; - } - } - break; - default: - D_80334A30 = 0; - D_80334A34 = 0; - D_80334A38 = 0; - break; - } -} diff --git a/lib/src/ldiv.c b/lib/src/ldiv.c index 01b04be2..869807e2 100644 --- a/lib/src/ldiv.c +++ b/lib/src/ldiv.c @@ -1,5 +1,7 @@ #include "libultra_internal.h" -#include +#include "stdlib.h" + +#ifdef NO_LDIV lldiv_t lldiv(long long num, long long denom) { lldiv_t ret; @@ -26,3 +28,5 @@ ldiv_t ldiv(long num, long denom) { return ret; } + +#endif diff --git a/lib/src/math/cosf.c b/lib/src/math/cosf.c deleted file mode 100644 index 2b01c12a..00000000 --- a/lib/src/math/cosf.c +++ /dev/null @@ -1,94 +0,0 @@ - -// These unions are necessary to put the constants in .rodata rather than .data. -// TODO: is it possible to remove them somehow? - -typedef union { - /* 0x0 */ double d; - /* 0x0 */ struct - { - /* 0x0 */ unsigned int hi; - /* 0x4 */ unsigned int lo; - } word; -} du; - -typedef union { - /* 0x0 */ float f; - /* 0x0 */ unsigned int i; -} fu; - -static const du P[5] = {{1.0}, - {-0.16666659550427756}, - {0.008333066246082155}, - {-1.980960290193795E-4}, - {2.605780637968037E-6}}; - -static const du rpi = {0.3183098861837907}; - -static const du pihi = { - 3.1415926218032837}; - -static const du pilo = { - 3.178650954705639E-8}; - -static const fu zero = {0.0}; -extern const fu NAN; - -float cosf(float x) -{ - double dx; // double x - double xsq; // x squared - double poly; - double dn; - float xabs; - int n; - double result; - int ix; // int x - int xpt; - ix = *(int *)&x; - xpt = (ix >> 22) & 0x1FF; - - if (xpt < 310) - { - if (0 < x) - xabs = x; - else - xabs = -x; - dx = xabs; - - dn = dx * rpi.d + .5; - if (0 <= dn) - { - - n = dn + .5; - } - else - { - n = dn - .5; - } - dn = n; - - dx -= (dn - .5) * pihi.d; - dx -= (dn - .5) * pilo.d; - xsq = dx * dx; - - poly = (((((P[4].d * xsq) + P[3].d) * xsq) + P[2].d) * xsq) + P[1].d; - - result = ((dx * xsq) * poly) + dx; - - if ((n & 0x1) == 0) - { - return result; - } - else - { - return -(float)result; - } - } - - if (x != x) - { - return NAN.f; - } - - return zero.f; -} diff --git a/lib/src/math/llconv.c b/lib/src/math/llconv.c deleted file mode 100644 index 3cf941c1..00000000 --- a/lib/src/math/llconv.c +++ /dev/null @@ -1,34 +0,0 @@ -typedef signed long long int s64; -typedef unsigned long long int u64; -s64 __d_to_ll(double d) -{ - return d; -} -s64 __f_to_ll(float f) -{ - return f; -} -u64 __d_to_ull(double d) -{ - return d; -} -u64 __f_to_ull(float f) -{ - return f; -} -double __ll_to_d(s64 s) -{ - return s; -} -float __ll_to_f(s64 s) -{ - return s; -} -double __ull_to_d(u64 u) -{ - return u; -} -float __ull_to_f(u64 u) -{ - return u; -} diff --git a/lib/src/math/llmuldiv.c b/lib/src/math/llmuldiv.c deleted file mode 100644 index e64b9d0c..00000000 --- a/lib/src/math/llmuldiv.c +++ /dev/null @@ -1,53 +0,0 @@ -unsigned long long __ull_rshift(unsigned long long a0, unsigned long long a1) -{ - return a0 >> a1; -} -unsigned long long __ull_rem(unsigned long long a0, unsigned long long a1) -{ - return a0 % a1; -} -unsigned long long __ull_div(unsigned long long a0, unsigned long long a1) -{ - return a0 / a1; -} - -unsigned long long __ll_lshift(unsigned long long a0, unsigned long long a1) -{ - return a0 << a1; -} - -long long __ll_rem(unsigned long long a0, long long a1) -{ - return a0 % a1; -} - -long long __ll_div(long long a0, long long a1) -{ - return a0 / a1; -} - -unsigned long long __ll_mul(unsigned long long a0, unsigned long long a1) -{ - return a0 * a1; -} - -void __ull_divremi(unsigned long long *div, unsigned long long *rem, unsigned long long a2, unsigned short a3) -{ - *div = a2 / a3; - *rem = a2 % a3; -} -long long __ll_mod(long long a0, long long a1) -{ - long long tmp = a0 % a1; - if ((tmp < 0 && a1 > 0) || (tmp > 0 && a1 < 0)) - { - - tmp += a1; - } - return tmp; -} - -long long __ll_rshift(long long a0, long long a1) -{ - return a0 >> a1; -} diff --git a/lib/src/math/sinf.c b/lib/src/math/sinf.c deleted file mode 100644 index bdc83168..00000000 --- a/lib/src/math/sinf.c +++ /dev/null @@ -1,111 +0,0 @@ - -// These unions are necessary to put the constants in .rodata rather than .data. -// TODO: is it possible to remove them somehow? - -typedef union { - /* 0x0 */ double d; - /* 0x0 */ struct - { - /* 0x0 */ unsigned int hi; - /* 0x4 */ unsigned int lo; - } word; -} du; - -typedef union { - /* 0x0 */ float f; - /* 0x0 */ unsigned int i; -} fu; - -static const du P[5] = {{1.0}, - {-0.16666659550427756}, - {0.008333066246082155}, - {-1.980960290193795E-4}, - {2.605780637968037E-6}}; - -static const du rpi = {0.3183098861837907}; - -static const du pihi = { - 3.1415926218032837}; - -static const du pilo = { - 3.178650954705639E-8}; - -static const fu zero = {0.0}; -extern const fu NAN; - -float sinf(float x) -{ - double dx; // double x - double xsq; // x squared - double poly; - double dn; - int n; - double result; - int ix; // int x - int xpt; - - ix = *(int *)&x; - xpt = (ix >> 22) & 0x1FF; - - if (xpt < 255) - { - dx = x; - if (xpt >= 230) - { - xsq = dx * dx; - - poly = (((((P[4].d * xsq) + P[3].d) * xsq) + P[2].d) * xsq) + P[1].d; - - result = ((dx * xsq) * poly) + dx; - - return result; - } - else - { - return x; - } - } - - if (xpt < 310) - { - dx = x; - - dn = dx * rpi.d; - - if (dn >= 0) - { - n = dn + 0.5; - } - else - { - n = dn - 0.5; - } - - dn = n; - - dx -= dn * pihi.d; - dx -= dn * pilo.d; - - xsq = dx * dx; - - poly = (((((P[4].d * xsq) + P[3].d) * xsq) + P[2].d) * xsq) + P[1].d; - - result = ((dx * xsq) * poly) + dx; - - if ((n & 0x1) == 0) - { - return result; - } - else - { - return -(float)result; - } - } - - if (x != x) - { - return NAN.f; - } - - return zero.f; -} diff --git a/lib/src/osAiGetLength.c b/lib/src/osAiGetLength.c deleted file mode 100644 index 08458a7a..00000000 --- a/lib/src/osAiGetLength.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "libultra_internal.h" -#include "osAi.h" -#include "hardware.h" - -u32 osAiGetLength() { - return HW_REG(AI_LEN_REG, u32); -} diff --git a/lib/src/osAiSetFrequency.c b/lib/src/osAiSetFrequency.c deleted file mode 100644 index 7ece6a15..00000000 --- a/lib/src/osAiSetFrequency.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "libultra_internal.h" -#include "osAi.h" -#include "hardware.h" - -extern s32 D_8033491C; - -s32 osAiSetFrequency(u32 freq) { - register u32 a1; - register s32 a2; - register float ftmp; - ftmp = D_8033491C / (float) freq + .5f; - - a1 = ftmp; - - if (a1 < 0x84) { - return -1; - } - - a2 = (a1 / 66) & 0xff; - if (a2 > 16) { - a2 = 16; - } - - HW_REG(AI_DACRATE_REG, u32) = a1 - 1; - HW_REG(AI_BITRATE_REG, u32) = a2 - 1; - HW_REG(AI_CONTROL_REG, u32) = 1; // enable dma - return D_8033491C / (s32) a1; -} - -// put some extra jr $ra's down there please -static void filler1(void) { -} -static void filler2(void) { -} diff --git a/lib/src/osAiSetNextBuffer.c b/lib/src/osAiSetNextBuffer.c deleted file mode 100644 index cc27ae4c..00000000 --- a/lib/src/osAiSetNextBuffer.c +++ /dev/null @@ -1,40 +0,0 @@ -#include "libultra_internal.h" -#include "osAi.h" -#include "hardware.h" - -u8 D_80334820 = 0; - -/** - * It is worth noting that a previous hardware bug has been fixed by a software - * patch in osAiSetNextBuffer. This bug occurred when the address of the end of the - * buffer specified by osAiSetNextBuffer was at a specific value. This value - * occurred when the following was true: - * - * (vaddr + nbytes) & 0x00003FFF == 0x00002000 - * - * (when the buffer ends with address of lower 14 bits 0x2000) In this case, the - * DMA transfer does not complete successfully. This can cause clicks and pops in - * the audio output. This bug no longer requires special handling by the application - * because it is now patched by osAiSetNextBuffer. - */ - -s32 osAiSetNextBuffer(void *buff, u32 len) { - u8 *sp1c = buff; - if (D_80334820 != 0) { - sp1c -= 0x2000; - } - - if ((((uintptr_t) buff + len) & 0x3fff) == 0x2000) { - D_80334820 = 1; - } else { - D_80334820 = 0; - } - - if (__osAiDeviceBusy()) { - return -1; - } - - HW_REG(AI_DRAM_ADDR_REG, void *) = (void *) osVirtualToPhysical(sp1c); - HW_REG(AI_LEN_REG, u32) = len; - return 0; -} diff --git a/lib/src/osContInit.c b/lib/src/osContInit.c deleted file mode 100644 index d0c707f6..00000000 --- a/lib/src/osContInit.c +++ /dev/null @@ -1,99 +0,0 @@ -#include "libultra_internal.h" -#include "osContInternal.h" - -void __osPackRequestData(u8); -void __osContGetInitData(u8 *, OSContStatus *); - -u32 _osContInitialized = 0; // probably initialized - -extern u64 osClockRate; - -// these probably belong in EEPROMlongread or something -u8 _osLastSentSiCmd; -u8 _osContNumControllers; -OSTimer D_80365D28; -OSMesgQueue _osContMesgQueue; -OSMesg _osContMesgBuff[4]; -s32 osContInit(OSMesgQueue *mq, u8 *bitpattern, OSContStatus *status) { - OSMesg mesg; - u32 ret = 0; - OSTime currentTime; - OSTimer timer; - OSMesgQueue timerMesgQueue; - - if (_osContInitialized) { - return 0; - } - _osContInitialized = 1; - currentTime = osGetTime(); - if (500000 * osClockRate / 1000000 > currentTime) { - osCreateMesgQueue(&timerMesgQueue, &mesg, 1); - osSetTimer(&timer, 500000 * osClockRate / 1000000 - currentTime, 0, &timerMesgQueue, &mesg); - osRecvMesg(&timerMesgQueue, &mesg, OS_MESG_BLOCK); - } - _osContNumControllers = 4; // TODO: figure out what it means -#ifdef VERSION_EU - __osPackRequestData(0); -#else - __osPackRequestData(255); -#endif - ret = __osSiRawStartDma(OS_WRITE, _osContCmdBuf); - osRecvMesg(mq, &mesg, OS_MESG_BLOCK); - ret = __osSiRawStartDma(OS_READ, _osContCmdBuf); - osRecvMesg(mq, &mesg, OS_MESG_BLOCK); - __osContGetInitData(bitpattern, status); -#ifdef VERSION_EU - _osLastSentSiCmd = 0; -#else - _osLastSentSiCmd = 255; -#endif - __osSiCreateAccessQueue(); - osCreateMesgQueue(&_osContMesgQueue, _osContMesgBuff, 1); - return ret; -} -void __osContGetInitData(u8 *bitpattern, OSContStatus *status) { - OSContPackedRequest *cmdBufPtr; - OSContPackedRequest response; - s32 i; - u8 sp7; - - sp7 = 0; - cmdBufPtr = &(_osContCmdBuf[0].request); - for (i = 0; i < _osContNumControllers; i++, cmdBufPtr++, status++) { - response = *(OSContPackedRequest *) cmdBufPtr; - status->errnum = (response.rxLen & 0xc0) >> 4; - if (status->errnum == 0) { - status->type = response.data2 << 8 | response.data1; - status->status = response.data3; - - sp7 |= 1 << i; - } - } - *bitpattern = sp7; -} -void __osPackRequestData(u8 command) { - OSContPackedRequest *cmdBufPtr; - OSContPackedRequest request; - s32 i; - - // some kind of weird zeroing code - for (i = 0; i < 0x10; i++) { - *((u32 *) &_osContCmdBuf + i) = 0; - } - - _osContPifCtrl = 1; - cmdBufPtr = &_osContCmdBuf[0].request; - request.padOrEnd = 255; - request.txLen = 1; - request.rxLen = 3; - request.command = command; - request.data1 = 255; - request.data2 = 255; - request.data3 = 255; - request.data4 = 255; - - for (i = 0; i < _osContNumControllers; i++) { - *cmdBufPtr++ = request; - } - cmdBufPtr->padOrEnd = 254; -} diff --git a/lib/src/osContStartReadData.c b/lib/src/osContStartReadData.c deleted file mode 100644 index 4362223a..00000000 --- a/lib/src/osContStartReadData.c +++ /dev/null @@ -1,73 +0,0 @@ -#include "libultra_internal.h" -#include "osContInternal.h" -#include - -#ifndef AVOID_UB -ALIGNED8 OSContPackedStruct _osContCmdBuf[7]; -UNUSED static u32 unused; // padding between these two variables -u32 _osContPifCtrl; -#else -// Reordered gcc vars above will disturb the aliasing done to access all 8 members of this array, hence AVOID_UB. -ALIGNED8 OSContPackedStruct _osContCmdBuf[8]; -#endif - -extern u8 _osLastSentSiCmd; -extern u8 _osContNumControllers; - -void __osPackReadData(void); -s32 osContStartReadData(OSMesgQueue *mesg) { - s32 ret = 0; - s32 i; - __osSiGetAccess(); - if (_osLastSentSiCmd != 1) { - __osPackReadData(); - ret = __osSiRawStartDma(OS_WRITE, _osContCmdBuf); - osRecvMesg(mesg, NULL, OS_MESG_BLOCK); - } - for (i = 0; i < 0x10; i++) { - *((u32 *) &_osContCmdBuf + i) = 255; - } - - _osContPifCtrl = 0; - ret = __osSiRawStartDma(OS_READ, _osContCmdBuf); - _osLastSentSiCmd = 1; - __osSiRelAccess(); - return ret; -} -void osContGetReadData(OSContPad *pad) { - OSContPackedRead *cmdBufPtr; - OSContPackedRead response; - s32 i; - cmdBufPtr = &_osContCmdBuf[0].read; - for (i = 0; i < _osContNumControllers; i++, cmdBufPtr++, pad++) { - response = *cmdBufPtr; - pad->errnum = (response.rxLen & 0xc0) >> 4; - if (pad->errnum == 0) { - pad->button = response.button; - pad->stick_x = response.rawStickX; - pad->stick_y = response.rawStickY; - } - }; -} -void __osPackReadData() { - OSContPackedRead *cmdBufPtr; - OSContPackedRead request; - s32 i; - cmdBufPtr = &_osContCmdBuf[0].read; - for (i = 0; i < 0x10; i++) { - *((u32 *) &_osContCmdBuf + i) = 0; - } - - _osContPifCtrl = 1; - request.padOrEnd = 255; - request.txLen = 1; - request.rxLen = 4; - request.command = 1; - request.button = 65535; - request.rawStickX = -1; - request.rawStickY = -1; - for (i = 0; i < _osContNumControllers; i++) { - *cmdBufPtr++ = request; - } - cmdBufPtr->padOrEnd = 254; -} diff --git a/lib/src/osCreateMesgQueue.c b/lib/src/osCreateMesgQueue.c deleted file mode 100644 index 727c0af7..00000000 --- a/lib/src/osCreateMesgQueue.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "libultra_internal.h" - -void osCreateMesgQueue(OSMesgQueue *mq, OSMesg *msgBuf, s32 count) { - mq->mtqueue = (OSThread *) &D_80334890; //? - mq->fullqueue = (OSThread *) &D_80334890; - mq->validCount = 0; - mq->first = 0; - mq->msgCount = count; - mq->msg = msgBuf; - return; -} diff --git a/lib/src/osCreatePiManager.c b/lib/src/osCreatePiManager.c deleted file mode 100644 index 0bdc9d2e..00000000 --- a/lib/src/osCreatePiManager.c +++ /dev/null @@ -1,53 +0,0 @@ -#include "libultra_internal.h" - -#define OS_PI_MGR_MESG_BUFF_SIZE 1 - -OSMgrArgs piMgrArgs = { 0 }; -#if defined(VERSION_EU) || defined(VERSION_SH) -OSPiHandle *D_80302DFC = NULL; -#endif -OSThread piMgrThread; -u32 piMgrStack[0x400]; // stack bottom -OSMesgQueue __osPiMesgQueue; -OSMesg piMgrMesgBuff[OS_PI_MGR_MESG_BUFF_SIZE + 1]; - -extern u32 gOsPiAccessQueueCreated; -extern OSMesgQueue gOsPiMessageQueue; -void __osDevMgrMain(void *); - -void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgCnt) { - u32 int_disabled; - OSPri newPri; - OSPri currentPri; - - if (!piMgrArgs.initialized) { - osCreateMesgQueue(cmdQ, cmdBuf, cmdMsgCnt); - osCreateMesgQueue(&__osPiMesgQueue, &piMgrMesgBuff[0], OS_PI_MGR_MESG_BUFF_SIZE); - if (!gOsPiAccessQueueCreated) { - __osPiCreateAccessQueue(); - } // what is this constant geez - osSetEventMesg(OS_EVENT_PI, &__osPiMesgQueue, (void *) 0x22222222); - newPri = -1; - currentPri = osGetThreadPri(NULL); - if (currentPri < pri) { - newPri = currentPri; - osSetThreadPri(NULL, pri); - } - int_disabled = __osDisableInt(); - piMgrArgs.initialized = TRUE; - piMgrArgs.mgrThread = &piMgrThread; - piMgrArgs.unk08 = cmdQ; - piMgrArgs.unk0c = &__osPiMesgQueue; - piMgrArgs.unk10 = &gOsPiMessageQueue; - piMgrArgs.dma_func = osPiRawStartDma; -#ifdef VERSION_EU - piMgrArgs.edma_func = osEPiRawStartDma; -#endif - osCreateThread(&piMgrThread, 0, __osDevMgrMain, (void *) &piMgrArgs, &piMgrStack[0x400], pri); - osStartThread(&piMgrThread); - __osRestoreInt(int_disabled); - if (newPri != -1) { - osSetThreadPri(NULL, newPri); - } - } -} diff --git a/lib/src/osCreateThread.c b/lib/src/osCreateThread.c deleted file mode 100644 index b4e283f2..00000000 --- a/lib/src/osCreateThread.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "libultra_internal.h" - -void __osCleanupThread(void); - -// Don't warn about pointer->u64 cast -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpointer-to-int-cast" - -void osCreateThread(OSThread *thread, OSId id, void (*entry)(void *), void *arg, void *sp, OSPri pri) { - register u32 int_disabled; - u32 tmp; - thread->id = id; - thread->priority = pri; - thread->next = NULL; - thread->queue = NULL; - thread->context.pc = (u32) entry; - thread->context.a0 = (u64) arg; - thread->context.sp = (u64) sp - 16; - thread->context.ra = (u64) __osCleanupThread; - tmp = OS_IM_ALL; - thread->context.sr = 65283; - thread->context.rcp = (tmp & 0x3f0000) >> 16; - thread->context.fpcsr = (u32) 0x01000800; - thread->fp = 0; - thread->state = OS_STATE_STOPPED; - thread->flags = 0; - int_disabled = __osDisableInt(); - thread->tlnext = D_8033489C; - - D_8033489C = thread; - __osRestoreInt(int_disabled); -} - -#pragma GCC diagnostic pop diff --git a/lib/src/osCreateViManager.c b/lib/src/osCreateViManager.c deleted file mode 100644 index 65e10d11..00000000 --- a/lib/src/osCreateViManager.c +++ /dev/null @@ -1,108 +0,0 @@ -#include "libultra_internal.h" - -#define OS_VI_MANAGER_MESSAGE_BUFF_SIZE 5 - -static OSMgrArgs viMgrMainArgs = { 0 }; -static OSThread viMgrThread; -static u32 viMgrStack[0x400]; // stack bottom -static OSMesgQueue __osViMesgQueue; -static OSMesg viMgrMesgBuff[OS_VI_MANAGER_MESSAGE_BUFF_SIZE]; - -static OSIoMesg viEventViMesg; -static OSIoMesg viEventCounterMesg; - -extern void __osTimerServicesInit(void); -extern void __osTimerInterrupt(void); -extern OSTime _osCurrentTime; -extern u32 D_80365DA8; -extern u32 __osViIntrCount; -void viMgrMain(void *); - -void osCreateViManager(OSPri pri) { - u32 int_disabled; - OSPri newPri; - OSPri currentPri; - if (!viMgrMainArgs.initialized) { - __osTimerServicesInit(); - osCreateMesgQueue(&__osViMesgQueue, &viMgrMesgBuff[0], OS_VI_MANAGER_MESSAGE_BUFF_SIZE); - viEventViMesg.hdr.type = 13; - viEventViMesg.hdr.pri = 0; - viEventViMesg.hdr.retQueue = 0; - viEventCounterMesg.hdr.type = 14; - viEventCounterMesg.hdr.pri = 0; - viEventCounterMesg.hdr.retQueue = 0; - osSetEventMesg(OS_EVENT_VI, &__osViMesgQueue, &viEventViMesg); - osSetEventMesg(OS_EVENT_COUNTER, &__osViMesgQueue, &viEventCounterMesg); - newPri = -1; - currentPri = osGetThreadPri(NULL); - if (currentPri < pri) { - newPri = currentPri; - osSetThreadPri(NULL, pri); - } - int_disabled = __osDisableInt(); - viMgrMainArgs.initialized = TRUE; - viMgrMainArgs.mgrThread = &viMgrThread; - viMgrMainArgs.unk08 = &__osViMesgQueue; - viMgrMainArgs.unk0c = &__osViMesgQueue; - viMgrMainArgs.unk10 = NULL; - viMgrMainArgs.dma_func = NULL; -#ifdef VERSION_EU - viMgrMainArgs.edma_func = NULL; -#endif - - osCreateThread(&viMgrThread, 0, viMgrMain, (void *) &viMgrMainArgs, &viMgrStack[0x400], pri); - __osViInit(); - osStartThread(&viMgrThread); - __osRestoreInt(int_disabled); - if (newPri != -1) { - osSetThreadPri(NULL, newPri); - } - } -} -void viMgrMain(void *vargs) { - static u16 retrace; - OSViContext *context; - OSMgrArgs *args; - OSMesg mesg; - u32 sp28; // always 0 - u32 sp24; // time related - mesg = NULL; - sp28 = FALSE; - context = __osViGetCurrentContext(); - - if ((retrace = context->retraceCount) == 0) { - retrace = 1; - } - - args = (OSMgrArgs *) vargs; - - while (1) { - osRecvMesg(args->unk0c, &mesg, OS_MESG_BLOCK); - switch (*(u16 *) mesg) { - case 13: - __osViSwapContext(); - if (!--retrace) { - context = __osViGetCurrentContext(); - if (context->mq != NULL) { - osSendMesg(context->mq, context->msg, OS_MESG_NOBLOCK); - } - retrace = context->retraceCount; - } - __osViIntrCount++; - if (sp28) { - sp24 = osGetCount(); - _osCurrentTime = sp24; - sp28 = 0; - } - sp24 = D_80365DA8; - D_80365DA8 = osGetCount(); - sp24 = D_80365DA8 - sp24; - _osCurrentTime = _osCurrentTime + sp24; - break; - - case 14: - __osTimerInterrupt(); - break; - } - } -} diff --git a/lib/src/osDestroyThread.c b/lib/src/osDestroyThread.c deleted file mode 100644 index 215ce073..00000000 --- a/lib/src/osDestroyThread.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "libultra_internal.h" - -void osDestroyThread(OSThread *thread) { - register s32 int_disabled; - register OSThread *s1; - register OSThread *s2; - - int_disabled = __osDisableInt(); - - if (thread == NULL) { - thread = D_803348A0; - } else if (thread->state != OS_STATE_STOPPED) { - __osDequeueThread(thread->queue, thread); - } - - if (D_8033489C == thread) { - D_8033489C = D_8033489C->tlnext; - } else { - s1 = D_8033489C; - s2 = s1->tlnext; - while (s2 != NULL) { - if (s2 == thread) { - s1->tlnext = thread->tlnext; - break; - } else { - s1 = s2; - s2 = s1->tlnext; - } - } - } - - if (thread == D_803348A0) { - __osDispatchThread(); - } - - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osEPiRawStartDma.c b/lib/src/osEPiRawStartDma.c deleted file mode 100644 index 236d42f9..00000000 --- a/lib/src/osEPiRawStartDma.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" -#include "new_func.h" - -s32 osEPiRawStartDma(OSPiHandle *arg0, s32 dir, u32 cart_addr, void *dram_addr, u32 size) { - register int status; - status = HW_REG(PI_STATUS_REG, u32); - while (status & PI_STATUS_ERROR) - status = HW_REG(PI_STATUS_REG, u32); - HW_REG(PI_DRAM_ADDR_REG, void *) = (void *) osVirtualToPhysical(dram_addr); - HW_REG(PI_CART_ADDR_REG, void *) = (void *) (((uintptr_t) arg0->baseAddress | cart_addr) & 0x1fffffff); - - switch (dir) { - case OS_READ: - HW_REG(PI_WR_LEN_REG, u32) = size - 1; - break; - case OS_WRITE: - HW_REG(PI_RD_LEN_REG, u32) = size - 1; - break; - default: - return -1; - } - return 0; -} diff --git a/lib/src/osEepromLongRead.c b/lib/src/osEepromLongRead.c deleted file mode 100644 index d6c7ed37..00000000 --- a/lib/src/osEepromLongRead.c +++ /dev/null @@ -1,29 +0,0 @@ -#include "libultra_internal.h" - -extern u64 osClockRate; -extern u8 D_80365D20; -extern u8 _osContNumControllers; -extern OSTimer D_80365D28; // not sure what this is yet -extern OSMesgQueue _osContMesgQueue; -extern OSMesg _osContMesgBuff[4]; - -s32 osEepromLongRead(OSMesgQueue *mq, u8 address, u8 *buffer, int nbytes) { - s32 status = 0; - if (address > 0x40) { - return -1; - } - - while (nbytes > 0) { - status = osEepromRead(mq, address, buffer); - if (status != 0) { - return status; - } - - nbytes -= 8; - address += 1; - buffer += 8; - osSetTimer(&D_80365D28, 12000 * osClockRate / 1000000, 0, &_osContMesgQueue, _osContMesgBuff); - osRecvMesg(&_osContMesgQueue, NULL, OS_MESG_BLOCK); - } - return status; -} diff --git a/lib/src/osEepromLongWrite.c b/lib/src/osEepromLongWrite.c deleted file mode 100644 index 92d52442..00000000 --- a/lib/src/osEepromLongWrite.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "libultra_internal.h" - -extern u64 osClockRate; -extern u8 D_80365D20; -extern u8 _osContNumControllers; -extern OSTimer D_80365D28; -extern OSMesgQueue _osContMesgQueue; -extern OSMesg _osContMesgBuff[4]; -// exactly the same as osEepromLongRead except for osEepromWrite call - -s32 osEepromLongWrite(OSMesgQueue *mq, u8 address, u8 *buffer, int nbytes) { - s32 result = 0; - if (address > 0x40) { - return -1; - } - - while (nbytes > 0) { - result = osEepromWrite(mq, address, buffer); - if (result != 0) { - return result; - } - nbytes -= 8; - address += 1; - buffer += 8; - osSetTimer(&D_80365D28, 12000 * osClockRate / 1000000, 0, &_osContMesgQueue, _osContMesgBuff); - osRecvMesg(&_osContMesgQueue, NULL, OS_MESG_BLOCK); - } - - return result; -} diff --git a/lib/src/osEepromProbe.c b/lib/src/osEepromProbe.c deleted file mode 100644 index d550b846..00000000 --- a/lib/src/osEepromProbe.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "libultra_internal.h" - -// TODO: merge with osEepromWrite -typedef struct { - u16 unk00; - u8 unk02; - u8 unk03; -} unkStruct; - -s32 __osEepStatus(OSMesgQueue *, unkStruct *); -s32 osEepromProbe(OSMesgQueue *mq) { - s32 status = 0; - unkStruct sp18; - - __osSiGetAccess(); - status = __osEepStatus(mq, &sp18); - if (status == 0 && (sp18.unk00 & 0x8000) != 0) { - status = 1; - } else { - status = 0; - } - __osSiRelAccess(); - return status; -} diff --git a/lib/src/osEepromRead.c b/lib/src/osEepromRead.c deleted file mode 100644 index ea784b2c..00000000 --- a/lib/src/osEepromRead.c +++ /dev/null @@ -1,99 +0,0 @@ -#include "libultra_internal.h" - -extern u8 _osLastSentSiCmd; - -typedef struct { - u16 unk00; - u8 unk02; - u8 unk03; -} unkStruct; -typedef struct { - u8 unk00; - u8 unk01; - u8 unk02; - u8 unk03; - u8 unk04; - u8 unk05; - u8 unk06; - u8 unk07; -} unkStruct3; - -typedef struct { - u8 unk00; - u8 unk01; - u8 unk02; - u8 unk03; - unkStruct3 unk04; -} unkStruct2; - -s32 __osEepStatus(OSMesgQueue *, unkStruct *); -s32 __osPackEepReadData(u8); - -s32 osEepromRead(OSMesgQueue *mq, u8 address, u8 *buffer) { - s32 sp34; - s32 sp30; - u8 *sp2c; - unkStruct sp28; - unkStruct2 sp20; - sp34 = 0; - sp30 = 0; - sp2c = (u8 *) &D_80365E00; - if (address > 0x40) { - return -1; - } - __osSiGetAccess(); - sp34 = __osEepStatus(mq, &sp28); - if (sp34 != 0 || sp28.unk00 != 0x8000) { - - return 8; - } - while (sp28.unk02 & 0x80) { - __osEepStatus(mq, &sp28); - } - __osPackEepReadData(address); - sp34 = __osSiRawStartDma(OS_WRITE, &D_80365E00); - osRecvMesg(mq, NULL, OS_MESG_BLOCK); - for (sp30 = 0; sp30 < 0x10; sp30++) { - (D_80365E00)[sp30] = 255; - } - D_80365E3C = 0; - sp34 = __osSiRawStartDma(OS_READ, D_80365E00); - _osLastSentSiCmd = 4; - osRecvMesg(mq, NULL, OS_MESG_BLOCK); - for (sp30 = 0; sp30 < 4; sp30++) { - sp2c++; - } - sp20 = *(unkStruct2 *) sp2c; - sp34 = (sp20.unk01 & 0xc0) >> 4; - if (sp34 == 0) { - for (sp30 = 0; sp30 < 8; sp30++) { - *buffer++ = ((u8 *) &sp20.unk04)[sp30]; - } - } - __osSiRelAccess(); - return sp34; -} - -s32 __osPackEepReadData(u8 address) { - u8 *sp14; - unkStruct2 sp8; - s32 sp4; - sp14 = (u8 *) &D_80365E00; - for (sp4 = 0; sp4 < 0x10; sp4++) { - D_80365E00[sp4] = 255; - } - D_80365E3C = 1; - sp8.unk00 = 2; - sp8.unk01 = 8; - sp8.unk02 = 4; - sp8.unk03 = address; - for (sp4 = 0; sp4 < 8; sp4++) { - ((u8 *) &sp8.unk04)[sp4] = 0; - } - for (sp4 = 0; sp4 < 4; sp4++) { - *sp14++ = 0; - } - *(unkStruct2 *) sp14 = sp8; - sp14 += 0xc; - *sp14 = 254; -} diff --git a/lib/src/osEepromWrite.c b/lib/src/osEepromWrite.c deleted file mode 100644 index 1a86477b..00000000 --- a/lib/src/osEepromWrite.c +++ /dev/null @@ -1,167 +0,0 @@ -#include "libultra_internal.h" -#include "osContInternal.h" - -#ifndef AVOID_UB -ALIGNED8 u32 D_80365E00[15]; -u32 D_80365E3C; -#else -// Certain code accesses the 16th element (D_80365E3C) in this array, making a seperate -// definition UB when gcc rearranges those. -ALIGNED8 u32 D_80365E00[16]; -#endif -extern u8 _osLastSentSiCmd; - -typedef struct { - u16 unk00; - u8 unk02; - u8 unk03; -} unkStruct; -typedef struct { - u8 unk00; - u8 unk01; - u8 unk02; - u8 unk03; - u8 unk04; - u8 unk05; - u8 unk06; - u8 unk07; -} unkStruct3; - -typedef struct { - u8 unk00; - u8 unk01; - u8 unk02; - u8 unk03; - unkStruct3 unk04; -} unkStruct2; - -s32 __osEepStatus(OSMesgQueue *, unkStruct *); -s32 __osPackEepWriteData(u8, u8 *); - -s32 osEepromWrite(OSMesgQueue *mq, u8 address, u8 *buffer) { - s32 sp34; - s32 sp30; - u8 *sp2c; - unkStruct2 sp20; - unkStruct sp1c; - sp34 = 0; - sp2c = (u8 *) &D_80365E00; - - if (address > 0x40) { - return -1; - } - - __osSiGetAccess(); - sp34 = __osEepStatus(mq, &sp1c); - - if (sp34 != 0 || sp1c.unk00 != 0x8000) { - return 8; - } - - while (sp1c.unk02 & 0x80) { - __osEepStatus(mq, &sp1c); - } - - __osPackEepWriteData(address, buffer); - - sp34 = __osSiRawStartDma(OS_WRITE, &D_80365E00); - osRecvMesg(mq, NULL, OS_MESG_BLOCK); - - for (sp30 = 0; sp30 < 0x10; sp30++) { - (D_80365E00)[sp30] = 255; - } - - D_80365E3C = 0; - sp34 = __osSiRawStartDma(OS_READ, D_80365E00); - _osLastSentSiCmd = 5; - osRecvMesg(mq, NULL, OS_MESG_BLOCK); - - for (sp30 = 0; sp30 < 4; sp30++) { - sp2c++; - } - - sp20 = *(unkStruct2 *) sp2c; - sp34 = (sp20.unk01 & 0xc0) >> 4; - __osSiRelAccess(); - return sp34; -} - -s32 __osPackEepWriteData(u8 address, u8 *buffer) { - u8 *sp14; - unkStruct2 sp8; - s32 sp4; - sp14 = (u8 *) &D_80365E00; - for (sp4 = 0; sp4 < 0x10; sp4++) { - D_80365E00[sp4] = 255; - } - D_80365E3C = 1; - sp8.unk00 = 10; - sp8.unk01 = 1; - sp8.unk02 = 5; - sp8.unk03 = address; - for (sp4 = 0; sp4 < 8; sp4++) { - ((u8 *) &sp8.unk04)[sp4] = *buffer++; - } - for (sp4 = 0; sp4 < 4; sp4++) { - *sp14++ = 0; - } - *(unkStruct2 *) sp14 = sp8; - sp14 += 0xc; - *sp14 = 254; -} - -s32 __osEepStatus(OSMesgQueue *a0, unkStruct *a1) { - u32 sp2c = 0; - s32 sp28; - u8 *sp24 = (u8 *) D_80365E00; - unkStruct3 sp1c; - - for (sp28 = 0; sp28 < 0x10; sp28++) { - D_80365E00[sp28] = 0; - } - - D_80365E3C = 1; - sp24 = (u8 *) D_80365E00; - for (sp28 = 0; sp28 < 4; sp28++) { - *sp24++ = 0; - } - - sp1c.unk00 = 255; - sp1c.unk01 = 1; - sp1c.unk02 = 3; - sp1c.unk03 = 0; - sp1c.unk04 = 255; - sp1c.unk05 = 255; - sp1c.unk06 = 255; - sp1c.unk07 = 255; - *(unkStruct3 *) sp24 = sp1c; - - sp24 += 8; - sp24[0] = 254; - - sp2c = __osSiRawStartDma(OS_WRITE, D_80365E00); - osRecvMesg(a0, NULL, OS_MESG_BLOCK); - - _osLastSentSiCmd = 5; - - sp2c = __osSiRawStartDma(OS_READ, D_80365E00); - osRecvMesg(a0, NULL, OS_MESG_BLOCK); - - if (sp2c != 0) { - return sp2c; - } - - sp24 = (u8 *) D_80365E00; - for (sp28 = 0; sp28 < 4; sp28++) { - *sp24++ = 0; - } - - sp1c = *(unkStruct3 *) sp24; - a1->unk03 = (sp1c.unk02 & 0xc0) >> 4; - a1->unk00 = (sp1c.unk05 << 8) | sp1c.unk04; - a1->unk02 = sp1c.unk06; - if (a1->unk03 != 0) { - return a1->unk03; - } - return 0; -} diff --git a/lib/src/osGetThreadPri.c b/lib/src/osGetThreadPri.c deleted file mode 100644 index 7b5b58c4..00000000 --- a/lib/src/osGetThreadPri.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "libultra_internal.h" - -OSPri osGetThreadPri(OSThread *thread) { - if (thread == NULL) { - thread = D_803348A0; - } - return thread->priority; -} diff --git a/lib/src/osGetTime.c b/lib/src/osGetTime.c deleted file mode 100644 index 93dc8cbe..00000000 --- a/lib/src/osGetTime.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "libultra_internal.h" - -extern OSTime _osCurrentTime; -extern u32 D_80365DA8; - -OSTime osGetTime() { - u32 sp34; - u32 sp30; - OSTime sp28; - register u32 int_disabled; - int_disabled = __osDisableInt(); - sp34 = osGetCount(); - sp30 = sp34 - D_80365DA8; - sp28 = _osCurrentTime; - __osRestoreInt(int_disabled); - return sp28 + sp30; -} diff --git a/lib/src/osInitialize.c b/lib/src/osInitialize.c deleted file mode 100644 index 3cbca8ea..00000000 --- a/lib/src/osInitialize.c +++ /dev/null @@ -1,88 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" -#include - -#define PIF_ADDR_START (void *) 0x1FC007FC - -typedef struct { - u32 instr00; - u32 instr01; - u32 instr02; - u32 instr03; -} exceptionPreamble; - -#if defined(VERSION_EU) || defined(VERSION_SH) -extern u32 EU_D_802f4330(u32, void (*)); -extern void D_802F4380(); - -#endif -u32 D_80365CD0; // maybe initialized? -u64 osClockRate = 62500000; -u32 D_80334808 = 0; - -#if defined(VERSION_EU) || defined(VERSION_SH) -u32 EU_D_80336C40; -u32 EU_D_80336C44; - -u32 D_8030208C = OS_IM_ALL; -u32 EU_D_80302090 = 0; -u8 EU_unusedZeroes[8] = { 0 }; -#endif - -#define EXCEPTION_TLB_MISS 0x80000000 -#define EXCEPTION_XTLB_MISS 0x80000080 -#define EXCEPTION_CACHE_ERROR 0x80000100 -#define EXCEPTION_GENERAL 0x80000180 - -extern u32 osResetType; -extern exceptionPreamble __osExceptionPreamble; - -void osInitialize(void) { - u32 sp34; - u32 sp30 = 0; - -#if defined(VERSION_EU) || defined(VERSION_SH) - UNUSED u32 eu_sp34; - UNUSED u32 eu_sp30; -#endif - UNUSED u32 sp2c; - D_80365CD0 = TRUE; - __osSetSR(__osGetSR() | 0x20000000); - __osSetFpcCsr(0x01000800); - while (__osSiRawReadIo(PIF_ADDR_START, &sp34)) { - ; - } - while (__osSiRawWriteIo(PIF_ADDR_START, sp34 | 8)) { - ; - } - *(exceptionPreamble *) EXCEPTION_TLB_MISS = __osExceptionPreamble; - *(exceptionPreamble *) EXCEPTION_XTLB_MISS = __osExceptionPreamble; - *(exceptionPreamble *) EXCEPTION_CACHE_ERROR = __osExceptionPreamble; - *(exceptionPreamble *) EXCEPTION_GENERAL = __osExceptionPreamble; - osWritebackDCache((void *) 0x80000000, - EXCEPTION_GENERAL + sizeof(exceptionPreamble) - EXCEPTION_TLB_MISS); - osInvalICache((void *) 0x80000000, - EXCEPTION_GENERAL + sizeof(exceptionPreamble) - EXCEPTION_TLB_MISS); - osMapTLBRdb(); - osPiRawReadIo(4, &sp30); - sp30 &= ~0xf; - if (sp30) { - osClockRate = sp30; - } - osClockRate = osClockRate * 3 / 4; - if (osResetType == RESET_TYPE_COLD_RESET) { - bzero(osAppNmiBuffer, sizeof(osAppNmiBuffer)); - } -#if defined(VERSION_EU) || defined(VERSION_SH) - eu_sp30 = HW_REG(PI_STATUS_REG, u32); - while (eu_sp30 & PI_STATUS_ERROR) { - eu_sp30 = HW_REG(PI_STATUS_REG, u32); - }; - if (!((eu_sp34 = HW_REG(ASIC_STATUS, u32)) & _64DD_PRESENT_MASK)) { - EU_D_80302090 = 1; - EU_D_802f4330(1, D_802F4380); - } else { - EU_D_80302090 = 0; - } -#endif -} diff --git a/lib/src/osJamMesg.c b/lib/src/osJamMesg.c deleted file mode 100644 index 72513135..00000000 --- a/lib/src/osJamMesg.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "libultra_internal.h" - -s32 osJamMesg(OSMesgQueue *mq, OSMesg msg, s32 flag) { - register s32 int_disabled; - int_disabled = __osDisableInt(); - while (mq->validCount >= mq->msgCount) { - if (flag == OS_MESG_BLOCK) { - D_803348A0->state = OS_STATE_WAITING; - __osEnqueueAndYield(&mq->fullqueue); - } else { - __osRestoreInt(int_disabled); - return -1; - } - } - - mq->first = (mq->first + mq->msgCount - 1) % mq->msgCount; - mq->msg[mq->first] = msg; - mq->validCount++; - if (mq->mtqueue->next != NULL) { - osStartThread(__osPopThread(&mq->mtqueue)); - } - __osRestoreInt(int_disabled); - return 0; -} diff --git a/lib/src/osLeoDiskInit.c b/lib/src/osLeoDiskInit.c deleted file mode 100644 index 8e21d6fd..00000000 --- a/lib/src/osLeoDiskInit.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" - -// this file must include some globally referenced data because it is not called anywhere -// data, comes shortly before _Ldtob I think, before crash_screen - -extern OSPiHandle *D_80302DFC; -// bss -OSPiHandle LeoDiskHandle; -OSPiHandle *__osDiskHandle; - -// some kind of piHandle init function, maybe osDriveRomInit or osCartRomInit -OSPiHandle *osLeoDiskInit(void) { - s32 sp1c; - LeoDiskHandle.type = 2; - LeoDiskHandle.baseAddress = (0xa0000000 | 0x05000000); - LeoDiskHandle.latency = 3; - LeoDiskHandle.pulse = 6; - LeoDiskHandle.pageSize = 6; - LeoDiskHandle.relDuration = 2; - HW_REG(PI_BSD_DOM2_LAT_REG, u32) = LeoDiskHandle.latency; - HW_REG(PI_BSD_DOM2_PWD_REG, u32) = LeoDiskHandle.pulse; - HW_REG(PI_BSD_DOM2_PGS_REG, u32) = LeoDiskHandle.pageSize; - HW_REG(PI_BSD_DOM2_RLS_REG, u32) = LeoDiskHandle.relDuration; - bzero(&LeoDiskHandle.transferInfo, sizeof(__OSTranxInfo)); - sp1c = __osDisableInt(); - LeoDiskHandle.next = D_80302DFC; - D_80302DFC = &LeoDiskHandle; - __osDiskHandle = &LeoDiskHandle; - __osRestoreInt(sp1c); - return &LeoDiskHandle; -} diff --git a/lib/src/osPiGetCmdQueue.c b/lib/src/osPiGetCmdQueue.c deleted file mode 100644 index 7d0f06a1..00000000 --- a/lib/src/osPiGetCmdQueue.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "libultra_internal.h" - -extern OSMgrArgs piMgrArgs; - -OSMesgQueue *osPiGetCmdQueue(void) { - if (!piMgrArgs.initialized) { - return NULL; - } - return piMgrArgs.unk08; -} diff --git a/lib/src/osPiRawReadIo.c b/lib/src/osPiRawReadIo.c deleted file mode 100644 index 07270788..00000000 --- a/lib/src/osPiRawReadIo.c +++ /dev/null @@ -1,14 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" - -extern u32 osRomBase; - -s32 osPiRawReadIo(u32 a0, u32 *a1) { - register int status; - status = HW_REG(PI_STATUS_REG, u32); - while (status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY | PI_STATUS_ERROR)) { - status = HW_REG(PI_STATUS_REG, u32); - } - *a1 = HW_REG(osRomBase | a0, u32); - return 0; -} diff --git a/lib/src/osPiRawStartDma.c b/lib/src/osPiRawStartDma.c deleted file mode 100644 index ca6044e6..00000000 --- a/lib/src/osPiRawStartDma.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" - -extern u32 osRomBase; // TODO: figure out why this is like this - -s32 osPiRawStartDma(s32 dir, u32 cart_addr, void *dram_addr, size_t size) { - register int status; - status = HW_REG(PI_STATUS_REG, u32); - while (status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY | PI_STATUS_ERROR)) { - status = HW_REG(PI_STATUS_REG, u32); - } - - HW_REG(PI_DRAM_ADDR_REG, void *) = (void *) osVirtualToPhysical(dram_addr); - - HW_REG(PI_CART_ADDR_REG, void *) = (void *) (((uintptr_t) osRomBase | cart_addr) & 0x1fffffff); - - switch (dir) { - case 0: - HW_REG(PI_WR_LEN_REG, u32) = size - 1; - break; - case 1: - HW_REG(PI_RD_LEN_REG, u32) = size - 1; - break; - default: - return -1; - break; - } - return 0; -} - -#ifdef VERSION_EU -/*s32 osPiRawStartDma_2(s32 dir, u32 cart_addr, void *dram_addr, size_t size) { - register int status; - status = HW_REG(PI_STATUS_REG, u32); - while (status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY | PI_STATUS_ERROR)) { - status = HW_REG(PI_STATUS_REG, u32); - } - - HW_REG(PI_DRAM_ADDR_REG, void *) = (void *) osVirtualToPhysical(dram_addr); - - HW_REG(PI_CART_ADDR_REG, void *) = (void *) (((uintptr_t) osRomBase | cart_addr) & 0x1fffffff); - - switch (dir) { - case 0: - HW_REG(PI_WR_LEN_REG, u32) = size - 1; - break; - case 1: - HW_REG(PI_RD_LEN_REG, u32) = size - 1; - break; - default: - return -1; - break; - } - return 0; -}*/ -#endif diff --git a/lib/src/osPiStartDma.c b/lib/src/osPiStartDma.c deleted file mode 100644 index 7227f83b..00000000 --- a/lib/src/osPiStartDma.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "libultra_internal.h" - -extern OSMgrArgs piMgrArgs; - -s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *vAddr, - size_t nbytes, OSMesgQueue *mq) { - register s32 result; - register OSMesgQueue *cmdQueue; - if (!piMgrArgs.initialized) { - return -1; - } - - // TODO: name magic constants - if (direction == OS_READ) { - mb->hdr.type = 11; - } else { - mb->hdr.type = 12; - } - - mb->hdr.pri = priority; - mb->hdr.retQueue = mq; - mb->dramAddr = vAddr; - mb->devAddr = devAddr; - mb->size = nbytes; -#ifdef VERSION_EU - mb->piHandle = NULL; -#endif - - if (priority == OS_MESG_PRI_HIGH) { - cmdQueue = osPiGetCmdQueue(); - result = osJamMesg(cmdQueue, mb, OS_MESG_NOBLOCK); - } else { - cmdQueue = osPiGetCmdQueue(); - result = osSendMesg(cmdQueue, mb, OS_MESG_NOBLOCK); - } - return result; -} diff --git a/lib/src/osRecvMesg.c b/lib/src/osRecvMesg.c deleted file mode 100644 index 057ec9f0..00000000 --- a/lib/src/osRecvMesg.c +++ /dev/null @@ -1,31 +0,0 @@ -#include "libultra_internal.h" - -s32 osRecvMesg(OSMesgQueue *mq, OSMesg *msg, s32 flag) { - register u32 int_disabled; - register OSThread *thread; - int_disabled = __osDisableInt(); - - while (!mq->validCount) { - if (!flag) { - __osRestoreInt(int_disabled); - return -1; - } - D_803348A0->state = OS_STATE_WAITING; - __osEnqueueAndYield(&mq->mtqueue); - } - - if (msg != NULL) { - *msg = *(mq->first + mq->msg); - } - - mq->first = (mq->first + 1) % mq->msgCount; - mq->validCount--; - - if (mq->fullqueue->next != NULL) { - thread = __osPopThread(&mq->fullqueue); - osStartThread(thread); - } - - __osRestoreInt(int_disabled); - return 0; -} diff --git a/lib/src/osSendMesg.c b/lib/src/osSendMesg.c deleted file mode 100644 index f0d02fff..00000000 --- a/lib/src/osSendMesg.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "libultra_internal.h" - -s32 osSendMesg(OSMesgQueue *mq, OSMesg msg, s32 flag) { - register u32 int_disabled; - register s32 index; - register OSThread *s2; - int_disabled = __osDisableInt(); - - while (mq->validCount >= mq->msgCount) { - if (flag == OS_MESG_BLOCK) { - D_803348A0->state = 8; - __osEnqueueAndYield(&mq->fullqueue); - } else { - __osRestoreInt(int_disabled); - return -1; - } - } - - index = (mq->first + mq->validCount) % mq->msgCount; - mq->msg[index] = msg; - mq->validCount++; - - if (mq->mtqueue->next != NULL) { - s2 = __osPopThread(&mq->mtqueue); - osStartThread(s2); - } - - __osRestoreInt(int_disabled); - return 0; -} diff --git a/lib/src/osSetEventMesg.c b/lib/src/osSetEventMesg.c deleted file mode 100644 index dc4aee23..00000000 --- a/lib/src/osSetEventMesg.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "libultra_internal.h" - -typedef struct OSEventMessageStruct_0_s { - OSMesgQueue *queue; - OSMesg msg; -} OSEventMessageStruct_0; - -OSEventMessageStruct_0 D_80363830[16]; - -void osSetEventMesg(OSEvent e, OSMesgQueue *mq, OSMesg msg) { - register u32 int_disabled; - OSEventMessageStruct_0 *msgs; - int_disabled = __osDisableInt(); - msgs = D_80363830 + e; - msgs->queue = mq; - msgs->msg = msg; - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osSetThreadPri.c b/lib/src/osSetThreadPri.c deleted file mode 100644 index 1c782534..00000000 --- a/lib/src/osSetThreadPri.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "libultra_internal.h" - -void osSetThreadPri(OSThread *thread, OSPri pri) { - register u32 int_disabled = __osDisableInt(); - if (thread == NULL) { - thread = D_803348A0; - } - - if (thread->priority != pri) { - thread->priority = pri; - if (thread != D_803348A0) { - if (thread->state != OS_STATE_STOPPED) { - __osDequeueThread(thread->queue, thread); - __osEnqueueThread(thread->queue, thread); - } - } - if (D_803348A0->priority < D_80334898->priority) { - D_803348A0->state = OS_STATE_RUNNABLE; - __osEnqueueAndYield(&D_80334898); - } - } - - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osSetTime.c b/lib/src/osSetTime.c deleted file mode 100644 index ba906b69..00000000 --- a/lib/src/osSetTime.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "libultra_internal.h" - -extern OSTime _osCurrentTime; - -void osSetTime(OSTime time) { - _osCurrentTime = time; -} diff --git a/lib/src/osSetTimer.c b/lib/src/osSetTimer.c deleted file mode 100644 index 09bf1066..00000000 --- a/lib/src/osSetTimer.c +++ /dev/null @@ -1,22 +0,0 @@ -#include "libultra_internal.h" -extern OSTimer *D_80334830; -extern u64 __osInsertTimer(OSTimer *); - -u32 osSetTimer(OSTimer *a0, OSTime a1, u64 a2, OSMesgQueue *a3, OSMesg a4) { - u64 sp18; - a0->next = NULL; - a0->prev = NULL; - a0->interval = a2; - if (a1 != 0) { - a0->remaining = a1; - } else { - a0->remaining = a2; - } - a0->mq = a3; - a0->msg = a4; - sp18 = __osInsertTimer(a0); - if (D_80334830->next == a0) { - __osSetTimerIntr(sp18); - } - return 0; -} diff --git a/lib/src/osSpTaskLoadGo.c b/lib/src/osSpTaskLoadGo.c deleted file mode 100644 index 8e688277..00000000 --- a/lib/src/osSpTaskLoadGo.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "libultra_internal.h" -#include "hardware.h" -#include - -#define _osVirtualToPhysical(ptr) \ - if (ptr != NULL) { \ - ptr = (void *) osVirtualToPhysical(ptr); \ - } - -OSTask D_803638B0; -OSTask *_VirtualToPhysicalTask(OSTask *task) { - OSTask *physicalTask; - physicalTask = &D_803638B0; - bcopy(task, physicalTask, sizeof(OSTask)); - _osVirtualToPhysical(physicalTask->t.ucode); - _osVirtualToPhysical(physicalTask->t.ucode_data); - _osVirtualToPhysical(physicalTask->t.dram_stack); - _osVirtualToPhysical(physicalTask->t.output_buff); - _osVirtualToPhysical(physicalTask->t.output_buff_size); - _osVirtualToPhysical(physicalTask->t.data_ptr); - _osVirtualToPhysical(physicalTask->t.yield_data_ptr); - return physicalTask; -} -void osSpTaskLoad(OSTask *task) { - OSTask *physicalTask; - physicalTask = _VirtualToPhysicalTask(task); - if (physicalTask->t.flags & M_TASK_FLAG0) { - physicalTask->t.ucode_data = physicalTask->t.yield_data_ptr; - physicalTask->t.ucode_data_size = physicalTask->t.yield_data_size; - task->t.flags &= ~M_TASK_FLAG0; - } - osWritebackDCache(physicalTask, sizeof(OSTask)); - __osSpSetStatus(SPSTATUS_CLEAR_SIGNAL0 | SPSTATUS_CLEAR_SIGNAL1 | SPSTATUS_CLEAR_SIGNAL2 - | SPSTATUS_SET_INTR_ON_BREAK); - while (__osSpSetPc((void *) SP_IMEM_START) == -1) { - ; - } - while (__osSpRawStartDma(1, (void *) (SP_IMEM_START - sizeof(*physicalTask)), physicalTask, - sizeof(OSTask)) - == -1) { - ; - } - while (__osSpDeviceBusy()) { - ; - } - while (__osSpRawStartDma(1, (void *) SP_IMEM_START, physicalTask->t.ucode_boot, - physicalTask->t.ucode_boot_size) - == -1) { - ; - } -} -void osSpTaskStartGo(UNUSED OSTask *task) { - while (__osSpDeviceBusy()) { - ; - } - __osSpSetStatus(SPSTATUS_SET_INTR_ON_BREAK | SPSTATUS_CLEAR_SSTEP | SPSTATUS_CLEAR_BROKE - | SPSTATUS_CLEAR_HALT); -} diff --git a/lib/src/osSpTaskYield.c b/lib/src/osSpTaskYield.c deleted file mode 100644 index 92546a8f..00000000 --- a/lib/src/osSpTaskYield.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "libultra_internal.h" - -void osSpTaskYield(void) { - __osSpSetStatus(SPSTATUS_SET_SIGNAL0); -} diff --git a/lib/src/osSpTaskYielded.c b/lib/src/osSpTaskYielded.c deleted file mode 100644 index c0ed728e..00000000 --- a/lib/src/osSpTaskYielded.c +++ /dev/null @@ -1,18 +0,0 @@ - -#include "libultra_internal.h" - -OSYieldResult osSpTaskYielded(OSTask *task) { - s32 status; - u32 int_disabledult; - status = __osSpGetStatus(); - if (status & SPSTATUS_SIGNAL1_SET) { - int_disabledult = 1; - } else { - int_disabledult = 0; - } - if (status & SPSTATUS_SIGNAL0_SET) { - task->t.flags |= int_disabledult; - task->t.flags &= ~(M_TASK_FLAG1); - } - return int_disabledult; -} diff --git a/lib/src/osStartThread.c b/lib/src/osStartThread.c deleted file mode 100644 index c241e388..00000000 --- a/lib/src/osStartThread.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "libultra_internal.h" - -void osStartThread(OSThread *thread) { - register u32 int_disabled; - register uintptr_t state; - int_disabled = __osDisableInt(); - state = thread->state; - - if (state != OS_STATE_STOPPED) { - if (state == OS_STATE_WAITING) { - do { - } while (0); - thread->state = OS_STATE_RUNNABLE; - __osEnqueueThread(&D_80334898, thread); - } - } else { - if (thread->queue == NULL || thread->queue == &D_80334898) { - thread->state = OS_STATE_RUNNABLE; - - __osEnqueueThread(&D_80334898, thread); - } else { - thread->state = OS_STATE_WAITING; - __osEnqueueThread(thread->queue, thread); - state = (uintptr_t) __osPopThread(thread->queue); - __osEnqueueThread(&D_80334898, (OSThread *) state); - } - } - if (D_803348A0 == NULL) { - __osDispatchThread(); - } else { - if (D_803348A0->priority < D_80334898->priority) { - D_803348A0->state = OS_STATE_RUNNABLE; - __osEnqueueAndYield(&D_80334898); - } - } - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osTimer.c b/lib/src/osTimer.c deleted file mode 100644 index e6410310..00000000 --- a/lib/src/osTimer.c +++ /dev/null @@ -1,89 +0,0 @@ -#include "libultra_internal.h" - - -// TODO: document -OSTimer D_80365D80; -OSTimer *D_80334830 = &D_80365D80; -OSTime _osCurrentTime; -u32 D_80365DA8; -u32 __osViIntrCount; -u32 D_80365DB0; - -void __osTimerServicesInit(void) { - _osCurrentTime = 0; - D_80365DA8 = 0; - __osViIntrCount = 0; - D_80334830->prev = D_80334830; - D_80334830->next = D_80334830->prev; - D_80334830->remaining = 0; - D_80334830->interval = D_80334830->remaining; - D_80334830->mq = NULL; - D_80334830->msg = NULL; -} - -void __osTimerInterrupt(void) { - OSTimer *sp24; - u32 sp20; - u32 sp1c; - if (D_80334830->next == D_80334830) { - return; - } - while (1) { - sp24 = D_80334830->next; - if (sp24 == D_80334830) { - __osSetCompare(0); - D_80365DB0 = 0; - break; - } - sp20 = osGetCount(); - sp1c = sp20 - D_80365DB0; - D_80365DB0 = sp20; - if (sp1c < sp24->remaining) { - sp24->remaining -= sp1c; - __osSetTimerIntr(sp24->remaining); - return; - } else { - sp24->prev->next = sp24->next; - sp24->next->prev = sp24->prev; - sp24->next = NULL; - sp24->prev = NULL; - if (sp24->mq != NULL) { - osSendMesg(sp24->mq, sp24->msg, OS_MESG_NOBLOCK); - } - if (sp24->interval != 0) { - sp24->remaining = sp24->interval; - __osInsertTimer(sp24); - } - } - } -} - -void __osSetTimerIntr(u64 a0) { - u64 tmp; - s32 intDisabled = __osDisableInt(); - D_80365DB0 = osGetCount(); - tmp = a0 + D_80365DB0; - __osSetCompare(tmp); - __osRestoreInt(intDisabled); -} - -u64 __osInsertTimer(OSTimer *a0) { - OSTimer *sp34; - u64 sp28; - s32 intDisabled; - intDisabled = __osDisableInt(); - for (sp34 = D_80334830->next, sp28 = a0->remaining; sp34 != D_80334830 && sp28 > sp34->remaining; - sp28 -= sp34->remaining, sp34 = sp34->next) { - ; - } - a0->remaining = sp28; - if (sp34 != D_80334830) { - sp34->remaining -= sp28; - } - a0->next = sp34; - a0->prev = sp34->prev; - sp34->prev->next = a0; - sp34->prev = a0; - __osRestoreInt(intDisabled); - return sp28; -} diff --git a/lib/src/osViBlack.c b/lib/src/osViBlack.c deleted file mode 100644 index 7729d28a..00000000 --- a/lib/src/osViBlack.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "libultra_internal.h" -extern OSViContext *D_80334914; -// TODO: name magic constants -void osViBlack(u8 active) { - register u32 int_disabled = __osDisableInt(); - if (active) { - D_80334914->unk00 |= 0x20; - } else { - D_80334914->unk00 &= ~0x20; - } - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osViData.c b/lib/src/osViData.c deleted file mode 100644 index 7a58e662..00000000 --- a/lib/src/osViData.c +++ /dev/null @@ -1,126 +0,0 @@ -#include "libultra_internal.h" -#ifdef VERSION_EU -OSViMode D_80334990 = { - /*type*/ 16, - /*comRegs*/ - { /*ctrl*/ 12574, - /*width*/ 320, - /*burst*/ 67380026, - /*vSync*/ 625, - /*hSync*/ 1379433, - /*leap*/ 208604270, - /*hStart*/ 8389376, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 6226489, - /*vBurst*/ 590443, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 6226489, - /*vBurst*/ 590443, - /*vIntr*/ 2 } } -}; -OSViMode D_803349E0 = { - /*type*/ 30, //osViModePalLan1 - /*comRegs*/ - { /*ctrl*/ 12574, - /*width*/ 320, - /*burst*/ 73735737, - /*vSync*/ 525, - /*hSync*/ 265233, - /*leap*/ 202968090, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } -}; -OSViMode D_80302FD0 = { - /*type*/ 2, - /*comRegs*/ - { /*ctrl*/ 12574, - /*width*/ 320, - /*burst*/ 65348153, - /*vSync*/ 525, - /*hSync*/ 3093, - /*leap*/ 202705941, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } -}; - -#else - -OSViMode D_80334990 = { - /*type*/ 2, - /*comRegs*/ - { /*ctrl*/ 12574, - /*width*/ 320, - /*burst*/ 65348153, - /*vSync*/ 525, - /*hSync*/ 3093, - /*leap*/ 202705941, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } -}; -OSViMode D_803349E0 = { - /*type*/ 16, - /*comRegs*/ - { /*ctrl*/ 12574, - /*width*/ 320, - /*burst*/ 67380026, - /*vSync*/ 625, - /*hSync*/ 1379433, - /*leap*/ 208604270, - /*hStart*/ 8389376, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 6226489, - /*vBurst*/ 590443, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 6226489, - /*vBurst*/ 590443, - /*vIntr*/ 2 } } -}; -#endif diff --git a/lib/src/osViSetEvent.c b/lib/src/osViSetEvent.c deleted file mode 100644 index e74ba2b8..00000000 --- a/lib/src/osViSetEvent.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "libultra_internal.h" -extern OSViContext *D_80334914; -void osViSetEvent(OSMesgQueue *mq, OSMesg msg, u32 retraceCount) { - - register u32 int_disabled = __osDisableInt(); - (D_80334914)->mq = mq; - (D_80334914)->msg = msg; - (D_80334914)->retraceCount = retraceCount; - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osViSetMode.c b/lib/src/osViSetMode.c deleted file mode 100644 index 518f746b..00000000 --- a/lib/src/osViSetMode.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "libultra_internal.h" -extern OSViContext *D_80334914; -void osViSetMode(OSViMode *mode) { - register u32 int_disabled = __osDisableInt(); - D_80334914->unk08 = mode; - D_80334914->unk00 = 1; - D_80334914->features = D_80334914->unk08->comRegs.ctrl; - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osViSetSpecialFeatures.c b/lib/src/osViSetSpecialFeatures.c deleted file mode 100644 index 590bfad8..00000000 --- a/lib/src/osViSetSpecialFeatures.c +++ /dev/null @@ -1,36 +0,0 @@ -#include "libultra_internal.h" -extern OSViContext *D_80334914; -void osViSetSpecialFeatures(u32 func) { - register u32 int_disabled = __osDisableInt(); - if (func & OS_VI_GAMMA_ON) { - D_80334914->features |= OS_VI_GAMMA; - } - if (func & OS_VI_GAMMA_OFF) { - D_80334914->features &= ~OS_VI_GAMMA; - } - if (func & OS_VI_GAMMA_DITHER_ON) { - D_80334914->features |= OS_VI_GAMMA_DITHER; - } - if (func & OS_VI_GAMMA_DITHER_OFF) { - - D_80334914->features &= ~OS_VI_GAMMA_DITHER; - } - if (func & OS_VI_DIVOT_ON) { - - D_80334914->features |= OS_VI_DIVOT; - } - if (func & OS_VI_DIVOT_OFF) { - - D_80334914->features &= ~OS_VI_DIVOT; - } - if (func & OS_VI_DITHER_FILTER_ON) { - D_80334914->features |= OS_VI_DITHER_FILTER; - D_80334914->features &= ~(OS_VI_UNK200 | OS_VI_UNK100); - } - if (func & OS_VI_DITHER_FILTER_OFF) { - D_80334914->features &= ~OS_VI_DITHER_FILTER; - D_80334914->features |= D_80334914->unk08->comRegs.ctrl & (OS_VI_UNK200 | OS_VI_UNK100); - } - D_80334914->unk00 |= 8; - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osViSwapBuffer.c b/lib/src/osViSwapBuffer.c deleted file mode 100644 index fcaa62fe..00000000 --- a/lib/src/osViSwapBuffer.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "libultra_internal.h" -extern OSViContext *D_80334914; -void osViSwapBuffer(void *vaddr) { - u32 int_disabled = __osDisableInt(); - D_80334914->buffer = vaddr; - D_80334914->unk00 |= 0x10; // TODO: figure out what this flag means - __osRestoreInt(int_disabled); -} diff --git a/lib/src/osViTable.c b/lib/src/osViTable.c deleted file mode 100644 index 775dbfe8..00000000 --- a/lib/src/osViTable.c +++ /dev/null @@ -1,975 +0,0 @@ -#include "libultra_internal.h" - -OSViMode osViModeTable[] = { - /*osViModeNtscLpn1*/ - { /*type*/ 0, - /*comRegs*/ - { /*ctrl*/ 12814, - /*width*/ 320, - /*burst*/ 65348153, - /*vSync*/ 525, - /*hSync*/ 3093, - /*leap*/ 202705941, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModeNtscLpf1*/ - { /*type*/ 1, - /*comRegs*/ - { /*ctrl*/ 12878, - /*width*/ 320, - /*burst*/ 65348153, - /*vSync*/ 524, - /*hSync*/ 3093, - /*leap*/ 202705941, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 16778240, - /*vStart*/ 2294269, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 50332672, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModeNtscLan1*/ - { /*type*/ 2, - /*comRegs*/ - { /*ctrl*/ 12574, - /*width*/ 320, - /*burst*/ 65348153, - /*vSync*/ 525, - /*hSync*/ 3093, - /*leap*/ 202705941, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModeNtscLaf1*/ - { /*type*/ 3, - /*comRegs*/ - { /*ctrl*/ 12382, - /*width*/ 320, - /*burst*/ 65348153, - /*vSync*/ 524, - /*hSync*/ 3093, - /*leap*/ 202705941, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 16778240, - /*vStart*/ 2294269, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 50332672, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModeNtscLpn2*/ - { /*type*/ 4, - /*comRegs*/ - { /*ctrl*/ 13071, - /*width*/ 320, - /*burst*/ 65348153, - /*vSync*/ 525, - /*hSync*/ 3093, - /*leap*/ 202705941, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModeNtscLpf2*/ - { /*type*/ 5, - /*comRegs*/ - { /*ctrl*/ 12879, - /*width*/ 320, - /*burst*/ 65348153, - /*vSync*/ 524, - /*hSync*/ 3093, - /*leap*/ 202705941, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 16778240, - /*vStart*/ 2294269, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 1280, - /*yScale*/ 50332672, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModeNtscLan2*/ - { /*type*/ 6, - /*comRegs*/ - { /*ctrl*/ 12319, - /*width*/ 320, - /*burst*/ 65348153, - /*vSync*/ 525, - /*hSync*/ 3093, - /*leap*/ 202705941, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModeNtscLaf2*/ - { /*type*/ 7, - /*comRegs*/ - { /*ctrl*/ 12383, - /*width*/ 320, - /*burst*/ 65348153, - /*vSync*/ 524, - /*hSync*/ 3093, - /*leap*/ 202705941, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 16778240, - /*vStart*/ 2294269, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 1280, - /*yScale*/ 50332672, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModeNtscHpn1*/ - { /*type*/ 8, - /*comRegs*/ - { /*ctrl*/ 12878, - /*width*/ 1280, - /*burst*/ 65348153, - /*vSync*/ 524, - /*hSync*/ 3093, - /*leap*/ 202705941, - /*hStart*/ 7078636, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 2294269, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 2560, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModeNtscHpf1*/ - { /*type*/ 9, - /*comRegs*/ - { /*ctrl*/ 12878, - /*width*/ 640, - /*burst*/ 65348153, - /*vSync*/ 524, - /*hSync*/ 3093, - /*leap*/ 202705941, - /*hStart*/ 7078636, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 33556480, - /*vStart*/ 2294269, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 2560, - /*yScale*/ 33556480, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModeNtscHan1*/ - { /*type*/ 10, - /*comRegs*/ - { /*ctrl*/ 12382, - /*width*/ 1280, - /*burst*/ 65348153, - /*vSync*/ 524, - /*hSync*/ 3093, - /*leap*/ 202705941, - /*hStart*/ 7078636, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 2294269, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 2560, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModeNtscHaf1*/ - { /*type*/ 11, - /*comRegs*/ - { /*ctrl*/ 12382, - /*width*/ 640, - /*burst*/ 65348153, - /*vSync*/ 524, - /*hSync*/ 3093, - /*leap*/ 202705941, - /*hStart*/ 7078636, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 33556480, - /*vStart*/ 2294269, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 2560, - /*yScale*/ 33556480, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModeNtscHpn2*/ - { /*type*/ 12, - /*comRegs*/ - { /*ctrl*/ 13135, - /*width*/ 1280, - /*burst*/ 65348153, - /*vSync*/ 524, - /*hSync*/ 3093, - /*leap*/ 202705941, - /*hStart*/ 7078636, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 2560, - /*yScale*/ 1024, - /*vStart*/ 2294269, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 5120, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModeNtscHpf2*/ - { /*type*/ 13, - /*comRegs*/ - { /*ctrl*/ 12879, - /*width*/ 640, - /*burst*/ 65348153, - /*vSync*/ 524, - /*hSync*/ 3093, - /*leap*/ 202705941, - /*hStart*/ 7078636, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 2560, - /*yScale*/ 33556480, - /*vStart*/ 2294269, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 5120, - /*yScale*/ 33556480, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - -#if !defined(VERSION_US) - /*osViModePalLpn1*/ - { /*type*/ 14, - /*comRegs*/ - { /*ctrl*/ 12814, - /*width*/ 320, - /*burst*/ 67380026, - /*vSync*/ 625, - /*hSync*/ 1379433, - /*leap*/ 208604270, - /*hStart*/ 8389376, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 6226489, - /*vBurst*/ 590443, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 6226489, - /*vBurst*/ 590443, - /*vIntr*/ 2 } } }, - /*osViModePalLpf1*/ - { /*type*/ 15, - /*comRegs*/ - { /*ctrl*/ 12878, - /*width*/ 320, - /*burst*/ 67380026, - /*vSync*/ 624, - /*hSync*/ 1379433, - /*leap*/ 208604270, - /*hStart*/ 8389376, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 16778240, - /*vStart*/ 6095415, - /*vBurst*/ 590443, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 50332672, - /*vStart*/ 6226489, - /*vBurst*/ 852585, - /*vIntr*/ 2 } } }, - /*osViModePalLan1*/ - { /*type*/ 16, - /*comRegs*/ - { /*ctrl*/ 12574, - /*width*/ 320, - /*burst*/ 67380026, - /*vSync*/ 625, - /*hSync*/ 1379433, - /*leap*/ 208604270, - /*hStart*/ 8389376, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 6226489, - /*vBurst*/ 590443, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 6226489, - /*vBurst*/ 590443, - /*vIntr*/ 2 } } }, - /*osViModePalLaf1*/ - { /*type*/ 17, - /*comRegs*/ - { /*ctrl*/ 12382, - /*width*/ 320, - /*burst*/ 67380026, - /*vSync*/ 624, - /*hSync*/ 1379433, - /*leap*/ 208604270, - /*hStart*/ 8389376, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 16778240, - /*vStart*/ 6095415, - /*vBurst*/ 590443, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 50332672, - /*vStart*/ 6226489, - /*vBurst*/ 852585, - /*vIntr*/ 2 } } }, - /*osViModePalLpn2*/ - { /*type*/ 18, - /*comRegs*/ - { /*ctrl*/ 13071, - /*width*/ 320, - /*burst*/ 67380026, - /*vSync*/ 625, - /*hSync*/ 1379433, - /*leap*/ 208604270, - /*hStart*/ 8389376, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 6226489, - /*vBurst*/ 590443, - /*vIntr*/ 2 }, - { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 6226489, - /*vBurst*/ 590443, - /*vIntr*/ 2 } } }, - /*osViModePalLpf2*/ - { /*type*/ 19, - /*comRegs*/ - { /*ctrl*/ 12879, - /*width*/ 320, - /*burst*/ 67380026, - /*vSync*/ 624, - /*hSync*/ 1379433, - /*leap*/ 208604270, - /*hStart*/ 8389376, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 16778240, - /*vStart*/ 6095415, - /*vBurst*/ 590443, - /*vIntr*/ 2 }, - { /*origin*/ 1280, - /*yScale*/ 50332672, - /*vStart*/ 6226489, - /*vBurst*/ 852585, - /*vIntr*/ 2 } } }, - /*osViModePalLan2*/ - { /*type*/ 20, - /*comRegs*/ - { /*ctrl*/ 12319, - /*width*/ 320, - /*burst*/ 67380026, - /*vSync*/ 625, - /*hSync*/ 1379433, - /*leap*/ 208604270, - /*hStart*/ 8389376, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 6226489, - /*vBurst*/ 590443, - /*vIntr*/ 2 }, - { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 6226489, - /*vBurst*/ 590443, - /*vIntr*/ 2 } } }, - /*osViModePalLaf2*/ - { /*type*/ 21, - /*comRegs*/ - { /*ctrl*/ 12383, - /*width*/ 320, - /*burst*/ 67380026, - /*vSync*/ 624, - /*hSync*/ 1379433, - /*leap*/ 208604270, - /*hStart*/ 8389376, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 16778240, - /*vStart*/ 6095415, - /*vBurst*/ 590443, - /*vIntr*/ 2 }, - { /*origin*/ 1280, - /*yScale*/ 50332672, - /*vStart*/ 6226489, - /*vBurst*/ 852585, - /*vIntr*/ 2 } } }, - /*osViModePalHpn1*/ - { /*type*/ 22, - /*comRegs*/ - { /*ctrl*/ 12878, - /*width*/ 1280, - /*burst*/ 67380026, - /*vSync*/ 624, - /*hSync*/ 1379433, - /*leap*/ 208604270, - /*hStart*/ 8389376, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 6095415, - /*vBurst*/ 590443, - /*vIntr*/ 2 }, - { /*origin*/ 2560, - /*yScale*/ 1024, - /*vStart*/ 6226489, - /*vBurst*/ 852585, - /*vIntr*/ 2 } } }, - /*osViModePalHpf1*/ - { /*type*/ 23, - /*comRegs*/ - { /*ctrl*/ 12878, - /*width*/ 640, - /*burst*/ 67380026, - /*vSync*/ 624, - /*hSync*/ 1379433, - /*leap*/ 208604270, - /*hStart*/ 8389376, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 33556480, - /*vStart*/ 6095415, - /*vBurst*/ 590443, - /*vIntr*/ 2 }, - { /*origin*/ 2560, - /*yScale*/ 33556480, - /*vStart*/ 6226489, - /*vBurst*/ 852585, - /*vIntr*/ 2 } } }, - /*osViModePalHan1*/ - { /*type*/ 24, - /*comRegs*/ - { /*ctrl*/ 12382, - /*width*/ 1280, - /*burst*/ 67380026, - /*vSync*/ 624, - /*hSync*/ 1379433, - /*leap*/ 208604270, - /*hStart*/ 8389376, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 6095415, - /*vBurst*/ 590443, - /*vIntr*/ 2 }, - { /*origin*/ 2560, - /*yScale*/ 1024, - /*vStart*/ 6226489, - /*vBurst*/ 852585, - /*vIntr*/ 2 } } }, - /*osViModePalHaf1*/ - { /*type*/ 25, - /*comRegs*/ - { /*ctrl*/ 12382, - /*width*/ 640, - /*burst*/ 67380026, - /*vSync*/ 624, - /*hSync*/ 1379433, - /*leap*/ 208604270, - /*hStart*/ 8389376, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 33556480, - /*vStart*/ 6095415, - /*vBurst*/ 590443, - /*vIntr*/ 2 }, - { /*origin*/ 2560, - /*yScale*/ 33556480, - /*vStart*/ 6226489, - /*vBurst*/ 852585, - /*vIntr*/ 2 } } }, - /*osViModePalHpn2*/ - { /*type*/ 26, - /*comRegs*/ - { /*ctrl*/ 13135, - /*width*/ 1280, - /*burst*/ 67380026, - /*vSync*/ 624, - /*hSync*/ 1379433, - /*leap*/ 208604270, - /*hStart*/ 8389376, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 2560, - /*yScale*/ 1024, - /*vStart*/ 6095415, - /*vBurst*/ 590443, - /*vIntr*/ 2 }, - { /*origin*/ 5120, - /*yScale*/ 1024, - /*vStart*/ 6226489, - /*vBurst*/ 852585, - /*vIntr*/ 2 } } }, - /*osViModePalHpf2*/ - { /*type*/ 27, - /*comRegs*/ - { /*ctrl*/ 12879, - /*width*/ 640, - /*burst*/ 67380026, - /*vSync*/ 624, - /*hSync*/ 1379433, - /*leap*/ 208604270, - /*hStart*/ 8389376, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 2560, - /*yScale*/ 33556480, - /*vStart*/ 6095415, - /*vBurst*/ 590443, - /*vIntr*/ 2 }, - { /*origin*/ 5120, - /*yScale*/ 33556480, - /*vStart*/ 6226489, - /*vBurst*/ 852585, - /*vIntr*/ 2 } } }, -#endif -#if !defined(VERSION_JP) - /*osViModePalLpn1*/ - { /*type*/ 28, - /*comRegs*/ - { /*ctrl*/ 12814, - /*width*/ 320, - /*burst*/ 73735737, - /*vSync*/ 525, - /*hSync*/ 265233, - /*leap*/ 202968090, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModePalLpf1*/ - { /*type*/ 29, - /*comRegs*/ - { /*ctrl*/ 12878, - /*width*/ 320, - /*burst*/ 73735737, - /*vSync*/ 524, - /*hSync*/ 3088, - /*leap*/ 203164700, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 16778240, - /*vStart*/ 2294269, - /*vBurst*/ 721410, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 50332672, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModePalLan1*/ - { /*type*/ 30, - /*comRegs*/ - { /*ctrl*/ 12574, - /*width*/ 320, - /*burst*/ 73735737, - /*vSync*/ 525, - /*hSync*/ 265233, - /*leap*/ 202968090, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModePalLaf1*/ - { /*type*/ 31, - /*comRegs*/ - { /*ctrl*/ 12382, - /*width*/ 320, - /*burst*/ 73735737, - /*vSync*/ 524, - /*hSync*/ 3088, - /*leap*/ 203164700, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 640, - /*yScale*/ 16778240, - /*vStart*/ 2294269, - /*vBurst*/ 721410, - /*vIntr*/ 2 }, - { /*origin*/ 640, - /*yScale*/ 50332672, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModePalLpn2*/ - { /*type*/ 32, - /*comRegs*/ - { /*ctrl*/ 13071, - /*width*/ 320, - /*burst*/ 73735737, - /*vSync*/ 525, - /*hSync*/ 265233, - /*leap*/ 202968090, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModePalLpf2*/ - { /*type*/ 33, - /*comRegs*/ - { /*ctrl*/ 12879, - /*width*/ 320, - /*burst*/ 73735737, - /*vSync*/ 524, - /*hSync*/ 3088, - /*leap*/ 203164700, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 16778240, - /*vStart*/ 2294269, - /*vBurst*/ 721410, - /*vIntr*/ 2 }, - { /*origin*/ 1280, - /*yScale*/ 50332672, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModePalLan2*/ - { /*type*/ 34, - /*comRegs*/ - { /*ctrl*/ 12319, - /*width*/ 320, - /*burst*/ 73735737, - /*vSync*/ 525, - /*hSync*/ 265233, - /*leap*/ 202968090, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 }, - { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModePalLaf2*/ - { /*type*/ 35, - /*comRegs*/ - { /*ctrl*/ 12383, - /*width*/ 320, - /*burst*/ 73735737, - /*vSync*/ 524, - /*hSync*/ 3088, - /*leap*/ 203164700, - /*hStart*/ 7078636, - /*xScale*/ 512, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 16778240, - /*vStart*/ 2294269, - /*vBurst*/ 721410, - /*vIntr*/ 2 }, - { /*origin*/ 1280, - /*yScale*/ 50332672, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModePalHpn1*/ - { /*type*/ 36, - /*comRegs*/ - { /*ctrl*/ 12878, - /*width*/ 1280, - /*burst*/ 73735737, - /*vSync*/ 524, - /*hSync*/ 3088, - /*leap*/ 203164700, - /*hStart*/ 7078636, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 2294269, - /*vBurst*/ 721410, - /*vIntr*/ 2 }, - { /*origin*/ 2560, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModePalHpf1*/ - { /*type*/ 37, - /*comRegs*/ - { /*ctrl*/ 12878, - /*width*/ 640, - /*burst*/ 73735737, - /*vSync*/ 524, - /*hSync*/ 3088, - /*leap*/ 203164700, - /*hStart*/ 7078636, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 33556480, - /*vStart*/ 2294269, - /*vBurst*/ 721410, - /*vIntr*/ 2 }, - { /*origin*/ 2560, - /*yScale*/ 33556480, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModePalHan1*/ - { /*type*/ 38, - /*comRegs*/ - { /*ctrl*/ 12382, - /*width*/ 1280, - /*burst*/ 73735737, - /*vSync*/ 524, - /*hSync*/ 3088, - /*leap*/ 203164700, - /*hStart*/ 7078636, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 1024, - /*vStart*/ 2294269, - /*vBurst*/ 721410, - /*vIntr*/ 2 }, - { /*origin*/ 2560, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModePalHaf1*/ - { /*type*/ 39, - /*comRegs*/ - { /*ctrl*/ 12382, - /*width*/ 640, - /*burst*/ 73735737, - /*vSync*/ 524, - /*hSync*/ 3088, - /*leap*/ 203164700, - /*hStart*/ 7078636, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 1280, - /*yScale*/ 33556480, - /*vStart*/ 2294269, - /*vBurst*/ 721410, - /*vIntr*/ 2 }, - { /*origin*/ 2560, - /*yScale*/ 33556480, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModePalHpn2*/ - { /*type*/ 40, - /*comRegs*/ - { /*ctrl*/ 13135, - /*width*/ 1280, - /*burst*/ 73735737, - /*vSync*/ 524, - /*hSync*/ 3088, - /*leap*/ 203164700, - /*hStart*/ 7078636, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 2560, - /*yScale*/ 1024, - /*vStart*/ 2294269, - /*vBurst*/ 721410, - /*vIntr*/ 2 }, - { /*origin*/ 5120, - /*yScale*/ 1024, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } }, - /*osViModePalHpf2*/ - { /*type*/ 41, - /*comRegs*/ - { /*ctrl*/ 12879, - /*width*/ 640, - /*burst*/ 73735737, - /*vSync*/ 524, - /*hSync*/ 3088, - /*leap*/ 203164700, - /*hStart*/ 7078636, - /*xScale*/ 1024, - /*vCurrent*/ 0 }, - /*fldRegs*/ - { { /*origin*/ 2560, - /*yScale*/ 33556480, - /*vStart*/ 2294269, - /*vBurst*/ 721410, - /*vIntr*/ 2 }, - { /*origin*/ 5120, - /*yScale*/ 33556480, - /*vStart*/ 2425343, - /*vBurst*/ 918020, - /*vIntr*/ 2 } } } -#endif -}; diff --git a/lib/src/osVirtualToPhysical.c b/lib/src/osVirtualToPhysical.c deleted file mode 100644 index b1fb1a55..00000000 --- a/lib/src/osVirtualToPhysical.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "libultra_internal.h" - -uintptr_t osVirtualToPhysical(void *addr) { - if ((uintptr_t) addr >= 0x80000000 && (uintptr_t) addr < 0xa0000000) { - return ((uintptr_t) addr & 0x1fffffff); - } else if ((uintptr_t) addr >= 0xa0000000 && (uintptr_t) addr < 0xc0000000) { - return ((uintptr_t) addr & 0x1fffffff); - } else { - return __osProbeTLB(addr); - } -} diff --git a/lib/src/printf.h b/lib/src/printf.h deleted file mode 100644 index 5d798a19..00000000 --- a/lib/src/printf.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _PRINTF_H_ -#define _PRINTF_H_ -#include - -typedef struct -{ - union { - /* 00 */ s64 s64; - u64 u64; - f64 f64; - u32 u32; - u16 u16; - } value; - /* 08 */ char *buff; - /* 0c */ s32 part1_len; - /* 10 */ s32 num_leading_zeros; - /* 14 */ s32 part2_len; - /* 18 */ s32 num_mid_zeros; - /* 1c */ s32 part3_len; - /* 20 */ s32 num_trailing_zeros; - /* 24 */ s32 precision; - /* 28 */ s32 width; - /* 2c */ u32 size; - /* 30 */ u32 flags; - /* 34 */ u8 length; -} printf_struct; - -#define FLAGS_SPACE 1 -#define FLAGS_PLUS 2 -#define FLAGS_MINUS 4 -#define FLAGS_HASH 8 -#define FLAGS_ZERO 16 -s32 _Printf(char *(*prout)(char *, const char *, size_t), char *dst, const char *fmt, va_list args); -void _Litob(printf_struct *args, u8 type); -void _Ldtob(printf_struct *args, u8 type); -#endif diff --git a/lib/src/sprintf.c b/lib/src/sprintf.c deleted file mode 100644 index cd0cf5af..00000000 --- a/lib/src/sprintf.c +++ /dev/null @@ -1,20 +0,0 @@ - -#include -#include "libultra_internal.h" -#include "printf.h" -#include -char *proutSprintf(char *dst, const char *src, size_t count); -int sprintf(char *dst, const char *fmt, ...) { - s32 written; - va_list args; - va_start(args, fmt); - written = _Printf(proutSprintf, dst, fmt, args); - if (written >= 0) { - dst[written] = 0; - } - return written; -} - -char *proutSprintf(char *dst, const char *src, size_t count) { - return (char *) memcpy((u8 *) dst, (u8 *) src, count) + count; -} diff --git a/lib/src/string.c b/lib/src/string.c deleted file mode 100644 index 549c9148..00000000 --- a/lib/src/string.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "libultra_internal.h" -#include - -void *memcpy(void *dst, const void *src, size_t size) { - u8 *_dst = dst; - const u8 *_src = src; - while (size > 0) { - *_dst++ = *_src++; - size--; - } - return dst; -} -size_t strlen(const char *str) { - const u8 *ptr = (const u8 *) str; - while (*ptr) { - ptr++; - } - return (const char *) ptr - str; -} - -char *strchr(const char *str, s32 ch) { - u8 c = ch; - while (*(u8 *)str != c) { - if (*(u8 *)str == 0) { - return NULL; - } - str++; - } - return (char *) str; -} diff --git a/lib/src/unk_stack_data.c b/lib/src/unk_stack_data.c deleted file mode 100644 index 84d5fcec..00000000 --- a/lib/src/unk_stack_data.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "libultra_internal.h" - - -// only referenced in kdebugserver... -#ifdef VERSION_EU -u8 D_80365E40[0x1000]; -#else -u8 D_80365E40[0x100]; -#endif diff --git a/obj2c.py b/obj2c.py new file mode 100644 index 00000000..015aa628 --- /dev/null +++ b/obj2c.py @@ -0,0 +1,107 @@ +""" +This module generates a fragment of C code, in the style of that found in +the ``model.inc.c`` files, that encodes the geometry of the model specified +by the Wavefront OBJ file. + +Example: + Specify the path to the ``.obj`` file and pipe the output of the script + into the desired destination ``.c`` file. + + $ python obj2c.py left_hand_closed.obj > left_hand_closed.inc.c + +This is a work in progress and it currently has some serious limitations: + * It only encodes the geometry information of the OBJ file, so no + texture mapping or any other info. + * The generated fragment of C code has to be manually pasted into the + desired source file. Make sure that the name of the Gfx structure + you're pasting matches the one you're replacing. + * It hasn't been properly tested. + +""" + +def parse(filename): + from os.path import basename, splitext + from re import sub + + # WARNIGN! + # `gfx_name` is just a guess. You have to manually check that the name + # of the Gfx structure you're pasting matches the one you're replacing. + clean = lambda fn: sub('\W|^(?=\d)','_', fn) + gfx_name = clean(splitext(basename(filename))[0]) + gfx_vertices = [] + gfx_normals = [] + vertex_to_normal = {} + gfx_v_count = 0 + + vtx_name = '' + vtx_faces = [] + vtx_v_count = 0 + + output_upper = [] + output_lower = [f'const Gfx {gfx_name}[] = {{'] + + with open(filename, 'r') as obj: + for line in obj: + line = line.strip() + + if line.startswith('v '): + coordinates = [eval(x) for x in line.split()[1:4]] + gfx_vertices.append(coordinates) + vtx_v_count += 1 + gfx_v_count += 1 + + if line.startswith('vn '): + coordinates = [eval(x) for x in line.split()[1:4]] + gfx_normals.append([_encode_normal(x) for x in coordinates]) + + if line.startswith('g '): + vtx_name = line.split()[1] + + if line.startswith('f '): + pairs = [pair.split('//') for pair in line.split()[1:4]] + vtx_faces.append([int(pair[0]) for pair in pairs]) + for (x, y) in pairs: + vertex_to_normal[int(x) - 1] = int(y) - 1 + + if line.startswith('# ') and line.endswith('faces'): + output_upper.append(f'static const Vtx {vtx_name}[] = {{') + for i in range(gfx_v_count - vtx_v_count, gfx_v_count): + v_string = '[{}, {}, {}]'.format(*gfx_vertices[i]) + n_string = '[{}, {}, {}, 0x00]'.format(*gfx_normals[vertex_to_normal[i]]) + combined = f' [[{v_string}, 0, [0, 0], {n_string}]],' + output_upper.append(combined.replace('[', '{').replace(']', '}')) + + output_upper.append('};\n') + output_lower.append(f' gsSPVertex({vtx_name}, {vtx_v_count}, 0),') + + n = len(vtx_faces) + correction = vtx_v_count - gfx_v_count - 1 + for i in range(int(n / 2)): + f1 = [vtx_faces[2 * i][j] + correction for j in range(3)] + f2 = [vtx_faces[2 * i + 1][j] + correction for j in range(3)] + output_lower.append(' gsSP2Triangles({}, {}, {}, 0x0, {}, {}, {}, 0x0),'.format(*f1, *f2)) + + if n % 2 != 0: + f3 = [vtx_faces[-1][j] + correction for j in range(3)] + output_lower.append(' gsSP1Triangle({}, {}, {}, 0x0),'.format(*f3)) + + vtx_v_count = 0 + vtx_faces = [] + + output_lower.append(' gsSPEndDisplayList(),') + output_lower.append('};') + + for line in output_upper + output_lower: + print(line) + +def _encode_normal(x): + x *= 127 + if x <= 0: x += 255 + return hex(int(x)) + +if __name__ == "__main__": + import argparse + parser = argparse.ArgumentParser() + parser.add_argument('filename', help = 'filename of the .obj file to parse') + args = parser.parse_args() + parse(args.filename) \ No newline at end of file diff --git a/pisetup.sh b/pisetup.sh new file mode 100644 index 00000000..57a07ea3 --- /dev/null +++ b/pisetup.sh @@ -0,0 +1,413 @@ +#!/bin/bash +# Super Mario 64 PC on Raspberry Pi +# Find latest updates and code on https://www.github.com/sm64pc/sm64ex +# NOTE: If you clone the repo, source must be copied in ~/src/sm64pc/sm64ex/ +# ToDo: Test on more Pi models with fresh Raspbian and allow existing src folders to be updated. +# +clear +echo "This script will assist with compiling Super Mario 64 on Raspbian 10" +echo "Note that accelerated OpenGL (vc4_drm) is required for maximum performance" +echo "Checking Raspberry Pi model..." +lowmem=0 +pi=0 +pimodel=$(uname -m 2>/dev/null || echo unknown) +pitype=$(tr -d '\0' < /sys/firmware/devicetree/base/model) +repo_url="https://github.com/sm64pc/sm64ex" + +if [[ $pimodel =~ "armv6" ]] +then + echo -e "\nRaspberry Pi Model 1/0(W) detected (LOWMEM)" + echo "Warning: Additional steps may be required to safely compile and maximize performance" + pi=1; + lowmem=1; + exp=1; +fi + +if [[ $pimodel =~ "armv7" ]] +then + echo -e "\nRaspberry Pi Model 2/3/4 detected (32bit)" + pi=2; + lowmem=0; +fi + +if [[ $pimodel =~ "aarch64" && $pitype =~ "4" ]] +then + echo -e "\nRaspberry Pi Model 4 (64 bits) detected" + echo "Audio errors reported" + echo "Fixing audio config, reboot after compilation completes to activate" + sudo sed -i 's/load-module module-udev-detect/load-module module-udev-detect tsched=0/' /etc/pulse/default.pa + #load-module module-udev-detect tsched=0 + pi=4; + lowmem=0; + exp=1; +fi + + +if [[ $exp == 1 ]] +then + echo "" + echo "Notice: Due to detected Pi version, compilation and execution of Super Mario 64 (RPi) is experimental." + echo "Further steps may be required and software / driver compatibility is not guaranteed." + read -p "Continue setup & compilation (Y/N): " exp + + if [[ $exp =~ [Yy] ]] + then + echo "" + else + exit + fi + + echo "Please report any problems encountered to ${repo_url} issue tracker." + echo "" + sleep 7 +fi + +#////////////////////////////////////////////////////////////////////////////////////////////////////////// +#////////////////////////////////////////////////////////////////////////////////////////////////////////// +clear +echo "Super Mario 64 RPi Initial Setup" + +if [[ $pi != 4 ]] +then #Dumb idea, but quick hack. + #We CANNOT enable VC4 for Pi4 as it uses VC6 + +inxinf=$(inxi -Gx) +echo "Checking for pre-enabled VC4 acceleration (inxi -Gx)" + +if [[ $inxinf =~ "not found" ]] +then +echo "Error: inxi not installed. Installing..." +sudo apt-get update +sudo apt-get install -y inxi +inxi=$(inxi -Gx) + + if [[ $inxinf =~ "not found" ]] + then + echo "Warning: Setup will not continue unless inxi is installed" + echo "Please ensure your Pi is in a state to download and install packages" + sleep 3 + exit + fi +fi + +if [[ $inxinf =~ "vc4_drm" ]] +then +echo "Success: VC4 OpenGL acceleration found!" +echo "" +sleep 4 + + else + echo "" + echo "OpenGL driver not found. opening Raspi-Config..." + echo "Please enable raspi-config -> ADV Opt -> OpenGL -> Enable FullKMS Renderer" + echo "" + sleep 5 + sudo raspi-config + vc4add=$(cat /boot/config.txt | grep -e "dtoverlay=vc4-kms-v3d") + + if [[ $vc4add =~ "vc4" ]] + then + echo "OGL driver now enabled on reboot" + fi +fi + +if [[ $lowmem == 1 ]] +then +fixmem=$(cat /boot/cmdline.txt | grep cma=128M) + + if [[ $fixmem =~ "cma=128M" ]] + then + echo "" + echo "Notice: Low-RAM RasPi model detected, BUT fixes already applied." + echo "Continuing setup." + + else + echo "" + echo "Warning: VC4 enabled, but your RasPi has 512MB or less RAM" + echo "To ensure VC4_DRM and game compilation is succesful, video memory will be reduced" + echo "gpu_mem=48M (config.txt) | cma=128M (cmdline.txt) will be written to /boot " + echo "" + read -p "Fix mem? (Y/N): " fixmem + + if [[ $fixmem =~ [Yy] ]] + then + sudo sh -c "echo 'gpu_mem=48' >> /boot/config.txt" + sudo sh -c "echo 'cma=128M' >> /boot/cmdline.txt" + sync + echo "Wrote configuration changes to SD card." + sleep 2 + else + echo "" + echo "Warning: Compilation freezes & errors are likely to occur on your Pi" + echo "" + sleep 3 + fi + fi +fi + +if [[ $fixmem =~ [Yy] || $vc4add =~ "vc4" ]] +then +clear +echo "System configuration has changed!" +read -p "Reboot to enable changes? (Y/N): " fixstart + if [[ $fixstart =~ [Yy] ]] + then + echo "" + echo "Rebooting RasPi in 4 seconds! Press Control-C to cancel." + sleep 4 + sudo reboot + fi + fi +fi # "Should never run on a Pi 4" part ends here + +#-------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +clear +echo "Beginning installation" +echo "" +echo "Step 1. Installing latest dependencies" +echo "Allow installation & checking of Super Mario 64 compile dependencies?" +read -p "Install? (Y/N): " instdep + +if [[ $instdep =~ [Yy] ]] +then +echo "" +sudo apt-get update +sudo apt install -y build-essential git python3 libaudiofile-dev libglew-dev libsdl2-dev +sync +else +echo "" +echo "Super Mario 64 dependencies not installed." +echo "Please manually install if Raspbian is modified from stock" +echo "" +sleep 3 +fi + +#-------------------------------------------------------------------------------------- +#------------------------------------------------------------------------------------- +clear +echo "Optional: Compile SDL2 with 'KMSDRM' for enhanced performance?" +echo "KMSDRM allows Super Mario 64 to be run without GUI/Desktop (Xorg) enabled on boot" +echo "" +echo "Warning: Compile could take up to an hour on older Raspberry Pi models" +read -p "Proceed? (Y/N): " sdlcomp + +if [[ $sdlcomp =~ [Yy] ]] +then +echo "" +echo "Installing dependencies for SDL2 compilation" + +sudo sed -i '/^#\sdeb-src /s/^#//' "/etc/apt/sources.list" +sudo apt build-dep libsdl2 +sudo apt install -y libdrm-dev libgbm-dev +sync + +echo "" +echo "Creating folder src in HOME directory for compile" +echo "" + +mkdir $HOME/src +cd $HOME/src +mkdir $HOME/src/sdl2 +cd $HOME/src/sdl2 +sleep 2 + +echo "Downloading SDL2 from libsdl.org and unzipping to HOME/src/sdl2/SDL2" +wget https://www.libsdl.org/release/SDL2-2.0.10.tar.gz +sync +tar xzf ./SDL2*.gz +sync +cd ./SDL2* + +echo "Configuring SDL2 library to enable KMSDRM (Xorg free rendering)" +./configure --enable-video-kmsdrm +echo "Compiling modified SDL2 and installing." +make +sudo make install +fi + +#---------------------------------------------------------------------- +#--------------------------------------------------------------------- +sleep 2 +clear +echo "Super Mario 64 RPi preparation & downloader" +echo "" +echo "Checking in current directory and" +echo "checking in "$HOME"/src/sm64pc/sm64ex/ for existing Super Mario 64 PC files" +echo "" +sm64dircur=$(ls ./Makefile) +sm64dir=$(ls $HOME/src/sm64pc/sm64ex/Makefile) + +if [[ $sm64dircur =~ "Makefile" ]] #If current directory has a makefile +then +sm64dir=$sm64dircur +curdir=1; #If current directory has a Makefile or is git zip +fi + +if [[ $sm64dir =~ "Makefile" ]]; +then + echo "Existing Super Mario 64 PC port files found!" + echo "Redownload files (fresh compile)?" + read -p "Redownload? (Y/N): " sm64git + + if [[ $sm64git =~ "N" ]] # Do NOT redownload, USE current directory for compile + then + sm64dir=1; # Don't redownload files , use current directory (has sm64 files) + curdir=1 + fi + +else #Do a fresh compile in HOME/src/sm64pc/sm64ex/ + sm64dir=0; + curdir=0; +fi + +#------------------------------------------------------------------------------ +#------------------------------------------------------------------------------ + +if [[ $sm64git =~ [Yy] || $sm64dir == 0 || $curdir == 0 ]] #If user wants to redownload or NOT git-zip execution +then +echo "Step 2. Super Mario 64 PC-Port will now be downloaded from github" +echo "Current folder will NOT be compiled." +read -p "Proceed? (Y/N): " gitins + +if [[ $gitins =~ [Yy] ]] +then +echo "" +echo "Creating directory "$HOME"/src/sm64pc" +mkdir $HOME/src/ +cd $HOME/src/ +mkdir $HOME/src/sm64pc +cd $HOME/src/sm64pc + +echo "" +echo "Downloading latest Super Mario 64 PC-port code" +git clone ${repo_url} +cd $HOME/src/sm64pc/sm64ex/ +echo "Download complete" +echo "" +sleep 2 +fi #End of downloader +fi +sleep 2 + +#------------------------------------------------------------------- +#------------------------------------------------------------------ +clear +echo "Super Mario 64 RPi compilation" +echo "" +echo "Step 3. Compiling Super Mario 64 for the Raspberry Pi" +echo "" +echo "Warning: Super Mario 64 assets are required in order to compile" +if [[ $curdir == 1 ]] +then +echo "Assets will be extracted from "$PWD" " +else +echo "Assets will be extracted from $HOME/src/sm64pc/sm64ex/baserom.(us/eu/jp).z64 " +fi + +if [[ $curdir == 1 ]] +then +sm64z64=$(find ./* | grep baserom) #See if current directory is prepped +else +sm64z64=$(find $HOME/src/sm64pc/sm64ex/* | grep baserom) #see if fresh compile directory is prepped +fi + +if [[ $sm64z64 =~ "baserom" ]] +then +echo "" +echo "Super Mario 64 assets found in compilation directory" +echo "Continuing with compilation" + +else +echo "" +echo "Please satisfy this requirement before continuing." +echo "Exiting Super Mario 64 RasPi setup and compilation script." +echo "" +echo "Note: Re-run script once baserom(s) are inserted into" + +if [[ $curdir == 1 ]] +then +echo $PWD +echo "" +else +echo "" +echo $HOME/src/sm64pc/sm64ex/ +fi + +sleep 5 +exit + +fi + +#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +sleep 3 +clear +echo "" + +if [[ $curdir != 1 ]] # If we're not compiling from a git zip / random directory +then +cd $HOME/src/sm64pc/sm64ex/ +fi + +echo "Beginning Super Mario 64 RasPi compilation!" +echo "" +echo "Warning: Compilation may take up to an hour on weaker hardware" +echo "At least 300MB of free storage AND RAM is recommended" +echo "" +make clean +sync +if [[ $pimodel =~ "armv6" ]] +then +make TARGET_RPI=1 +else +make TARGET_RPI=1 -j4 +fi +sync + + +#--------------------------------------------------------------------------- +#-------------------------------------------------------------------------- + +if [[ $curdir == 1 ]] +then +sm64done=$(find ./build/*/* | grep .arm) +else +sm64done=$(find $HOME/src/sm64pc/sm64ex/build/*/* | grep .arm) +fi + +echo "" +if [[ $sm64done =~ ".arm" ]] +then +echo "Super Mario 64 RasPi compilation successful!" +echo "You may find it in" + +if [[ $curdir == 1 ]] +then +$sm64loc=$(ls ./build/*pc/*.arm) +else +$sm64loc=$(ls $HOME/src/sm64pc/sm64ex/build/*pc/*.arm) +fi + +echo $sm64loc + +echo "" +echo "Execute compiled Super Mario 64 RasPi?" +read -p "Run game (Y/N): " sm64run + +if [[ $sm64run =~ [Yy] ]] +then +cd +chmod +x $sm64loc +bash $sm64loc +sleep 1 +fi + +else +echo "Cannot find compiled sm64*.arm binary..." +echo "Please note of any errors during compilation process and report them to" +echo "${repo_url}" +sleep 5 +fi + +exit diff --git a/rsp/audio.s b/rsp/audio.s deleted file mode 100644 index f8c08f92..00000000 --- a/rsp/audio.s +++ /dev/null @@ -1,1129 +0,0 @@ -.rsp - -.include "rsp/rsp_defs.inc" - -// This file assumes DATA_FILE and CODE_FILE are set on the command line - -.if version() < 110 - .error "armips 0.11 or newer is required" -.endif - -.macro jumpTableEntry, addr - .dh addr & 0xFFFF -.endmacro - -// Audio flags -A_INIT equ 0x01 -A_CONTINUE equ 0x00 -A_LOOP equ 0x02 -A_OUT equ 0x02 -A_LEFT equ 0x02 -A_RIGHT equ 0x00 -A_VOL equ 0x04 -A_RATE equ 0x00 -A_AUX equ 0x08 -A_NOAUX equ 0x00 -A_MAIN equ 0x00 -A_MIX equ 0x10 - -.create DATA_FILE, 0x0000 - -.dh 0x0000, 0x0001, 0x0002, 0xffff, 0x0020, 0x0800, 0x7fff, 0x4000 // 0x00000000 - -// 0x10 - 0x1F: command dispatch table -dispatchTable: - jumpTableEntry cmd_SPNOOP - jumpTableEntry cmd_ADPCM - jumpTableEntry cmd_CLEARBUFF - jumpTableEntry cmd_ENVMIXER - jumpTableEntry cmd_LOADBUFF - jumpTableEntry cmd_RESAMPLE - jumpTableEntry cmd_SAVEBUFF - jumpTableEntry cmd_SEGMENT - jumpTableEntry cmd_SETBUFF - jumpTableEntry cmd_SETVOL - jumpTableEntry cmd_DMEMMOVE - jumpTableEntry cmd_LOADADPCM - jumpTableEntry cmd_MIXER - jumpTableEntry cmd_INTERLEAVE - jumpTableEntry cmd_POLEF - jumpTableEntry cmd_SETLOOP - -.dh 0xf000, 0x0f00, 0x00f0, 0x000f, 0x0001, 0x0010, 0x0100, 0x1000 // 0x00000030 -data0040: -.dh 0x0002, 0x0004, 0x0006, 0x0008, 0x000a, 0x000c, 0x000e, 0x0010 // 0x00000040 -.dh 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001 // 0x00000050 -.dh 0x0000, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0100, 0x0200 // 0x00000060 -.dh 0x0001, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000 // 0x00000070 -.dh 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000 // 0x00000080 -.dh 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000 // 0x00000090 -.dh 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0001 // 0x000000a0 -.dh 0x2000, 0x4000, 0x6000, 0x8000, 0xa000, 0xc000, 0xe000, 0xffff // 0x000000b0 -.dh 0x0c39, 0x66ad, 0x0d46, 0xffdf, 0x0b39, 0x6696, 0x0e5f, 0xffd8 // 0x000000c0 -.dh 0x0a44, 0x6669, 0x0f83, 0xffd0, 0x095a, 0x6626, 0x10b4, 0xffc8 // 0x000000d0 -.dh 0x087d, 0x65cd, 0x11f0, 0xffbf, 0x07ab, 0x655e, 0x1338, 0xffb6 // 0x000000e0 -.dh 0x06e4, 0x64d9, 0x148c, 0xffac, 0x0628, 0x643f, 0x15eb, 0xffa1 // 0x000000f0 -.dh 0x0577, 0x638f, 0x1756, 0xff96, 0x04d1, 0x62cb, 0x18cb, 0xff8a // 0x00000100 -.dh 0x0435, 0x61f3, 0x1a4c, 0xff7e, 0x03a4, 0x6106, 0x1bd7, 0xff71 // 0x00000110 -.dh 0x031c, 0x6007, 0x1d6c, 0xff64, 0x029f, 0x5ef5, 0x1f0b, 0xff56 // 0x00000120 -.dh 0x022a, 0x5dd0, 0x20b3, 0xff48, 0x01be, 0x5c9a, 0x2264, 0xff3a // 0x00000130 -.dh 0x015b, 0x5b53, 0x241e, 0xff2c, 0x0101, 0x59fc, 0x25e0, 0xff1e // 0x00000140 -.dh 0x00ae, 0x5896, 0x27a9, 0xff10, 0x0063, 0x5720, 0x297a, 0xff02 // 0x00000150 -.dh 0x001f, 0x559d, 0x2b50, 0xfef4, 0xffe2, 0x540d, 0x2d2c, 0xfee8 // 0x00000160 -.dh 0xffac, 0x5270, 0x2f0d, 0xfedb, 0xff7c, 0x50c7, 0x30f3, 0xfed0 // 0x00000170 -.dh 0xff53, 0x4f14, 0x32dc, 0xfec6, 0xff2e, 0x4d57, 0x34c8, 0xfebd // 0x00000180 -.dh 0xff0f, 0x4b91, 0x36b6, 0xfeb6, 0xfef5, 0x49c2, 0x38a5, 0xfeb0 // 0x00000190 -.dh 0xfedf, 0x47ed, 0x3a95, 0xfeac, 0xfece, 0x4611, 0x3c85, 0xfeab // 0x000001a0 -.dh 0xfec0, 0x4430, 0x3e74, 0xfeac, 0xfeb6, 0x424a, 0x4060, 0xfeaf // 0x000001b0 -.dh 0xfeaf, 0x4060, 0x424a, 0xfeb6, 0xfeac, 0x3e74, 0x4430, 0xfec0 // 0x000001c0 -.dh 0xfeab, 0x3c85, 0x4611, 0xfece, 0xfeac, 0x3a95, 0x47ed, 0xfedf // 0x000001d0 -.dh 0xfeb0, 0x38a5, 0x49c2, 0xfef5, 0xfeb6, 0x36b6, 0x4b91, 0xff0f // 0x000001e0 -.dh 0xfebd, 0x34c8, 0x4d57, 0xff2e, 0xfec6, 0x32dc, 0x4f14, 0xff53 // 0x000001f0 -.dh 0xfed0, 0x30f3, 0x50c7, 0xff7c, 0xfedb, 0x2f0d, 0x5270, 0xffac // 0x00000200 -.dh 0xfee8, 0x2d2c, 0x540d, 0xffe2, 0xfef4, 0x2b50, 0x559d, 0x001f // 0x00000210 -.dh 0xff02, 0x297a, 0x5720, 0x0063, 0xff10, 0x27a9, 0x5896, 0x00ae // 0x00000220 -.dh 0xff1e, 0x25e0, 0x59fc, 0x0101, 0xff2c, 0x241e, 0x5b53, 0x015b // 0x00000230 -.dh 0xff3a, 0x2264, 0x5c9a, 0x01be, 0xff48, 0x20b3, 0x5dd0, 0x022a // 0x00000240 -.dh 0xff56, 0x1f0b, 0x5ef5, 0x029f, 0xff64, 0x1d6c, 0x6007, 0x031c // 0x00000250 -.dh 0xff71, 0x1bd7, 0x6106, 0x03a4, 0xff7e, 0x1a4c, 0x61f3, 0x0435 // 0x00000260 -.dh 0xff8a, 0x18cb, 0x62cb, 0x04d1, 0xff96, 0x1756, 0x638f, 0x0577 // 0x00000270 -.dh 0xffa1, 0x15eb, 0x643f, 0x0628, 0xffac, 0x148c, 0x64d9, 0x06e4 // 0x00000280 -.dh 0xffb6, 0x1338, 0x655e, 0x07ab, 0xffbf, 0x11f0, 0x65cd, 0x087d // 0x00000290 -.dh 0xffc8, 0x10b4, 0x6626, 0x095a, 0xffd0, 0x0f83, 0x6669, 0x0a44 // 0x000002a0 -.dh 0xffd8, 0x0e5f, 0x6696, 0x0b39, 0xffdf, 0x0d46, 0x66ad, 0x0c39 // 0x000002b0 - -.definelabel segmentTable, 0x320 - -.definelabel audioStruct, 0x360 -audio_in_buf equ 0x00 // 0x360 -audio_out_buf equ 0x02 // 0x362 -audio_count equ 0x04 // 0x364 -audio_vol_left equ 0x06 // 0x366 -audio_vol_right equ 0x08 // 0x366 -audio_aux_buf0 equ 0x0a // 0x36a -audio_aux_buf1 equ 0x0c // 0x36c -audio_aux_buf2 equ 0x0e // 0x36e -audio_loop_value equ 0x10 // 0x370 (shared) -audio_target_left equ 0x10 // 0x370 (shared) -audio_rate_hi_left equ 0x12 // 0x372 (shared) -audio_rate_lo_left equ 0x14 // 0x374 -audio_target_right equ 0x16 // 0x376 -audio_rate_hi_right equ 0x18 // 0x378 -audio_rate_lo_right equ 0x1a // 0x37a -audio_dry_gain equ 0x1c // 0x37c -audio_wet_gain equ 0x1e // 0x37e - -.definelabel nextTaskEntry, 0x380 // next task entries (0x140 bytes) -.definelabel adpcmTable, 0x4c0 // (16*8 16-bit entries) -.definelabel dmemBase, 0x5c0 // all samples stored that is transferred to DMEM -.definelabel tmpData, 0xF90 // temporary area - -.close // DATA_FILE - - -.create CODE_FILE, 0x04001080 - - addi $24, $zero, audioStruct - addi $23, $zero, tmpData - lw $28, 0x30($1) // task_data - lw $27, 0x34($1) // task_data_size - mfc0 $5, DPC_STATUS - andi $4, $5, DPC_STATUS_XBUS_DMA - beqz $4, @@audio_040010b4 - andi $4, $5, DPC_STATUS_DMA_BUSY - beqz $4, @@audio_040010b4 - nop -@@dpc_dma_busy: - mfc0 $4, DPC_STATUS - andi $4, $4, DPC_STATUS_DMA_BUSY - bgtz $4, @@dpc_dma_busy -@@audio_040010b4: - nop - jal audio_04001150 - nop - addi $2, $zero, 0x000f - addi $1, $zero, segmentTable -@@audio_040010c8: - sw $zero, 0x00($1) - bgtz $2, @@audio_040010c8 - addi $2, $2, -1 - -dma_busy: - mfc0 $2, SP_DMA_BUSY - bnez $2, dma_busy - addi $29, $zero, nextTaskEntry - mtc0 $zero, SP_SEMAPHORE // release semaphore -audio_040010e4: - lw $26, 0x00($29) // first word of command - lw $25, 0x04($29) // second word of command - srl $1, $26, 23 // cmd byte << 1 - andi $1, $1, 0x00fe - addi $28, $28, 8 - addi $27, $27, -8 - addi $29, $29, 8 - addi $30, $30, -8 - add $2, $zero, $1 - lh $2, (dispatchTable)($2) - jr $2 - nop - break - -cmd_SPNOOP: - bgtz $30, audio_040010e4 - nop - blez $27, @@audio_04001138 - nop - jal audio_04001150 - nop - j dma_busy - nop -@@audio_04001138: - ori $1, $zero, 0x4000 - mtc0 $1, SP_STATUS - break - nop -@@forever: - b @@forever - nop - -audio_04001150: - addi $5, $ra, 0x0000 - add $2, $zero, $28 - addi $3, $27, 0x0000 - addi $4, $3, -0x0140 - blez $4, @@audio_0400116c - addi $1, $zero, nextTaskEntry - addi $3, $zero, 0x0140 -@@audio_0400116c: - addi $30, $3, 0x0000 - jal dma_read_start - addi $3, $3, -1 - addi $29, $zero, nextTaskEntry - jr $5 - nop - -dma_read_start: - mfc0 $4, SP_SEMAPHORE - bnez $4, dma_read_start - nop -@@dma_not_full: - mfc0 $4, SP_DMA_FULL - bnez $4, @@dma_not_full - nop - mtc0 $1, SP_MEM_ADDR - mtc0 $2, SP_DRAM_ADDR - mtc0 $3, SP_RD_LEN - jr $ra - nop - -dma_write_start: - mfc0 $4, SP_SEMAPHORE - bnez $4, dma_write_start - nop -@@dma_not_full: - mfc0 $4, SP_DMA_FULL - bnez $4, @@dma_not_full - nop - mtc0 $1, SP_MEM_ADDR - mtc0 $2, SP_DRAM_ADDR - mtc0 $3, SP_WR_LEN - jr $ra - nop - -cmd_CLEARBUFF: - andi $3, $25, 0xffff - beqz $3, cmd_SPNOOP - addi $4, $zero, dmemBase - andi $2, $26, 0xffff - add $2, $2, $4 - vxor $v1, $v1, $v1 - addi $3, $3, -0x10 -@@audio_040011f8: - sdv $v1[0], 0x0($2) - sdv $v1[0], 0x8($2) - addi $2, $2, 0x10 - bgtz $3, @@audio_040011f8 - addi $3, $3, -0x10 - j cmd_SPNOOP - nop - -cmd_LOADBUFF: - lhu $3, (audio_count)($24) - beqz $3, cmd_SPNOOP - sll $2, $25, 8 - srl $2, $2, 8 - srl $4, $25, 24 - sll $4, $4, 2 - lw $5, (segmentTable)($4) - add $2, $2, $5 - lhu $1, (audio_in_buf)($24) - jal dma_read_start - addi $3, $3, -1 -@@dma_read_busy: - mfc0 $1, SP_DMA_BUSY - bnez $1, @@dma_read_busy - nop - j cmd_SPNOOP - mtc0 $zero, SP_SEMAPHORE - -cmd_SAVEBUFF: - lhu $3, (audio_count)($24) - beqz $3, cmd_SPNOOP - sll $2, $25, 8 - srl $2, $2, 8 - srl $4, $25, 24 - sll $4, $4, 2 - lw $5, (segmentTable)($4) - add $2, $2, $5 - lhu $1, (audio_out_buf)($24) - jal dma_write_start - addi $3, $3, -1 -@@dma_write_busy: - mfc0 $1, SP_DMA_BUSY - bnez $1, @@dma_write_busy - nop - j cmd_SPNOOP - mtc0 $zero, SP_SEMAPHORE - -cmd_LOADADPCM: - sll $2, $25, 8 - srl $2, $2, 8 - srl $4, $25, 24 - sll $4, $4, 2 - lw $5, (segmentTable)($4) - add $2, $2, $5 - addi $1, $zero, adpcmTable - andi $3, $26, 0xffff - jal dma_read_start - addi $3, $3, -1 -@@dma_read_busy: - mfc0 $1, SP_DMA_BUSY - bnez $1, @@dma_read_busy - nop - j cmd_SPNOOP - mtc0 $zero, SP_SEMAPHORE - -cmd_SEGMENT: - sll $3, $25, 8 // Least significant 24-bits offset - srl $3, $3, 8 - srl $2, $25, 24 // Most significant 8-bits segment number - sll $2, $2, 2 - add $4, $zero, $2 - j cmd_SPNOOP - sw $3, (segmentTable)($4) - -cmd_SETBUFF: - addi $1, $26, dmemBase - srl $2, $25, 16 - addi $2, $2, dmemBase - srl $4, $26, 16 - andi $4, $4, A_AUX - bgtz $4, @@audio_04001318 - addi $3, $25, dmemBase - sh $1, (audio_in_buf)($24) - sh $2, (audio_out_buf)($24) - j cmd_SPNOOP - sh $25, (audio_count)($24) -@@audio_04001318: - sh $3, (audio_aux_buf2)($24) - sh $1, (audio_aux_buf0)($24) - j cmd_SPNOOP - sh $2, (audio_aux_buf1)($24) - -cmd_SETVOL: - srl $2, $26, 16 - andi $1, $2, A_AUX - beqz $1, @@audio_04001344 - andi $1, $2, A_VOL - sh $26, (audio_dry_gain)($24) - j cmd_SPNOOP - sh $25, (audio_wet_gain)($24) -@@audio_04001344: - beqz $1, @@audio_04001364 - andi $1, $2, A_LEFT - beqz $1, @@audio_0400135c - nop - j cmd_SPNOOP - sh $26, (audio_vol_left)($24) -@@audio_0400135c: - j cmd_SPNOOP - sh $26, (audio_vol_right)($24) -@@audio_04001364: - beqz $1, @@audio_0400137c - srl $1, $25, 16 - sh $26, (audio_target_left)($24) - sh $1, (audio_rate_hi_left)($24) - j cmd_SPNOOP - sh $25, (audio_rate_lo_left)($24) -@@audio_0400137c: - sh $26, (audio_target_right)($24) - sh $1, (audio_rate_hi_right)($24) - j cmd_SPNOOP - sh $25, (audio_rate_lo_right)($24) - -cmd_INTERLEAVE: - lhu $1, (audio_count)($24) - lhu $4, (audio_out_buf)($24) - beqz $1, cmd_SPNOOP - andi $3, $25, 0xffff - addi $3, $3, dmemBase - srl $2, $25, 16 - addi $2, $2, dmemBase -@@audio_040013a8: - lqv $v1[0], 0x00($2) - lqv $v2[0], 0x00($3) - ssv $v1[0], 0x00($4) - ssv $v2[0], 0x02($4) - ssv $v1[2], 0x04($4) - ssv $v2[2], 0x06($4) - ssv $v1[4], 0x08($4) - ssv $v2[4], 0x0a($4) - ssv $v1[6], 0x0c($4) - ssv $v2[6], 0x0e($4) - ssv $v1[8], 0x10($4) - ssv $v2[8], 0x12($4) - ssv $v1[10], 0x14($4) - ssv $v2[10], 0x16($4) - ssv $v1[12], 0x18($4) - ssv $v2[12], 0x1a($4) - ssv $v1[14], 0x1c($4) - ssv $v2[14], 0x1e($4) - addi $1, $1, -0x10 - addi $2, $2, 0x10 - addi $3, $3, 0x10 - bgtz $1, @@audio_040013a8 - addi $4, $4, 0x20 - j cmd_SPNOOP - nop - -cmd_DMEMMOVE: - andi $1, $25, 0xffff - beqz $1, cmd_SPNOOP - andi $2, $26, 0xffff - addi $2, $2, dmemBase - srl $3, $25, 16 - addi $3, $3, dmemBase -@@audio_04001424: - ldv $v1[0], 0x0($2) - ldv $v2[0], 0x8($2) - addi $1, $1, -0x10 - addi $2, $2, 0x10 - sdv $v1[0], 0x0($3) - sdv $v2[0], 0x8($3) - bgtz $1, @@audio_04001424 - addi $3, $3, 0x10 - j cmd_SPNOOP - nop - -cmd_SETLOOP: - sll $1, $25, 8 - srl $1, $1, 8 - srl $3, $25, 24 - sll $3, $3, 2 - lw $2, (segmentTable)($3) - add $1, $1, $2 - sw $1, (audio_loop_value)($24) - j cmd_SPNOOP - nop - -cmd_ADPCM: - lqv $v31[0], 0x00($zero) - vxor $v27, $v27, $v27 - lhu $21, (audio_in_buf)($24) - vxor $v25, $v25, $v25 - vxor $v24, $v24, $v24 - addi $20, $21, 1 - lhu $19, (audio_out_buf)($24) - vxor $v13, $v13, $v13 - vxor $v14, $v14, $v14 - lhu $18, (audio_count)($24) - vxor $v15, $v15, $v15 - lui $1, 0x00ff - vxor $v16, $v16, $v16 - ori $1, $1, 0xffff - vxor $v17, $v17, $v17 - and $17, $25, $1 - vxor $v18, $v18, $v18 - srl $2, $25, 24 - vxor $v19, $v19, $v19 - sll $2, $2, 2 - lw $3, (segmentTable)($2) - add $17, $17, $3 // last frame addr - sqv $v27[0], 0x00($19) - sqv $v27[0], 0x10($19) - srl $1, $26, 16 - andi $1, $1, A_INIT - bgtz $1, @@audio_0400150c - srl $1, $26, 16 - andi $1, $1, A_LOOP - beq $zero, $1, @@audio_040014f0 - addi $2, $17, 0x00 - lw $2, (audio_loop_value)($24) -@@audio_040014f0: - addi $1, $19, 0x0000 - jal dma_read_start - addi $3, $zero, 0x1f -@@dma_read_busy: - mfc0 $5, SP_DMA_BUSY - bnez $5, @@dma_read_busy - nop - mtc0 $zero, SP_SEMAPHORE -@@audio_0400150c: - addi $16, $zero, 0x0030 - addi $15, $zero, adpcmTable - ldv $v25[0], 0x00($16) - ldv $v24[8], 0x00($16) - ldv $v23[0], 0x08($16) - ldv $v23[8], 0x08($16) - lqv $v27[0], 0x10($19) // last 8 frames - addi $19, $19, 0x20 - beqz $18, @@audio_040016e8 - ldv $v1[0], 0x00($20) - lbu $1, 0x00($21) - andi $11, $1, 0x000f - sll $11, $11, 5 - vand $v3, $v25, $v1[0] - add $13, $11, $15 - vand $v4, $v24, $v1[1] - srl $14, $1, 4 - vand $v5, $v25, $v1[2] - addi $2, $zero, 12 - vand $v6, $v24, $v1[3] - sub $14, $2, $14 - addi $2, $14, -1 - addi $3, $zero, 1 - sll $3, $3, 15 - srlv $4, $3, $2 - mtc2 $4, $v22[0] - lqv $v21[0], 0x00($13) - lqv $v20[0], 0x10($13) - addi $13, $13, -2 - lrv $v19[0], 0x20($13) - addi $13, $13, -2 - lrv $v18[0], 0x20($13) - addi $13, $13, -2 - lrv $v17[0], 0x20($13) - addi $13, $13, -2 - lrv $v16[0], 0x20($13) - addi $13, $13, -2 - lrv $v15[0], 0x20($13) - addi $13, $13, -2 - lrv $v14[0], 0x20($13) - addi $13, $13, -2 - lrv $v13[0], 0x20($13) -@@audio_040015b4: - addi $20, $20, 9 - vmudn $v30, $v3, $v23 - addi $21, $21, 9 - vmadn $v30, $v4, $v23 - ldv $v1[0], 0x00($20) - vmudn $v29, $v5, $v23 - lbu $1, 0x00($21) - vmadn $v29, $v6, $v23 - blez $14, @@audio_040015e4 - andi $11, $1, 0x000f - vmudm $v30, $v30, $v22[0] - vmudm $v29, $v29, $v22[0] -@@audio_040015e4: - sll $11, $11, 5 - vand $v3, $v25, $v1[0] - add $13, $11, $15 - vand $v4, $v24, $v1[1] - vand $v5, $v25, $v1[2] - vand $v6, $v24, $v1[3] - srl $14, $1, 4 - vmudh $v2, $v21, $v27[6] - addi $2, $zero, 12 - vmadh $v2, $v20, $v27[7] - sub $14, $2, $14 - vmadh $v2, $v19, $v30[0] - addi $2, $14, -1 - vmadh $v2, $v18, $v30[1] - addi $3, $zero, 1 - vmadh $v2, $v17, $v30[2] - sll $3, $3, 15 - vmadh $v2, $v16, $v30[3] - srlv $4, $3, $2 - vmadh $v28, $v15, $v30[4] - mtc2 $4, $v22[0] - vmadh $v2, $v14, $v30[5] - vmadh $v2, $v13, $v30[6] - vmadh $v2, $v30, $v31[5] - vsar $v26, $v7, $v28[1] - vsar $v28, $v7, $v28[0] - vmudn $v2, $v26, $v31[4] - vmadh $v28, $v28, $v31[4] - vmudh $v2, $v19, $v29[0] - addi $12, $13, -2 - vmadh $v2, $v18, $v29[1] - lrv $v19[0], 0x20($12) - vmadh $v2, $v17, $v29[2] - addi $12, $12, -2 - vmadh $v2, $v16, $v29[3] - lrv $v18[0], 0x20($12) - vmadh $v2, $v15, $v29[4] - addi $12, $12, -2 - vmadh $v2, $v14, $v29[5] - lrv $v17[0], 0x20($12) - vmadh $v2, $v13, $v29[6] - addi $12, $12, -2 - vmadh $v2, $v29, $v31[5] - lrv $v16[0], 0x20($12) - vmadh $v2, $v21, $v28[6] - addi $12, $12, -2 - vmadh $v2, $v20, $v28[7] - lrv $v15[0], 0x20($12) - vsar $v26, $v7, $v27[1] - addi $12, $12, -2 - vsar $v27, $v7, $v27[0] - lrv $v14[0], 0x20($12) - addi $12, $12, -2 - lrv $v13[0], 0x20($12) - lqv $v21[0], 0x00($13) - vmudn $v2, $v26, $v31[4] - lqv $v20[0], 0x10($13) - vmadh $v27, $v27, $v31[4] - addi $18, $18, -0x20 - sdv $v28[0], 0x00($19) - sdv $v28[8], 0x08($19) - sdv $v27[0], 0x10($19) - sdv $v27[8], 0x18($19) - bgtz $18, @@audio_040015b4 - addi $19, $19, 0x20 -@@audio_040016e8: - addi $1, $19, -0x20 - addi $2, $17, 0x00 - jal dma_write_start - addi $3, $zero, 0x1f -@@dma_write_busy: - mfc0 $5, SP_DMA_BUSY - bnez $5, @@dma_write_busy - nop - j cmd_SPNOOP - mtc0 $zero, SP_SEMAPHORE - -cmd_POLEF: // unused by SM64 - lqv $v31[0], 0x0000($zero) - vxor $v28, $v28, $v28 - lhu $21, (audio_in_buf)($24) - vxor $v17, $v17, $v17 - lhu $20, (audio_out_buf)($24) - vxor $v18, $v18, $v18 - lhu $19, (audio_count)($24) - vxor $v19, $v19, $v19 - beqz $19, @@audio_04001874 - andi $14, $26, 0xffff - mtc2 $14, $v31[10] - sll $14, $14, 2 - mtc2 $14, $v16[0] - lui $1, 0x00ff - vxor $v20, $v20, $v20 - ori $1, $1, 0xffff - vxor $v21, $v21, $v21 - and $18, $25, $1 - vxor $v22, $v22, $v22 - srl $2, $25, 24 - vxor $v23, $v23, $v23 - sll $2, $2, 2 - lw $3, (segmentTable)($2) - add $18, $18, $3 - slv $v28[0], 0x00($23) - srl $1, $26, 16 - andi $1, $1, 0x0001 - bgtz $1, @@audio_040017a0 - nop - addi $1, $23, 0x0000 - addi $2, $18, 0x0000 - jal dma_read_start - addi $3, $zero, 7 -@@dma_read_busy: - mfc0 $5, SP_DMA_BUSY - bnez $5, @@dma_read_busy - nop - mtc0 $zero, SP_SEMAPHORE -@@audio_040017a0: - addi $13, $zero, adpcmTable - addi $1, $zero, 0x0004 - mtc2 $1, $v14[0] - lqv $v24[0], 0x0010($13) - vmudm $v16, $v24, $v16[0] - ldv $v28[8], 0x00($23) - sqv $v16[0], 0x10($13) - lqv $v25[0], 0x00($13) - addi $13, $13, -2 - lrv $v23[0], 0x20($13) - addi $13, $13, -2 - lrv $v22[0], 0x20($13) - addi $13, $13, -2 - lrv $v21[0], 0x20($13) - addi $13, $13, -2 - lrv $v20[0], 0x20($13) - addi $13, $13, -2 - lrv $v19[0], 0x20($13) - addi $13, $13, -2 - lrv $v18[0], 0x20($13) - addi $13, $13, -2 - lrv $v17[0], 0x20($13) - ldv $v30[0], 0x00($21) - ldv $v30[8], 0x08($21) -@@audio_04001800: - vmudh $v16, $v25, $v28[6] - addi $21, $21, 0x10 - vmadh $v16, $v24, $v28[7] - addi $19, $19, -0x10 - vmadh $v16, $v23, $v30[0] - vmadh $v16, $v22, $v30[1] - vmadh $v16, $v21, $v30[2] - vmadh $v16, $v20, $v30[3] - vmadh $v28, $v19, $v30[4] - vmadh $v16, $v18, $v30[5] - vmadh $v16, $v17, $v30[6] - vmadh $v16, $v30, $v31[5] - ldv $v30[0], 0x00($21) - vsar $v26, $v15, $v28[1] - ldv $v30[8], 0x08($21) - vsar $v28, $v15, $v28[0] - vmudn $v16, $v26, $v14[0] - vmadh $v28, $v28, $v14[0] - sdv $v28[0], 0x00($20) - sdv $v28[8], 0x08($20) - bgtz $19, @@audio_04001800 - addi $20, $20, 0x10 - addi $1, $20, -8 - addi $2, $18, 0x00 - jal dma_write_start - addi $3, $zero, 7 -@@dma_write_busy: - mfc0 $5, SP_DMA_BUSY - bnez $5, @@dma_write_busy - nop -@@audio_04001874: - j cmd_SPNOOP - mtc0 $zero, SP_SEMAPHORE - -cmd_RESAMPLE: - lh $8, (audio_in_buf)($24) - lh $19, (audio_out_buf)($24) - lh $18, (audio_count)($24) - lui $4, 0x00ff - ori $4, $4, 0xffff - and $2, $25, $4 - srl $5, $25, 24 - sll $5, $5, 2 - lw $6, (segmentTable)($5) - add $2, $2, $6 // physical address of state_addr - addi $1, $23, 0x0000 - sw $2, 0x40($23) // overwrite TASK_UCODE ptr - addi $3, $zero, 0x1f - srl $7, $26, 16 - andi $10, $7, A_INIT - bgtz $10, @@audio_040018dc - nop - jal dma_read_start - nop -@@dma_read_busy: - mfc0 $1, SP_DMA_BUSY - bnez $1, @@dma_read_busy - nop - j @@audio_040018e8 - mtc0 $zero, SP_SEMAPHORE -@@audio_040018dc: - sh $zero, 0x08($23) - vxor $v16, $v16, $v16 - sdv $v16[0], 0x00($23) -@@audio_040018e8: - andi $10, $7, 0x02 // A_LOOP? A_OUT? - beqz $10, @@audio_04001908 - nop - lh $11, 0x0a($23) - lqv $v3[0], 0x10($23) - sdv $v3[0], -0x10($8) - sdv $v3[8], -0x08($8) - sub $8, $8, $11 -@@audio_04001908: - addi $8, $8, -8 - lsv $v23[14], 0x08($23) // saved pitch_accumulator - ldv $v16[0], 0x00($23) // saved next 4 unprocessed samples - sdv $v16[0], 0x00($8) // store them before the input samples - mtc2 $8, $v18[4] - addi $10, $zero, 0xc0 - mtc2 $10, $v18[6] - mtc2 $26, $v18[8] // pitch - addi $10, $zero, 0x40 - mtc2 $10, $v18[10] - addi $9, $zero, data0040 - lqv $v31[0], 0x10($9) // 0x50 - lqv $v25[0], 0x00($9) // 0x40 - vsub $v25, $v25, $v31 - lqv $v30[0], 0x20($9) // 0x60 - lqv $v29[0], 0x30($9) // 0x70 - lqv $v28[0], 0x40($9) // 0x80 - lqv $v27[0], 0x50($9) // 0x90 - lqv $v26[0], 0x60($9) // 0xA0 - vsub $v25, $v25, $v31 - lqv $v24[0], 0x70($9) // 0xB0 - addi $21, $23, 0x20 - addi $20, $23, 0x30 - vxor $v22, $v22, $v22 - vmudm $v23, $v31, $v23[7] // load pitch_accumulator into every vector element - vmadm $v22, $v25, $v18[4] // (accumulate with pitch times index) >> 16 - vmadn $v23, $v31, $v30[0] // result & 0xffff - vmudn $v21, $v31, $v18[2] // load the in address into every vector element - vmadn $v21, $v22, $v30[2] // accumulate with 2 * $v22 - vmudl $v17, $v23, $v18[5] // 64 * $v23 >> 16 - vmudn $v17, $v17, $v30[4] // * 8 - vmadn $v17, $v31, $v18[3] // += 0x00c0 (resample lookup table address) - lqv $v25[0], 0x00($9) - sqv $v21[0], 0x00($21) - sqv $v17[0], 0x00($20) - ssv $v23[7], 0x08($23) - lh $17, 0x00($21) - lh $9, 0x00($20) - lh $13, 0x08($21) - lh $5, 0x08($20) - lh $16, 0x02($21) - lh $8, 0x02($20) - lh $12, 0x0a($21) - lh $4, 0x0a($20) - lh $15, 0x04($21) - lh $7, 0x04($20) - lh $11, 0x0c($21) - lh $3, 0x0c($20) - lh $14, 0x06($21) - lh $6, 0x06($20) - lh $10, 0x0e($21) - lh $2, 0x0e($20) -@@audio_040019d8: - ldv $v16[0], 0x00($17) - vmudm $v23, $v31, $v23[7] - ldv $v15[0], 0x00($9) - vmadh $v23, $v31, $v22[7] - ldv $v16[8], 0x00($13) - vmadm $v22, $v25, $v18[4] - ldv $v15[8], 0x00($5) - vmadn $v23, $v31, $v30[0] - ldv $v14[0], 0x00($16) - vmudn $v21, $v31, $v18[2] - ldv $v13[0], 0x00($8) - vmadn $v21, $v22, $v30[2] - ldv $v14[8], 0x00($12) - vmudl $v17, $v23, $v18[5] - ldv $v13[8], 0x00($4) - ldv $v12[0], 0x00($15) - ldv $v11[0], 0x00($7) - ldv $v12[8], 0x00($11) - vmudn $v17, $v17, $v30[4] - ldv $v11[8], 0x00($3) - ldv $v10[0], 0x00($14) - ldv $v9[0], 0x00($6) - vmadn $v17, $v31, $v18[3] - ldv $v10[8], 0x00($10) - vmulf $v8, $v16, $v15 - ldv $v9[8], 0x00($2) - vmulf $v7, $v14, $v13 - sqv $v21[0], 0x00($21) - vmulf $v6, $v12, $v11 - sqv $v17[0], 0x00($20) - lh $17, 0x00($21) - vmulf $v5, $v10, $v9 - lh $9, 0x00($20) - vadd $v8, $v8, $v8[1q] - lh $13, 0x08($21) - vadd $v7, $v7, $v7[1q] - lh $5, 0x08($20) - vadd $v6, $v6, $v6[1q] - lh $16, 0x02($21) - vadd $v5, $v5, $v5[1q] - lh $8, 0x02($20) - vadd $v8, $v8, $v8[2h] - lh $12, 0x0a($21) - vadd $v7, $v7, $v7[2h] - lh $4, 0x0a($20) - vadd $v6, $v6, $v6[2h] - lh $15, 0x04($21) - vadd $v5, $v5, $v5[2h] - lh $7, 0x04($20) - vmudn $v4, $v29, $v8[0h] - lh $11, 0x0c($21) - vmadn $v4, $v28, $v7[0h] - lh $3, 0x0c($20) - vmadn $v4, $v27, $v6[0h] - lh $14, 0x06($21) - vmadn $v4, $v26, $v5[0h] - lh $6, 0x06($20) - lh $10, 0x0e($21) - addi $18, $18, -0x10 - sqv $v4[0], 0x00($19) - blez $18, @@audio_04001ad8 - lh $2, 0x0e($20) - j @@audio_040019d8 - addi $19, $19, 0x0010 -@@audio_04001ad8: - ssv $v23[0], 0x08($23) - ldv $v16[0], 0x00($17) - sdv $v16[0], 0x00($23) - lh $6, (audio_in_buf)($24) - addi $17, $17, 8 - sub $5, $17, $6 - andi $4, $5, 0x000f - sub $17, $17, $4 - beqz $4, @@audio_04001b04 - addi $7, $zero, 0x10 - sub $4, $7, $4 -@@audio_04001b04: - sh $4, 0x0a($23) - ldv $v3[0], 0x00($17) - ldv $v3[8], 0x08($17) - sqv $v3[0], 0x10($23) - lw $2, 0x40($23) - addi $1, $23, 0x00 - jal dma_write_start - addi $3, $zero, 0x1f -@@dma_write_busy: - mfc0 $5, SP_DMA_BUSY - bnez $5, @@dma_write_busy - nop - j cmd_SPNOOP - mtc0 $zero, SP_SEMAPHORE - -cmd_ENVMIXER: - lui $4, 0x00ff - ori $4, $4, 0xffff - and $2, $25, $4 - srl $5, $25, 24 - sll $5, $5, 2 - lw $6, (segmentTable)($5) - add $2, $2, $6 - addi $1, $23, 0x00 - addi $3, $zero, 0x4f - vxor $v0, $v0, $v0 - addi $11, $zero, 0x40 - lqv $v31[0], 0x10($11) // all 0001 - lqv $v10[0], 0x00($zero) // element 6 is 0x7fff - srl $12, $26, 16 - andi $10, $12, A_INIT - beqz $10, @@audio_04001b84 - lqv $v24[0], 0x10($24) - j @@audio_04001bb0 - nop -@@audio_04001b84: - jal dma_read_start - nop -@@dma_read_busy: - mfc0 $5, SP_DMA_BUSY - bnez $5, @@dma_read_busy - nop - mtc0 $zero, SP_SEMAPHORE - lqv $v20[0], 0x00($23) - lqv $v21[0], 0x10($23) - lqv $v18[0], 0x20($23) - lqv $v19[0], 0x30($23) - lqv $v24[0], 0x40($23) -@@audio_04001bb0: - lh $13, (audio_in_buf)($24) - lh $19, (audio_out_buf)($24) - lh $18, (audio_aux_buf0)($24) - lh $17, (audio_aux_buf1)($24) - lh $16, (audio_aux_buf2)($24) - lh $14, (audio_count)($24) - addi $15, $zero, 0x10 - mfc2 $21, $v24[2] - mfc2 $20, $v24[8] - andi $9, $12, 0x0008 - bgtz $9, @@audio_04001bec - nop - addi $17, $23, 0x50 - add $16, $zero, $17 - addi $15, $zero, 0 -@@audio_04001bec: - beqz $10, @@audio_04001cf0 - lqv $v30[0], 0x70($11) - lqv $v17[0], 0x00($13) - lqv $v29[0], 0x00($19) - lqv $v27[0], 0x00($17) - vxor $v21, $v21, $v21 - lsv $v20[14], 0x06($24) - vmudm $v23, $v20, $v24[2] - vmadh $v22, $v20, $v24[1] - vmadn $v23, $v31, $v0[0] - vsubc $v23, $v23, $v21 - vsub $v22, $v22, $v20 - vmudl $v23, $v30, $v23[7] - vmadn $v23, $v30, $v22[7] - vmadm $v22, $v31, $v0[0] - vmadm $v21, $v31, $v21[7] - vmadh $v20, $v31, $v20[7] - bgtz $21, @@audio_04001c44 - vmadn $v21, $v31, $v0[0] - vge $v20, $v20, $v24[0] - j @@audio_04001c48 - nop -@@audio_04001c44: - vcl $v20, $v20, $v24[0] -@@audio_04001c48: - vmulf $v16, $v20, $v24[6] - vmulf $v15, $v20, $v24[7] - vmulf $v29, $v29, $v10[6] - vmacf $v29, $v17, $v16 - vmulf $v27, $v27, $v10[6] - vmacf $v27, $v17, $v15 - sqv $v29[0], 0x00($19) - sqv $v27[0], 0x00($17) - lqv $v28[0], 0x00($18) - lqv $v26[0], 0x00($16) - vxor $v19, $v19, $v19 - lsv $v18[14], 0x08($24) - vmudm $v23, $v18, $v24[5] - vmadh $v22, $v18, $v24[4] - vmadn $v23, $v31, $v0[0] - vsubc $v23, $v23, $v19 - vsub $v22, $v22, $v18 - vmudl $v23, $v30, $v23[7] - vmadn $v23, $v30, $v22[7] - vmadm $v22, $v31, $v0[0] - vmadm $v19, $v31, $v19[7] - vmadh $v18, $v31, $v18[7] - bgtz $20, @@audio_04001cb4 - vmadn $v19, $v31, $v0[0] - vge $v18, $v18, $v24[3] - j @@audio_04001cb8 - nop -@@audio_04001cb4: - vcl $v18, $v18, $v24[3] -@@audio_04001cb8: - vmulf $v16, $v18, $v24[6] - vmulf $v15, $v18, $v24[7] - vmulf $v28, $v28, $v10[6] - vmacf $v28, $v17, $v16 - vmulf $v26, $v26, $v10[6] - vmacf $v26, $v17, $v15 - sqv $v28[0], 0x00($18) - sqv $v26[0], 0x00($16) - addi $14, $14, -0x10 - addi $13, $13, 0x10 - addi $19, $19, 0x10 - addi $18, $18, 0x10 - add $17, $17, $15 - add $16, $16, $15 -@@audio_04001cf0: - vmudl $v23, $v21, $v24[2] - vmadm $v23, $v20, $v24[2] - vmadn $v23, $v21, $v24[1] - vmadh $v20, $v20, $v24[1] - vmadn $v21, $v31, $v0[0] -@@audio_04001d04: - bgtz $21, @@audio_04001d30 - lqv $v17[0], 0x00($13) - vge $v20, $v20, $v24[0] - vmudl $v23, $v19, $v24[5] - vmadm $v23, $v18, $v24[5] - vmadn $v23, $v19, $v24[4] - lqv $v29[0], 0x00($19) - vmadh $v18, $v18, $v24[4] - lqv $v27[0], 0x00($17) - j @@audio_04001d50 - vmadn $v19, $v31, $v0[0] -@@audio_04001d30: - vcl $v20, $v20, $v24[0] - vmudl $v23, $v19, $v24[5] - vmadm $v23, $v18, $v24[5] - vmadn $v23, $v19, $v24[4] - lqv $v29[0], 0x00($19) - vmadh $v18, $v18, $v24[4] - lqv $v27[0], 0x00($17) - vmadn $v19, $v31, $v0[0] -@@audio_04001d50: - vmulf $v16, $v20, $v24[6] - sqv $v20[0], 0x00($23) - vmulf $v15, $v20, $v24[7] - sqv $v21[0], 0x10($23) - vmulf $v29, $v29, $v10[6] - vmacf $v29, $v17, $v16 - lqv $v28[0], 0x00($18) - vmulf $v27, $v27, $v10[6] - lqv $v26[0], 0x00($16) - vmacf $v27, $v17, $v15 - bgtz $20, @@audio_04001da0 - sqv $v29[0], 0x00($19) - vge $v18, $v18, $v24[3] - vmudl $v23, $v21, $v24[2] - sqv $v27[0], 0x00($17) - vmadm $v23, $v20, $v24[2] - vmadn $v23, $v21, $v24[1] - vmadh $v20, $v20, $v24[1] - j @@audio_04001dbc - vmadn $v21, $v31, $v0[0] -@@audio_04001da0: - vcl $v18, $v18, $v24[3] - vmudl $v23, $v21, $v24[2] - sqv $v27[0], 0x00($17) - vmadm $v23, $v20, $v24[2] - vmadn $v23, $v21, $v24[1] - vmadh $v20, $v20, $v24[1] - vmadn $v21, $v31, $v0[0] -@@audio_04001dbc: - vmulf $v16, $v18, $v24[6] - addi $14, $14, -0x10 - vmulf $v15, $v18, $v24[7] - addi $19, $19, 0x10 - vmulf $v28, $v28, $v10[6] - add $17, $17, $15 - vmacf $v28, $v17, $v16 - addi $13, $13, 0x10 - vmulf $v26, $v26, $v10[6] - vmacf $v26, $v17, $v15 - sqv $v28[0], 0x00($18) - addi $18, $18, 0x10 - blez $14, @@audio_04001dfc - sqv $v26[0], 0x00($16) - j @@audio_04001d04 - add $16, $16, $15 -@@audio_04001dfc: - sqv $v18[0], 0x20($23) - sqv $v19[0], 0x30($23) - sqv $v24[0], 0x40($23) - jal dma_write_start - addi $3, $zero, 0x004f -@@dma_write_busy: - mfc0 $5, SP_DMA_BUSY - bnez $5, @@dma_write_busy - nop - j cmd_SPNOOP - mtc0 $zero, SP_SEMAPHORE - -cmd_MIXER: - lqv $v31[0], 0x00($zero) // element 6 is 0x7fff - lhu $18, (audio_count)($24) - beqz $18, @@cmd_mixer_done // skip operation when count is 0 - nop - andi $19, $25, 0xffff - addi $19, $19, dmemBase // dmemout + DMEM_BASE - srl $20, $25, 16 - addi $20, $20, dmemBase // dmemin + DMEM_BASE - andi $17, $26, 0xffff - mtc2 $17, $v30[0] - lqv $v27[0], 0x00($19) - lqv $v29[0], 0x00($20) - lqv $v26[0], 0x10($19) - lqv $v28[0], 0x10($20) -@@audio_04001e5c: - vmulf $v27, $v27, $v31[6] - addi $18, $18, -0x20 - vmacf $v27, $v29, $v30[0] - addi $20, $20, 0x20 - sqv $v27[0], 0x00($19) - vmulf $v26, $v26, $v31[6] - lqv $v29[0], 0x00($20) - vmacf $v26, $v28, $v30[0] - lqv $v28[0], 0x10($20) - sqv $v26[0], 0x10($19) - addi $19, $19, 0x20 - lqv $v27[0], 0x00($19) - bgtz $18, @@audio_04001e5c - lqv $v26[0], 0x10($19) -@@cmd_mixer_done: - j cmd_SPNOOP - nop - nop - -.close // CODE_FILE diff --git a/rsp/fast3d.s b/rsp/fast3d.s deleted file mode 100644 index e44432b6..00000000 --- a/rsp/fast3d.s +++ /dev/null @@ -1,1766 +0,0 @@ -.rsp - -.include "rsp/rsp_defs.inc" -.include "rsp/gbi.inc" - -// This file assumes DATA_FILE and CODE_FILE are set on the command line - -.if version() < 110 - .error "armips 0.11 or newer is required" -.endif - -// Overlay table data member offsets -overlay_load equ 0x0000 -overlay_len equ 0x0004 -overlay_imem equ 0x0006 -.macro OverlayEntry, loadStart, loadEnd, imemAddr - .dw loadStart - .dh (loadEnd - loadStart - 1) & 0xFFFF - .dh (imemAddr) & 0xFFFF -.endmacro - -.macro jumpTableEntry, addr - .dh addr & 0xFFFF -.endmacro - -// RSP DMEM -.create DATA_FILE, 0x0000 - -// 0x0000-0x0027: Overlay Table -overlayInfo0: - OverlayEntry orga(Overlay0Address), orga(Overlay0End), Overlay0Address -overlayInfo1: - OverlayEntry orga(Overlay1Address), orga(Overlay1End), Overlay1Address -overlayInfo2: - OverlayEntry orga(Overlay2Address), orga(Overlay2End), Overlay2Address -overlayInfo3: - OverlayEntry orga(Overlay3Address), orga(Overlay3End), Overlay3Address -overlayInfo4: - OverlayEntry orga(Overlay4Address), orga(Overlay4End), Overlay4Address - -// 0x0028-0x009F: ?? -.dw 0x0FFAF006 -.dw 0x7FFF0000 -.dw 0x00000001 -.dw 0x0002FFFF -.dw 0x40000004 -.dw 0x06330200 -.dw 0x7FFFFFF8 -.dw 0x00080040 -.dw 0x00208000 -.dw 0x01CCCCCC -.dw 0x0001FFFF -.dw 0x00010001 -.dw 0x0001FFFF -.dw 0x00010001 -.dw 0x00020002 -.dw 0x00020002 - -// 0x0068 -.dw 0x00020002 -.dw 0x00020002 - -data0070: -.dw 0x00010000 - -// 0x0074 -.dh 0x0000 -// 0x0076 -.dh 0x0001 - -// 0x0078 -.dw 0x00000001 -.dw 0x00000001 -.dw 0x00010000 -.dw 0x0000FFFF -.dw 0x00000001 -.dw 0x0000FFFF -.dw 0x00000000 -.dw 0x0001FFFF -.dw 0x00000000 -.dw 0x00010001 - -// 0x00A0-0x00A1 -lightEntry: - jumpTableEntry load_lighting - -// 0x00A2-0x00A3: ?? -.dh 0x7FFF - -// 0x00A4-0x00B3: ?? -.dw 0x571D3A0C -.dw 0x00010002 -.dw 0x01000200 -.dw 0x40000040 - -// 0x00B4 -.dh 0x0000 - -// 0x00B6-0x00B7 -taskDoneEntry: - jumpTableEntry overlay_4_entry - -// 0x00B8 -lower24Mask: -.dw 0x00FFFFFF - -// 0x00BC: Operation Types -operationJumpTable: - jumpTableEntry dispatch_dma // cmds 0x00-0x3f -spNoopEntry: - jumpTableEntry SP_NOOP // cmds 0x40-0x7f - jumpTableEntry dispatch_imm // cmds 0x80-0xbf - jumpTableEntry dispatch_rdp // cmds 0xc0-0xff - -// 0x00C4: DMA operations -dmaJumpTable: - jumpTableEntry SP_NOOP // 0x00 - jumpTableEntry dma_MTX // 0x01 - jumpTableEntry SP_NOOP // 0x02 - jumpTableEntry dma_MOVEMEM // 0x03 - jumpTableEntry dma_VTX // 0x04 - jumpTableEntry SP_NOOP // 0x05 - jumpTableEntry dma_DL // 0x06 - jumpTableEntry SP_NOOP // 0x07 - jumpTableEntry SP_NOOP // 0x08 - jumpTableEntry SP_NOOP // 0x09 - -// 0x00D8: Immediate operations -immediateJumpTableBase equ (immediateJumpTable - ((0xB2 << 1) & 0xFE)) -.ifdef F3D_OLD - jumpTableEntry imm_UNKNOWN -.endif -immediateJumpTable: - jumpTableEntry imm_RDPHALF_CONT // 0xB2 - jumpTableEntry imm_RDPHALF_2 // 0xB3 - jumpTableEntry imm_RDPHALF_1 // 0xB4 - jumpTableEntry SP_NOOP // 0xB5? - jumpTableEntry imm_CLEARGEOMETRYMODE // 0xB6 - jumpTableEntry imm_SETGEOMETRYMODE // 0xB7 - jumpTableEntry imm_ENDDL // 0xB8 - jumpTableEntry imm_SETOTHERMODE_L // 0xB9 - jumpTableEntry imm_SETOTHERMODE_H // 0xBA - jumpTableEntry imm_TEXTURE // 0xBB - jumpTableEntry imm_MOVEWORD // 0xBC - jumpTableEntry imm_POPMTX // 0xBD - jumpTableEntry imm_CULLDL // 0xBE - jumpTableEntry imm_TRI1 // 0xBF - -// 0x00F6: Label constants -labelLUT: - jumpTableEntry found_in -foundOutEntry: - jumpTableEntry found_out - jumpTableEntry found_first_in - jumpTableEntry found_first_out -clipDrawEntry: - jumpTableEntry clip_draw_loop -performClipEntry: - jumpTableEntry perform_clip -nextClipEntry: - jumpTableEntry next_clip -DMAWaitEntry: - jumpTableEntry dma_wait_dl - -// 0x0106: ?? -data0106: -.dh 0x0000 - -.ifdef F3D_NEW -.dh 0x0000 -.endif - -// 0x0108: DRAM pointer -dramPtr: -.dw 0x00000000 -.dh 0x0000 // 0x10C: RDPHALF_2 - -.dh 0x0000 - -// 0x110: display list stack size -displayListStackSize: -.dh 0x0000 -.dh 0xFFFF // 0x112: RDPHALF_1 - -.dw 0x00000000 // 0x114: geometrymode (bit 1 is texture ON) -.dw 0xEF080CFF // 0x118: othermode -.dw 0x00000000 -.dw 0x00000000 // 0x120: texture max mipmap levels, tile descriptor enable/disable -.dh 0x0000 // 0x124: texture scaling factor S axis (horizontal) U16 fraction -.dh 0x0000 // 0x126: texture scaling factor T axis (vertical) -.dw 0x00000000 // 0x128: some dpc dma address state - -numLights: -.dw 0x80000040 // 0x12c: num lights, bit 31 = needs init, bits 11:0 = (num_lights+1)*32 -.dw 0x00000000 // 0x130: dram stack pointer 1 -.dw 0x00000000 // 0x134: dram stack pointer modelview matrices - -data0138: -.dw 0x40004000 // 0x138: txtatt (unused?) - -.dw 0x00000000 -.dw 0x00000000 -.dw 0x00000000 -.dw 0x00000000 -.dw 0x00000000 - -.dw 0x00000000 // 0x150: output buffer - -.dw 0x00000000 // 0x154: output buffer size - -data0158: -.dh 0x0000 // 0x158: ?? -.dh 0x0000 -.dw 0x00000000 // 0x15c: dram stack end? - -// 0x160-0x19f: RSP memory segment table -segmentTable: -.fill 0x40, 0 - -// 0x1a0: Lights -.dw 0x80000000 -.dw 0x80000000 -.dw 0x00000000 -.dw 0x00000000 - -lookAtY: // 0x1b0: lookaty -.dw 0x00800000, 0x00800000, 0x7F000000, 0x00000000 -.dw 0x00000000, 0x00000000, 0x00000000, 0x00000000 - -lookAtX: // 0x1d0: lookatx -.dw 0x00000000, 0x00000000, 0x007F0000, 0x00000000 -.dw 0x00000000, 0x00000000, 0x00000000, 0x00000000 - -// 0x1f0: L0..L7 light info (32 bytes each) -lightInfo0: // 0x1f0 -.dw 0x00000000, 0x00000000, 0x00000000, 0x00000000 -.dw 0x00000000, 0x00000000, 0xE0011FFF, 0x00040000 - -lightInfo1: // 0x210 -.dw 0xFF000000, 0xFF000000, 0x00000000, 0x00000000 -.dw 0x00000000, 0x00000000, 0x00000000, 0x00000000 - -lightInfo2: // 0x230 -.dw 0x00000000, 0x00000000, 0x00000000, 0x00000000 -.dw 0x00000000, 0x00000000, 0x00000000, 0x00000000 - -lightInfo3: // 0x250 -.dw 0x00000000, 0x00000000, 0x00000000, 0x00000000 -.dw 0x00000000, 0x00000000, 0x00000000, 0x00000000 - -lightInfo4: // 0x270 - -// L4-L7 overlap with version string -.definelabel lightInfo5, lightInfo4 + 0x20 // 0x290 -.definelabel lightInfo6, lightInfo5 + 0x20 // 0x2b0 -.definelabel lightInfo7, lightInfo6 + 0x20 // 0x2d0 - -.if defined(F3D_OLD) || defined(VERSION_EU) - .asciiz "RSP SW Version: 2.0D, 04-01-96" -.elseif defined(F3D_NEW) - .asciiz "RSP SW Version: 2.0H, 02-12-97" -.endif -.asciiz "SGI U64 GFX SW TEAM: S Anderson, S Carr, H Cheng, K Luster, R Moore, N Pooley, A Srinivasan", 0x0A - -.dw 0x00000000 - -// 0x2f0-0x31f: DMEM table -dmemTableOffset equ (dmemTable - 0x80) -dmemTable: - .dh viewport, lookAtY, lookAtX, lightInfo0, lightInfo1, lightInfo2, lightInfo3, lightInfo4 - .dh lightInfo5, lightInfo6, lightInfo7, data0138, mpMatrix+0x10, mpMatrix+0x20, mpMatrix+0x30, mpMatrix - .dh numLights, data0070, segmentTable, fogFactors, lightInfo0, pointsBuffer -.ifdef F3D_NEW - .dh displayListStackSize, 0x0000 -.else - .dh 0x0000, 0x0000 -.endif - -// 0x320: Viewport (0x010 bytes) -viewport: -.dw 0x00000000, 0x00000000, 0x00000000, 0x00000000 - -// 0x330: fog factors (three 16-bit integers: mul, add, min) -fogFactors: -.dh 0x0100, 0x0000, 0x00FF - -// 0x336: display list stack (return addresses) -displayListStack: // this is not 4-byte aligned -.fill 0x2a, 0 - -// 0x360-0x39f: Modelview matrix top of stack (0x40 bytes) -modelViewMatrixStack: -.fill 0x40, 0 - -// 0x3a0-0x3df Projection Matrix top of stack (0x40 bytes) -projectionMatrixStack: -.fill 0x40, 0 - -// 0x3e0-0x41f: MP matrix (Modelview * Projection) -mpMatrix: -.fill 0x40, 0 - -// 0x420: Points buffer (0x280 bytes) -pointsBuffer: -.fill 0x280, 0 - -// 0x6a0-0x7df: input display list buffer -inputDisplayList: -.fill 0x140, 0 - -// 0x7E0-0x7ff: input data -inputData: -.fill (0x800 - 0x7E0), 0 - -.close // DATA_FILE - -// uninitialized variables -.definelabel setupTemp, 0x08E0 -.definelabel data08e4, 0x08E4 -.definelabel data08e8, 0x08E8 -.definelabel data08ec, 0x08EC -.definelabel data08f0, 0x08F0 -.definelabel clipTemp, 0x0940 -.definelabel data0942, 0x0942 -.definelabel data0944, 0x0944 -.definelabel data0946, 0x0946 -.definelabel rdpOutput, 0x09E0 -.definelabel scratchSpace, 0x0DE0 -.definelabel data0DE4, 0x0DE4 -.definelabel data0DE8, 0x0DE8 - -.create CODE_FILE, 0x04001080 - -// Overlay 0 -Overlay0Address: - j f3d_04001780 - addi $29, $zero, displayListStackSize - jal segmented_to_physical - add $19, $24, $zero - add $20, $zero, $22 - jal dma_read_write - addi $17, $zero, 0x00 - -// $1 = most significant 2 bits of cmd byte << 1 -// $25 = first command word -dispatch_task: - lh $2, (operationJumpTable)($1) - jr $2 - srl $2, $25, 23 // $2 = MSbyte << 1 - -SP_NOOP: - mfc0 $2, SP_STATUS - andi $2, $2, 0x0080 - bne $2, $zero, f3d_040010cc - lh $21, 0x26($zero) -f3d_040010b8: - bgtz $28, read_next_task_entry - nop - j load_display_list_dma - lh $ra, DMAWaitEntry -f3d_040010c8: - lh $21, taskDoneEntry -f3d_040010cc: - j load_overlay - ori $30, $zero, overlayInfo4 - -load_display_list_dma: - addi $28, $zero, 0x0140 // size of display list - add $21, $zero, $ra - addi $20, $zero, inputDisplayList - add $19, $zero, $26 // TASK_DATA_PTR - addi $18, $zero, 0x013f - jal dma_read_write - addi $17, $zero, 0x00 - jr $21 - addi $27, $zero, inputDisplayList // initial pointer - -// load overlay into IMEM -// $30 = offset into overlay table -// $21 = return address -load_overlay_fcn: - add $21, $zero, $ra -load_overlay: - lw $19, overlay_load($30) - lh $18, overlay_len($30) - lh $20, overlay_imem($30) - jal dma_read_write - addi $17, $zero, 0x00 - jal wait_while_dma_busy - nop - jr $21 - -segmented_to_physical: - lw $11, lower24Mask - srl $12, $19, 22 - andi $12, $12, 0x3c - and $19, $19, $11 - add $13, $zero, $12 - lw $12, 0x0160($13) - jr $ra - add $19, $19, $12 - -// $20 = SP_MEM address -// $19 = DRAM address -// $18 = length - 1 -// $17 = 1:write, 0:read -dma_read_write: -@@dma_full: - mfc0 $11, SP_DMA_FULL - bne $11, $zero, @@dma_full - nop - mtc0 $20, SP_MEM_ADDR - bgtz $17, @@dma_write - mtc0 $19, SP_DRAM_ADDR - jr $ra - mtc0 $18, SP_RD_LEN -@@dma_write: - jr $ra - mtc0 $18, SP_WR_LEN - -wait_while_dma_busy: - mfc0 $11, SP_DMA_BUSY - bne $11, $zero, wait_while_dma_busy - nop - jr $ra - nop - -f3d_04001178: // sends stuff to RDP - add $21, $zero, $ra - lw $19, 0x18($29) - addi $18, $23, -0x09e0 - lw $23, 0x44($29) - blez $18, f3d_040011f4 - add $20, $19, $18 - sub $20, $23, $20 - bgez $20, f3d_040011b8 -f3d_04001198: - mfc0 $20, DPC_STATUS - andi $20, $20, DPC_STATUS_START_VALID - bne $20, $zero, f3d_04001198 -f3d_040011a4: - mfc0 $23, DPC_CURRENT - lw $19, 0x40($29) - beq $23, $19, f3d_040011a4 - nop - mtc0 $19, DPC_START -f3d_040011b8: - mfc0 $23, DPC_CURRENT - sub $20, $19, $23 - bgez $20, f3d_040011d4 - add $20, $19, $18 - sub $20, $20, $23 - bgez $20, f3d_040011b8 - nop -f3d_040011d4: - add $23, $19, $18 - addi $18, $18, -0x01 - addi $20, $zero, rdpOutput // output to RDP - jal dma_read_write - addi $17, $zero, 0x01 - jal wait_while_dma_busy - sw $23, 0x18($29) - mtc0 $23, DPC_END -f3d_040011f4: - jr $21 - addi $23, $zero, rdpOutput - -// codes 0x80-0xBF -// $2 = immediate cmd byte << 1 -dispatch_imm: - andi $2, $2, 0x00fe - lh $2, (immediateJumpTableBase)($2) // data IMM offset - jr $2 - lbu $1, -0x01($27) - -imm_TRI1: - lbu $5, -0x04($27) - lbu $1, -0x03($27) - lbu $2, -0x02($27) - lbu $3, -0x01($27) - sll $5, $5, 2 - sll $1, $1, 2 - sll $2, $2, 2 - sll $3, $3, 2 - addi $1, $1, pointsBuffer - addi $2, $2, pointsBuffer - addi $3, $3, pointsBuffer - sw $1, scratchSpace - sw $2, data0DE4 - sw $3, data0DE8 - lw $4, (scratchSpace)($5) - j f3d_04001998 - lh $30, spNoopEntry - -imm_POPMTX: -.ifdef F3D_NEW - sbv $v31[6], 0x1c($29) -.endif - lw $19, 0x24($29) - lw $3, 0x4c($29) - addi $20, $zero, modelViewMatrixStack - addi $18, $zero, 0x3f - sub $3, $3, $19 - addi $3, $3, -0x0280 - bgez $3, SP_NOOP // stop if stack is empty - addi $19, $19, -0x40 - jal dma_read_write // read new top from DRAM - addi $17, $zero, 0x00 - jal wait_while_dma_busy - addi $3, $zero, mpMatrix // MP matrix (modelview * projection) - j f3d_04001444 // recompute MP matrix - sw $19, 0x24($29) - -imm_MOVEWORD: - lbu $1, -0x05($27) - lhu $2, -0x07($27) - lh $5, 0x030e($1) - add $5, $5, $2 - j SP_NOOP - sw $24, 0x00($5) - -imm_TEXTURE: - sw $25, 0x10($29) - sw $24, 0x14($29) - lh $2, 0x06($29) - andi $2, $2, 0xfffd - andi $3, $25, 0x0001 - sll $3, $3, 1 - or $2, $2, $3 - j SP_NOOP - sh $2, 0x06($29) - -imm_SETOTHERMODE_H: - j @f3d_040012d0 - addi $7, $29, 8 -imm_SETOTHERMODE_L: - addi $7, $29, 0x0c -@f3d_040012d0: - lw $3, 0x00($7) - addi $8, $zero, -1 - lbu $5, -0x05($27) - lbu $6, -0x06($27) - addi $2, $zero, 1 - sllv $2, $2, $5 - addi $2, $2, -1 - sllv $2, $2, $6 - xor $2, $2, $8 - and $2, $2, $3 - or $3, $2, $24 - sw $3, 0x00($7) - lw $25, 0x08($29) - j f3d_040013a8 - lw $24, 0x0c($29) - -imm_CULLDL: - andi $25, $25, 0x03ff -.ifdef F3D_OLD - ori $2, $zero, 0xffff -.else - ori $2, $zero, 0x7070 -.endif -@@f3d_04001314: - lh $3, 0x0444($25) - addi $25, $25, 0x28 - bne $25, $24, @@f3d_04001314 - and $2, $2, $3 - beq $2, $zero, SP_NOOP - -DL_STACK_SIZE_OFFSET equ (defined(F3D_OLD) ? 0x00 : 0x4A) - -imm_ENDDL: - lb $2, (DL_STACK_SIZE_OFFSET)($29) - addi $2, $2, -4 - bltz $2, f3d_040010c8 - addi $3, $2, displayListStack - lw $26, 0x00($3) - sb $2, (DL_STACK_SIZE_OFFSET)($29) - j SP_NOOP - addi $28, $zero, 0 - -imm_SETGEOMETRYMODE: - lw $2, 0x04($29) - or $2, $2, $24 - j SP_NOOP - sw $2, 0x04($29) - -imm_CLEARGEOMETRYMODE: - lw $2, 0x04($29) - addi $3, $zero, -1 - xor $3, $3, $24 - and $2, $2, $3 - j SP_NOOP - sw $2, 0x04($29) - -.ifdef F3D_OLD -imm_RDPHALF_1: - j SP_NOOP - sh $24, 0x02($29) -imm_RDPHALF_2: -.else -imm_RDPHALF_1: -.endif - j f3d_040010b8 - sw $24, -0x04($29) - -.ifdef F3D_OLD -imm_UNKNOWN: -.else -imm_RDPHALF_CONT: -.endif - ori $2, $zero, 0x0000 -.ifdef F3D_OLD -imm_RDPHALF_CONT: -.else -imm_RDPHALF_2: -.endif - j f3d_040013a8 - lw $25, -0x04($29) - -// codes 0xC0-0xFF -dispatch_rdp: - sra $2, $25, 24 - addi $2, $2, 3 - bltz $2, f3d_040013a8 - addi $2, $2, 0x18 - jal segmented_to_physical - add $19, $24, $zero - add $24, $19, $zero -f3d_040013a8: - sw $25, 0x00($23) - sw $24, 0x04($23) - jal f3d_04001178 - addi $23, $23, 0x08 - bgtz $2, SP_NOOP - nop - j f3d_040010b8 - -dispatch_dma: - andi $2, $2, 0x01fe - lh $2, (dmaJumpTable)($2) - jal wait_while_dma_busy - lbu $1, -0x07($27) - jr $2 - andi $6, $1, 0x000f - -dma_MTX: - sbv $v31[6], 0x1c($29) // lights need re-init - andi $8, $1, 0x0001 // 1=projection, 0=modelview - bne $8, $zero, f3d_04001454 - andi $7, $1, 0x0002 // 1=load, 0=multiply - addi $20, $zero, modelViewMatrixStack - andi $8, $1, 0x0004 // 1=push, 0=no push - beq $8, $zero, f3d_04001420 - lqv $v26[0], 0x30($22) - lw $19, 0x24($29) // DRAM stack pointer 2 - lw $8, 0x4c($29) // DRAM stack end - addi $17, $zero, 1 - addi $1, $19, 0x40 - beq $19, $8, f3d_04001420 - addi $12, $zero, 0x3f // BUG: wrong register, should be $18 - jal dma_read_write - sw $1, 0x24($29) - jal wait_while_dma_busy -f3d_04001420: - lqv $v28[0], 0x10($22) - beq $7, $zero, f3d_04001460 - lqv $v27[0], 0x20($22) - sqv $v26[0], 0x30($20) - lqv $v29[0], 0x00($22) - sqv $v28[0], 0x10($20) -f3d_04001438: - addi $3, $zero, mpMatrix - sqv $v27[0], 0x20($20) - sqv $v29[0], 0x00($20) -f3d_04001444: - addi $1, $zero, modelViewMatrixStack - addi $2, $zero, projectionMatrixStack - j f3d_04001484 - lh $ra, spNoopEntry -f3d_04001454: - lqv $v26[0], 0x30($22) - j f3d_04001420 - addi $20, $zero, projectionMatrixStack -f3d_04001460: - addiu $3, $zero, scratchSpace - addu $1, $zero, $22 // input matrix from user - jal f3d_04001484 - addu $2, $zero, $20 // current P matrix or M top - sqv $v6[0], 0x30($20) // store result to P or M - sqv $v5[0], 0x10($20) - lqv $v27[0], 0x00($3) - j f3d_04001438 - lqv $v29[0], -0x20($3) -f3d_04001484: - addi $19, $3, 0x10 -f3d_04001488: - vmudh $v5, $v31, $v31[0] // clear accumulator and $v5 - addi $18, $1, 8 -f3d_04001490: - ldv $v3[0], 0x00($2) - ldv $v4[0], 0x20($2) - lqv $v1[0], 0x00($1) - lqv $v2[0], 0x20($1) - ldv $v3[8], 0x00($2) - ldv $v4[8], 0x20($2) - vmadl $v6, $v4, $v2[0h] - addi $1, $1, 2 - vmadm $v6, $v3, $v2[0h] - addi $2, $2, 8 - vmadn $v6, $v4, $v1[0h] - vmadh $v5, $v3, $v1[0h] - bne $1, $18, f3d_04001490 - vmadn $v6, $v31, $v31[0] - addi $2, $2, -0x20 - addi $1, $1, 8 - sqv $v5[0], 0x00($3) - sqv $v6[0], 0x20($3) - bne $3, $19, f3d_04001488 - addi $3, $3, 0x10 - jr $ra - nop -f3d_040014e8: - addi $8, $zero, viewport - lqv $v3[0], 0x50($zero) - lsv $v19[0], 0x02($29) // RDPHALF_1, contains persp normalize - lh $3, 0x04($29) // geometrymode - ldv $v0[0], 0x00($8) // viewport scale - ldv $v1[0], 0x08($8) // viewport translate - ldv $v0[8], 0x00($8) - ldv $v1[8], 0x08($8) - jr $ra - vmudh $v0, $v0, $v3 // negate Y? - -load_mp_matrix: - addi $8, $zero, mpMatrix - ldv $v11[0], 0x18($8) // load into $v8-v15, dup lower half and higher half - ldv $v11[8], 0x18($8) // $v8-v11 integer parts, $v12-v15 frac parts - ldv $v15[0], 0x38($8) - ldv $v15[8], 0x38($8) -f3d_04001524: - ldv $v8[0], 0x00($8) - ldv $v9[0], 0x08($8) - ldv $v10[0], 0x10($8) - ldv $v12[0], 0x20($8) - ldv $v13[0], 0x28($8) - ldv $v14[0], 0x30($8) - ldv $v8[8], 0x00($8) - ldv $v9[8], 0x08($8) - ldv $v10[8], 0x10($8) - ldv $v12[8], 0x20($8) - ldv $v13[8], 0x28($8) - jr $ra - ldv $v14[8], 0x30($8) - -dma_MOVEMEM: - lqv $v0[0], 0x00($22) - lh $5, (dmemTableOffset)($1) - j SP_NOOP - sqv $v0[0], 0x00($5) - -dma_VTX: - lh $8, spNoopEntry - sh $8, data0106 - srl $1, $1, 4 - addi $5, $1, 1 // num vertex - addi $9, $5, 0 - ldv $v2[0], 0x00($22) // input data - ldv $v2[8], 0x10($22) // load 2nd vertex (assuming it exists) - addi $7, $zero, pointsBuffer - sll $8, $6, 5 // dest index - sll $6, $6, 3 - add $8, $6, $8 // 40 bytes per vertex - jal f3d_040014e8 - add $7, $7, $8 - llv $v17[0], 0x14($29) // texture scaling - jal load_mp_matrix - llv $v17[8], 0x14($29) -@f3d_040015a8: - vmudn $v28, $v12, $v2[0h] // x * first row frac - llv $v18[0], 0x08($22) - vmadh $v28, $v8, $v2[0h] // x * first row int - lw $15, 0x0c($22) // XR, YG, ZB, AA - vmadn $v28, $v13, $v2[1h] // y * second row frac - lw $16, 0x1c($22) - vmadh $v28, $v9, $v2[1h] // y * second row int - andi $1, $3, G_LIGHTING_H - vmadn $v28, $v14, $v2[2h] // z * third row frac - vmadh $v28, $v10, $v2[2h] // z * third row int - vmadn $v28, $v15, $v31[1] // 1 * fourth row frac - llv $v18[8], 0x18($22) - vmadh $v29, $v11, $v31[1] // 1 * fourth row int - bne $1, $zero, load_lighting - addi $22, $22, 0x20 // next 2 vertices -@f3d_040015e4: - vmudm $v18, $v18, $v17 // U *= S scale, V *= T scale (result >> 16) -@f3d_040015e8: - lsv $v21[0], 0x76($zero) - vmudn $v20, $v28, $v21[0] - vmadh $v21, $v29, $v21[0] - vch $v3, $v29, $v29[3h] // do trivial clip rejection - vcl $v3, $v28, $v28[3h] // by comparing xyz with w - cfc2 $13, vcc - vch $v3, $v29, $v21[3h] - vcl $v3, $v28, $v20[3h] - andi $8, $13, 0x0707 // filter out xyz clip result for 1st vertex - andi $13, $13, 0x7070 // filter out xyz clip result for 2nd vertex - sll $8, $8, 4 - sll $13, $13, 16 - or $13, $13, $8 - cfc2 $14, vcc - andi $8, $14, 0x0707 - vadd $v21, $v29, $v31[0] - andi $14, $14, 0x7070 - vadd $v20, $v28, $v31[0] - sll $14, $14, 12 - vmudl $v28, $v28, $v19[0] // persp normalize, used to improve precision - or $8, $8, $14 - vmadm $v29, $v29, $v19[0] - or $8, $8, $13 - vmadn $v28, $v31, $v31[0] - sh $8, 0x24($7) - jal f3d_04001000 // compute 1/w - lh $13, -0x1a($22) // $13 unused? - vge $v6, $v27, $v31[0] // 1/w >= 0? - sdv $v21[0], 0x00($7) // store xyzw int - vmrg $v6, $v27, $v30[0] - sdv $v20[0], 0x08($7) // store xyzw frac - vmudl $v5, $v20, $v26[3h] // mul xyzw with 1/w - vmadm $v5, $v21, $v26[3h] - vmadn $v5, $v20, $v6[3h] - vmadh $v4, $v21, $v6[3h] - addi $9, $9, -1 // decrement vertex input count - vmudl $v5, $v5, $v19[0] // take away persp normalize factor - vmadm $v4, $v4, $v19[0] - vmadn $v5, $v31, $v31[0] - andi $12, $3, G_FOG_H - ldv $v2[0], 0x00($22) // pre-load next vertices from input - vmudh $v7, $v1, $v31[1] // viewport translate * 0001 - ldv $v2[8], 0x10($22) - vmadn $v7, $v5, $v0 // viewport scale - ldv $v29[0], 0x28($zero) - vmadh $v6, $v4, $v0 - ldv $v29[8], 0x28($zero) - vmadn $v7, $v31, $v31[0] // $v6$v7 contains vertex results after viewport - vge $v6, $v6, $v29[1q] // some saturating 0FFA-F006 - sw $15, 0x10($7) - beq $12, $zero, @@f3d_040016e0 // skip fog? - vlt $v6, $v6, $v29[0q] - lqv $v3[0], 0x0330($zero) - vmudn $v5, $v5, $v3[0] // mul fog factor (default 1) - vmadh $v4, $v4, $v3[0] - vadd $v4, $v4, $v3[1] // add parameter (default 0) - vge $v4, $v4, $v31[0] - vlt $v4, $v4, $v3[2] // min parameter (default 0xff) - sbv $v4[5], 0x13($7) // high z for 1st vertex, store in AA - sw $16, 0x18($7) - sbv $v4[13], 0x1b($7) // high z for 2nd vertex, store in AA - lw $16, 0x18($7) -@@f3d_040016e0: - slv $v18[0], 0x14($7) // texture coordinates, 1st vertex - sdv $v6[0], 0x18($7) // xyz_int after viewport - ssv $v7[4], 0x1e($7) // z_frac after viewport - ssv $v27[6], 0x20($7) // 1/w - ssv $v26[6], 0x22($7) - blez $9, @@f3d_04001728 - addi $9, $9, -1 // decrement vertex input counter again - sdv $v21[8], 0x28($7) - sdv $v20[8], 0x30($7) - slv $v18[8], 0x3c($7) // texture coordinates, 2nd vertex - sw $16, 0x38($7) - sdv $v6[8], 0x40($7) - ssv $v7[12], 0x46($7) - ssv $v27[14], 0x48($7) - ssv $v26[14], 0x4a($7) - sw $8, 0x4c($7) // puts high hword first - addi $7, $7, 0x50 - bgtz $9, @f3d_040015a8 -@@f3d_04001728: - lh $8, data0106 - jr $8 - nop - -dma_DL: - bgtz $1, @@f3d_04001754 // 0=store ret addr, 1=end DL after branch - lb $2, (DL_STACK_SIZE_OFFSET)($29) - addi $4, $2, -0x24 // DL stack full? - bgtz $4, SP_NOOP - addi $3, $2, displayListStack - addi $2, $2, 4 - sw $26, 0x00($3) // store return address on DL stack - sb $2, (DL_STACK_SIZE_OFFSET)($29) -@@f3d_04001754: - jal segmented_to_physical - add $19, $24, $zero - add $26, $19, $zero - j SP_NOOP - addi $28, $zero, 0x00 - -// Overlays 2-4 will overwrite the following code -.org 0x04001768 -f3d_04001768: - ori $30, $zero, overlayInfo2 - b load_overlay - lh $21, performClipEntry - -load_lighting: - ori $30, $zero, overlayInfo3 - b load_overlay - lh $21, lightEntry - -f3d_04001780: - ori $2, $zero, 0x2800 // clear yielded, clear taskdone - mtc0 $2, SP_STATUS - lqv $v31[0], 0x30($zero) - lqv $v30[0], 0x40($zero) - lw $4, OSTask_addr + OSTask_flags - andi $4, $4, 0x0001 - bne $4, $zero, @@f3d_04001870 - nop - lw $23, 0x28($1) // task output buff - lw $3, 0x2c($1) // task output buff size - sw $23, 0x40($29) - sw $3, 0x44($29) - mfc0 $4, DPC_STATUS - andi $4, $4, DPC_STATUS_XBUS_DMA - bne $4, $zero, @@f3d_040017e4 - mfc0 $4, DPC_END - sub $23, $23, $4 - bgtz $23, @@f3d_040017e4 - mfc0 $5, DPC_CURRENT - beq $5, $zero, @@f3d_040017e4 - nop - beq $5, $4, @@f3d_040017e4 - nop - j @@f3d_04001800 - ori $3, $4, 0x0000 -@@f3d_040017e4: - mfc0 $4, DPC_STATUS - andi $4, $4, DPC_STATUS_START_VALID - bne $4, $zero, @@f3d_040017e4 - addi $4, $zero, DPC_STATUS_CLR_XBUS - mtc0 $4, DPC_STATUS - mtc0 $3, DPC_START - mtc0 $3, DPC_END -@@f3d_04001800: - sw $3, 0x18($29) - addi $23, $zero, rdpOutput - lw $5, 0x10($1) // TASK_UCODE (DRAM address) - lw $2, overlayInfo1 - lw $3, overlayInfo2 - lw $4, overlayInfo3 - lw $6, overlayInfo4 - add $2, $2, $5 // apply DRAM offset - add $3, $3, $5 - add $4, $4, $5 - add $6, $6, $5 - sw $2, overlayInfo1 // store back with DRAM offsets - sw $3, overlayInfo2 - sw $4, overlayInfo3 - sw $6, overlayInfo4 - jal load_overlay_fcn - addi $30, $zero, overlayInfo1 - jal load_display_list_dma - lw $26, 0x30($1) // TASK_DATA_PTR - lw $2, 0x20($1) // TASK_DRAM_STACK - sw $2, 0x20($29) - sw $2, 0x24($29) - addi $2, $2, 0x0280 // end of stack? - sw $2, 0x4c($29) - lw $2, -0x08($zero) // TASK_YIELD_DATA_PTR - sw $2, dramPtr - j dma_wait_dl - nop -@@f3d_04001870: - jal load_overlay_fcn - addi $30, $zero, overlayInfo1 - lw $23, data08F0 - lw $28, data08E4 - lw $27, data08E8 - j SP_NOOP - lw $26, data08EC - -// 0x0400188c-0x04001987: bunch of nops -.fill 0xfc, 0 -.ifdef F3D_OLD - .fill 16, 0 -.endif - -// from G_TRI1 -f3d_04001998: - lh $11, 0x24($3) - lh $8, 0x24($2) - lh $9, 0x24($1) - and $12, $11, $8 - or $11, $11, $8 - and $12, $12, $9 - andi $12, $12, 0x7070 - bne $12, $zero, SP_NOOP // all vertices outside screen, return - or $11, $11, $9 - andi $11, $11, 0x4343 - bne $11, $zero, f3d_04001768 // halfway outside, so trigger clipping routine -f3d_040019c4: - llv $v13[0], 0x18($1) // xy_int after viewport - llv $v14[0], 0x18($2) - llv $v15[0], 0x18($3) - lw $13, 0x04($29) // geometrymode - addi $8, $zero, setupTemp // setup temp area - lsv $v21[0], 0x02($29) - lsv $v5[0], 0x06($1) // w_int p1 - vsub $v10, $v14, $v13 // p2-p1 - lsv $v6[0], 0x0e($1) // w_frac p1 - vsub $v9, $v15, $v13 // p3-p1 - lsv $v5[2], 0x06($2) - vsub $v12, $v13, $v14 // p1-p2 - lsv $v6[2], 0x0e($2) - lsv $v5[4], 0x06($3) - lsv $v6[4], 0x0e($3) - vmudh $v16, $v9, $v10[1] // (p3-p1)*((p2-p1)_y) - lh $9, 0x1a($1) // y_int after viewport - vsar $v18, $v18, $v18[1] // high into $v18 - lh $10, 0x1a($2) - vsar $v17, $v17, $v17[0] // bits 47..31 of ACC - lh $11, 0x1a($3) - vmudh $v16, $v12, $v9[1] // (p1-p2)*((p3-p1)_y) - andi $14, $13, G_CULL_FRONT - vsar $v20, $v20, $v20[1] - andi $15, $13, G_CULL_BACK - vsar $v19, $v19, $v19[0] - addi $12, $zero, 0 // now sort p1,p2,p3 by y -@@sort_points_loop: - slt $7, $10, $9 - blez $7, @@f3d_04001a58 - add $7, $10, $zero // y2_int < y1_int (after viewport) - add $10, $9, $zero // swap $9/$10 and swap $1/$2 - add $9, $7, $zero - addu $7, $2, $zero - addu $2, $1, $zero - addu $1, $7, $zero - xori $12, $12, 0x0001 // xor that we swapped p1 and p2 - nop // interesting place for NOP -@@f3d_04001a58: - vaddc $v28, $v18, $v20 - slt $7, $11, $10 - vadd $v29, $v17, $v19 - blez $7, @@f3d_04001a88 - add $7, $11, $zero // y3_int < y2_int? - add $11, $10, $zero // swap p2, p3 - add $10, $7, $zero - addu $7, $3, $zero - addu $3, $2, $zero - addu $2, $7, $zero - j @@sort_points_loop // go back to test y1 and new y2 - xori $12, $12, 0x0001 // xor that we swapped p2 and p3 -@@f3d_04001a88: - vlt $v27, $v29, $v31[0] - llv $v15[0], 0x18($3) // xy_int after viewport for new p3 - vor $v26, $v29, $v28 - llv $v14[0], 0x18($2) - llv $v13[0], 0x18($1) - blez $12, @@f3d_04001ab0 // skip if even number of swaps - vsub $v4, $v15, $v14 // p3-p2 - vmudn $v28, $v28, $v31[3] - vmadh $v29, $v29, $v31[3] - vmadn $v28, $v31, $v31[0] -@@f3d_04001ab0: - vsub $v10, $v14, $v13 // p2-p1 - mfc2 $17, $v27[0] - vsub $v9, $v15, $v13 // p3-p1 - mfc2 $16, $v26[0] - sra $17, $17, 31 - vmov $v29[3], $v29[0] - and $15, $15, $17 - vmov $v28[3], $v28[0] - vmov $v4[2], $v10[0] - beq $16, $zero, @@f3d_04001fd0 // skip this triangle? - xori $17, $17, 0xffff - vlt $v27, $v29, $v31[0] - and $14, $14, $17 - vmov $v4[3], $v10[1] - or $16, $15, $14 - vmov $v4[4], $v9[0] - bgtz $16, @@f3d_04001fd0 - vmov $v4[5], $v9[1] - mfc2 $7, $v27[0] - jal f3d_04001000 - addi $6, $zero, 0x80 // left major flag - bltz $7, @@f3d_04001b10 - lb $5, 0x07($29) // low byte for geometrymode - addi $6, $zero, 0 -@@f3d_04001b10: - vmudm $v9, $v4, $v31[4] - vmadn $v10, $v31, $v31[0] - vrcp $v8[1], $v4[1] - vrcph $v7[1], $v31[0] - ori $5, $5, 0x00c8 // OR with RDP command code - lb $7, 0x12($29) // mpmap level and tile ID - vrcp $v8[3], $v4[3] - vrcph $v7[3], $v31[0] - vrcp $v8[5], $v4[5] - vrcph $v7[5], $v31[0] - or $6, $6, $7 - vmudl $v8, $v8, $v30[4] - sb $5, 0x00($23) - vmadm $v7, $v7, $v30[4] - sb $6, 0x01($23) - vmadn $v8, $v31, $v31[0] - vmudh $v4, $v4, $v31[5] - lsv $v12[0], 0x18($2) - vmudl $v6, $v6, $v21[0] - lsv $v12[4], 0x18($1) - vmadm $v5, $v5, $v21[0] - lsv $v12[8], 0x18($1) - vmadn $v6, $v31, $v31[0] - sll $7, $9, 14 - vmudl $v1, $v8, $v10[0q] - vmadm $v1, $v7, $v10[0q] - vmadn $v1, $v8, $v9[0q] - vmadh $v0, $v7, $v9[0q] - mtc2 $7, $v2[0] - vmadn $v1, $v31, $v31[0] - sw $3, 0x00($8) - vmudl $v8, $v8, $v31[4] - vmadm $v7, $v7, $v31[4] - vmadn $v8, $v31, $v31[0] - vmudl $v1, $v1, $v31[4] - vmadm $v0, $v0, $v31[4] - vmadn $v1, $v31, $v31[0] - sh $11, 0x02($23) // YL - vand $v16, $v1, $v30[1] - sh $9, 0x06($23) // YH - vmudm $v12, $v12, $v31[4] - sw $2, 0x04($8) - vmadn $v13, $v31, $v31[0] - sw $1, 0x08($8) - sh $10, 0x04($23) // YM - vcr $v0, $v0, $v30[6] - ssv $v12[0], 0x08($23) // XL - vmudl $v11, $v16, $v2[0] - ssv $v13[0], 0x0a($23) // XL, frac - vmadm $v10, $v0, $v2[0] - ssv $v0[2], 0x0c($23) // DxLDy - vmadn $v11, $v31, $v31[0] - ssv $v1[2], 0x0e($23) // DxLDy, frac - andi $7, $5, G_TEXTURE_ENABLE - addi $15, $8, 8 - addi $16, $8, 0x10 - vsubc $v3, $v13, $v11[1q] - ssv $v0[10], 0x14($23) // DxHDy - vsub $v9, $v12, $v10[1q] - ssv $v1[10], 0x16($23) // DxHDy, frac - vsubc $v21, $v6, $v6[1] - ssv $v0[6], 0x1c($23) // DxMDy - vlt $v19, $v5, $v5[1] - ssv $v1[6], 0x1e($23) // DxMDy, frac - vmrg $v20, $v6, $v6[1] - ssv $v9[8], 0x10($23) // XH - vsubc $v21, $v20, $v6[2] - ssv $v3[8], 0x12($23) // XH, frac - vlt $v19, $v19, $v5[2] - ssv $v9[4], 0x18($23) // XM - vmrg $v20, $v20, $v6[2] - ssv $v3[4], 0x1a($23) // XM, frac - addi $23, $23, 0x20 - blez $7, @@f3d_04001cfc // no texture? - vmudl $v20, $v20, $v30[5] - lw $14, 0x00($15) - vmadm $v19, $v19, $v30[5] - lw $17, -0x04($15) - vmadn $v20, $v31, $v31[0] - lw $18, -0x08($15) - llv $v9[0], 0x14($14) - llv $v9[8], 0x14($17) - llv $v22[0], 0x14($18) - lsv $v11[0], 0x22($14) - lsv $v12[0], 0x20($14) - lsv $v11[8], 0x22($17) - vmov $v9[2], $v30[0] - lsv $v12[8], 0x20($17) - vmov $v9[6], $v30[0] - lsv $v24[0], 0x22($18) - vmov $v22[2], $v30[0] - lsv $v25[0], 0x20($18) - vmudl $v6, $v11, $v20[0] - vmadm $v6, $v12, $v20[0] - ssv $v19[0], 0x44($8) - vmadn $v6, $v11, $v19[0] - ssv $v20[0], 0x4c($8) - vmadh $v5, $v12, $v19[0] - vmudl $v16, $v24, $v20[0] - vmadm $v16, $v25, $v20[0] - vmadn $v20, $v24, $v19[0] - vmadh $v19, $v25, $v19[0] - vmudm $v16, $v9, $v6[0h] - vmadh $v9, $v9, $v5[0h] - vmadn $v10, $v31, $v31[0] - vmudm $v16, $v22, $v20[0] - vmadh $v22, $v22, $v19[0] - vmadn $v23, $v31, $v31[0] - sdv $v9[8], 0x10($16) - sdv $v10[8], 0x18($16) - sdv $v9[0], 0x00($16) - sdv $v10[0], 0x08($16) - sdv $v22[0], 0x20($16) - sdv $v23[0], 0x28($16) - vabs $v9, $v9, $v9 - llv $v19[0], 0x10($16) - vabs $v22, $v22, $v22 - llv $v20[0], 0x18($16) - vabs $v19, $v19, $v19 - vge $v17, $v9, $v22 - vmrg $v18, $v10, $v23 - vge $v17, $v17, $v19 - vmrg $v18, $v18, $v20 -@@f3d_04001cfc: - slv $v17[0], 0x40($8) - slv $v18[0], 0x48($8) - andi $7, $5, (G_SHADE | G_TEXTURE_ENABLE | G_ZBUFFER) - blez $7, @@f3d_04001fcc // skip code below if no bits set - vxor $v18, $v31, $v31 - luv $v25[0], 0x10($3) - vadd $v16, $v18, $v30[5] - luv $v15[0], 0x10($1) - vadd $v24, $v18, $v30[5] - andi $7, $13, 0x0200 - vadd $v5, $v18, $v30[5] - bgtz $7, @@f3d_04001d3c - luv $v23[0], 0x10($2) - luv $v25[0], 0x10($4) - luv $v15[0], 0x10($4) - luv $v23[0], 0x10($4) -@@f3d_04001d3c: - vmudm $v25, $v25, $v31[7] - vmudm $v15, $v15, $v31[7] - vmudm $v23, $v23, $v31[7] - ldv $v16[8], 0x18($8) - ldv $v15[8], 0x10($8) - ldv $v24[8], 0x28($8) - ldv $v23[8], 0x20($8) - ldv $v5[8], 0x38($8) - ldv $v25[8], 0x30($8) - lsv $v16[14], 0x1e($1) - lsv $v15[14], 0x1c($1) - lsv $v24[14], 0x1e($2) - lsv $v23[14], 0x1c($2) - lsv $v5[14], 0x1e($3) - lsv $v25[14], 0x1c($3) - vsubc $v12, $v24, $v16 - vsub $v11, $v23, $v15 - vsubc $v20, $v16, $v5 - vsub $v19, $v15, $v25 - vsubc $v10, $v5, $v16 - vsub $v9, $v25, $v15 - vsubc $v22, $v16, $v24 - vsub $v21, $v15, $v23 - vmudn $v6, $v10, $v4[3] - vmadh $v6, $v9, $v4[3] - vmadn $v6, $v22, $v4[5] - vmadh $v6, $v21, $v4[5] - vsar $v9, $v9, $v9[0] - vsar $v10, $v10, $v10[1] - vmudn $v6, $v12, $v4[4] - vmadh $v6, $v11, $v4[4] - vmadn $v6, $v20, $v4[2] - vmadh $v6, $v19, $v4[2] - vsar $v11, $v11, $v11[0] - vsar $v12, $v12, $v12[1] - vmudl $v6, $v10, $v26[3] - vmadm $v6, $v9, $v26[3] - vmadn $v10, $v10, $v27[3] - vmadh $v9, $v9, $v27[3] - vmudl $v6, $v12, $v26[3] - vmadm $v6, $v11, $v26[3] - vmadn $v12, $v12, $v27[3] - sdv $v9[0], 0x08($23) - vmadh $v11, $v11, $v27[3] - sdv $v10[0], 0x18($23) - vmudn $v6, $v12, $v31[1] - vmadh $v6, $v11, $v31[1] - vmadl $v6, $v10, $v1[5] - vmadm $v6, $v9, $v1[5] - vmadn $v14, $v10, $v0[5] - sdv $v11[0], 0x28($23) - vmadh $v13, $v9, $v0[5] - sdv $v12[0], 0x38($23) - vmudl $v28, $v14, $v2[0] - sdv $v13[0], 0x20($23) - vmadm $v6, $v13, $v2[0] - sdv $v14[0], 0x30($23) - vmadn $v28, $v31, $v31[0] - vsubc $v18, $v16, $v28 - vsub $v17, $v15, $v6 - andi $7, $5, G_SHADE - blez $7, @@f3d_04001e44 - andi $7, $5, G_TEXTURE_ENABLE - addi $23, $23, 0x40 - sdv $v17[0], -0x40($23) - sdv $v18[0], -0x30($23) -@@f3d_04001e44: - blez $7, @@f3d_04001f48 - andi $7, $5, G_ZBUFFER - addi $16, $zero, 0x0800 - mtc2 $16, $v19[0] - vabs $v24, $v9, $v9 - ldv $v20[8], 0x40($8) - vabs $v25, $v11, $v11 - ldv $v21[8], 0x48($8) - vmudm $v24, $v24, $v19[0] - vmadn $v26, $v31, $v31[0] - vmudm $v25, $v25, $v19[0] - vmadn $v27, $v31, $v31[0] - vmudl $v21, $v21, $v19[0] - vmadm $v20, $v20, $v19[0] - vmadn $v21, $v31, $v31[0] - vmudn $v26, $v26, $v31[2] - vmadh $v24, $v24, $v31[2] - vmadn $v26, $v31, $v31[0] - vmadn $v23, $v27, $v31[1] - vmadh $v22, $v25, $v31[1] - addi $16, $zero, 0x40 - vmadn $v6, $v21, $v31[1] - mtc2 $16, $v19[0] - vmadh $v5, $v20, $v31[1] - vsubc $v23, $v6, $v6[5] - vge $v5, $v5, $v5[5] - vmrg $v6, $v6, $v6[5] - vsubc $v23, $v6, $v6[6] - vge $v5, $v5, $v5[6] - vmrg $v6, $v6, $v6[6] - vmudl $v6, $v6, $v19[0] - vmadm $v5, $v5, $v19[0] - vmadn $v6, $v31, $v31[0] - vrcph $v23[0], $v5[4] - vrcpl $v6[0], $v6[4] - vrcph $v5[0], $v31[0] - vmudn $v6, $v6, $v31[2] - vmadh $v5, $v5, $v31[2] - vlt $v5, $v5, $v31[1] - vmrg $v6, $v6, $v31[0] - vmudl $v20, $v18, $v6[0] - vmadm $v20, $v17, $v6[0] - vmadn $v20, $v18, $v5[0] - vmadh $v19, $v17, $v5[0] - vmudl $v22, $v10, $v6[0] - vmadm $v22, $v9, $v6[0] - vmadn $v22, $v10, $v5[0] - sdv $v19[8], 0x00($23) - vmadh $v21, $v9, $v5[0] - sdv $v20[8], 0x10($23) - vmudl $v24, $v12, $v6[0] - vmadm $v24, $v11, $v6[0] - vmadn $v24, $v12, $v5[0] - sdv $v21[8], 0x08($23) - vmadh $v23, $v11, $v5[0] - sdv $v22[8], 0x18($23) - vmudl $v26, $v14, $v6[0] - vmadm $v26, $v13, $v6[0] - vmadn $v26, $v14, $v5[0] - sdv $v23[8], 0x28($23) - vmadh $v25, $v13, $v5[0] - sdv $v24[8], 0x38($23) - addi $23, $23, 0x40 - sdv $v25[8], -0x20($23) - sdv $v26[8], -0x10($23) -@@f3d_04001f48: - blez $7, @@f3d_04001fcc - vmudn $v14, $v14, $v30[4] - vmadh $v13, $v13, $v30[4] - vmadn $v14, $v31, $v31[0] - vmudn $v16, $v16, $v30[4] - vmadh $v15, $v15, $v30[4] - vmadn $v16, $v31, $v31[0] - ssv $v13[14], 0x08($23) - vmudn $v10, $v10, $v30[4] - ssv $v14[14], 0x0a($23) - vmadh $v9, $v9, $v30[4] - vmadn $v10, $v31, $v31[0] - vmudn $v12, $v12, $v30[4] - vmadh $v11, $v11, $v30[4] - vmadn $v12, $v31, $v31[0] - lbu $7, 0x11($29) - sub $7, $zero, $7 - beq $7, $zero, @@f3d_04001f9c - mtc2 $7, $v6[0] - vch $v11, $v11, $v6[0] - vcl $v12, $v12, $v31[0] -@@f3d_04001f9c: - ssv $v9[14], 0x04($23) - vmudl $v28, $v14, $v2[0] - ssv $v10[14], 0x06($23) - vmadm $v6, $v13, $v2[0] - ssv $v11[14], 0x0c($23) - vmadn $v28, $v31, $v31[0] - ssv $v12[14], 0x0e($23) - vsubc $v18, $v16, $v28 - vsub $v17, $v15, $v6 - addi $23, $23, 0x10 - ssv $v17[14], -0x10($23) - ssv $v18[14], -0x0e($23) -@@f3d_04001fcc: - jal f3d_04001178 -@@f3d_04001fd0: - nop - jr $30 - nop - nop -Overlay0End: - -// Overlay 1 -.headersize 0x04001000 - orga() -.definelabel Overlay1LoadStart, orga() -// reciprocal method, see RSP Programmers Guide page 79 -// $v29[3]=s_int, $v28[3]=s_frac, $v29[7]=t_int, $v28[7]=t_frac -// out: $v27[3,7]=s,t int, $v26[3,7]=s,t frac -Overlay1Address: -f3d_04001000: - vrcph $v27[3], $v29[3] - vrcpl $v26[3], $v28[3] - vrcph $v27[3], $v29[7] - vrcpl $v26[7], $v28[7] - vrcph $v27[7], $v31[0] - vmudn $v26, $v26, $v31[2] // 0002, << 1 since input is S15.16 - vmadh $v27, $v27, $v31[2] - vmadn $v26, $v31, $v31[0] - // $v27[3]=sres_int, $v26[3]=sres_frac, $v27[7]=tres_int, $v26[7]=tres_frac - lqv $v23[0], 0x60($zero) - vxor $v22, $v31, $v31 // (1/w)*w - vmudl $v24, $v26, $v28 - vmadm $v24, $v27, $v28 - vmadn $v24, $v26, $v29 - vmadh $v25, $v27, $v29 - // $v24=frac, $v25=int, should be very close to 1.0 - vsubc $v24, $v22, $v24 // take 2.0-result (better rounding?) - vsub $v25, $v23, $v25 - vmudl $v22, $v26, $v24 // (2.0-(1/w)*w)*(1/w) - vmadm $v23, $v27, $v24 - vmadn $v26, $v26, $v25 - vmadh $v27, $v27, $v25 - jr $ra - nop - -dma_wait_dl: - jal wait_while_dma_busy - addi $27, $zero, inputDisplayList - -read_next_task_entry: - lw $25, 0x00($27) // first command word - lw $24, 0x04($27) // second command word - srl $1, $25, 29 - andi $1, $1, 0x0006 // $1 = (two MSbits) << 1 - addi $26, $26, 8 // increase next task in DRAM ptr - addi $27, $27, 8 // increase next task in DMEM ptr - addi $28, $28, -8 // decrease task count left in DMEM - bgtz $1, dispatch_task - andi $18, $25, 0x01ff - addi $22, $zero, inputData // command that loads data input -Overlay1End: - - -// Overlay 2 -.headersize 0x04001768 - orga() -Overlay2Address: - b perform_clip - sh $ra, data0158 - nop - nop - ori $30, $zero, overlayInfo3 - b load_overlay - lh $21, lightEntry - -perform_clip: - sh $3, clipTemp - sh $2, data0942 - sh $1, data0944 - sh $zero, data0946 - ori $7, $zero, 0x0db8 - ori $30, $zero, clipTemp - ori $6, $zero, 0x000c -next_clip: - or $5, $30, $30 - xori $30, $30, 0x0014 -f3d_040017a8: - beq $6, $zero, @f3d_04001954 - lh $11, 0xa6($6) - addi $6, $6, -2 - ori $17, $zero, 0x0000 - or $18, $zero, $zero - -found_in: - ori $2, $5, 0x0000 - -found_out: - j f3d_040017d4 - addi $14, $30, 2 -f3d_040017c8: - and $8, $8, $11 - beq $8, $18, f3d_o2_04001804 - addi $2, $2, 2 -f3d_040017d4: - or $20, $10, $zero - sh $10, 0x00($14) - addi $14, $14, 2 -f3d_040017e0: - lh $10, 0x00($2) - bne $10, $zero, f3d_040017c8 - lh $8, 0x24($10) - addi $8, $17, -2 - bgtz $8, f3d_040017e0 - ori $2, $5, 0x0000 - beq $8, $zero, f3d_040017a8 - nop - j f3d_04001980 -f3d_o2_04001804: - xor $18, $18, $11 - lh $8, lo(labelLUT)($17) - addi $17, $17, 2 - jr $8 - lh $8, nextClipEntry - -found_first_in: - mtc2 $10, $v13[0] - or $10, $20, $zero - mfc2 $20, $v13[0] - ori $14, $30, 0x0000 - lh $8, foundOutEntry - -found_first_out: - sh $8, data0106 - addi $7, $7, 0x28 - sh $7, 0x00($14) - sh $zero, 0x02($14) - ldv $v9[0], 0x00($10) - ldv $v10[0], 0x08($10) - ldv $v4[0], 0x00($20) - ldv $v5[0], 0x08($20) - sll $8, $6, 2 - ldv $v1[0], 0x70($8) - vmudh $v0, $v1, $v31[3] - vmudn $v12, $v5, $v1 - vmadh $v11, $v4, $v1 - vmadn $v12, $v31, $v31[0] - vmadn $v28, $v10, $v0 - vmadh $v29, $v9, $v0 - vmadn $v28, $v31, $v31[0] - vaddc $v26, $v28, $v28[0q] - vadd $v27, $v29, $v29[0q] - vaddc $v28, $v26, $v26[1h] - vadd $v29, $v27, $v27[1h] - mfc2 $8, $v29[6] - vrcph $v7[3], $v29[3] - vrcpl $v3[3], $v28[3] - vrcph $v7[3], $v31[0] - vmudn $v3, $v3, $v31[2] - bgez $8, f3d_040018a4 - vmadh $v7, $v7, $v31[2] - vmudn $v3, $v3, $v31[3] - vmadh $v7, $v7, $v31[3] -f3d_040018a4: - veq $v7, $v7, $v31[0] - vmrg $v3, $v3, $v31[3] - vmudl $v28, $v28, $v3[3] - vmadm $v29, $v29, $v3[3] - jal f3d_04001000 - vmadn $v28, $v31, $v31[0] - vaddc $v28, $v12, $v12[0q] - vadd $v29, $v11, $v11[0q] - vaddc $v12, $v28, $v28[1h] - vadd $v11, $v29, $v29[1h] - vmudl $v15, $v12, $v26 - vmadm $v15, $v11, $v26 - vmadn $v15, $v12, $v27 - vmadh $v8, $v11, $v27 - vmudl $v28, $v31, $v31[5] - vmadl $v15, $v15, $v3[3] - vmadm $v8, $v8, $v3[3] - vmadn $v15, $v31, $v31[0] - veq $v8, $v8, $v31[0] - vmrg $v15, $v15, $v31[3] - vne $v15, $v15, $v31[0] - vmrg $v15, $v15, $v31[1] - vnxor $v8, $v15, $v31[0] - vaddc $v8, $v8, $v31[1] - vadd $v29, $v29, $v29 - vmudl $v28, $v5, $v8[3h] - vmadm $v29, $v4, $v8[3h] - vmadl $v28, $v10, $v15[3h] - vmadm $v29, $v9, $v15[3h] - vmadn $v28, $v31, $v31[0] - luv $v12[0], 0x10($10) - luv $v11[0], 0x10($20) - llv $v12[8], 0x14($10) - llv $v11[8], 0x14($20) - vmudm $v18, $v12, $v15[3] - vmadm $v18, $v11, $v8[3] - suv $v18[0], 0x00($7) - sdv $v18[8], 0x08($7) - ldv $v18[0], 0x08($7) - jal f3d_040014e8 - lw $15, 0x00($7) - mfc2 $10, $v13[0] - j @f3d_040015e8 - ori $9, $zero, 0x0001 -@f3d_04001954: - lh $8, 0x00($5) - sh $8, 0xb4($zero) - sh $5, data0106 - lh $30, clipDrawEntry - -clip_draw_loop: - lh $8, data0106 - lh $3, 0xb4($zero) - lh $2, 0x02($8) - lh $1, 0x04($8) - addi $8, $8, 2 - bne $1, $zero, f3d_040019c4 - sh $8, data0106 -f3d_04001980: - j SP_NOOP - nop -Overlay2End: - -// Overlay 3 -.headersize 0x04001768 - orga() -Overlay3Address: - ori $30, $zero, overlayInfo2 - b load_overlay - lh $21, performClipEntry - lw $1, numLights - sw $15, 0x00($7) // normal vector 1st vertex - sw $16, 0x04($7) // normal vector 2nd vertex - bltz $1, @init_lights - lpv $v4[0], 0x00($7) - luv $v7[0], 0x01d0($1) // ambient RGB - vxor $v27, $v27, $v27 -@@f3d_04001790: - vge $v7, $v7, $v31[0] // max(0, $v7) - lpv $v5[0], 0x01c0($1) // calculated light - vadd $v27, $v27, $v7 - luv $v7[0], 0x01b0($1) // light's RGB - vor $v20, $v6, $v31[0] - vmulf $v6, $v4, $v5 // mul normal vector - vadd $v3, $v6, $v6[1q] - vadd $v6, $v3, $v6[2h] - vmulf $v7, $v7, $v6[0h] // $v6[0] and $v6[4] contain dot product - bgtz $1, @@f3d_04001790 - addi $1, $1, -0x20 - suv $v27[0], 0x00($7) - andi $8, $3, G_TEXTURE_GEN_H - sb $15, 0x03($7) - sb $16, 0x07($7) - lw $15, 0x00($7) - beq $8, $zero, @f3d_040015e4 - lw $16, 0x04($7) - andi $8, $3, G_TEXTURE_GEN_LINEAR_H // not used in SM64 - lpv $v7[0], 0x90($29) - ldv $v6[0], 0xa0($zero) - vmadn $v20, $v7, $v20[0h] - beq $8, $zero, @@f3d_o3_04001804 - vmadm $v18, $v31, $v31[0] - vmulf $v7, $v18, $v18 - vmulf $v7, $v7, $v18 - vmulf $v20, $v7, $v6[1] - vmacf $v20, $v7, $v6[3] - vmacf $v18, $v18, $v6[2] -@@f3d_o3_04001804: - j @f3d_040015e4 - vadd $v18, $v18, $v31[4] - -@init_lights: - andi $1, $1, 0x0fff - sw $1, numLights - jal f3d_04001524 - addi $8, $zero, modelViewMatrixStack - ori $8, $zero, scratchSpace - stv $v8[2], 0x10($8) // transpose - stv $v8[4], 0x20($8) - stv $v8[12], 0x30($8) - stv $v8[14], 0x40($8) - ltv $v8[14], 0x10($8) - ltv $v8[12], 0x20($8) - ltv $v8[4], 0x30($8) - ltv $v8[2], 0x40($8) - sdv $v12[8], 0x10($8) - sdv $v13[8], 0x20($8) - sdv $v14[8], 0x30($8) - ldv $v12[0], 0x10($8) - ldv $v13[0], 0x20($8) - ldv $v14[0], 0x30($8) -f3d_04001858: - lpv $v5[0], 0x01b8($1) // this light's dir vector - vmulf $v5, $v5, $v31[4] - vmudn $v6, $v12, $v5[0h] - vmadn $v6, $v13, $v5[1h] - vmadn $v6, $v14, $v5[2h] - vmadm $v3, $v31, $v31[0] - vmudm $v6, $v3, $v31[2] - vmacf $v3, $v8, $v5[0h] - vmacf $v3, $v9, $v5[1h] - vmacf $v3, $v10, $v5[2h] - vmadn $v6, $v31, $v31[0] - vmudl $v5, $v6, $v6 - vmadm $v5, $v3, $v6 - vmadn $v5, $v6, $v3 - vmadh $v26, $v3, $v3 - vaddc $v7, $v5, $v5[1q] - vadd $v4, $v26, $v26[1q] - vaddc $v7, $v5, $v7[0h] - vadd $v4, $v26, $v4[0h] - vrsqh $v11[0], $v4[2] // normalize vector - vrsql $v15[0], $v7[2] - vrsqh $v11[0], $v31[0] - vmudl $v15, $v15, $v30[3] - vmadm $v11, $v11, $v30[3] - vmadn $v15, $v31, $v31[0] - vmudl $v7, $v6, $v15[0] - vmadm $v7, $v3, $v15[0] - vmadn $v7, $v6, $v11[0] - vmadh $v4, $v3, $v11[0] - vmadn $v7, $v31, $v31[0] - ldv $v2[0], 0xf8($29) - vge $v7, $v7, $v2[0] - vlt $v7, $v7, $v2[1] - vmudn $v7, $v7, $v2[2] - spv $v7[0], 0x01c0($1) - lw $8, 0x01c0($1) - sw $8, 0x01c4($1) - bgtz $1, f3d_04001858 - addi $1, $1, -0x20 - j load_mp_matrix - lh $ra, lightEntry - nop -Overlay3End: - -// Overlay 4 -.headersize 0x04001768 - orga() -Overlay4Address: - j f3d_04001788 - nop -overlay_4_entry: - nop - jal wait_while_dma_busy - ori $2, $zero, 0x4000 - mtc0 $2, SP_STATUS - break - nop -f3d_04001788: - ori $2, $zero, 0x1000 - sw $28, data08E4 - sw $27, data08E8 - sw $26, data08EC - sw $23, data08F0 - lw $19, dramPtr - ori $20, $zero, 0x0000 - ori $18, $zero, 0x08ff - jal dma_read_write - ori $17, $zero, 0x0001 - jal wait_while_dma_busy - nop - j f3d_040010c8 - mtc0 $2, SP_STATUS - nop - nop - addiu $zero, $zero, 0xbeef - nop -Overlay4End: - -.close // CODE_FILE diff --git a/rsp/gbi.inc b/rsp/gbi.inc deleted file mode 100644 index 1ea1314c..00000000 --- a/rsp/gbi.inc +++ /dev/null @@ -1,19 +0,0 @@ -// GBI: Graphics Binary Interface - -G_FOG equ 0x00010000 -G_LIGHTING equ 0x00020000 -G_TEXTURE_GEN equ 0x00040000 -G_TEXTURE_GEN_LINEAR equ 0x00080000 - -G_FOG_H equ (G_FOG/0x10000) -G_LIGHTING_H equ (G_LIGHTING/0x10000) -G_TEXTURE_GEN_H equ (G_TEXTURE_GEN/0x10000) -G_TEXTURE_GEN_LINEAR_H equ(G_TEXTURE_GEN_LINEAR/0x10000) - - -G_CULL_BACK equ 0x00002000 -G_CULL_FRONT equ 0x00001000 - -G_ZBUFFER equ 0x00000001 -G_TEXTURE_ENABLE equ 0x00000002 -G_SHADE equ 0x00000004 diff --git a/rsp/rsp_defs.inc b/rsp/rsp_defs.inc deleted file mode 100644 index 57984c56..00000000 --- a/rsp/rsp_defs.inc +++ /dev/null @@ -1,20 +0,0 @@ -// RSP definitions - -// OSTask placed at end of DMEM (IMEM_START - sizeof(OSTask)) -.definelabel OSTask_addr, 0xFC0 -// OSTask data member offsets -OSTask_flags equ 0x04 -OSTask_ucode equ 0x10 -OSTask_ucode_size equ 0x14 // ucode_size is ignored -OSTask_ucode_data equ 0x18 -OSTask_ucode_data_size equ 0x1C -// flags -OS_TASK_DP_WAIT equ 0x0002 - -// RDP Status read flags -DPC_STATUS_XBUS_DMA equ 0x0001 -DPC_STATUS_DMA_BUSY equ 0x0100 -DPC_STATUS_START_VALID equ 0x0400 - -// RDP Status write flags -DPC_STATUS_CLR_XBUS equ 0x0001 diff --git a/rsp/rspboot.s b/rsp/rspboot.s deleted file mode 100644 index cf18ef6d..00000000 --- a/rsp/rspboot.s +++ /dev/null @@ -1,73 +0,0 @@ -.rsp - -.include "rsp/rsp_defs.inc" - -// This file assumes CODE_FILE is set on the command line -.create CODE_FILE, 0x04001000 - -.ifndef VERSION_EU - ori $1, $1, 0x0001 -.endif - j boot_04001068 - addi $1, $zero, OSTask_addr -boot_load_ucode: - lw $2, OSTask_ucode($1) - addi $3, $zero, 0x0f7f // hard-coded length = 0xF80 - addi $7, $zero, 0x1080 // hard-coded address = 0x1080 - mtc0 $7, SP_MEM_ADDR - mtc0 $2, SP_DRAM_ADDR - mtc0 $3, SP_RD_LEN -boot_ucode_dma_busy: - mfc0 $4, SP_DMA_BUSY - bne $4, $zero, boot_ucode_dma_busy - nop - jal check_yielded - nop - jr $7 // jump to the loaded ucode - mtc0 $zero, SP_SEMAPHORE // clear semaphore - -check_yielded: - mfc0 $8, SP_STATUS - andi $8, $8, 0x0080 // yield signal is set - bne $8, $zero, boot_04001054 - nop - jr ra -boot_04001054: - mtc0 $zero, SP_SEMAPHORE // clear semaphore - ori $8, $zero, 0x5200 // clear yield, set yielded, set taskdone? - mtc0 $8, SP_STATUS - break // halt RSP and set SP_STATUS_BROKE - nop - -boot_04001068: - lw $2, OSTask_flags($1) - andi $2, $2, OS_TASK_DP_WAIT - beq $2, $zero, boot_load_data - nop - jal check_yielded - nop - mfc0 $2, DPC_STATUS - andi $2, $2, DPC_STATUS_DMA_BUSY - bgtz $2, check_yielded - nop -boot_load_data: - lw $2, OSTask_ucode_data($1) - lw $3, OSTask_ucode_data_size($1) - addi $3, $3, -1 -boot_dma_not_full: - mfc0 $30, SP_DMA_FULL - bne $30, $zero, boot_dma_not_full - nop - mtc0 $zero, SP_MEM_ADDR // ucode_data store at base of DMEM - mtc0 $2, SP_DRAM_ADDR - mtc0 $3, SP_RD_LEN -boot_data_dma_busy: - mfc0 $4, SP_DMA_BUSY - bne $4, $zero, boot_data_dma_busy - nop - jal check_yielded - nop - j boot_load_ucode - nop - -.close // CODE_FILE diff --git a/sm64-port.sln b/sm64-port.sln deleted file mode 100644 index b2fe3431..00000000 --- a/sm64-port.sln +++ /dev/null @@ -1,41 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29806.167 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sm64-port", "sm64-port.vcxproj", "{D10788B9-30BA-4228-95B1-128945490682}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tst", "tst\tst.vcxproj", "{AD3FF334-6C82-481E-83C5-3EE0FDDF389F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D10788B9-30BA-4228-95B1-128945490682}.Debug|x64.ActiveCfg = Debug|x64 - {D10788B9-30BA-4228-95B1-128945490682}.Debug|x64.Build.0 = Debug|x64 - {D10788B9-30BA-4228-95B1-128945490682}.Debug|x86.ActiveCfg = Debug|Win32 - {D10788B9-30BA-4228-95B1-128945490682}.Debug|x86.Build.0 = Debug|Win32 - {D10788B9-30BA-4228-95B1-128945490682}.Release|x64.ActiveCfg = Release|x64 - {D10788B9-30BA-4228-95B1-128945490682}.Release|x64.Build.0 = Release|x64 - {D10788B9-30BA-4228-95B1-128945490682}.Release|x86.ActiveCfg = Release|Win32 - {D10788B9-30BA-4228-95B1-128945490682}.Release|x86.Build.0 = Release|Win32 - {AD3FF334-6C82-481E-83C5-3EE0FDDF389F}.Debug|x64.ActiveCfg = Debug|x64 - {AD3FF334-6C82-481E-83C5-3EE0FDDF389F}.Debug|x64.Build.0 = Debug|x64 - {AD3FF334-6C82-481E-83C5-3EE0FDDF389F}.Debug|x86.ActiveCfg = Debug|Win32 - {AD3FF334-6C82-481E-83C5-3EE0FDDF389F}.Debug|x86.Build.0 = Debug|Win32 - {AD3FF334-6C82-481E-83C5-3EE0FDDF389F}.Release|x64.ActiveCfg = Release|x64 - {AD3FF334-6C82-481E-83C5-3EE0FDDF389F}.Release|x64.Build.0 = Release|x64 - {AD3FF334-6C82-481E-83C5-3EE0FDDF389F}.Release|x86.ActiveCfg = Release|Win32 - {AD3FF334-6C82-481E-83C5-3EE0FDDF389F}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {1D5BDBFE-C1F2-4A56-9AAD-42125398DEE4} - EndGlobalSection -EndGlobal diff --git a/sm64-port.vcxproj b/sm64-port.vcxproj deleted file mode 100644 index c0cefbb8..00000000 --- a/sm64-port.vcxproj +++ /dev/null @@ -1,2530 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {D10788B9-30BA-4228-95B1-128945490682} - Win32Proj - - - - Makefile - true - v142 - - - Makefile - false - v142 - - - Makefile - true - v142 - - - Makefile - false - v142 - - - - - - - - - - - - - - - - - - - - - - - - - R:\msys64\msys2_shell.cmd -mingw64 -c "cd R:/Documents/CppWorkspace/sm64-port%3b make VERSION=us -j4" - sm64.us.f3dex2e.exe - R:\msys64\msys2_shell.cmd -mingw64 -c "cd R:/Documents/CppWorkspace/sm64-port%3b make VERSION=us -j4" - WIN32;_DEBUG;$(NMakePreprocessorDefinitions) - - - R:\msys64\msys2_shell.cmd -mingw64 -c "cd R:/Documents/CppWorkspace/sm64-port; make VERSION=us -j4" - build\us_pc\sm64.us.f3dex2e.exe - R:\msys64\msys2_shell.cmd -mingw64 -c "cd R:/Documents/CppWorkspace/sm64-port; make VERSION=us -j4" - AVOID_UB=$(AVOID_UB);NON_MATCHING=$(NON_MATCHING);_DEBUG;$(NMakePreprocessorDefinitions) - R:\msys64\msys2_shell.cmd -mingw64 -c "cd R:/Documents/CppWorkspace/sm64-port; make clean" - ./;include/;src/;$(IncludePath) - ./;include/;src/;$(NMakeIncludeSearchPath) - - - R:\msys64\msys2_shell.cmd -mingw64 -c "cd R:/Documents/CppWorkspace/sm64-port%3b make VERSION=us -j4" - sm64.us.f3dex2e.exe - R:\msys64\msys2_shell.cmd -mingw64 -c "cd R:/Documents/CppWorkspace/sm64-port%3b make VERSION=us -j4" - WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - - - R:\msys64\msys2_shell.cmd -mingw64 -c "cd R:/Documents/CppWorkspace/sm64-port%3b make VERSION=us -j4" - sm64.us.f3dex2e.exe - R:\msys64\msys2_shell.cmd -mingw64 -c "cd R:/Documents/CppWorkspace/sm64-port%3b make VERSION=us -j4" - NDEBUG;$(NMakePreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Document - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sm64-port.vcxproj.filters b/sm64-port.vcxproj.filters deleted file mode 100644 index 8c136ef2..00000000 --- a/sm64-port.vcxproj.filters +++ /dev/null @@ -1,7210 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Header Files - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/sm64-port.vcxproj.user b/sm64-port.vcxproj.user deleted file mode 100644 index 966b4ffb..00000000 --- a/sm64-port.vcxproj.user +++ /dev/null @@ -1,6 +0,0 @@ - - - - true - - \ No newline at end of file diff --git a/sm64_save_file2.bin b/sm64_save_file2.bin deleted file mode 100644 index 08b82a69..00000000 Binary files a/sm64_save_file2.bin and /dev/null differ diff --git a/sound/sequences/00_sound_player.s b/sound/sequences/00_sound_player.s index caa0e782..e1297dad 100644 --- a/sound/sequences/00_sound_player.s +++ b/sound/sequences/00_sound_player.s @@ -66,7 +66,7 @@ chan_stereoheadseteffects 1 chan_setdyntable .channel59_table chan_jump .main_loop_023589 -# Main loop for standard, non-continuous sound effects + .main_loop_023589: chan_delay1 chan_ioreadval 0 @@ -80,17 +80,17 @@ chan_iowriteval 5 chan_ioreadval 4 chan_dyncall -# keep looping until layer 0 finishes or we are told to stop or to play something else + .poll_023589: chan_delay1 chan_ioreadval 0 -chan_bltz .skip_023589 # if we have a signal: - chan_beqz .force_stop_023589 # told to stop - chan_jump .start_playing_023589 # told to play something else +chan_bltz .skip_023589 + chan_beqz .force_stop_023589 + chan_jump .start_playing_023589 .skip_023589: chan_testlayerfinished 0 -chan_beqz .poll_023589 # if layer 0 hasn't finished, keep polling -chan_jump .main_loop_023589 # otherwise go back to the main loop +chan_beqz .poll_023589 +chan_jump .main_loop_023589 .force_stop_023589: chan_freelayer 0 chan_freelayer 1 @@ -133,7 +133,7 @@ chan_stereoheadseteffects 1 chan_setdyntable .channel6_table chan_jump .main_loop_146 -# Main loop for moving, env and air sound effects, which play continuously + .main_loop_146: chan_delay1 chan_ioreadval 0 @@ -148,7 +148,7 @@ chan_iowriteval 5 chan_ioreadval 4 chan_dyncall -# keep looping until we are told to stop or to play something else + .poll_146: chan_delay1 chan_ioreadval 0 @@ -170,7 +170,7 @@ chan_iowriteval 5 chan_stereoheadseteffects 1 chan_setdyntable .channel7_table -# Loop for menu sound effects + .main_loop_7: chan_delay1 chan_ioreadval 0 @@ -187,19 +187,19 @@ chan_setpanmix 127 chan_ioreadval 4 chan_dyncall -# keep looping until layer 0 finishes or we are told to stop or to play something else + .poll_7: chan_delay1 chan_ioreadval 0 -chan_bltz .skip_7 # if we have a signal: - chan_beqz .force_stop_7 # told to stop +chan_bltz .skip_7 + chan_beqz .force_stop_7 chan_unreservenotes - chan_jump .start_playing_7 # told to play something else + chan_jump .start_playing_7 .skip_7: chan_testlayerfinished 0 -chan_beqz .poll_7 # if layer 0 hasn't finished, keep polling +chan_beqz .poll_7 chan_unreservenotes -chan_jump .main_loop_7 # otherwise go back to the main loop +chan_jump .main_loop_7 .force_stop_7: chan_freelayer 0 chan_freelayer 1 @@ -207,7 +207,7 @@ chan_freelayer 2 chan_unreservenotes chan_jump .main_loop_7 -# Delay for a number of ticks (1-255) in an interruptible manner. + .delay: chan_writeseq_nextinstr 0, 1 chan_loop 20 @@ -222,15 +222,15 @@ chan_end chan_setpanmix 127 chan_setvolscale 127 chan_setvibratoextent 0 -chan_ioreadval 1 # IO slots 0-3 are reset to -1 when read; restore the value +chan_ioreadval 1 chan_iowriteval 0 -chan_break # break out of the loop -chan_break # force the caller to return immediately +chan_break +chan_break chan_end -# Set reverb in way that takes area echo level and volume into account. This -# is done by writing to IO slot 5 and letting get_sound_reverb in external.c -# do the necessary math. + + + .set_reverb: chan_writeseq_nextinstr 0, 1 chan_setreverb 10 @@ -977,7 +977,7 @@ layer_portamento 0x81, 42, 255 layer_note1 37, 0x1e, 105 layer_end -.sound_action_climb_down_tree: # unused +.sound_action_climb_down_tree: chan_setbank 0 chan_setinstr 1 chan_setlayer 0, .layer_579 @@ -988,7 +988,7 @@ layer_portamento 0x81, 44, 255 layer_note1 40, 0xb4, 100 layer_end -.chan_582: # unused +.chan_582: chan_setbank 0 chan_setinstr 2 chan_setlayer 0, .layer_58A @@ -1408,7 +1408,7 @@ layer_note1 42, 0x8, 127 layer_end .ifndef VERSION_JP - .chan_828: # unused + .chan_828: chan_setbank 7 chan_setinstr 3 chan_setlayer 0, .layer_83C diff --git a/src/audio/data.c b/src/audio/data.c index 61deaa72..47b02c4d 100644 --- a/src/audio/data.c +++ b/src/audio/data.c @@ -3,10 +3,10 @@ #include "data.h" #include "effects.h" -extern OSMesgQueue OSMesgQueue0; -extern OSMesgQueue OSMesgQueue1; -extern OSMesgQueue OSMesgQueue2; -extern OSMesgQueue OSMesgQueue3; +extern struct OSMesgQueue OSMesgQueue0; +extern struct OSMesgQueue OSMesgQueue1; +extern struct OSMesgQueue OSMesgQueue2; +extern struct OSMesgQueue OSMesgQueue3; #ifdef VERSION_EU struct ReverbSettingsEU sReverbSettings[] = { @@ -174,9 +174,9 @@ s8 gVibratoCurve[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, #endif struct AdsrEnvelope gDefaultEnvelope[] = { - { (s16) BSWAP16(4), (s16) BSWAP16(32000) }, // go from 0 to 32000 over the course of 16ms - { (s16) BSWAP16(1000), (s16) BSWAP16(32000) }, // stay there for 4.16 seconds - { (s16) BSWAP16(ADSR_HANG), 0 } // then continue staying there + { BE_TO_HOST16(4), BE_TO_HOST16(32000) }, // go from 0 to 32000 over the course of 16ms + { BE_TO_HOST16(1000), BE_TO_HOST16(32000) }, // stay there for 4.16 seconds + { BE_TO_HOST16(ADSR_HANG), 0 } // then continue staying there }; #ifdef VERSION_EU diff --git a/src/audio/effects.c b/src/audio/effects.c index 80cdbeda..bf8c343a 100644 --- a/src/audio/effects.c +++ b/src/audio/effects.c @@ -17,7 +17,8 @@ static void sequence_channel_process_sound(struct SequenceChannel *seqChannel, s s32 i; if (seqChannel->changes.as_bitfields.volume || recalculateVolume) { - channelVolume = seqChannel->volume * seqChannel->volumeScale * seqChannel->seqPlayer->appliedFadeVolume; + channelVolume = seqChannel->volume * seqChannel->volumeScale * + seqChannel->seqPlayer->appliedFadeVolume * seqChannel->seqPlayer->volumeScale; if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0) { channelVolume = seqChannel->seqPlayer->muteVolumeScale * channelVolume; } @@ -58,7 +59,8 @@ static void sequence_channel_process_sound(struct SequenceChannel *seqChannel) { f32 panFromChannel; s32 i; - channelVolume = seqChannel->volume * seqChannel->volumeScale * seqChannel->seqPlayer->fadeVolume; + channelVolume = seqChannel->volume * seqChannel->volumeScale * + seqChannel->seqPlayer->fadeVolume * seqChannel->seqPlayer->volumeScale; if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0) { channelVolume *= seqChannel->seqPlayer->muteVolumeScale; } @@ -390,7 +392,7 @@ s32 adsr_update(struct AdsrState *adsr) { // fallthrough case ADSR_STATE_LOOP: - adsr->delay = BSWAP16(adsr->envelope[adsr->envIndex].delay); + adsr->delay = BE_TO_HOST16(adsr->envelope[adsr->envIndex].delay); switch (adsr->delay) { case ADSR_DISABLE: adsr->state = ADSR_STATE_DISABLED; @@ -399,7 +401,7 @@ s32 adsr_update(struct AdsrState *adsr) { adsr->state = ADSR_STATE_HANG; break; case ADSR_GOTO: - adsr->envIndex = BSWAP16(adsr->envelope[adsr->envIndex].arg); + adsr->envIndex = BE_TO_HOST16(adsr->envelope[adsr->envIndex].arg); break; case ADSR_RESTART: adsr->state = ADSR_STATE_INITIAL; @@ -410,11 +412,11 @@ s32 adsr_update(struct AdsrState *adsr) { if (adsr->delay >= 4) { adsr->delay = adsr->delay * gAudioBufferParameters.updatesPerFrame / 4; } - adsr->target = (f32) BSWAP16(adsr->envelope[adsr->envIndex].arg) / 32767.0; + adsr->target = (f32) BE_TO_HOST16(adsr->envelope[adsr->envIndex].arg) / 32767.0; adsr->target = adsr->target * adsr->target; adsr->velocity = (adsr->target - adsr->current) / adsr->delay; #else - adsr->target = BSWAP16(adsr->envelope[adsr->envIndex].arg); + adsr->target = BE_TO_HOST16(adsr->envelope[adsr->envIndex].arg); adsr->velocity = ((adsr->target - adsr->current) << 0x10) / adsr->delay; #endif adsr->state = ADSR_STATE_FADE; diff --git a/src/audio/effects.h b/src/audio/effects.h index 67730744..b858dbbd 100644 --- a/src/audio/effects.h +++ b/src/audio/effects.h @@ -5,6 +5,7 @@ #include "internal.h" #include "platform_info.h" +#include "macros.h" #define ADSR_STATE_DISABLED 0 #define ADSR_STATE_INITIAL 1 @@ -26,12 +27,9 @@ #define ADSR_RESTART -3 // Envelopes are always stored as big endian, to match sequence files which are -// byte blobs and can embed envelopes. Hence this byteswapping macro. -#if IS_BIG_ENDIAN -#define BSWAP16(x) (x) -#else -#define BSWAP16(x) (((x) & 0xff) << 8 | (((x) >> 8) & 0xff)) -#endif +// byte blobs and can embed envelopes. +// BSWAP16() definition has been moved to macros.h. Use BE_TO_HOST16() for the +// same effect in the future. void sequence_player_process_sound(struct SequencePlayer *seqPlayer); void note_vibrato_update(struct Note *note); diff --git a/src/audio/external.c b/src/audio/external.c index 83db4887..d8a26b35 100644 --- a/src/audio/external.c +++ b/src/audio/external.c @@ -12,6 +12,7 @@ #include "game/camera.h" #include "seq_ids.h" #include "dialog_ids.h" +#include "level_table.h" #ifdef VERSION_EU #define EU_FLOAT(x) x ## f @@ -253,25 +254,25 @@ u8 sDialogSpeaker[] = { /*16*/ _, YOSHI, _, _, _, _, _, _, WIGLR, _ }; #undef _ -//STATIC_ASSERT(ARRAY_COUNT(sDialogSpeaker) == DIALOG_COUNT, "change this array if you are adding dialogs"); +STATIC_ASSERT(ARRAY_COUNT(sDialogSpeaker) == DIALOG_COUNT, "change this array if you are adding dialogs"); s32 sDialogSpeakerVoice[] = { - (s32)SOUND_OBJ_UKIKI_CHATTER_LONG, - (s32)SOUND_OBJ_BIG_PENGUIN_YELL, - (s32)SOUND_OBJ_BOWSER_INTRO_LAUGH, - (s32)SOUND_OBJ_KOOPA_TALK, - (s32)SOUND_OBJ_KING_BOBOMB_TALK, - (s32)SOUND_OBJ_BOO_LAUGH_LONG, - (s32)SOUND_OBJ_BOBOMB_BUDDY_TALK, - (s32)SOUND_OBJ_BOWSER_LAUGH, - (s32)SOUND_OBJ2_BOSS_DIALOG_GRUNT, - (s32)SOUND_OBJ_WIGGLER_TALK, - (s32)SOUND_GENERAL_YOSHI_TALK, + SOUND_OBJ_UKIKI_CHATTER_LONG, + SOUND_OBJ_BIG_PENGUIN_YELL, + SOUND_OBJ_BOWSER_INTRO_LAUGH, + SOUND_OBJ_KOOPA_TALK, + SOUND_OBJ_KING_BOBOMB_TALK, + SOUND_OBJ_BOO_LAUGH_LONG, + SOUND_OBJ_BOBOMB_BUDDY_TALK, + SOUND_OBJ_BOWSER_LAUGH, + SOUND_OBJ2_BOSS_DIALOG_GRUNT, + SOUND_OBJ_WIGGLER_TALK, + SOUND_GENERAL_YOSHI_TALK, #ifndef VERSION_EU - (s32)NO_SOUND, - (s32)NO_SOUND, - (s32)NO_SOUND, - (s32)NO_SOUND, + NO_SOUND, + NO_SOUND, + NO_SOUND, + NO_SOUND, #endif }; @@ -377,7 +378,7 @@ struct MusicDynamic sMusicDynamics[8] = { { 0x03f7, 127, 100, 0x0008, 0, 100 }, // SEQ_LEVEL_UNDERGROUND { 0x0070, 127, 10, 0x0000, 0, 100 }, // SEQ_LEVEL_SPOOKY { 0x0000, 127, 100, 0x0070, 0, 10 }, // SEQ_LEVEL_SPOOKY - { (s16) 0xffff, 127, 100, 0x0000, 0, 100 }, // any (unused) + { 0xffff, 127, 100, 0x0000, 0, 100 }, // any (unused) }; #define STUB_LEVEL(_0, _1, _2, _3, echo1, echo2, echo3, _7, _8) { echo1, echo2, echo3 }, @@ -442,8 +443,8 @@ u8 sBackgroundMusicDefaultVolume[] = { 0, // SEQ_EVENT_CUTSCENE_LAKITU (not in JP) }; -/*STATIC_ASSERT(ARRAY_COUNT(sBackgroundMusicDefaultVolume) == SEQ_COUNT, - "change this array if you are adding sequences");*/ +STATIC_ASSERT(ARRAY_COUNT(sBackgroundMusicDefaultVolume) == SEQ_COUNT, + "change this array if you are adding sequences"); u8 sPlayer0CurSeqId = SEQUENCE_NONE; u8 sMusicDynamicDelay = 0; @@ -735,6 +736,7 @@ void func_8031D838(s32 player, FadeT fadeInTime, u8 targetVolume) { } seqPlayer->fadeVelocity = (((f32)(FLOAT_CAST(targetVolume) / EU_FLOAT(127.0)) - seqPlayer->fadeVolume) / (f32) fadeInTime); + #ifdef VERSION_EU seqPlayer->state = 0; #else @@ -762,113 +764,10 @@ void func_eu_802e9bec(s32 player, s32 channel, s32 arg2) { #else -#ifdef TARGET_N64 -struct SPTask *create_next_audio_frame_task(void) { - u32 samplesRemainingInAI; - s32 writtenCmds; - s32 index; - OSTask_t *task; - s32 oldDmaCount; - s32 flags; - - gAudioFrameCount++; - if (gAudioLoadLock != AUDIO_LOCK_NOT_LOADING) { - stubbed_printf("DAC:Lost 1 Frame.\n"); - return NULL; - } - - gAudioTaskIndex ^= 1; - gCurrAiBufferIndex++; - gCurrAiBufferIndex %= NUMAIBUFFERS; - index = (gCurrAiBufferIndex - 2 + NUMAIBUFFERS) % NUMAIBUFFERS; - samplesRemainingInAI = osAiGetLength() / 4; - - // Audio is triple buffered; the audio interface reads from two buffers - // while the third is being written by the RSP. More precisely, the - // lifecycle is: - // - this function computes an audio command list - // - wait for vblank - // - the command list is sent to the RSP (we could have sent it to the - // RSP before the vblank, but that gives the RSP less time to finish) - // - wait for vblank - // - the RSP is now expected to be finished, and we can send its output - // on to the AI - // Here we thus send to the AI the sound that was generated two frames ago. - if (gAiBufferLengths[index] != 0) { - osAiSetNextBuffer(gAiBuffers[index], gAiBufferLengths[index] * 4); - } - - oldDmaCount = gCurrAudioFrameDmaCount; - // There has to be some sort of no-op if here, but it's not exactly clear - // how it should look... It's also very unclear why gCurrAudioFrameDmaQueue - // isn't read from here, despite gCurrAudioFrameDmaCount being reset. - if (oldDmaCount > AUDIO_FRAME_DMA_QUEUE_SIZE) { - stubbed_printf("DMA: Request queue over.( %d )\n", oldDmaCount); - } - gCurrAudioFrameDmaCount = 0; - - gAudioTask = &gAudioTasks[gAudioTaskIndex]; - gAudioCmd = gAudioCmdBuffers[gAudioTaskIndex]; - - index = gCurrAiBufferIndex; - gCurrAiBuffer = gAiBuffers[index]; - gAiBufferLengths[index] = ((gSamplesPerFrameTarget - samplesRemainingInAI + - EXTRA_BUFFERED_AI_SAMPLES_TARGET) & ~0xf) + SAMPLES_TO_OVERPRODUCE; - if (gAiBufferLengths[index] < gMinAiBufferLength) { - gAiBufferLengths[index] = gMinAiBufferLength; - } - if (gAiBufferLengths[index] > gSamplesPerFrameTarget + SAMPLES_TO_OVERPRODUCE) { - gAiBufferLengths[index] = gSamplesPerFrameTarget + SAMPLES_TO_OVERPRODUCE; - } - - if (sGameLoopTicked != 0) { - update_game_sound(); - sGameLoopTicked = 0; - } - - // For the function to match we have to preserve some arbitrary variable - // across this function call. - flags = 0; - gAudioCmd = synthesis_execute(gAudioCmd, &writtenCmds, gCurrAiBuffer, gAiBufferLengths[index]); - gAudioRandom = ((gAudioRandom + gAudioFrameCount) * gAudioFrameCount); - - index = gAudioTaskIndex; - gAudioTask->msgqueue = NULL; - gAudioTask->msg = NULL; - - task = &gAudioTask->task.t; - task->type = M_AUDTASK; - task->flags = flags; - task->ucode_boot = rspF3DBootStart; - task->ucode_boot_size = (u8 *) rspF3DBootEnd - (u8 *) rspF3DBootStart; - task->ucode = rspAspMainStart; - task->ucode_size = 0x800; // (this size is ignored) - task->ucode_data = rspAspMainDataStart; - task->ucode_data_size = (rspAspMainDataEnd - rspAspMainDataStart) * sizeof(u64); - task->dram_stack = NULL; - task->dram_stack_size = 0; - task->output_buff = NULL; - task->output_buff_size = NULL; - task->data_ptr = gAudioCmdBuffers[index]; - task->data_size = writtenCmds * sizeof(u64); - - // The audio task never yields, so having a yield buffer is pointless. - // This wastefulness was fixed in US. -#ifdef VERSION_JP - task->yield_data_ptr = (u64 *) gAudioSPTaskYieldBuffer; - task->yield_data_size = OS_YIELD_AUDIO_SIZE; -#else - task->yield_data_ptr = NULL; - task->yield_data_size = 0; -#endif - - decrease_sample_dma_ttls(); - return gAudioTask; -} -#else struct SPTask *create_next_audio_frame_task(void) { return NULL; } + void create_next_audio_buffer(s16 *samples, u32 num_samples) { gAudioFrameCount++; if (sGameLoopTicked != 0) { @@ -881,7 +780,6 @@ void create_next_audio_buffer(s16 *samples, u32 num_samples) { decrease_sample_dma_ttls(); } #endif -#endif void play_sound(s32 soundBits, f32 *pos) { sSoundRequests[sSoundRequestCount].soundBits = soundBits; @@ -2158,6 +2056,10 @@ void play_dialog_sound(u8 dialogID) { #endif } +void set_sequence_player_volume(s32 player, f32 volume) { + gSequencePlayers[player].volumeScale = volume; +} + void play_music(u8 player, u16 seqArgs, u16 fadeTimer) { u8 seqId = seqArgs & 0xff; u8 priority = seqArgs >> 8; @@ -2166,11 +2068,12 @@ void play_music(u8 player, u16 seqArgs, u16 fadeTimer) { // Except for the background music player, we don't support queued // sequences. Just play them immediately, stopping any old sequence. + if (player != 0) { play_sequence(player, seqId, fadeTimer); return; } - + // Abort if the queue is already full. if (sBackgroundMusicQueueSize == MAX_BG_MUSIC_QUEUE_SIZE) { return; diff --git a/src/audio/external.h b/src/audio/external.h index 284a1925..cdbd28b6 100644 --- a/src/audio/external.h +++ b/src/audio/external.h @@ -39,6 +39,7 @@ void sound_banks_disable(u8 player, u16 bankMask); void sound_banks_enable(u8 player, u16 bankMask); void func_80320A4C(u8 bankIndex, u8 arg1); void play_dialog_sound(u8 dialogID); +void set_sequence_player_volume(s32 player, f32 volume); void play_music(u8 player, u16 seqArgs, u16 fadeTimer); void stop_background_music(u16 seqId); void fadeout_background_music(u16 arg0, u16 fadeOut); diff --git a/src/audio/heap.c b/src/audio/heap.c index 2fb66527..a183a707 100644 --- a/src/audio/heap.c +++ b/src/audio/heap.c @@ -479,7 +479,7 @@ void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg if (ret == NULL) #else - persistent->entries[persistent->numEntries].ptr = (u8*) soundAlloc(&persistent->pool, arg1 * size); + persistent->entries[persistent->numEntries].ptr = soundAlloc(&persistent->pool, arg1 * size); if (persistent->entries[persistent->numEntries].ptr == NULL) #endif @@ -650,12 +650,6 @@ s32 audio_shut_down_and_reset_step(void) { */ void wait_for_audio_frames(UNUSED s32 frames) { gAudioFrameCount = 0; -#ifdef TARGET_N64 - // Sound thread will update gAudioFrameCount - while (gAudioFrameCount < frames) { - // spin - } -#endif } #endif @@ -841,11 +835,11 @@ void audio_reset_session(void) { #ifndef VERSION_EU for (j = 0; j < 2; j++) { - gAudioCmdBuffers[j] = (u64*) soundAlloc(&gNotesAndBuffersPool, gMaxAudioCmds * sizeof(u64)); + gAudioCmdBuffers[j] = soundAlloc(&gNotesAndBuffersPool, gMaxAudioCmds * sizeof(u64)); } #endif - gNotes = (struct Note*) soundAlloc(&gNotesAndBuffersPool, gMaxSimultaneousNotes * sizeof(struct Note)); + gNotes = soundAlloc(&gNotesAndBuffersPool, gMaxSimultaneousNotes * sizeof(struct Note)); note_init_all(); init_note_free_list(); @@ -897,8 +891,8 @@ void audio_reset_session(void) { gSynthesisReverb.useReverb = 0; } else { gSynthesisReverb.useReverb = 8; - gSynthesisReverb.ringBuffer.left = (s16*) soundAlloc(&gNotesAndBuffersPool, reverbWindowSize * 2); - gSynthesisReverb.ringBuffer.right = (s16*) soundAlloc(&gNotesAndBuffersPool, reverbWindowSize * 2); + gSynthesisReverb.ringBuffer.left = soundAlloc(&gNotesAndBuffersPool, reverbWindowSize * 2); + gSynthesisReverb.ringBuffer.right = soundAlloc(&gNotesAndBuffersPool, reverbWindowSize * 2); gSynthesisReverb.nextRingBufferPos = 0; gSynthesisReverb.unkC = 0; gSynthesisReverb.curFrame = 0; @@ -908,15 +902,15 @@ void audio_reset_session(void) { if (gReverbDownsampleRate != 1) { gSynthesisReverb.resampleFlags = A_INIT; gSynthesisReverb.resampleRate = 0x8000 / gReverbDownsampleRate; - gSynthesisReverb.resampleStateLeft = (s16*) soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16)); - gSynthesisReverb.resampleStateRight = (s16*) soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16)); - gSynthesisReverb.unk24 = (s16*) soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16)); - gSynthesisReverb.unk28 = (s16*) soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16)); + gSynthesisReverb.resampleStateLeft = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16)); + gSynthesisReverb.resampleStateRight = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16)); + gSynthesisReverb.unk24 = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16)); + gSynthesisReverb.unk28 = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16)); for (i = 0; i < gAudioUpdatesPerFrame; i++) { - mem = (s16*) soundAlloc(&gNotesAndBuffersPool, DEFAULT_LEN_2CH); + mem = soundAlloc(&gNotesAndBuffersPool, DEFAULT_LEN_2CH); gSynthesisReverb.items[0][i].toDownsampleLeft = mem; gSynthesisReverb.items[0][i].toDownsampleRight = mem + DEFAULT_LEN_1CH / sizeof(s16); - mem = (s16*) soundAlloc(&gNotesAndBuffersPool, DEFAULT_LEN_2CH); + mem = soundAlloc(&gNotesAndBuffersPool, DEFAULT_LEN_2CH); gSynthesisReverb.items[1][i].toDownsampleLeft = mem; gSynthesisReverb.items[1][i].toDownsampleRight = mem + DEFAULT_LEN_1CH / sizeof(s16); } diff --git a/src/audio/internal.h b/src/audio/internal.h index b042f74f..89dcc791 100644 --- a/src/audio/internal.h +++ b/src/audio/internal.h @@ -273,6 +273,7 @@ struct SequencePlayer #endif /*0x138, 0x140*/ uintptr_t bankDmaCurrDevAddr; /*0x13C, 0x144*/ ssize_t bankDmaRemaining; + /* ext */ f32 volumeScale; }; // size = 0x140, 0x148 on EU struct AdsrSettings @@ -507,9 +508,6 @@ struct Note /* U/J, EU */ /*0xA4, 0x00*/ struct AudioListItem listItem; /* 0x10*/ struct NoteSynthesisState synthesisState; -#ifdef TARGET_N64 - u8 pad0[12]; -#endif /*0x04, 0x30*/ u8 priority; /* 0x31*/ u8 waveId; /* 0x32*/ u8 sampleCountIndex; diff --git a/src/audio/load.c b/src/audio/load.c index 47f73221..d4c27b74 100644 --- a/src/audio/load.c +++ b/src/audio/load.c @@ -6,6 +6,9 @@ #include "load.h" #include "seqplayer.h" +#include "pc/platform.h" +#include "pc/fs/fs.h" + #define ALIGN16(val) (((val) + 0xF) & ~0xF) struct SharedDma { @@ -302,7 +305,7 @@ void init_sample_dma_buffers(UNUSED s32 arg0) { D_80226D68 = 144 * 9; for (i = 0; i < gMaxSimultaneousNotes * 3; i++) { #endif - sSampleDmas[gSampleDmaNumListItems].buffer = (u8*) soundAlloc(&gNotesAndBuffersPool, D_80226D68); + sSampleDmas[gSampleDmaNumListItems].buffer = soundAlloc(&gNotesAndBuffersPool, D_80226D68); if (sSampleDmas[gSampleDmaNumListItems].buffer == NULL) { #ifdef VERSION_EU break; @@ -340,7 +343,7 @@ out1: D_80226D68 = 160 * 9; #endif for (i = 0; i < gMaxSimultaneousNotes; i++) { - sSampleDmas[gSampleDmaNumListItems].buffer = (u8*) soundAlloc(&gNotesAndBuffersPool, D_80226D68); + sSampleDmas[gSampleDmaNumListItems].buffer = soundAlloc(&gNotesAndBuffersPool, D_80226D68); if (sSampleDmas[gSampleDmaNumListItems].buffer == NULL) { #ifdef VERSION_EU break; @@ -389,17 +392,17 @@ static void patch_sound(UNUSED struct AudioBankSound *sound, UNUSED u8 *memBase, UNUSED u8 *offsetBase) { struct AudioBankSample *sample; - void* patched; + void *patched; UNUSED u8 *mem; // unused on US -#define PATCH(x, base) (patched = (void*) ((uintptr_t) (x) + (uintptr_t) base)) +#define PATCH(x, base) (patched = (void *)((uintptr_t) (x) + (uintptr_t) base)) if (sound->sample != NULL) { - sample = sound->sample = (struct AudioBankSample*) PATCH(sound->sample, memBase); + sample = sound->sample = PATCH(sound->sample, memBase); if (sample->loaded == 0) { - sample->sampleAddr = (u8*) PATCH(sample->sampleAddr, offsetBase); - sample->loop = (struct AdpcmLoop*) PATCH(sample->loop, memBase); - sample->book = (struct AdpcmBook*) PATCH(sample->book, memBase); + sample->sampleAddr = PATCH(sample->sampleAddr, offsetBase); + sample->loop = PATCH(sample->loop, memBase); + sample->book = PATCH(sample->book, memBase); sample->loaded = 1; } #ifdef VERSION_EU @@ -432,16 +435,16 @@ void patch_sound(UNUSED struct AudioBankSound *sound, UNUSED u8 *memBase, UNUSED if ((*sound).sample != (void *) 0) \ { \ patched = (void *)(((uintptr_t)(*sound).sample) + ((uintptr_t)((u8 *) mem))); \ - (*sound).sample = (struct AudioBankSample*) patched; \ + (*sound).sample = patched; \ sample = (*sound).sample; \ if ((*sample).loaded == 0) \ { \ patched = (void *)(((uintptr_t)(*sample).sampleAddr) + ((uintptr_t) offset)); \ - (*sample).sampleAddr = (u8*) patched; \ + (*sample).sampleAddr = patched; \ patched = (void *)(((uintptr_t)(*sample).loop) + ((uintptr_t)((u8 *) mem))); \ - (*sample).loop = (struct AdpcmLoop*) patched; \ + (*sample).loop = patched; \ patched = (void *)(((uintptr_t)(*sample).book) + ((uintptr_t)((u8 *) mem))); \ - (*sample).book = (struct AdpcmBook*) patched; \ + (*sample).book = patched; \ (*sample).loaded = 1; \ } \ } \ @@ -468,25 +471,25 @@ void patch_audio_bank(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 drums = mem->drums; #ifndef VERSION_EU if (drums != NULL && numDrums > 0) { - mem->drums = (struct Drum**)((uintptr_t) drums + (uintptr_t) mem); + mem->drums = (void *)((uintptr_t) drums + (uintptr_t) mem); if (numDrums > 0) //! unneeded when -sopt is enabled for (i = 0; i < numDrums; i++) { #else numDrums2 = numDrums; if (drums != NULL && numDrums2 > 0) { - mem->drums = (struct Drum*) PATCH(drums, mem); + mem->drums = PATCH(drums, mem); for (i = 0; i < numDrums2; i++) { #endif patched = mem->drums[i]; if (patched != NULL) { - drum = (struct Drum*) PATCH(patched, mem); + drum = PATCH(patched, mem); mem->drums[i] = drum; if (drum->loaded == 0) { #ifndef VERSION_EU //! copt replaces drum with 'patched' for these two lines PATCH_SOUND(&(*(struct Drum *)patched).sound, mem, offset); patched = (*(struct Drum *)patched).envelope; - drum->envelope = (struct AdsrEnvelope*)((uintptr_t) mem + (uintptr_t) patched); + drum->envelope = (void *)((uintptr_t) mem + (uintptr_t) patched); #else patch_sound(&drum->sound, (u8 *) mem, offset); patched = drum->envelope; @@ -517,7 +520,7 @@ l2: do { #endif if (*itInstrs != NULL) { - *itInstrs = (struct Instrument*)((uintptr_t) *itInstrs + (uintptr_t) mem); + *itInstrs = (void *)((uintptr_t) *itInstrs + (uintptr_t) mem); instrument = *itInstrs; if (instrument->loaded == 0) { @@ -532,9 +535,9 @@ l2: #endif patched = instrument->envelope; #ifndef VERSION_EU - instrument->envelope = (struct AdsrEnvelope*)((uintptr_t) mem + (uintptr_t) patched); + instrument->envelope = (void *)((uintptr_t) mem + (uintptr_t) patched); #else - instrument->envelope = (struct AdsrEnvelope*)((uintptr_t) patched + (uintptr_t) mem); + instrument->envelope = (void *)((uintptr_t) patched + (uintptr_t) mem); #endif instrument->loaded = 1; } @@ -568,7 +571,7 @@ struct AudioBank *bank_load_immediate(s32 bankId, s32 arg1) { alloc = ALIGN16(alloc); alloc -= 0x10; ctlData = gAlCtlHeader->seqArray[bankId].offset; - ret = (struct AudioBank*) alloc_bank_or_seq(&gBankLoadedPool, 1, alloc, arg1, bankId); + ret = alloc_bank_or_seq(&gBankLoadedPool, 1, alloc, arg1, bankId); if (ret == NULL) { return NULL; } @@ -603,7 +606,7 @@ struct AudioBank *bank_load_async(s32 bankId, s32 arg1, struct SequencePlayer *s alloc = ALIGN16(alloc); alloc -= 0x10; ctlData = gAlCtlHeader->seqArray[bankId].offset; - ret = (struct AudioBank*) alloc_bank_or_seq(&gBankLoadedPool, 1, alloc, arg1, bankId); + ret = alloc_bank_or_seq(&gBankLoadedPool, 1, alloc, arg1, bankId); if (ret == NULL) { return NULL; } @@ -737,7 +740,7 @@ u8 get_missing_bank(u32 seqId, s32 *nonNullCount, s32 *nullCount) { } struct AudioBank *load_banks_immediate(s32 seqId, u8 *arg1) { - struct AudioBank* ret; + void *ret; u32 bankId; u16 offset; u8 i; @@ -755,9 +758,9 @@ struct AudioBank *load_banks_immediate(s32 seqId, u8 *arg1) { if (IS_BANK_LOAD_COMPLETE(bankId) == TRUE) { #ifdef VERSION_EU - ret = (struct AudioBank*) get_bank_or_seq(&gBankLoadedPool, 2, bankId); + ret = get_bank_or_seq(&gBankLoadedPool, 2, bankId); #else - ret = (struct AudioBank*) get_bank_or_seq(&gBankLoadedPool, 2, gAlBankSets[offset - 1]); + ret = get_bank_or_seq(&gBankLoadedPool, 2, gAlBankSets[offset - 1]); #endif } else { ret = NULL; @@ -864,10 +867,25 @@ void load_sequence_internal(u32 player, u32 seqId, s32 loadAsync) { seqPlayer->scriptState.depth = 0; seqPlayer->delay = 0; seqPlayer->enabled = TRUE; - seqPlayer->seqData = (u8*) sequenceData; - seqPlayer->scriptState.pc = (u8*) sequenceData; + seqPlayer->seqData = sequenceData; + seqPlayer->scriptState.pc = sequenceData; } +#ifdef EXTERNAL_DATA +# define LOAD_DATA(x) load_sound_res((const char *)x) +# include +# include +static inline void *load_sound_res(const char *path) { + void *data = fs_load_file(path, NULL); + if (!data) sys_fatal("could not load sound data from '%s'", path); + // FIXME: figure out where it is safe to free this shit + // can't free it immediately after in audio_init() + return data; +} +#else +# define LOAD_DATA(x) x +#endif + // (void) must be omitted from parameters void audio_init() { #ifdef VERSION_EU @@ -902,32 +920,11 @@ void audio_init() { for (i = 0; i <= lim2 / 8 - 1; i++) { ((u64 *) gAudioHeap)[i] = 0; } - -#ifdef TARGET_N64 - // It seems boot.s doesn't clear the .bss area for audio, so do it here. - i = 0; - lim3 = ((uintptr_t) &gAudioGlobalsEndMarker - (uintptr_t) &gAudioGlobalsStartMarker) / 8; - ptr64 = &gAudioGlobalsStartMarker - 1; - for (k = lim3; k >= 0; k--) { - i++; - ptr64[i] = 0; - } -#endif - #else for (i = 0; i < gAudioHeapSize / 8; i++) { ((u64 *) gAudioHeap)[i] = 0; } -#ifdef TARGET_N64 - // It seems boot.s doesn't clear the .bss area for audio, so do it here. - lim3 = ((uintptr_t) &gAudioGlobalsEndMarker - (uintptr_t) &gAudioGlobalsStartMarker) / 8; - ptr64 = &gAudioGlobalsStartMarker; - for (k = lim3; k >= 0; k--) { - *ptr64++ = 0; - } -#endif - D_EU_802298D0 = 20.03042f; gRefreshRate = 50; port_eu_init(); @@ -955,7 +952,7 @@ void audio_init() { sound_init_main_pools(D_80333EF0); for (i = 0; i < NUMAIBUFFERS; i++) { - gAiBuffers[i] = (s16*) soundAlloc(&gAudioInitPool, AIBUFFER_LEN); + gAiBuffers[i] = soundAlloc(&gAudioInitPool, AIBUFFER_LEN); for (j = 0; j < (s32) (AIBUFFER_LEN / sizeof(s16)); j++) { gAiBuffers[i][j] = 0; @@ -972,7 +969,7 @@ void audio_init() { // Load header for sequence data (assets/music_data.sbk.s) gSeqFileHeader = (ALSeqFile *) buf; - data = gMusicData; + data = LOAD_DATA(gMusicData); audio_dma_copy_immediate((uintptr_t) data, gSeqFileHeader, 0x10); gSequenceCount = gSeqFileHeader->seqCount; #ifdef VERSION_EU @@ -981,33 +978,36 @@ void audio_init() { #else size = ALIGN16(gSequenceCount * sizeof(ALSeqData) + 4); #endif - gSeqFileHeader = (ALSeqFile*) soundAlloc(&gAudioInitPool, size); + gSeqFileHeader = soundAlloc(&gAudioInitPool, size); audio_dma_copy_immediate((uintptr_t) data, gSeqFileHeader, size); - alSeqFileNew(gSeqFileHeader, (u8*) data); + alSeqFileNew(gSeqFileHeader, data); // Load header for CTL (assets/sound_data.ctl.s, i.e. ADSR) gAlCtlHeader = (ALSeqFile *) buf; - data = gSoundDataADSR; + data = LOAD_DATA(gSoundDataADSR); audio_dma_copy_immediate((uintptr_t) data, gAlCtlHeader, 0x10); size = gAlCtlHeader->seqCount * sizeof(ALSeqData) + 4; size = ALIGN16(size); - gCtlEntries = (struct CtlEntry*) soundAlloc(&gAudioInitPool, gAlCtlHeader->seqCount * sizeof(struct CtlEntry)); - gAlCtlHeader = (ALSeqFile*) soundAlloc(&gAudioInitPool, size); + gCtlEntries = soundAlloc(&gAudioInitPool, gAlCtlHeader->seqCount * sizeof(struct CtlEntry)); + gAlCtlHeader = soundAlloc(&gAudioInitPool, size); audio_dma_copy_immediate((uintptr_t) data, gAlCtlHeader, size); - alSeqFileNew(gAlCtlHeader, (u8*) data); + alSeqFileNew(gAlCtlHeader, data); // Load header for TBL (assets/sound_data.tbl.s, i.e. raw data) gAlTbl = (ALSeqFile *) buf; audio_dma_copy_immediate((uintptr_t) data, gAlTbl, 0x10); size = gAlTbl->seqCount * sizeof(ALSeqData) + 4; size = ALIGN16(size); - gAlTbl = (ALSeqFile*) soundAlloc(&gAudioInitPool, size); - audio_dma_copy_immediate((uintptr_t) gSoundDataRaw, gAlTbl, size); - alSeqFileNew(gAlTbl, gSoundDataRaw); + gAlTbl = soundAlloc(&gAudioInitPool, size); + + data = LOAD_DATA(gSoundDataRaw); + audio_dma_copy_immediate((uintptr_t) data, gAlTbl, size); + alSeqFileNew(gAlTbl, data); // Load bank sets for each sequence (assets/bank_sets.s) - gAlBankSets = (u8*) soundAlloc(&gAudioInitPool, 0x100); - audio_dma_copy_immediate((uintptr_t) gBankSetsData, gAlBankSets, 0x100); + data = LOAD_DATA(gBankSetsData); + gAlBankSets = soundAlloc(&gAudioInitPool, 0x100); + audio_dma_copy_immediate((uintptr_t) data, gAlBankSets, 0x100); init_sequence_players(); gAudioLoadLock = AUDIO_LOCK_NOT_LOADING; diff --git a/src/audio/playback.c b/src/audio/playback.c index 4fce60c5..b34089db 100644 --- a/src/audio/playback.c +++ b/src/audio/playback.c @@ -151,11 +151,6 @@ struct Drum *get_drum(s32 bankId, s32 drumId) { gAudioErrorFlags = ((bankId << 8) + drumId) + 0x4000000; return 0; } -#ifndef NO_SEGMENTED_MEMORY - if ((uintptr_t) gCtlEntries[bankId].drums < 0x80000000U) { - return 0; - } -#endif drum = gCtlEntries[bankId].drums[drumId]; if (drum == NULL) { gAudioErrorFlags = ((bankId << 8) + drumId) + 0x5000000; @@ -249,11 +244,6 @@ void process_notes(void) { #ifdef VERSION_EU playbackState = (struct NotePlaybackState *) ¬e->priority; if (note->parentLayer != NO_LAYER) { -#ifndef NO_SEGMENTED_MEMORY - if ((uintptr_t) playbackState->parentLayer < 0x7fffffffU) { - continue; - } -#endif if (!playbackState->parentLayer->enabled && playbackState->priority >= NOTE_PRIORITY_MIN) { goto c; } else if (playbackState->parentLayer->seqChannel->seqPlayer == NULL) { @@ -729,7 +719,7 @@ void note_pool_fill(struct NotePool *pool, s32 count) { } while (j < count) { - note = (struct Note*) audio_list_pop_back(source); + note = audio_list_pop_back(source); if (note == NULL) { break; } @@ -789,7 +779,7 @@ struct Note *pop_node_with_value_less_equal(struct AudioListItem *list, s32 limi #endif audio_list_remove(best); - return (struct Note*) best->u.value; + return best->u.value; } #if defined(VERSION_EU) @@ -868,7 +858,7 @@ void note_release_and_take_ownership(struct Note *note, struct SequenceChannelLa } struct Note *alloc_note_from_disabled(struct NotePool *pool, struct SequenceChannelLayer *seqLayer) { - struct Note *note = (struct Note*) audio_list_pop_back(&pool->disabled); + struct Note *note = audio_list_pop_back(&pool->disabled); if (note != NULL) { #ifdef VERSION_EU note_init_for_layer(note, seqLayer); @@ -884,7 +874,7 @@ struct Note *alloc_note_from_disabled(struct NotePool *pool, struct SequenceChan } struct Note *alloc_note_from_decaying(struct NotePool *pool, struct SequenceChannelLayer *seqLayer) { - struct Note *note = (struct Note*) audio_list_pop_back(&pool->decaying); + struct Note *note = audio_list_pop_back(&pool->decaying); if (note != NULL) { note_release_and_take_ownership(note, seqLayer); audio_list_push_back(&pool->releasing, ¬e->listItem); @@ -1052,7 +1042,7 @@ void note_init_all(void) { #ifdef VERSION_EU note->synthesisState.synthesisBuffers = soundAlloc(&gNotesAndBuffersPool, sizeof(struct NoteSynthesisBuffers)); #else - note->synthesisBuffers = (struct NoteSynthesisBuffers*) soundAlloc(&gNotesAndBuffersPool, sizeof(struct NoteSynthesisBuffers)); + note->synthesisBuffers = soundAlloc(&gNotesAndBuffersPool, sizeof(struct NoteSynthesisBuffers)); #endif } } diff --git a/src/audio/port_eu.c b/src/audio/port_eu.c index cdd608ed..4fbc74db 100644 --- a/src/audio/port_eu.c +++ b/src/audio/port_eu.c @@ -34,104 +34,6 @@ void decrease_sample_dma_ttls(void); s32 audio_shut_down_and_reset_step(void); void func_802ad7ec(u32); -#ifdef TARGET_N64 -struct SPTask *create_next_audio_frame_task(void) { - u32 samplesRemainingInAI; - s32 writtenCmds; - s32 index; - OSTask_t *task; - s32 flags; - s16 *currAiBuffer; - s32 oldDmaCount; - OSMesg sp30; - OSMesg sp2C; - - gAudioFrameCount++; - if (gAudioFrameCount % gAudioBufferParameters.presetUnk4 != 0) { - stubbed_printf("DAC:Lost 1 Frame.\n"); - return NULL; - } - - osSendMesg(OSMesgQueues[0], (OSMesg) gAudioFrameCount, 0); - - gAudioTaskIndex ^= 1; - gCurrAiBufferIndex++; - gCurrAiBufferIndex %= NUMAIBUFFERS; - index = (gCurrAiBufferIndex - 2 + NUMAIBUFFERS) % NUMAIBUFFERS; - samplesRemainingInAI = osAiGetLength() / 4; - - if (gAiBufferLengths[index] != 0) { - osAiSetNextBuffer(gAiBuffers[index], gAiBufferLengths[index] * 4); - } - - oldDmaCount = gCurrAudioFrameDmaCount; - if (oldDmaCount > AUDIO_FRAME_DMA_QUEUE_SIZE) { - stubbed_printf("DMA: Request queue over.( %d )\n", oldDmaCount); - } - gCurrAudioFrameDmaCount = 0; - - decrease_sample_dma_ttls(); - if (osRecvMesg(OSMesgQueues[2], &sp30, 0) != -1) { - gAudioResetPresetIdToLoad = (u8) (s32) sp30; - gAudioResetStatus = 5; - } - - if (gAudioResetStatus != 0) { - if (audio_shut_down_and_reset_step() == 0) { - if (gAudioResetStatus == 0) { - osSendMesg(OSMesgQueues[3], (OSMesg) (s32) gAudioResetPresetIdToLoad, OS_MESG_NOBLOCK); - } - return NULL; - } - } - - gAudioTask = &gAudioTasks[gAudioTaskIndex]; - gAudioCmd = gAudioCmdBuffers[gAudioTaskIndex]; - index = gCurrAiBufferIndex; - currAiBuffer = gAiBuffers[index]; - - gAiBufferLengths[index] = ((gAudioBufferParameters.samplesPerFrameTarget - samplesRemainingInAI + - EXTRA_BUFFERED_AI_SAMPLES_TARGET) & ~0xf) + SAMPLES_TO_OVERPRODUCE; - if (gAiBufferLengths[index] < gAudioBufferParameters.minAiBufferLength) { - gAiBufferLengths[index] = gAudioBufferParameters.minAiBufferLength; - } - if (gAiBufferLengths[index] > gAudioBufferParameters.maxAiBufferLength) { - gAiBufferLengths[index] = gAudioBufferParameters.maxAiBufferLength; - } - - if (osRecvMesg(OSMesgQueues[1], &sp2C, OS_MESG_NOBLOCK) != -1) { - func_802ad7ec((u32) sp2C); - } - - flags = 0; - gAudioCmd = synthesis_execute(gAudioCmd, &writtenCmds, currAiBuffer, gAiBufferLengths[index]); - gAudioRandom = ((gAudioRandom + gAudioFrameCount) * gAudioFrameCount); - gAudioRandom = gAudioRandom + writtenCmds / 8; - - index = gAudioTaskIndex; - gAudioTask->msgqueue = NULL; - gAudioTask->msg = NULL; - - task = &gAudioTask->task.t; - task->type = M_AUDTASK; - task->flags = flags; - task->ucode_boot = rspF3DBootStart; - task->ucode_boot_size = (u8 *) rspF3DBootEnd - (u8 *) rspF3DBootStart; - task->ucode = rspAspMainStart; - task->ucode_data = rspAspMainDataStart; - task->ucode_size = 0x800; // (this size is ignored) - task->ucode_data_size = (rspAspMainDataEnd - rspAspMainDataStart) * sizeof(u64); - task->dram_stack = NULL; - task->dram_stack_size = 0; - task->output_buff = NULL; - task->output_buff_size = NULL; - task->data_ptr = gAudioCmdBuffers[index]; - task->data_size = writtenCmds * sizeof(u64); - task->yield_data_ptr = NULL; - task->yield_data_size = 0; - return gAudioTask; -} -#else struct SPTask *create_next_audio_frame_task(void) { return NULL; } @@ -156,7 +58,6 @@ void create_next_audio_buffer(s16 *samples, u32 num_samples) { gAudioRandom = ((gAudioRandom + gAudioFrameCount) * gAudioFrameCount); gAudioRandom = gAudioRandom + writtenCmds / 8; } -#endif void eu_process_audio_cmd(struct EuAudioCmd *cmd) { s32 i; diff --git a/src/audio/seqplayer.c b/src/audio/seqplayer.c index e403851d..91146bbb 100644 --- a/src/audio/seqplayer.c +++ b/src/audio/seqplayer.c @@ -85,7 +85,7 @@ s32 seq_channel_set_layer(struct SequenceChannel *seqChannel, s32 layerIndex) { #ifdef VERSION_EU struct SequenceChannelLayer *layer; #endif - layer = (struct SequenceChannelLayer*) audio_list_pop_back(&gLayerFreeList); + layer = audio_list_pop_back(&gLayerFreeList); seqChannel->layers[layerIndex] = layer; if (layer == NULL) { seqChannel->layers[layerIndex] = NULL; @@ -263,7 +263,7 @@ void sequence_channel_enable(struct SequencePlayer *seqPlayer, u8 channelIndex, seqChannel->enabled = TRUE; seqChannel->finished = FALSE; seqChannel->scriptState.depth = 0; - seqChannel->scriptState.pc = (u8*) arg2; + seqChannel->scriptState.pc = arg2; seqChannel->delay = 0; for (i = 0; i < LAYERS_MAX; i++) { if (seqChannel->layers[i] != NULL) { @@ -1165,14 +1165,14 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { case 0xc2: // chan_setdyntable sp5A = m64_read_s16(state); - seqChannel->dynTable = (u8 (*)[][2]) (seqPlayer->seqData + sp5A); + seqChannel->dynTable = (void *) (seqPlayer->seqData + sp5A); break; case 0xc5: // chan_dynsetdyntable if (value != -1) { sp5A = (*seqChannel->dynTable)[value][1] + ((*seqChannel->dynTable)[value][0] << 8); - seqChannel->dynTable = (u8 (*)[][2]) (seqPlayer->seqData + sp5A); + seqChannel->dynTable = (void *) (seqPlayer->seqData + sp5A); } break; @@ -2081,6 +2081,10 @@ void init_sequence_players(void) { #endif gSequencePlayers[i].bankDmaInProgress = FALSE; gSequencePlayers[i].seqDmaInProgress = FALSE; + + // only set this once at the start so it doesn't spike later + gSequencePlayers[i].volumeScale = 1.0f; + init_note_lists(&gSequencePlayers[i].notePool); init_sequence_player(i); } diff --git a/src/audio/seqplayer.h b/src/audio/seqplayer.h index d2fc1344..99ea13ac 100644 --- a/src/audio/seqplayer.h +++ b/src/audio/seqplayer.h @@ -11,6 +11,7 @@ void sequence_channel_disable(struct SequenceChannel *seqPlayer); void sequence_player_disable(struct SequencePlayer* seqPlayer); void audio_list_push_back(struct AudioListItem *list, struct AudioListItem *item); void *audio_list_pop_back(struct AudioListItem *list); +void sequence_channel_set_volume(struct SequenceChannel *seqChannel, u8 volume); void process_sequences(s32 iterationsRemaining); void init_sequence_player(u32 player); void init_sequence_players(void); diff --git a/src/audio/synthesis.c b/src/audio/synthesis.c index 05d3bf5a..1fdd8510 100644 --- a/src/audio/synthesis.c +++ b/src/audio/synthesis.c @@ -7,9 +7,7 @@ #include "seqplayer.h" #include "external.h" -#ifndef TARGET_N64 #include "../pc/mixer.h" -#endif #define DMEM_ADDR_TEMP 0x0 #define DMEM_ADDR_UNCOMPRESSED_NOTE 0x180 @@ -853,7 +851,7 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { } #else temp = (note->samplePosInt - s2 + 0x10) / 16; - v0_2 = (u8*) dma_sample_data( + v0_2 = dma_sample_data( (uintptr_t) (sampleAddr + temp * 9), t0 * 9, flags, ¬e->sampleDmaIndex); #endif diff --git a/src/buffers/buffers.h b/src/buffers/buffers.h index 5ffecd44..9d1d692b 100644 --- a/src/buffers/buffers.h +++ b/src/buffers/buffers.h @@ -28,11 +28,8 @@ extern struct SaveBuffer gSaveBuffer; extern u8 gGfxSPTaskStack[]; -#ifdef TARGET_N64 -#define GFX_NUM_POOLS 2 -#else #define GFX_NUM_POOLS 1 -#endif + extern struct GfxPool gGfxPools[GFX_NUM_POOLS]; #endif // BUFFERS_H diff --git a/src/common/level/area_builder.cpp b/src/common/level/area_builder.cpp deleted file mode 100644 index bec7ec4a..00000000 --- a/src/common/level/area_builder.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include "area_builder.hpp" - -#include "include/level_commands.h" - -AreaBuilder::AreaBuilder(u8 area_index, const GeoLayout* geo_layout) - : entry_(std::make_unique()), - body_(std::make_shared()) { - (*entry_) - .add_scripts({AREA(area_index, geo_layout)}) - .add_builder(body_) - .add_script(END_AREA()); -} - -AreaBuilder& AreaBuilder::add_part( - std::shared_ptr> part) { - body_->add_part(part); - return *this; -} - -AreaBuilder& AreaBuilder::add_script(LevelScript script) { - body_->add_script(script); - return *this; -} - -AreaBuilder& AreaBuilder::add_scripts( - std::initializer_list scripts) { - body_->add_scripts(scripts); - return *this; -} - -AreaBuilder& AreaBuilder::add_scripts(const LevelScript* scripts, - int script_count) { - body_->add_scripts(scripts, script_count); - return *this; -} - -AreaBuilder& AreaBuilder::add_builder( - std::shared_ptr> builder) { - body_->add_builder(builder); - return *this; -} - -AreaBuilder& AreaBuilder::add_object( - std::shared_ptr object_builder, - const std::function& params_callback) { - auto params = ObjectBuilderParams(); - params_callback(params); - - const auto model_index = object_builder->get_model_index(); - const auto x = params.x; - const auto y = params.y; - const auto z = params.z; - const auto x_angle = params.x_angle; - const auto y_angle = params.y_angle; - const auto z_angle = params.z_angle; - const auto bhv_param = params.beh_param; - const auto bhv_scripts = object_builder->get_behavior_scripts(); - - body_->add_scripts({OBJECT(model_index, - x, - y, - z, - x_angle, - y_angle, - z_angle, - bhv_param, - bhv_scripts)}); - - return *this; -} - -int AreaBuilder::size() const { return entry_->size(); } - -void AreaBuilder::build_into(LevelScript* dst, int& dst_pos) const { - entry_->build_into(dst, dst_pos); -} - -std::weak_ptr AreaBuilder::get_cache_validation_node() { - return body_->get_cache_validation_node(); -} \ No newline at end of file diff --git a/src/common/level/area_builder.hpp b/src/common/level/area_builder.hpp deleted file mode 100644 index 82f26348..00000000 --- a/src/common/level/area_builder.hpp +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once -#include -#include - -#include "common/scripts/dynamic_level_script_builder.hpp" -#include "common/scripts/i_level_script_builder.hpp" - -#include "i_object_builder.hpp" -#include "object_builder_params.hpp" - -class AreaBuilder : public ILevelScriptBuilder { -public: - AreaBuilder(u8 area_index, const GeoLayout* geo_layout); - AreaBuilder(const AreaBuilder& other) = delete; - - AreaBuilder& add_part( - std::shared_ptr> part) override; - - AreaBuilder& add_script(LevelScript script) override; - AreaBuilder& add_scripts( - std::initializer_list scripts) override; - AreaBuilder& add_scripts(const LevelScript* scripts, - int script_count) override; - - AreaBuilder& add_builder( - std::shared_ptr> builder) override; - - AreaBuilder& add_object(std::shared_ptr object_builder, - const std::function& - params_callback); - - int size() const override; - void build_into(LevelScript* dst, int& dst_pos) const override; - std::weak_ptr get_cache_validation_node() override; - -private: - const std::unique_ptr entry_; - const std::shared_ptr body_; -}; diff --git a/src/common/level/i_object_builder.hpp b/src/common/level/i_object_builder.hpp deleted file mode 100644 index 2826b912..00000000 --- a/src/common/level/i_object_builder.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#include "include/types.h" - -class IObjectBuilder { - public: - IObjectBuilder() = default; - IObjectBuilder(const IObjectBuilder& other) = delete; - - virtual u16 get_model_index() = 0; - virtual const BehaviorScript* get_behavior_scripts() const = 0; -}; diff --git a/src/common/level/macro_behavior_script_builder.hpp b/src/common/level/macro_behavior_script_builder.hpp deleted file mode 100644 index 3f59c932..00000000 --- a/src/common/level/macro_behavior_script_builder.hpp +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once - diff --git a/src/common/level/object_builder_params.hpp b/src/common/level/object_builder_params.hpp deleted file mode 100644 index 13bde067..00000000 --- a/src/common/level/object_builder_params.hpp +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include "include/types.h" - -class ObjectBuilderParams { -public: - ObjectBuilderParams& set_pos(s16 x, s16 y, s16 z) { - this->x = x; - this->y = y; - this->z = z; - - return *this; - } - - ObjectBuilderParams& set_angle(s16 x_angle, s16 y_angle, s16 z_angle) { - this->x_angle = x_angle; - this->y_angle = y_angle; - this->z_angle = z_angle; - - return *this; - } - - ObjectBuilderParams& set_beh_param(u16 beh_param) { - this->beh_param = beh_param; - - return *this; - } - - s16 x; - s16 y; - s16 z; - - s16 x_angle = 0; - s16 y_angle = 0; - s16 z_angle = 0; - - u16 beh_param = 0x00000000; -}; \ No newline at end of file diff --git a/src/common/level/original_object_builder.cpp b/src/common/level/original_object_builder.cpp deleted file mode 100644 index 38b40d32..00000000 --- a/src/common/level/original_object_builder.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "original_object_builder.hpp" - - -OriginalObjectBuilder::OriginalObjectBuilder(u16 model_index, - const BehaviorScript* - behavior_scripts) - : model_index(model_index), - behavior_scripts(behavior_scripts) {} - -u16 OriginalObjectBuilder::get_model_index() { return model_index; } - -const BehaviorScript* OriginalObjectBuilder::get_behavior_scripts() const { - return behavior_scripts; -} diff --git a/src/common/level/original_object_builder.hpp b/src/common/level/original_object_builder.hpp deleted file mode 100644 index 14daeade..00000000 --- a/src/common/level/original_object_builder.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "i_object_builder.hpp" -#include "include/types.h" - -class OriginalObjectBuilder : public IObjectBuilder { -public: - OriginalObjectBuilder(u16 model_index, const BehaviorScript* scripts); - OriginalObjectBuilder(const OriginalObjectBuilder& other) = delete; - - u16 get_model_index() override; - const BehaviorScript* get_behavior_scripts() const override; - -private: - const u16 model_index; - const BehaviorScript* behavior_scripts; -}; diff --git a/src/common/level/wrapped_object_builder.cpp b/src/common/level/wrapped_object_builder.cpp deleted file mode 100644 index c507638b..00000000 --- a/src/common/level/wrapped_object_builder.cpp +++ /dev/null @@ -1,110 +0,0 @@ -#include "wrapped_object_builder.hpp" - -#include "common/scripts/util.hpp" -#include "game/behaviors/butterfly/butterfly.hpp" - -#include "behavior_macros.h" - -// TODO: Remove this call by merging the WrappedObjectBuilder hpp/cpp files. -template class WrappedObjectBuilder; - -template -WrappedObjectBuilder::WrappedObjectBuilder( - u16 model_index, ObjectList object_type) - : model_index(model_index) { - add_script(BEGIN(object_type)); -} - -template -u16 WrappedObjectBuilder::get_model_index() { - return model_index; -} - -template -void bhv_wrapper_init() { - IObjectWrapper::get_or_create_wrapper_for(gCurrentObject)->init(); -} - -void bhv_wrapper_loop() { - IObjectWrapper::get_wrapper_for(gCurrentObject)->tick(); -} - -template -const BehaviorScript* WrappedObjectBuilder::get_entry_pointer( - int& out_count) const { - if (cached_behavior_scripts != nullptr) { - out_count = size(); - return cached_behavior_scripts; - } - - // TODO: Move this into a wrapper around body_. - auto unconst_this = const_cast*>(this); - unconst_this->add_scripts({ - CALL_NATIVE(bhv_wrapper_init), - BEGIN_LOOP(), - CALL_NATIVE(bhv_wrapper_loop), - END_LOOP(), - }); - - return build_impl(out_count); -} - -template -WrappedObjectBuilder& -WrappedObjectBuilder::add_part( - std::shared_ptr> part) { - parts_.push_back(std::move(part)); - return *this; -} - -template -WrappedObjectBuilder& -WrappedObjectBuilder::add_script(BehaviorScript script) { - return add_part(std::make_shared>(script)); -} - -template -WrappedObjectBuilder& -WrappedObjectBuilder::add_scripts( - std::initializer_list scripts) { - return add_part( - std::make_shared>(scripts)); -} - -template -WrappedObjectBuilder& -WrappedObjectBuilder::add_scripts(const BehaviorScript* scripts, - int script_count) { - return add_part(std::make_shared>( - scripts, script_count)); -} - -template -WrappedObjectBuilder& -WrappedObjectBuilder::add_builder( - std::shared_ptr> builder) { - return add_part(std::make_shared>(builder)); -} - -template -int WrappedObjectBuilder::size() const { - auto total_size = 0; - for (const auto& part : parts_) { - total_size += part->size(); - } - return total_size; -} - -template -void WrappedObjectBuilder::build_into(LevelScript* dst, - int& dst_pos) const { - for (const auto& part : parts_) { - part->build_into(dst, dst_pos); - } -} - -template -std::weak_ptr -WrappedObjectBuilder::get_cache_validation_node() { - return cache_validation_impl_; -} diff --git a/src/common/level/wrapped_object_builder.hpp b/src/common/level/wrapped_object_builder.hpp deleted file mode 100644 index 9a5327c6..00000000 --- a/src/common/level/wrapped_object_builder.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once -#include -#include -#include - -#include "common/scripts/i_behavior_script_builder.hpp" -#include "game/object_list_processor.h" - -#include "i_object_builder.hpp" - -// TODO: Memory leaking will be a problem with the behavior scripts. -// TODO: Will not update if changes are made after first build. -// TODO: Each version of the build should maintain the same pointer location. -template -class WrappedObjectBuilder - : public IBehaviorScriptBuilder, public IObjectBuilder { -public: - WrappedObjectBuilder(u16 model_index, ObjectList object_type); - WrappedObjectBuilder(const WrappedObjectBuilder& other) = delete; - - u16 get_model_index() override; - - const BehaviorScript* get_behavior_scripts() const override { - return get_entry_pointer(); - } - - const BehaviorScript* get_entry_pointer(int& out_count = unused_int) const - override; - - WrappedObjectBuilder& add_part( - std::shared_ptr> part) override; - - WrappedObjectBuilder& add_script(BehaviorScript script) override; - WrappedObjectBuilder& add_scripts( - std::initializer_list scripts) override; - WrappedObjectBuilder& add_scripts(const BehaviorScript* scripts, - int script_count) override; - - WrappedObjectBuilder& add_builder( - std::shared_ptr> builder) override; - - int size() const override; - void build_into(LevelScript* dst, int& dst_count) const override; - std::weak_ptr get_cache_validation_node() override; - -private: - const u16 model_index; - std::vector>> parts_; - - std::shared_ptr cache_validation_impl_; - - const BehaviorScript* cached_behavior_scripts = nullptr; -}; diff --git a/src/common/object/i_object_wrapper.cpp b/src/common/object/i_object_wrapper.cpp deleted file mode 100644 index 047a30a5..00000000 --- a/src/common/object/i_object_wrapper.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "i_object_wrapper.hpp" - -IObjectWrapper* IObjectWrapper::get_wrapper_for(struct Object* wrapped_object) { - return (IObjectWrapper*) wrapped_object->wrapper.get(); -} - -// TODO: Don't make this such an easily accessed public method... -void IObjectWrapper::destroy_wrapper_for(struct Object* wrapped_object) { - wrapped_object->wrapper.reset(); -} - -IObjectWrapper::IObjectWrapper(struct Object* wrapped_object) { - this->wrapped_object = wrapped_object; -} diff --git a/src/common/object/i_object_wrapper.hpp b/src/common/object/i_object_wrapper.hpp deleted file mode 100644 index 68f15e40..00000000 --- a/src/common/object/i_object_wrapper.hpp +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once - -#include -#include - -#include "include/types.h" - -/** - * Interface for "object wrappers", which allows us to reframe Super Mario 64's - * C-style instance system in an C++ way. - */ -// TODO: Move these static methods to a management service. -class IObjectWrapper { - public: - // TODO: Remote this method, store the wrapper on the object. - template - static TWrapper* get_or_create_wrapper_for(struct Object* wrapped_object) { - auto& wrapper_ptr = wrapped_object->wrapper; - - auto wrapper = (TWrapper*)wrapper_ptr.get(); - if (wrapper == nullptr) { - wrapper = new TWrapper(wrapped_object); - wrapper_ptr.reset(wrapper); - } - - return wrapper; - } - - static IObjectWrapper* get_wrapper_for(struct Object* wrapped_object); - // TODO: Don't make this such an easily accessed public method... - static void destroy_wrapper_for(struct Object* wrapped_object); - - // TODO: Limit construction to just a factory method. - explicit IObjectWrapper(struct Object* wrapped_object); - - virtual void init() {} - virtual void tick() {} - - protected: - struct Object* wrapped_object; -}; diff --git a/src/common/object/i_physical_object_wrapper.cpp b/src/common/object/i_physical_object_wrapper.cpp deleted file mode 100644 index 9f644a16..00000000 --- a/src/common/object/i_physical_object_wrapper.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "i_physical_object_wrapper.hpp" - -#include "include/object_fields.h" - -IPhysicalObjectWrapper::IPhysicalObjectWrapper(struct Object* wrapped_object) - : IObjectWrapper(wrapped_object), - position_(&wrapped_object->oPosX, - &wrapped_object->oPosY, - &wrapped_object->oPosZ), - home_(&wrapped_object->oHomeX, - &wrapped_object->oHomeY, - &wrapped_object->oHomeZ) {} diff --git a/src/common/object/i_physical_object_wrapper.hpp b/src/common/object/i_physical_object_wrapper.hpp deleted file mode 100644 index 3eb52d0b..00000000 --- a/src/common/object/i_physical_object_wrapper.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include "i_object_wrapper.hpp" -#include "position_wrapper.hpp" - -class IPhysicalObjectWrapper : public IObjectWrapper { - public: - explicit IPhysicalObjectWrapper(struct Object* wrapped_object); - - protected: - PositionWrapper position_; - PositionWrapper home_; -}; diff --git a/src/common/object/i_position.hpp b/src/common/object/i_position.hpp deleted file mode 100644 index 317443c5..00000000 --- a/src/common/object/i_position.hpp +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once - -#include "engine/math_util.h" - -class IPosition { - public: - virtual void set_x(const f32 x) = 0; - virtual f32 get_x() const = 0; - - virtual void set_y(const f32 y) = 0; - virtual f32 get_y() const = 0; - - virtual void set_z(const f32 z) = 0; - virtual f32 get_z() const = 0; - - void set(const IPosition& other) { - set_x(other.get_x()); - set_y(other.get_y()); - set_z(other.get_z()); - } - - /** - * Calculates (Euclidean distance)^2 from a given position to another. This - * can be preferable over the exact distance, since square root operations - * can be expensive. - */ - f32 calc_sqr_distance_to(const IPosition& other) const { - const auto dist_x = other.get_x() - get_x(); - const auto dist_y = other.get_y() - get_y(); - const auto dist_z = other.get_z() - get_z(); - - return dist_x * dist_x + dist_y * dist_y + dist_z * dist_z; - } - - void calc_angle_to(const IPosition& other, s16& h_angle, s16& v_angle) const { - const auto dist_x = other.get_x() - get_x(); - const auto dist_y = other.get_y() - get_y(); - const auto dist_z = other.get_z() - get_z(); - - h_angle = atan2s(dist_z, dist_x); - v_angle = atan2s(sqrtf(dist_x * dist_x + dist_z * dist_z), -dist_y); - } -}; \ No newline at end of file diff --git a/src/common/object/position_wrapper.hpp b/src/common/object/position_wrapper.hpp deleted file mode 100644 index 63d0e549..00000000 --- a/src/common/object/position_wrapper.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "i_position.hpp" - -class PositionWrapper : public IPosition { - public: - explicit PositionWrapper(f32* x_ptr, f32* y_ptr, f32* z_ptr) - : x_ptr_(x_ptr), - y_ptr_(y_ptr), - z_ptr_(z_ptr) {} - explicit PositionWrapper(const PositionWrapper& other) = delete; - - void set_x(const f32 x) override { *x_ptr_ = x; } - f32 get_x() const override { return *x_ptr_; } - - void set_y(const f32 y) override { *y_ptr_ = y; } - f32 get_y() const override { return *y_ptr_; } - - void set_z(const f32 z) override { *z_ptr_ = z; } - f32 get_z() const override { return *z_ptr_; } - - private: - f32* x_ptr_; - f32* y_ptr_; - f32* z_ptr_; -}; diff --git a/src/common/scripts/constants.hpp b/src/common/scripts/constants.hpp deleted file mode 100644 index d96a2e98..00000000 --- a/src/common/scripts/constants.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -const int JUMP_COUNT = 2; -const int JUMP_LINK_COUNT = 2; -const int JUMP_IF_COUNT = 3; - -const int EXECUTE_COUNT = 4; -const int EXIT_AND_EXECUTE_COUNT = 4; \ No newline at end of file diff --git a/src/common/scripts/dynamic_level_script_builder.cpp b/src/common/scripts/dynamic_level_script_builder.cpp deleted file mode 100644 index c65165bf..00000000 --- a/src/common/scripts/dynamic_level_script_builder.cpp +++ /dev/null @@ -1,165 +0,0 @@ -#include "dynamic_level_script_builder.hpp" - -#include "include/level_commands.h" - -#include "util.hpp" - -DynamicLevelScriptBuilder& DynamicLevelScriptBuilder::add_part( - std::shared_ptr> part) { - parts_.push_back(std::move(part)); - invalidate_cache(); - - return *this; -} - -DynamicLevelScriptBuilder& DynamicLevelScriptBuilder::add_script( - LevelScript script) { - return add_part(std::make_shared>(script)); -} - -DynamicLevelScriptBuilder& DynamicLevelScriptBuilder::add_scripts( - std::initializer_list scripts) { - return add_part( - std::make_shared>(scripts)); -} - -DynamicLevelScriptBuilder& DynamicLevelScriptBuilder::add_scripts( - const LevelScript* scripts, - int script_count) { - return add_part( - std::make_shared>( - scripts, - script_count)); -} - -DynamicLevelScriptBuilder& DynamicLevelScriptBuilder::add_builder( - std::shared_ptr> builder) { - cache_validation_impl_->depend_on(builder->get_cache_validation_node()); - return add_part( - std::make_shared>(builder)); -} - -DynamicLevelScriptBuilder& DynamicLevelScriptBuilder::add_call( - void (*callback)(void)) { - auto part = new LevelScriptPart(); - part->type = LevelScriptPartType::CALL; - part->callback = callback; - - return add_part(std::shared_ptr(part)); -} - -DynamicLevelScriptBuilder& DynamicLevelScriptBuilder::add_jump_link( - const LevelScript* address) { - auto part = new LevelScriptPart(); - part->type = LevelScriptPartType::JUMP_LINK_TO_ADDRESS; - part->address = address; - - return add_part(std::shared_ptr(part)); -} - -DynamicLevelScriptBuilder& DynamicLevelScriptBuilder::add_jump_link( - std::shared_ptr builder) { - auto part = new LevelScriptPart(); - part->type = LevelScriptPartType::JUMP_LINK_TO_BUILDER; - part->builder = std::move(builder); - - return add_part(std::shared_ptr(part)); -} - -DynamicLevelScriptBuilder& DynamicLevelScriptBuilder::add_jump_if_equal( - u32 value, - const LevelScript* address) { - auto part = new LevelScriptPart(); - part->type = LevelScriptPartType::JUMP_IF_EQUAL_TO_ADDRESS; - part->value = value; - part->address = address; - - return add_part(std::shared_ptr(part)); -} - -DynamicLevelScriptBuilder& DynamicLevelScriptBuilder::add_jump_if_equal( - u32 value, - std::shared_ptr builder) { - auto part = new LevelScriptPart(); - part->type = LevelScriptPartType::JUMP_IF_EQUAL_TO_BUILDER; - part->value = value; - part->builder = std::move(builder); - - return add_part(std::shared_ptr(part)); -} - -DynamicLevelScriptBuilder& DynamicLevelScriptBuilder::add_execute( - u8 segment, - const u8* segment_start, - const u8* segment_end, - const LevelScript* address) { - auto part = new LevelScriptPart(); - part->type = LevelScriptPartType::EXECUTE_ADDRESS; - part->segment = segment; - part->segment_start = segment_start; - part->segment_end = segment_end; - part->address = address; - - return add_part(std::shared_ptr(part)); -} - -DynamicLevelScriptBuilder& DynamicLevelScriptBuilder::add_execute( - u8 segment, - const u8* segment_start, - const u8* segment_end, - std::shared_ptr builder) { - auto part = new LevelScriptPart(); - part->type = LevelScriptPartType::EXECUTE_BUILDER; - part->segment = segment; - part->segment_start = segment_start; - part->segment_end = segment_end; - part->builder = std::move(builder); - - return add_part(std::shared_ptr(part)); -} - -DynamicLevelScriptBuilder& DynamicLevelScriptBuilder::add_exit_and_execute( - u8 segment, - const u8* segment_start, - const u8* segment_end, - std::shared_ptr builder) { - auto part = new LevelScriptPart(); - part->type = LevelScriptPartType::EXIT_AND_EXECUTE_BUILDER; - part->segment = segment; - part->segment_start = segment_start; - part->segment_end = segment_end; - part->builder = std::move(builder); - - return add_part(std::shared_ptr(part)); -} - -DynamicLevelScriptBuilder& -DynamicLevelScriptBuilder::add_jump_to_top_of_this_builder(u8 jump_offset) { - auto part = new LevelScriptPart(); - part->type = LevelScriptPartType::JUMP_TO_TOP_OF_THIS_BUILDER; - part->jump_offset = jump_offset; - - return add_part(std::shared_ptr(part)); -} - -int DynamicLevelScriptBuilder::size() const { - auto total_size = 0; - for (const auto& part : parts_) { total_size += part->size(); } - return total_size; -} - -void DynamicLevelScriptBuilder::build_into(LevelScript* dst, int& dst_pos) const { - for (const auto& part : parts_) { part->build_into(dst, dst_pos); } -} - -std::weak_ptr DynamicLevelScriptBuilder:: -get_cache_validation_node() { return cache_validation_impl_; } - - -bool DynamicLevelScriptBuilder::is_cache_valid() const { - return cache_validation_impl_->is_valid(); -} - -void DynamicLevelScriptBuilder::invalidate_cache() { - cache_validation_impl_->invalidate(); -} diff --git a/src/common/scripts/dynamic_level_script_builder.hpp b/src/common/scripts/dynamic_level_script_builder.hpp deleted file mode 100644 index 9d721cd6..00000000 --- a/src/common/scripts/dynamic_level_script_builder.hpp +++ /dev/null @@ -1,90 +0,0 @@ -#pragma once - -#include -#include - -#include "include/types.h" - -#include "i_level_script_builder.hpp" -#include "level_script_part.hpp" -#include "validation_node.hpp" - -/* - A wrapper around the macros that define levels in Super Mario 64. This class - guarantees type-safety, simplifies calls, and allows us to incrementally - convert levels to a more readable format. -*/ -// TODO: Rebuilding the macro allocates new memory. Currently this poses a -// memory leak risk. -// TODO: Should cache the build, update if changes are made. -// TODO: Each version of the build should maintain the same pointer location. -class DynamicLevelScriptBuilder final : public ILevelScriptBuilder { - public: - DynamicLevelScriptBuilder() = default; - DynamicLevelScriptBuilder(const DynamicLevelScriptBuilder& other) = delete; - - DynamicLevelScriptBuilder& add_part( - std::shared_ptr> part) override; - - DynamicLevelScriptBuilder& add_script(LevelScript in_script) override; - DynamicLevelScriptBuilder& add_scripts( - std::initializer_list in_scripts) override; - DynamicLevelScriptBuilder& add_scripts(const LevelScript* in_scripts, - int script_count) override; - - DynamicLevelScriptBuilder& add_builder( - std::shared_ptr> builder) override; - - DynamicLevelScriptBuilder& add_call(void (*callback)(void)); - - template - DynamicLevelScriptBuilder& add_call(void (*callback)(T*), T* value) { - auto part = new LevelScriptPart(); - part->type = LevelScriptPartType::CALL; - part->callback = (void (*)(void))callback; - part->callback_arg = (uintptr_t)value; - - parts_.push_back(std::unique_ptr(part)); - - return *this; - } - - DynamicLevelScriptBuilder& add_jump_to_top_of_this_builder( - u8 jump_offset = 0); - DynamicLevelScriptBuilder& add_jump_link(const LevelScript* address); - DynamicLevelScriptBuilder& add_jump_link( - std::shared_ptr builder); - DynamicLevelScriptBuilder& add_jump_if_equal(u32 value, - const LevelScript* address); - DynamicLevelScriptBuilder& add_jump_if_equal( - u32 value, - std::shared_ptr builder); - - DynamicLevelScriptBuilder& add_execute(u8 segment, - const u8* segment_start, - const u8* segment_end, - const LevelScript* address); - DynamicLevelScriptBuilder& add_execute( - u8 segment, - const u8* segment_start, - const u8* segment_end, - std::shared_ptr builder); - DynamicLevelScriptBuilder& add_exit_and_execute( - u8 segment, - const u8* segment_start, - const u8* segment_end, - std::shared_ptr builder); - - int size() const override; - void build_into(LevelScript* dst, int& dst_pos) const override; - std::weak_ptr get_cache_validation_node() override; - - private: - bool is_cache_valid() const; - void invalidate_cache(); - - std::vector>> parts_; - - std::shared_ptr cache_validation_impl_ = std::make_unique< - ValidationNode>(); -}; diff --git a/src/common/scripts/i_behavior_script_builder.cpp b/src/common/scripts/i_behavior_script_builder.cpp deleted file mode 100644 index d2d69ff1..00000000 --- a/src/common/scripts/i_behavior_script_builder.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "i_behavior_script_builder.hpp" - -const BehaviorScript* IBehaviorScriptBuilder::get_entry_pointer( - int& out_count) const { - return build_impl(out_count); -} - -const BehaviorScript* IBehaviorScriptBuilder::build_impl(int& out_count) const { - const auto script_count = size(); - - const auto dst = new BehaviorScript[script_count]; - auto dst_pos = 0; - build_into(dst, dst_pos); - - out_count = script_count; - return dst; -} diff --git a/src/common/scripts/i_behavior_script_builder.hpp b/src/common/scripts/i_behavior_script_builder.hpp deleted file mode 100644 index 24fb19ff..00000000 --- a/src/common/scripts/i_behavior_script_builder.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#include - -#include "include/types.h" -#include "util/unused.hpp" - -#include "i_script_builder.hpp" - -class IBehaviorScriptBuilder : public IScriptBuilder { - public: - IBehaviorScriptBuilder() = default; - IBehaviorScriptBuilder(const IBehaviorScriptBuilder& other) = delete; - - IBehaviorScriptBuilder& add_part( - std::shared_ptr> part) override = 0; - - IBehaviorScriptBuilder& add_script(BehaviorScript script) override = 0; - IBehaviorScriptBuilder& add_scripts( - std::initializer_list scripts) override = 0; - IBehaviorScriptBuilder& add_scripts(const BehaviorScript* scripts, - int script_count) override = 0; - - IBehaviorScriptBuilder& add_builder( - std::shared_ptr> other) override = 0; - - int size() const override = 0; - - void build_into(LevelScript* dst, int& dst_count) const override = 0; - - const BehaviorScript* get_entry_pointer( - int& out_count = unused_int) const override = 0; - std::weak_ptr get_cache_validation_node() override = 0; - - protected: - const BehaviorScript* build_impl(int& out_count) const; -}; diff --git a/src/common/scripts/i_level_script_builder.cpp b/src/common/scripts/i_level_script_builder.cpp deleted file mode 100644 index d00d8ab7..00000000 --- a/src/common/scripts/i_level_script_builder.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "i_level_script_builder.hpp" - -const LevelScript* ILevelScriptBuilder::get_entry_pointer(int& out_count) const { - return build_impl(out_count); -} - -const LevelScript* ILevelScriptBuilder::build_impl(int& out_count) const { - const auto script_count = size(); - - const auto dst = new LevelScript[script_count]; - auto dst_pos = 0; - build_into(dst, dst_pos); - - out_count = script_count; - return dst; -} diff --git a/src/common/scripts/i_level_script_builder.hpp b/src/common/scripts/i_level_script_builder.hpp deleted file mode 100644 index 0014f661..00000000 --- a/src/common/scripts/i_level_script_builder.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#include - -#include "include/types.h" -#include "util/unused.hpp" - -#include "i_script_builder.hpp" - -class ILevelScriptBuilder : public IScriptBuilder { -public: - ILevelScriptBuilder() = default; - ILevelScriptBuilder(const ILevelScriptBuilder& other) = delete; - - ILevelScriptBuilder& add_part( - std::shared_ptr> part) override = 0; - - ILevelScriptBuilder& add_script(LevelScript script) override = 0; - ILevelScriptBuilder& add_scripts( - std::initializer_list scripts) override = 0; - ILevelScriptBuilder& add_scripts(const LevelScript* scripts, - int script_count) override = 0; - - ILevelScriptBuilder& add_builder( - std::shared_ptr> other) override = 0; - - int size() const override = 0; - - void build_into(LevelScript* dst, int& dst_count) const override = 0; - - const LevelScript* get_entry_pointer(int& out_count = unused_int) const - override; - std::weak_ptr get_cache_validation_node() override = 0; - - protected: - const LevelScript* build_impl(int& out_count) const; -}; diff --git a/src/common/scripts/i_script_builder.hpp b/src/common/scripts/i_script_builder.hpp deleted file mode 100644 index 91466f1d..00000000 --- a/src/common/scripts/i_script_builder.hpp +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -#include - -#include "util/unused.hpp" - -#include "validation_node.hpp" - -template -class IScriptPart; - -template -class IScriptBuilder { -public: - IScriptBuilder() = default; - IScriptBuilder(const IScriptBuilder& other) = delete; - - virtual IScriptBuilder& add_part( - std::shared_ptr> part) = 0; - - virtual IScriptBuilder& add_script(TScript script) = 0; - virtual IScriptBuilder& add_scripts( - std::initializer_list scripts) = 0; - virtual IScriptBuilder& add_scripts(const TScript* scripts, - int script_count) = 0; - - virtual IScriptBuilder& add_builder( - std::shared_ptr> other) = 0; - - virtual int size() const = 0; - - virtual void build_into(TScript* dst, int& dst_pos) const = 0; - - virtual const TScript* get_entry_pointer(int& out_count = unused_int) const = - 0; - - // TODO: Can we make this private... - virtual std::weak_ptr get_cache_validation_node() = 0; -}; diff --git a/src/common/scripts/i_script_part.hpp b/src/common/scripts/i_script_part.hpp deleted file mode 100644 index 13dbe015..00000000 --- a/src/common/scripts/i_script_part.hpp +++ /dev/null @@ -1,81 +0,0 @@ -#pragma once - -#include -#include - -#include "util.hpp" - -template -class IScriptBuilder; - -template -class IScriptPart { - public: - IScriptPart() {} - IScriptPart(const IScriptPart& other) = delete; - - virtual int size() const = 0; - virtual void build_into(TScript* dst, int& dst_pos) const = 0; -}; - -template -class SingleScriptPart : public IScriptPart { - public: - SingleScriptPart(TScript script) : script_(script) {} - - SingleScriptPart(const SingleScriptPart& other) = delete; - - int size() const override { return 1; } - - void build_into(TScript* dst, int& dst_pos) const override { - append_script(dst, dst_pos, script_); - } - - private: - TScript script_; -}; - -template -class MultipleScriptPart : public IScriptPart { - public: - MultipleScriptPart(const TScript* scripts, int script_count) { - for (auto i = 0; i < script_count; ++i) { - scripts_.push_back(scripts[i]); - } - } - - MultipleScriptPart(std::initializer_list scripts) { - for (auto script : scripts) { - scripts_.push_back(script); - } - } - - MultipleScriptPart(const MultipleScriptPart& other) = delete; - - int size() const override { return scripts_.size(); } - - void build_into(TScript* dst, int& dst_pos) const override { - append_scripts(dst, dst_pos, &scripts_[0], scripts_.size()); - } - - private: - std::vector scripts_; -}; - -template -class BuilderScriptPart : public IScriptPart { - public: - BuilderScriptPart(std::shared_ptr> builder) - : builder_(std::move(builder)) {} - - BuilderScriptPart(const BuilderScriptPart& other) = delete; - - int size() const override { return builder_->size(); } - - void build_into(TScript* dst, int& dst_pos) const override { - builder_->build_into(dst, dst_pos); - } - - private: - std::shared_ptr> builder_; -}; diff --git a/src/common/scripts/level_script_part.cpp b/src/common/scripts/level_script_part.cpp deleted file mode 100644 index 3f6f5bf5..00000000 --- a/src/common/scripts/level_script_part.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include "level_script_part.hpp" - -#include "constants.hpp" -#include "level_commands.h" - -int LevelScriptPart::size() const { - switch (type) { - case LevelScriptPartType::CALL: - return 2; - - case LevelScriptPartType::JUMP_TO_TOP_OF_THIS_BUILDER: - return JUMP_COUNT; - case LevelScriptPartType::JUMP_LINK_TO_ADDRESS: - case LevelScriptPartType::JUMP_LINK_TO_BUILDER: - return JUMP_LINK_COUNT; - case LevelScriptPartType::JUMP_IF_EQUAL_TO_ADDRESS: - case LevelScriptPartType::JUMP_IF_EQUAL_TO_BUILDER: - return JUMP_IF_COUNT; - - case LevelScriptPartType::EXECUTE_ADDRESS: - case LevelScriptPartType::EXECUTE_BUILDER: - return EXECUTE_COUNT; - case LevelScriptPartType::EXIT_AND_EXECUTE_BUILDER: - return EXIT_AND_EXECUTE_COUNT; - - default: - return 0; - } -} - -void LevelScriptPart::build_into(LevelScript* dst, int& dst_pos) const { - switch (type) { - case LevelScriptPartType::CALL: - append_scripts(dst, dst_pos, {CALL(callback_arg, callback)}); - break; - - case LevelScriptPartType::JUMP_TO_TOP_OF_THIS_BUILDER: - append_jump_to_address(dst, dst_pos, dst + jump_offset); - break; - case LevelScriptPartType::JUMP_LINK_TO_ADDRESS: - append_jump_link_to_address(dst, dst_pos, address); - break; - case LevelScriptPartType::JUMP_LINK_TO_BUILDER: { - const auto inner_inner_scripts = builder->get_entry_pointer(); - append_jump_link_to_address(dst, dst_pos, inner_inner_scripts); - break; - } - case LevelScriptPartType::JUMP_IF_EQUAL_TO_ADDRESS: - append_jump_if_equal_to_address(dst, dst_pos, value, address); - break; - case LevelScriptPartType::JUMP_IF_EQUAL_TO_BUILDER: { - const auto inner_inner_scripts = builder->get_entry_pointer(); - append_jump_if_equal_to_address( - dst, dst_pos, value, inner_inner_scripts); - break; - } - - case LevelScriptPartType::EXECUTE_ADDRESS: - append_execute(dst, - dst_pos, - segment, - segment_start, - segment_end, - address); - break; - case LevelScriptPartType::EXECUTE_BUILDER: { - const auto inner_inner_scripts = builder->get_entry_pointer(); - append_execute(dst, - dst_pos, - segment, - segment_start, - segment_end, - inner_inner_scripts); - break; - } - case LevelScriptPartType::EXIT_AND_EXECUTE_BUILDER: { - const auto inner_inner_scripts = builder->get_entry_pointer(); - append_exit_and_execute(dst, - dst_pos, - segment, - segment_start, - segment_end, - inner_inner_scripts); - break; - } - } -} \ No newline at end of file diff --git a/src/common/scripts/level_script_part.hpp b/src/common/scripts/level_script_part.hpp deleted file mode 100644 index c389b742..00000000 --- a/src/common/scripts/level_script_part.hpp +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once -#include "i_script_builder.hpp" -#include "i_script_part.hpp" - -class ILevelScriptPart : public IScriptPart { -public: - int size() const override = 0; - void build_into(LevelScript* dst, int& dst_pos) const override = 0; -}; - -enum class LevelScriptPartType { - CALL, - - JUMP_TO_TOP_OF_THIS_BUILDER, - JUMP_LINK_TO_ADDRESS, - JUMP_LINK_TO_BUILDER, - JUMP_IF_EQUAL_TO_ADDRESS, - JUMP_IF_EQUAL_TO_BUILDER, - - EXECUTE_ADDRESS, - EXECUTE_BUILDER, - EXIT_AND_EXECUTE_BUILDER, -}; - -class LevelScriptPart : public ILevelScriptPart { -public: - int size() const override; - void build_into(LevelScript* dst, int& dst_pos) const override; - - LevelScriptPartType type; - void (*callback)(void); - uintptr_t callback_arg; - u32 value; - u8 segment; - const u8* segment_start; - const u8* segment_end; - std::shared_ptr> builder; - const LevelScript* address; - u8 jump_offset; -}; diff --git a/src/common/scripts/util.cpp b/src/common/scripts/util.cpp deleted file mode 100644 index c8475c3b..00000000 --- a/src/common/scripts/util.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "util.hpp" - -#include "include/level_commands.h" -#include "include/types.h" - -template -void append_script(TScript* dst, int& dst_pos, TScript src) { - dst[dst_pos++] = src; -} - -template -void append_scripts(TScript* dst, int& dst_pos, const TScript* src, - const int src_count) { - for (auto i = 0; i < src_count; ++i) { - append_script(dst, dst_pos, src[i]); - } -} - -template -void append_scripts(TScript* dst, int& dst_pos, - std::initializer_list src) { - append_scripts(dst, dst_pos, src.begin(), src.size()); -} - -void append_jump_to_address(LevelScript* dst, int& dst_pos, - const LevelScript* address) { - append_scripts(dst, dst_pos, {JUMP(address)}); -} - -void append_jump_link_to_address(LevelScript* dst, int& dst_pos, - const LevelScript* address) { - append_scripts(dst, dst_pos, {JUMP_LINK(address)}); -} - -extern void append_jump_if_equal_to_address(LevelScript* dst, int& dst_pos, - u32 value, - const LevelScript* address) { - append_scripts(dst, dst_pos, {JUMP_IF(OP_EQ, value, address)}); -} - -void append_execute(LevelScript* dst, int& dst_pos, u8 segment, - const u8* segment_start, const u8* segment_end, - const LevelScript* address) { - append_scripts(dst, dst_pos, { - EXECUTE(segment, segment_start, segment_end, address), - }); -} - -void append_exit_and_execute(LevelScript* dst, int& dst_pos, u8 segment, - const u8* segment_start, const u8* segment_end, - const LevelScript* address) { - append_scripts(dst, dst_pos, { - EXIT_AND_EXECUTE(segment, segment_start, segment_end, - address), - }); -} diff --git a/src/common/scripts/util.hpp b/src/common/scripts/util.hpp deleted file mode 100644 index f01fdfdb..00000000 --- a/src/common/scripts/util.hpp +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -#include - -#include "include/types.h" - -template -extern void append_script(TScript* dst, int& dst_pos, - TScript src); -template -extern void append_scripts(TScript* dst, int& dst_pos, - const TScript* src, - const int src_count); -template -extern void append_scripts(TScript* dst, int& dst_pos, - std::initializer_list src); - -extern void append_jump_to_address(LevelScript* dst, int& dst_pos, - const LevelScript* address); -extern void append_jump_link_to_address(LevelScript* dst, int& dst_pos, - const LevelScript* address); -extern void append_jump_if_equal_to_address(LevelScript* dst, int& dst_pos, - u32 value, - const LevelScript* address); - -extern void append_execute(LevelScript* dst, int& dst_pos, - u8 segment, - const u8* segment_start, - const u8* segment_end, - const LevelScript* address); -extern void append_exit_and_execute(LevelScript* dst, int& dst_pos, - u8 segment, - const u8* segment_start, - const u8* segment_end, - const LevelScript* address); \ No newline at end of file diff --git a/src/common/scripts/validation_node.cpp b/src/common/scripts/validation_node.cpp deleted file mode 100644 index 09ed5ac0..00000000 --- a/src/common/scripts/validation_node.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "validation_node.hpp" - -ValidationNode::~ValidationNode() { clear(); } - - -bool ValidationNode::is_valid() const { return is_valid_; } - -void ValidationNode::validate() { is_valid_ = true; } - -void ValidationNode::invalidate() { - if (!is_valid_) { return; } - - is_valid_ = false; - for (auto& parent : parents_) { - if (!parent.expired()) { parent.lock()->invalidate(); } - } -} - - -void ValidationNode::clear() { - for (auto& child : children_) { - if (!child.expired()) { - child.lock()->parents_.erase(weak_from_this()); - } - } - children_.clear(); - - invalidate(); -} - -void ValidationNode::depend_on(std::weak_ptr child) { - children_.insert(child); - child.lock()->parents_.insert(weak_from_this()); - - invalidate(); -} diff --git a/src/common/scripts/validation_node.hpp b/src/common/scripts/validation_node.hpp deleted file mode 100644 index e2a77d7a..00000000 --- a/src/common/scripts/validation_node.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once -#include -#include - -class ValidationNode; - -typedef std::owner_less> ValidationNodeComparer; - -class ValidationNode : public std::enable_shared_from_this { -public: - ValidationNode() = default; - ValidationNode(const ValidationNode& other) = delete; - ~ValidationNode(); - - bool is_valid() const; - void validate(); - void invalidate(); - - void clear(); - void depend_on(std::weak_ptr child); - -private: - std::set, ValidationNodeComparer> parents_; - std::set, ValidationNodeComparer> children_; - - bool is_valid_ = false; -}; diff --git a/src/common/service_locator.cpp b/src/common/service_locator.cpp deleted file mode 100644 index e826e408..00000000 --- a/src/common/service_locator.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "service_locator.hpp" - -#include "common/ui/original_text_renderer.hpp" - -/** - * Public - */ -ITextRenderer& ServiceLocator::get_text_renderer() { return *text_renderer; } - -/** - * Private - */ -ITextRenderer* ServiceLocator::text_renderer = new OriginalTextRenderer(); \ No newline at end of file diff --git a/src/common/service_locator.hpp b/src/common/service_locator.hpp deleted file mode 100644 index aaf4bf68..00000000 --- a/src/common/service_locator.hpp +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#include "common/ui/i_text_renderer.hpp" - -class ServiceLocator { -public: - static ITextRenderer &get_text_renderer(); - -private: - static ITextRenderer* text_renderer; -}; \ No newline at end of file diff --git a/src/common/ui/i_fluent_text_render_chain.hpp b/src/common/ui/i_fluent_text_render_chain.hpp deleted file mode 100644 index 025b02af..00000000 --- a/src/common/ui/i_fluent_text_render_chain.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "include/types.h" -#include "lut_source.hpp" - -class IFluentTextRenderChain { -public: - virtual IFluentTextRenderChain *with_glyph_set(LutSource lut_source) = 0; - virtual IFluentTextRenderChain *with_alpha(u8 alpha) = 0; - virtual IFluentTextRenderChain *scheduled() = 0; - virtual IFluentTextRenderChain *centered() = 0; - - /* This is the final step in the chain that actually does the rendering. */ - virtual IFluentTextRenderChain *glyphs_at(std::string text, s16 x, s16 y) = 0; - virtual IFluentTextRenderChain *glyphs_at(const u8 *text, s16 x, s16 y) = 0; - virtual IFluentTextRenderChain *glyph_at(u8 chr, s16 x, s16 y) = 0; -}; \ No newline at end of file diff --git a/src/common/ui/i_text_renderer.hpp b/src/common/ui/i_text_renderer.hpp deleted file mode 100644 index 88daf1af..00000000 --- a/src/common/ui/i_text_renderer.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include -#include -#include "include/types.h" - -#include "i_fluent_text_render_chain.hpp" - -class ITextRenderer { -public: - virtual void render_scheduled_text() = 0; - - virtual std::unique_ptr render() = 0; -}; diff --git a/src/common/ui/lut_source.hpp b/src/common/ui/lut_source.hpp deleted file mode 100644 index f8da4c72..00000000 --- a/src/common/ui/lut_source.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -/** - * This changes the font used when text rendering, since each one has different - * glyphs. - */ -enum class LutSource { - UNDEFINED, - DEFAULT, - JAPANESE, - DIFF, -}; \ No newline at end of file diff --git a/src/common/ui/original_fluent_text_render_chain.cpp b/src/common/ui/original_fluent_text_render_chain.cpp deleted file mode 100644 index aeecf13b..00000000 --- a/src/common/ui/original_fluent_text_render_chain.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "original_fluent_text_render_chain.hpp" - -#include "original_text_renderer.hpp" - -OriginalFluentTextRenderChain::OriginalFluentTextRenderChain( - OriginalTextRenderer* parent) : parent(parent) {} - -IFluentTextRenderChain* OriginalFluentTextRenderChain::with_glyph_set( - LutSource lut_source) { - text_to_render.lut_source = lut_source; - return this; -} - -IFluentTextRenderChain* OriginalFluentTextRenderChain::with_alpha(u8 alpha) { - text_to_render.alpha = alpha; - return this; -} - -IFluentTextRenderChain* OriginalFluentTextRenderChain::scheduled() { - text_to_render.scheduled = true; - return this; -} - -IFluentTextRenderChain* OriginalFluentTextRenderChain::centered() { - text_to_render.centered = true; - return this; -} - -void OriginalFluentTextRenderChain::trigger() { - if (text_to_render.scheduled) { - parent->schedule_text(text_to_render); - } else { - parent->render_text(text_to_render); - } -} - -IFluentTextRenderChain *OriginalFluentTextRenderChain::glyphs_at(std::string text, s16 x, s16 y) { - text_to_render.set_glyphs(text); - text_to_render.x = x; - text_to_render.y = y; - - trigger(); - - return this; -} - -IFluentTextRenderChain *OriginalFluentTextRenderChain::glyphs_at(const u8 *text, s16 x, s16 y) { - text_to_render.set_glyphs(text); - text_to_render.x = x; - text_to_render.y = y; - - trigger(); - - return this; -} - -IFluentTextRenderChain *OriginalFluentTextRenderChain::glyph_at(u8 chr, s16 x, s16 y) { - text_to_render.set_glyph(chr); - text_to_render.x = x; - text_to_render.y = y; - - trigger(); - - return this; -} diff --git a/src/common/ui/original_fluent_text_render_chain.hpp b/src/common/ui/original_fluent_text_render_chain.hpp deleted file mode 100644 index fb4b8637..00000000 --- a/src/common/ui/original_fluent_text_render_chain.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include -#include "include/types.h" - -#include "i_fluent_text_render_chain.hpp" -#include "original_text_renderer.hpp" -#include "text_to_render.hpp" - -class OriginalFluentTextRenderChain : IFluentTextRenderChain { -public: - OriginalFluentTextRenderChain(OriginalTextRenderer *parent); - - IFluentTextRenderChain* with_glyph_set(LutSource lut_source); - IFluentTextRenderChain* with_alpha(u8 alpha); - IFluentTextRenderChain* scheduled(); - IFluentTextRenderChain* centered(); - - /* This is the final step in the chain that actually does the rendering. */ - IFluentTextRenderChain *glyphs_at(std::string text, s16 x, s16 y); - IFluentTextRenderChain *glyphs_at(const u8 *text, s16 x, s16 y); - IFluentTextRenderChain *glyph_at(u8 chr, s16 x, s16 y); - -private: - std::unique_ptr parent; - TextToRender text_to_render = TextToRender(); - - void trigger(); -}; diff --git a/src/common/ui/original_text_renderer.cpp b/src/common/ui/original_text_renderer.cpp deleted file mode 100644 index 00c5c8fc..00000000 --- a/src/common/ui/original_text_renderer.cpp +++ /dev/null @@ -1,363 +0,0 @@ -#include "original_text_renderer.hpp" - -#include "config.h" -#include "game/game_init.h" -#include "game/memory.h" -#include "game/print.h" -#include "game/segment2.h" -#include "levels/menu/header.h" -#include "original_fluent_text_render_chain.hpp" - -void process_rendered_strings_impl( - std::vector>& scheduled_text); - -void render_string_impl(const u8* str, s16 x, s16 y, s16 x_scale, s16 y_scale, - s16 dsdx, s16 dsdy, - u8 alpha, LutSource lut_source); - -/** - * Public - */ -void OriginalTextRenderer::render_scheduled_text() { - process_rendered_strings_impl(scheduled_text); -} - -std::unique_ptr OriginalTextRenderer::render() { - auto fluent_text_render_chain = (IFluentTextRenderChain*)new - OriginalFluentTextRenderChain(this); - return std::unique_ptr(fluent_text_render_chain); -} - -/** - * Private - */ -void OriginalTextRenderer::render_text(const TextToRender& text_to_render) { - render_string_impl(text_to_render.str, text_to_render.x, text_to_render.y, - 16, // text_to_render.x_scale, - 16, // text_to_render.y_scale, - 1, // text_to_render.dsdx, - 1, // text_to_render.dsdy, - text_to_render.alpha, text_to_render.lut_source); -} - -void OriginalTextRenderer:: -schedule_text(const TextToRender& text_to_render_impl) { - scheduled_text.push_back(std::make_unique(text_to_render_impl)); -} - -/** - * Implementation - */ - -/** Converts a char into the proper colorful glyph for the char. */ -s8 char_to_glyph_index_(char c) { - if (c >= 'A' && c <= 'Z') { return c - 55; } - - if (c >= 'a' && c <= 'z') { return c - 87; } - - if (c >= '0' && c <= '9') { return c - 48; } - - if (c == ' ') { return GLYPH_SPACE; } - - if (c == '!') { - return GLYPH_EXCLAMATION_PNT; // !, JP only - } - - if (c == '#') { - return GLYPH_TWO_EXCLAMATION; // !!, JP only - } - - if (c == '?') { - return GLYPH_QUESTION_MARK; // ?, JP only - } - - if (c == '&') { - return GLYPH_AMPERSAND; // &, JP only - } - - if (c == '%') { - return GLYPH_PERCENT; // %, JP only - } - - if (c == '*') { - return GLYPH_MULTIPLY; // x - } - - if (c == '+') { - return GLYPH_COIN; // coin - } - - if (c == ',') { - return GLYPH_MARIO_HEAD; // Imagine I drew Mario's head - } - - if (c == '-') { - return GLYPH_STAR; // star - } - - if (c == '.') { - return GLYPH_PERIOD; // large shaded dot, JP only - } - - if (c == '/') { - return GLYPH_BETA_KEY; // beta key, JP only. Reused for in EU. - } - - return GLYPH_SPACE; -} - -void add_glyph_texture(const u8* const * glyphs, s8 glyphIndex) { - gDPPipeSync(gDisplayListHead++); - gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, - glyphs[glyphIndex]); - gSPDisplayList(gDisplayListHead++, dl_hud_img_load_tex_block); -} - -void apply_jitter(s16& x, s16& y) { - const auto rand_xf = rand() * 1. / RAND_MAX; - const auto rand_yf = rand() * 1. / RAND_MAX; - - x += 4 * (rand_xf - .5); - y += 4 * (rand_yf - .5); -} - -void apply_alpha_start(u8 alpha) { - auto r = 255; - auto g = 255; - auto b = 255; - - /*auto r = (u8)(255 * rand() * 1. / RAND_MAX); - auto g = (u8)(255 * rand() * 1. / RAND_MAX); - auto b = (u8)(255 * rand() * 1. / RAND_MAX);*/ - - if (alpha != 255) { - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); - gDPSetEnvColor(gDisplayListHead++, r, g, b, alpha); - } -} - -void apply_alpha_end(u8 alpha) { - if (alpha != 255) { gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); } -} - -const u8* const * get_glyphs(LutSource lut_source) { - switch (lut_source) { - case LutSource::JAPANESE: - // Japanese Menu HUD Color font - return (const u8*const *)segmented_to_virtual(menu_hud_lut); - case LutSource::DEFAULT: - default: - // 0-9 A-Z HUD Color Font - return (const u8*const *)segmented_to_virtual(main_hud_lut); - } -} - -u32 get_x_stride(const LutSource lut_source) { - if (lut_source == LutSource::JAPANESE) { return 16; } - else { - // HUD_LUT_GLOBAL -#if defined(VERSION_JP) - return 14; -#else - return 12; //? Shindou uses this. -#endif - } -} - -void apply_stride(u8 chr, s16& x, const u32 x_stride) { -#ifdef VERSION_EU - if (chr == GLOBAL_CHAR_SPACE) { - x += x_stride / 2; - return; - } -#endif -#if defined(VERSION_US) || defined(VERSION_SH) - if (chr == GLOBAL_CHAR_SPACE) { - x += 8; - return; - } -#endif - - x += x_stride; -} - -#ifndef WIDESCREEN -/** - * Clips textrect into the boundaries defined. - */ -void clip_to_bounds(s16& x, s16& y) { - if (x < TEXRECT_MIN_X) { x = TEXRECT_MIN_X; } - - if (x > TEXRECT_MAX_X) { x = TEXRECT_MAX_X; } - - if (y < TEXRECT_MIN_Y) { y = TEXRECT_MIN_Y; } - - if (y > TEXRECT_MAX_Y) { y = TEXRECT_MAX_Y; } -} -#endif - -void render_textrect(s16 x, s16 y) { - //apply_jitter(x, y); - -#ifndef WIDESCREEN - // For widescreen we must allow drawing outside the usual area - clip_to_bounds(x, y); -#endif - gSPTextureRectangle(gDisplayListHead++, x << 2, y << 2, (x + 16 - 1) << 2, - (y + 16 - 1) << 2, - G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10); -} - -void process_rendered_strings_impl( - std::vector>& scheduled_text) { - - auto text_to_render_count = scheduled_text.size(); - if (text_to_render_count == 0) { return; } - - Mtx* mtx; - - mtx = (Mtx*)alloc_display_list(sizeof(*mtx)); - if (mtx == NULL) { - scheduled_text.clear(); - return; - } - - guOrtho(mtx, 0.0f, SCREEN_WIDTH, 0.0f, SCREEN_HEIGHT, -10.0f, 10.0f, 1.0f); - gSPPerspNormalize((Gfx *) (gDisplayListHead++), 0xFFFF); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx), - G_MTX_PROJECTION | G_MTX_LOAD | G_MTX_NOPUSH); - gSPDisplayList(gDisplayListHead++, dl_hud_img_begin); - - for (auto i = 0; i < text_to_render_count; ++i) { - auto& text_to_render = *scheduled_text[i]; - - const auto str = text_to_render.str; - const auto length = text_to_render.length; - - auto cur_x = text_to_render.x; - const auto cur_y = text_to_render.y; - - auto lut_source = text_to_render.lut_source; - - const auto glyphs = get_glyphs(lut_source); - const auto x_stride = get_x_stride(lut_source); - - apply_alpha_start(text_to_render.alpha); - - for (auto j = 0; j < length; j++) { - auto chr = str[j]; - // auto glyphIndex = char_to_glyph_index_(chr); - // Assumes it's already formatted in glyphs. - auto glyphIndex = chr; - - // if (glyphIndex != GLYPH_SPACE) { -#ifdef VERSION_EU - // Beta Key was removed by EU, so glyph slot reused. - // This produces a colorful . - if (glyphIndex == GLYPH_BETA_KEY) { - add_glyph_texture(GLYPH_U); - render_textrect(text_to_render); - - add_glyph_texture(GLYPH_UMLAUT); - render_textrect(sTextLabels[i]->x, sTextLabels[i]->y + 3, j); - } else { - add_glyph_texture(glyphIndex); - render_textrect(text_to_render); - } -#endif -#if defined(VERSION_US) || defined(VERSION_SH) - if (chr != GLOBAL_CHAR_SPACE) { -#endif - - add_glyph_texture(glyphs, glyphIndex); - render_textrect(cur_x, cur_y); - - cur_x += x_stride; -#if defined(VERSION_US) || defined(VERSION_SH) - } -#endif - //} - - apply_stride(chr, cur_x, x_stride); - } - - apply_alpha_end(text_to_render.alpha); - } - - gSPDisplayList(gDisplayListHead++, dl_hud_img_end); - - scheduled_text.clear(); -} - -void render_char_tile(s16 x, s16 y, s16 x_scale, s16 y_scale, s16 dsdx, - s16 dsdy) { - // apply_jitter(x, y); - - gSPTextureRectangle(gDisplayListHead++, x << 2, y << 2, (x + x_scale) << 2, - (y + y_scale) << 2, - G_TX_RENDERTILE, 0, 0, dsdx << 10, dsdy << 10); -} - -#ifdef VERSION_EU -void print_hud_char_umlaut(u8 chr, s16 x, s16 y, s16 x_scale, s16 y_scale, s16 dsdx, s16 dsdy) { - void **fontLUT = segmented_to_virtual(main_hud_lut); - - gDPPipeSync(gDisplayListHead++); - render_char_tile(chr, x, y, x_scale, y_scale, dsdx, dsdy, fontLUT); - render_char_tile(chr, x, y - y_scale / 16. * 4, x_scale, y_scale, dsdx, dsdy, fontLUT); -} -#endif - -void render_string_impl(const u8* str, s16 x, s16 y, s16 x_scale, s16 y_scale, - s16 dsdx, s16 dsdy, - u8 alpha, LutSource lut_source = LutSource::DEFAULT) { - s32 str_pos = 0; - auto cur_x = x; - const auto cur_y = y; - - const auto lut = get_glyphs(lut_source); - auto x_stride = get_x_stride(lut_source); - - apply_alpha_start(alpha); - - while (str[str_pos] != GLOBAR_CHAR_TERMINATOR) { - const auto chr = str[str_pos]; - -#ifdef VERSION_EU - switch (chr) { - case GLOBAL_CHAR_SPACE: - break; - case HUD_CHAR_A_UMLAUT: - print_hud_char_umlaut(ASCII_TO_DIALOG('A'), cur_x, cur_y, x_scale, y_scale, dsdx, dsdy); - break; - case HUD_CHAR_O_UMLAUT: - print_hud_char_umlaut(ASCII_TO_DIALOG('O'), cur_x, cur_y, x_scale, y_scale, dsdx, dsdy); - break; - case HUD_CHAR_U_UMLAUT: - print_hud_char_umlaut(ASCII_TO_DIALOG('U'), cur_x, cur_y, x_scale, y_scale, dsdx, dsdy); - break; - default: -#endif -#if defined(VERSION_US) || defined(VERSION_SH) - if (chr != GLOBAL_CHAR_SPACE) { -#endif - - gDPPipeSync(gDisplayListHead++); - add_glyph_texture(lut, chr); - render_char_tile(cur_x, cur_y, x_scale, y_scale, dsdx, dsdy); - -#ifdef VERSION_EU - break; - } -#endif -#if defined(VERSION_US) || defined(VERSION_SH) - } -#endif - - apply_stride(chr, cur_x, x_stride); - - str_pos++; - } - - apply_alpha_end(alpha); -} diff --git a/src/common/ui/original_text_renderer.hpp b/src/common/ui/original_text_renderer.hpp deleted file mode 100644 index 654d732e..00000000 --- a/src/common/ui/original_text_renderer.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include -#include - -#include "i_text_renderer.hpp" -#include "include/types.h" -#include "text_to_render.hpp" - -class OriginalFluentTextRenderChain; - -class OriginalTextRenderer : public ITextRenderer { - friend OriginalFluentTextRenderChain; - -public: - void render_scheduled_text(); - - std::unique_ptr render(); - -private: - void render_text(const TextToRender &text_to_render); - void schedule_text(const TextToRender &text_to_render); - - std::vector> scheduled_text; -}; diff --git a/src/common/ui/text_to_render.hpp b/src/common/ui/text_to_render.hpp deleted file mode 100644 index 296d16eb..00000000 --- a/src/common/ui/text_to_render.hpp +++ /dev/null @@ -1,70 +0,0 @@ -#pragma once - -#include "include/types.h" - -#include "game/ingame_menu.h" -#include "i_text_renderer.hpp" - -/* Helper class for bundling information about text to render. */ -class TextToRender { -public: - TextToRender() { } - - void set_glyphs(std::string text) { - length = (s16)text.length(); - for (auto i = 0; i < length; ++i) { str[i] = text[i]; } - str[length] = GLOBAR_CHAR_TERMINATOR; - } - - void set_glyphs(const u8* str) { - u8 c; - s32 strPos = 0; - do { - c = str[strPos]; - this->str[strPos] = c; - - strPos++; - } while (c != GLOBAR_CHAR_TERMINATOR); - length = strPos - 1; - } - - void set_glyph(u8 chr) { - str[0] = chr; - str[1] = GLOBAR_CHAR_TERMINATOR; - length = 1; - } - - TextToRender(const TextToRender& other) { - u8 c; - s32 strPos = 0; - do { - c = other.str[strPos]; - this->str[strPos] = c; - - strPos++; - } while (c != GLOBAR_CHAR_TERMINATOR); - length = strPos - 1; - - this->x = other.x; - this->y = other.y; - } - - u8 str[50]; - s16 length; - - s16 x; - s16 y; - - u8 alpha = 255; - - bool centered = false; - bool scheduled = false; - - // s16 x_scale = 16; - // s16 y_scale = 16; - - // s16 dsdx = 4; - // s16 dsdy = 1; - - LutSource lut_source; -}; diff --git a/src/engine/behavior_script.c b/src/engine/behavior_script.c index 7aaa67d4..f61f2bf4 100644 --- a/src/engine/behavior_script.c +++ b/src/engine/behavior_script.c @@ -32,7 +32,7 @@ static u16 gRandomSeed16; // Unused function that directly jumps to a behavior command and resets the object's stack index. static void goto_behavior_unused(const BehaviorScript *bhvAddr) { - gCurBhvCommand = (BehaviorScript*) segmented_to_virtual(bhvAddr); + gCurBhvCommand = segmented_to_virtual(bhvAddr); gCurrentObject->bhvStackIndex = 0; } @@ -140,6 +140,14 @@ static s32 bhv_cmd_billboard(void) { return BHV_PROC_CONTINUE; } +// Command 0x +static s32 bhv_cmd_cylboard(void) { + gCurrentObject->header.gfx.node.flags |= GRAPH_RENDER_CYLBOARD; + + gCurBhvCommand++; + return BHV_PROC_CONTINUE; +} + // Command 0x1B: Sets the current model ID of the object. // Usage: SET_MODEL(modelID) static s32 bhv_cmd_set_model(void) { @@ -155,7 +163,7 @@ static s32 bhv_cmd_set_model(void) { // Usage: SPAWN_CHILD(modelID, behavior) static s32 bhv_cmd_spawn_child(void) { u32 model = BHV_CMD_GET_U32(1); - const BehaviorScript *behavior = (const BehaviorScript *) BHV_CMD_GET_VPTR(2); + const BehaviorScript *behavior = BHV_CMD_GET_VPTR(2); struct Object *child = spawn_object_at_origin(gCurrentObject, 0, model, behavior); obj_copy_pos_and_angle(child, gCurrentObject); @@ -168,7 +176,7 @@ static s32 bhv_cmd_spawn_child(void) { // Usage: SPAWN_OBJ(modelID, behavior) static s32 bhv_cmd_spawn_obj(void) { u32 model = BHV_CMD_GET_U32(1); - const BehaviorScript *behavior = (const BehaviorScript*) BHV_CMD_GET_VPTR(2); + const BehaviorScript *behavior = BHV_CMD_GET_VPTR(2); struct Object *object = spawn_object_at_origin(gCurrentObject, 0, model, behavior); obj_copy_pos_and_angle(object, gCurrentObject); @@ -184,7 +192,7 @@ static s32 bhv_cmd_spawn_obj(void) { static s32 bhv_cmd_spawn_child_with_param(void) { u32 bhvParam = BHV_CMD_GET_2ND_S16(0); u32 modelID = BHV_CMD_GET_U32(1); - const BehaviorScript *behavior = (const BehaviorScript *) BHV_CMD_GET_VPTR(2); + const BehaviorScript *behavior = BHV_CMD_GET_VPTR(2); struct Object *child = spawn_object_at_origin(gCurrentObject, 0, modelID, behavior); obj_copy_pos_and_angle(child, gCurrentObject); @@ -220,7 +228,7 @@ static s32 bhv_cmd_call(void) { gCurBhvCommand++; cur_obj_bhv_stack_push(BHV_CMD_GET_ADDR_OF_CMD(1)); // Store address of the next bhv command in the stack. - jumpAddress = (BehaviorScript*) segmented_to_virtual(BHV_CMD_GET_VPTR(0)); + jumpAddress = segmented_to_virtual(BHV_CMD_GET_VPTR(0)); gCurBhvCommand = jumpAddress; // Jump to the new address. return BHV_PROC_CONTINUE; @@ -268,7 +276,7 @@ static s32 bhv_cmd_delay_var(void) { // Usage: GOTO(addr) static s32 bhv_cmd_goto(void) { gCurBhvCommand++; // Useless - gCurBhvCommand = (BehaviorScript*) segmented_to_virtual(BHV_CMD_GET_VPTR(0)); // Jump directly to address + gCurBhvCommand = segmented_to_virtual(BHV_CMD_GET_VPTR(0)); // Jump directly to address return BHV_PROC_CONTINUE; } @@ -359,7 +367,8 @@ static s32 bhv_cmd_end_loop(void) { // Usage: CALL_NATIVE(func) typedef void (*NativeBhvFunc)(void); static s32 bhv_cmd_call_native(void) { - NativeBhvFunc behaviorFunc = (NativeBhvFunc) BHV_CMD_GET_VPTR(1); + NativeBhvFunc behaviorFunc = BHV_CMD_GET_VPTR(1); + behaviorFunc(); gCurBhvCommand += 2; @@ -729,7 +738,7 @@ static s32 bhv_cmd_set_int_random_from_table(void) { // Command 0x2A: Loads collision data for the object. // Usage: LOAD_COLLISION_DATA(collisionData) static s32 bhv_cmd_load_collision_data(void) { - u32 *collisionData = (u32*) segmented_to_virtual(BHV_CMD_GET_VPTR(1)); + u32 *collisionData = segmented_to_virtual(BHV_CMD_GET_VPTR(1)); gCurrentObject->collisionData = collisionData; @@ -815,7 +824,7 @@ static s32 bhv_cmd_parent_bit_clear(void) { // Command 0x37: Spawns a water droplet with the given parameters. // Usage: SPAWN_WATER_DROPLET(dropletParams) static s32 bhv_cmd_spawn_water_droplet(void) { - struct WaterDropletParams *dropletParams = (struct WaterDropletParams*) BHV_CMD_GET_VPTR(1); + struct WaterDropletParams *dropletParams = BHV_CMD_GET_VPTR(1); spawn_water_droplet(gCurrentObject, dropletParams); @@ -843,62 +852,63 @@ void stub_behavior_script_2(void) { typedef s32 (*BhvCommandProc)(void); static BhvCommandProc BehaviorCmdTable[] = { - bhv_cmd_begin, - bhv_cmd_delay, - bhv_cmd_call, - bhv_cmd_return, - bhv_cmd_goto, - bhv_cmd_begin_repeat, - bhv_cmd_end_repeat, - bhv_cmd_end_repeat_continue, - bhv_cmd_begin_loop, - bhv_cmd_end_loop, - bhv_cmd_break, - bhv_cmd_break_unused, - bhv_cmd_call_native, - bhv_cmd_add_float, - bhv_cmd_set_float, - bhv_cmd_add_int, - bhv_cmd_set_int, - bhv_cmd_or_int, - bhv_cmd_bit_clear, - bhv_cmd_set_int_rand_rshift, - bhv_cmd_set_random_float, - bhv_cmd_set_random_int, - bhv_cmd_add_random_float, - bhv_cmd_add_int_rand_rshift, - bhv_cmd_nop_1, - bhv_cmd_nop_2, - bhv_cmd_nop_3, - bhv_cmd_set_model, - bhv_cmd_spawn_child, - bhv_cmd_deactivate, - bhv_cmd_drop_to_floor, - bhv_cmd_sum_float, - bhv_cmd_sum_int, - bhv_cmd_billboard, - bhv_cmd_hide, - bhv_cmd_set_hitbox, - bhv_cmd_nop_4, - bhv_cmd_delay_var, - bhv_cmd_begin_repeat_unused, - bhv_cmd_load_animations, - bhv_cmd_animate, - bhv_cmd_spawn_child_with_param, - bhv_cmd_load_collision_data, - bhv_cmd_set_hitbox_with_offset, - bhv_cmd_spawn_obj, - bhv_cmd_set_home, - bhv_cmd_set_hurtbox, - bhv_cmd_set_interact_type, - bhv_cmd_set_obj_physics, - bhv_cmd_set_interact_subtype, - bhv_cmd_scale, - bhv_cmd_parent_bit_clear, - bhv_cmd_animate_texture, - bhv_cmd_disable_rendering, - bhv_cmd_set_int_unused, - bhv_cmd_spawn_water_droplet, + bhv_cmd_begin, //00 + bhv_cmd_delay, //01 + bhv_cmd_call, //02 + bhv_cmd_return, //03 + bhv_cmd_goto, //04 + bhv_cmd_begin_repeat, //05 + bhv_cmd_end_repeat, //06 + bhv_cmd_end_repeat_continue, //07 + bhv_cmd_begin_loop, //08 + bhv_cmd_end_loop, //09 + bhv_cmd_break, //0A + bhv_cmd_break_unused, //0B + bhv_cmd_call_native, //0C + bhv_cmd_add_float, //0D + bhv_cmd_set_float, //0E + bhv_cmd_add_int, //0F + bhv_cmd_set_int, //10 + bhv_cmd_or_int, //11 + bhv_cmd_bit_clear, //12 + bhv_cmd_set_int_rand_rshift, //13 + bhv_cmd_set_random_float, //14 + bhv_cmd_set_random_int, //15 + bhv_cmd_add_random_float, //16 + bhv_cmd_add_int_rand_rshift, //17 + bhv_cmd_nop_1, //18 + bhv_cmd_nop_2, //19 + bhv_cmd_nop_3, //1A + bhv_cmd_set_model, //1B + bhv_cmd_spawn_child, //1C + bhv_cmd_deactivate, //1D + bhv_cmd_drop_to_floor, //1E + bhv_cmd_sum_float, //1F + bhv_cmd_sum_int, //20 + bhv_cmd_billboard, //21 + bhv_cmd_hide, //22 + bhv_cmd_set_hitbox, //23 + bhv_cmd_nop_4, //24 + bhv_cmd_delay_var, //25 + bhv_cmd_begin_repeat_unused, //26 + bhv_cmd_load_animations, //27 + bhv_cmd_animate, //28 + bhv_cmd_spawn_child_with_param, //29 + bhv_cmd_load_collision_data, //2A + bhv_cmd_set_hitbox_with_offset, //2B + bhv_cmd_spawn_obj, //2C + bhv_cmd_set_home, //2D + bhv_cmd_set_hurtbox, //2E + bhv_cmd_set_interact_type, //2F + bhv_cmd_set_obj_physics, //30 + bhv_cmd_set_interact_subtype, //31 + bhv_cmd_scale, //32 + bhv_cmd_parent_bit_clear, //33 + bhv_cmd_animate_texture, //34 + bhv_cmd_disable_rendering, //35 + bhv_cmd_set_int_unused, //36 + bhv_cmd_spawn_water_droplet, //37 + bhv_cmd_cylboard //38 }; // Execute the behavior script of the current object, process the object flags, and other miscellaneous code for updating objects. @@ -988,11 +998,15 @@ void cur_obj_update(void) { } else if ((objFlags & OBJ_FLAG_COMPUTE_DIST_TO_MARIO) && gCurrentObject->collisionData == NULL) { if (!(objFlags & OBJ_FLAG_ACTIVE_FROM_AFAR)) { // If the object has a render distance, check if it should be shown. +#ifndef NODRAWINGDISTANCE if (distanceFromMario > gCurrentObject->oDrawingDistance) { // Out of render distance, hide the object. gCurrentObject->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE; gCurrentObject->activeFlags |= ACTIVE_FLAG_FAR_AWAY; } else if (gCurrentObject->oHeldState == HELD_FREE) { +#else + if (distanceFromMario <= gCurrentObject->oDrawingDistance && gCurrentObject->oHeldState == HELD_FREE) { +#endif // In render distance (and not being held), show the object. gCurrentObject->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE; gCurrentObject->activeFlags &= ~ACTIVE_FLAG_FAR_AWAY; diff --git a/src/engine/geo_layout.c b/src/engine/geo_layout.c index df64ac49..d071d1a6 100644 --- a/src/engine/geo_layout.c +++ b/src/engine/geo_layout.c @@ -110,7 +110,7 @@ void geo_layout_cmd_branch_and_link(void) { gGeoLayoutStack[gGeoLayoutStackIndex++] = (uintptr_t) (gGeoLayoutCommand + CMD_PROCESS_OFFSET(8)); gGeoLayoutStack[gGeoLayoutStackIndex++] = (gCurGraphNodeIndex << 16) + gGeoLayoutReturnIndex; gGeoLayoutReturnIndex = gGeoLayoutStackIndex; - gGeoLayoutCommand = (u8*) segmented_to_virtual(cur_geo_cmd_ptr(0x04)); + gGeoLayoutCommand = segmented_to_virtual(cur_geo_cmd_ptr(0x04)); } // 0x01: Terminate geo layout @@ -130,7 +130,7 @@ void geo_layout_cmd_branch(void) { gGeoLayoutStack[gGeoLayoutStackIndex++] = (uintptr_t) (gGeoLayoutCommand + CMD_PROCESS_OFFSET(8)); } - gGeoLayoutCommand = (u8 *) segmented_to_virtual(cur_geo_cmd_ptr(0x04)); + gGeoLayoutCommand = segmented_to_virtual(cur_geo_cmd_ptr(0x04)); } // 0x03: Return from branch @@ -216,7 +216,7 @@ void geo_layout_cmd_node_root(void) { graphNode = init_graph_node_root(gGraphNodePool, NULL, 0, x, y, width, height); // TODO: check type - gGeoViews = (struct GraphNode**) alloc_only_pool_alloc(gGraphNodePool, gGeoNumViews * sizeof(struct GraphNode *)); + gGeoViews = alloc_only_pool_alloc(gGraphNodePool, gGeoNumViews * sizeof(struct GraphNode *)); graphNode->views = gGeoViews; graphNode->numViews = gGeoNumViews; @@ -780,7 +780,7 @@ struct GraphNode *process_geo_layout(struct AllocOnlyPool *pool, void *segptr) { gGeoLayoutStackIndex = 2; gGeoLayoutReturnIndex = 2; // stack index is often copied here? - gGeoLayoutCommand = (u8*) segmented_to_virtual(segptr); + gGeoLayoutCommand = segmented_to_virtual(segptr); gGraphNodePool = pool; diff --git a/src/engine/graph_node.c b/src/engine/graph_node.c index a13b8034..4a6495c0 100644 --- a/src/engine/graph_node.c +++ b/src/engine/graph_node.c @@ -37,7 +37,7 @@ void init_scene_graph_node_links(struct GraphNode *graphNode, s32 type) { struct GraphNodeRoot *init_graph_node_root(struct AllocOnlyPool *pool, struct GraphNodeRoot *graphNode, s16 areaIndex, s16 x, s16 y, s16 width, s16 height) { if (pool != NULL) { - graphNode = (struct GraphNodeRoot*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeRoot)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeRoot)); } if (graphNode != NULL) { @@ -63,7 +63,7 @@ struct GraphNodeOrthoProjection * init_graph_node_ortho_projection(struct AllocOnlyPool *pool, struct GraphNodeOrthoProjection *graphNode, f32 scale) { if (pool != NULL) { - graphNode = (struct GraphNodeOrthoProjection*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeOrthoProjection)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeOrthoProjection)); } if (graphNode != NULL) { @@ -82,7 +82,7 @@ struct GraphNodePerspective *init_graph_node_perspective(struct AllocOnlyPool *p f32 fov, s16 near, s16 far, GraphNodeFunc nodeFunc, s32 unused) { if (pool != NULL) { - graphNode = (struct GraphNodePerspective*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodePerspective)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodePerspective)); } if (graphNode != NULL) { @@ -108,7 +108,7 @@ struct GraphNodePerspective *init_graph_node_perspective(struct AllocOnlyPool *p struct GraphNodeStart *init_graph_node_start(struct AllocOnlyPool *pool, struct GraphNodeStart *graphNode) { if (pool != NULL) { - graphNode = (struct GraphNodeStart*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeStart)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeStart)); } if (graphNode != NULL) { @@ -124,7 +124,7 @@ struct GraphNodeStart *init_graph_node_start(struct AllocOnlyPool *pool, struct GraphNodeMasterList *init_graph_node_master_list(struct AllocOnlyPool *pool, struct GraphNodeMasterList *graphNode, s16 on) { if (pool != NULL) { - graphNode = (struct GraphNodeMasterList*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeMasterList)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeMasterList)); } if (graphNode != NULL) { @@ -145,7 +145,7 @@ struct GraphNodeLevelOfDetail *init_graph_node_render_range(struct AllocOnlyPool struct GraphNodeLevelOfDetail *graphNode, s16 minDistance, s16 maxDistance) { if (pool != NULL) { - graphNode = (struct GraphNodeLevelOfDetail*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeLevelOfDetail)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeLevelOfDetail)); } if (graphNode != NULL) { @@ -165,7 +165,7 @@ struct GraphNodeSwitchCase *init_graph_node_switch_case(struct AllocOnlyPool *po s16 numCases, s16 selectedCase, GraphNodeFunc nodeFunc, s32 unused) { if (pool != NULL) { - graphNode = (struct GraphNodeSwitchCase*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeSwitchCase)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeSwitchCase)); } if (graphNode != NULL) { @@ -190,7 +190,7 @@ struct GraphNodeCamera *init_graph_node_camera(struct AllocOnlyPool *pool, struct GraphNodeCamera *graphNode, f32 *pos, f32 *focus, GraphNodeFunc func, s32 mode) { if (pool != NULL) { - graphNode = (struct GraphNodeCamera*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeCamera)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeCamera)); } if (graphNode != NULL) { @@ -218,7 +218,7 @@ init_graph_node_translation_rotation(struct AllocOnlyPool *pool, struct GraphNodeTranslationRotation *graphNode, s32 drawingLayer, void *displayList, Vec3s translation, Vec3s rotation) { if (pool != NULL) { - graphNode = (struct GraphNodeTranslationRotation*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeTranslationRotation)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeTranslationRotation)); } if (graphNode != NULL) { @@ -241,7 +241,7 @@ struct GraphNodeTranslation *init_graph_node_translation(struct AllocOnlyPool *p s32 drawingLayer, void *displayList, Vec3s translation) { if (pool != NULL) { - graphNode = (struct GraphNodeTranslation*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeTranslation)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeTranslation)); } if (graphNode != NULL) { @@ -263,7 +263,7 @@ struct GraphNodeRotation *init_graph_node_rotation(struct AllocOnlyPool *pool, s32 drawingLayer, void *displayList, Vec3s rotation) { if (pool != NULL) { - graphNode = (struct GraphNodeRotation*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeRotation)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeRotation)); } if (graphNode != NULL) { @@ -283,7 +283,7 @@ struct GraphNodeScale *init_graph_node_scale(struct AllocOnlyPool *pool, struct GraphNodeScale *graphNode, s32 drawingLayer, void *displayList, f32 scale) { if (pool != NULL) { - graphNode = (struct GraphNodeScale*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeScale)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeScale)); } if (graphNode != NULL) { @@ -304,7 +304,7 @@ struct GraphNodeObject *init_graph_node_object(struct AllocOnlyPool *pool, struct GraphNode *sharedChild, Vec3f pos, Vec3s angle, Vec3f scale) { if (pool != NULL) { - graphNode = (struct GraphNodeObject*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeObject)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeObject)); } if (graphNode != NULL) { @@ -333,7 +333,7 @@ struct GraphNodeCullingRadius *init_graph_node_culling_radius(struct AllocOnlyPo struct GraphNodeCullingRadius *graphNode, s16 radius) { if (pool != NULL) { - graphNode = (struct GraphNodeCullingRadius*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeCullingRadius)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeCullingRadius)); } if (graphNode != NULL) { @@ -352,7 +352,7 @@ struct GraphNodeAnimatedPart *init_graph_node_animated_part(struct AllocOnlyPool s32 drawingLayer, void *displayList, Vec3s translation) { if (pool != NULL) { - graphNode = (struct GraphNodeAnimatedPart*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeAnimatedPart)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeAnimatedPart)); } if (graphNode != NULL) { @@ -373,7 +373,7 @@ struct GraphNodeBillboard *init_graph_node_billboard(struct AllocOnlyPool *pool, s32 drawingLayer, void *displayList, Vec3s translation) { if (pool != NULL) { - graphNode = (struct GraphNodeBillboard*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeBillboard)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeBillboard)); } if (graphNode != NULL) { @@ -393,7 +393,7 @@ struct GraphNodeDisplayList *init_graph_node_display_list(struct AllocOnlyPool * struct GraphNodeDisplayList *graphNode, s32 drawingLayer, void *displayList) { if (pool != NULL) { - graphNode = (struct GraphNodeDisplayList*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeDisplayList)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeDisplayList)); } if (graphNode != NULL) { @@ -412,7 +412,7 @@ struct GraphNodeShadow *init_graph_node_shadow(struct AllocOnlyPool *pool, struct GraphNodeShadow *graphNode, s16 shadowScale, u8 shadowSolidity, u8 shadowType) { if (pool != NULL) { - graphNode = (struct GraphNodeShadow*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeShadow)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeShadow)); } if (graphNode != NULL) { @@ -432,7 +432,7 @@ struct GraphNodeObjectParent *init_graph_node_object_parent(struct AllocOnlyPool struct GraphNodeObjectParent *graphNode, struct GraphNode *sharedChild) { if (pool != NULL) { - graphNode = (struct GraphNodeObjectParent*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeObjectParent)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeObjectParent)); } if (graphNode != NULL) { @@ -450,7 +450,7 @@ struct GraphNodeGenerated *init_graph_node_generated(struct AllocOnlyPool *pool, struct GraphNodeGenerated *graphNode, GraphNodeFunc gfxFunc, s32 parameter) { if (pool != NULL) { - graphNode = (struct GraphNodeGenerated*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeGenerated)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeGenerated)); } if (graphNode != NULL) { @@ -474,7 +474,7 @@ struct GraphNodeBackground *init_graph_node_background(struct AllocOnlyPool *poo u16 background, GraphNodeFunc backgroundFunc, s32 zero) { if (pool != NULL) { - graphNode = (struct GraphNodeBackground*) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeBackground)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeBackground)); } if (graphNode != NULL) { @@ -501,7 +501,7 @@ struct GraphNodeHeldObject *init_graph_node_held_object(struct AllocOnlyPool *po Vec3s translation, GraphNodeFunc nodeFunc, s32 playerIndex) { if (pool != NULL) { - graphNode = (struct GraphNodeHeldObject *) alloc_only_pool_alloc(pool, sizeof(struct GraphNodeHeldObject)); + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeHeldObject)); } if (graphNode != NULL) { @@ -695,7 +695,7 @@ void geo_obj_init(struct GraphNodeObject *graphNode, void *sharedChild, Vec3f po vec3f_copy(graphNode->pos, pos); vec3s_copy(graphNode->angle, angle); - graphNode->sharedChild = (struct GraphNode*) sharedChild; + graphNode->sharedChild = sharedChild; graphNode->unk4C = 0; graphNode->throwMatrix = NULL; graphNode->unk38.curAnim = NULL; @@ -734,8 +734,8 @@ void geo_obj_init_spawninfo(struct GraphNodeObject *graphNode, struct SpawnInfo * Initialize the animation of an object node */ void geo_obj_init_animation(struct GraphNodeObject *graphNode, struct Animation **animPtrAddr) { - struct Animation **animSegmented = (struct Animation**) segmented_to_virtual(animPtrAddr); - struct Animation *anim = (struct Animation*) segmented_to_virtual(*animSegmented); + struct Animation **animSegmented = segmented_to_virtual(animPtrAddr); + struct Animation *anim = segmented_to_virtual(*animSegmented); if (graphNode->unk38.curAnim != anim) { graphNode->unk38.curAnim = anim; @@ -749,8 +749,8 @@ void geo_obj_init_animation(struct GraphNodeObject *graphNode, struct Animation * Initialize the animation of an object node */ void geo_obj_init_animation_accel(struct GraphNodeObject *graphNode, struct Animation **animPtrAddr, u32 animAccel) { - struct Animation **animSegmented = (struct Animation**) segmented_to_virtual(animPtrAddr); - struct Animation *anim = (struct Animation*) segmented_to_virtual(*animSegmented); + struct Animation **animSegmented = segmented_to_virtual(animPtrAddr); + struct Animation *anim = segmented_to_virtual(*animSegmented); if (graphNode->unk38.curAnim != anim) { graphNode->unk38.curAnim = anim; @@ -855,8 +855,8 @@ void geo_retreive_animation_translation(struct GraphNodeObject *obj, Vec3f posit s16 frame; if (animation != NULL) { - attribute = (u16*) segmented_to_virtual((void *) animation->index); - values = (s16*) segmented_to_virtual((void *) animation->values); + attribute = segmented_to_virtual((void *) animation->index); + values = segmented_to_virtual((void *) animation->values); frame = obj->unk38.animFrame; diff --git a/src/engine/graph_node.h b/src/engine/graph_node.h index a680f70e..91d70c67 100644 --- a/src/engine/graph_node.h +++ b/src/engine/graph_node.h @@ -13,12 +13,13 @@ #define GRAPH_RENDER_Z_BUFFER (1 << 3) #define GRAPH_RENDER_INVISIBLE (1 << 4) #define GRAPH_RENDER_HAS_ANIMATION (1 << 5) +#define GRAPH_RENDER_CYLBOARD (1 << 6) // Whether the node type has a function pointer of type GraphNodeFunc #define GRAPH_NODE_TYPE_FUNCTIONAL 0x100 // Type used for Bowser and an unused geo function in obj_behaviors.c -#define GRAPH_NODE_TYPE_400 0x400 +#define GRAPH_NODE_TYPE_400 0x400 // The discriminant for different types of geo nodes #define GRAPH_NODE_TYPE_ROOT 0x001 @@ -44,6 +45,10 @@ #define GRAPH_NODE_TYPE_HELD_OBJ (0x02E | GRAPH_NODE_TYPE_FUNCTIONAL) #define GRAPH_NODE_TYPE_CULLING_RADIUS 0x02F +// Mesh node type used by the modern renderer +#define GRAPH_NODE_TYPE_RMODERN_MESH 0x030 + + // The number of master lists. A master list determines the order and render // mode with which display lists are drawn. #define GFX_NUM_MASTER_LISTS 8 diff --git a/src/engine/level_script.c b/src/engine/level_script.c index b273fc8a..b623c7f1 100644 --- a/src/engine/level_script.c +++ b/src/engine/level_script.c @@ -1,7 +1,5 @@ #include -#ifdef NO_SEGMENTED_MEMORY #include -#endif #include "sm64.h" #include "audio/external.h" @@ -24,6 +22,7 @@ #include "math_util.h" #include "surface_collision.h" #include "surface_load.h" +#include "level_table.h" #define CMD_GET(type, offset) (*(type *) (CMD_PROCESS_OFFSET(offset) + (u8 *) sCurrentCmd)) @@ -96,7 +95,7 @@ static void level_cmd_load_and_execute(void) { *sStackTop++ = (uintptr_t) sStackBase; sStackBase = sStackTop; - sCurrentCmd = (struct LevelCommand*) segmented_to_virtual(CMD_GET(void *, 12)); + sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 12)); } static void level_cmd_exit_and_execute(void) { @@ -109,7 +108,7 @@ static void level_cmd_exit_and_execute(void) { MEMORY_POOL_LEFT); sStackTop = sStackBase; - sCurrentCmd = (struct LevelCommand*) segmented_to_virtual(targetAddr); + sCurrentCmd = segmented_to_virtual(targetAddr); } static void level_cmd_exit(void) { @@ -143,12 +142,12 @@ static void level_cmd_sleep2(void) { } static void level_cmd_jump(void) { - sCurrentCmd = (struct LevelCommand*) segmented_to_virtual(CMD_GET(void *, 4)); + sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 4)); } static void level_cmd_jump_and_link(void) { *sStackTop++ = (uintptr_t) NEXT_CMD; - sCurrentCmd = (struct LevelCommand*) segmented_to_virtual(CMD_GET(void *, 4)); + sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 4)); } static void level_cmd_return(void) { @@ -192,7 +191,7 @@ static void level_cmd_loop_until(void) { static void level_cmd_jump_if(void) { if (eval_script_op(CMD_GET(u8, 2), CMD_GET(s32, 4)) != 0) { - sCurrentCmd = (struct LevelCommand*) segmented_to_virtual(CMD_GET(void *, 8)); + sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 8)); } else { sCurrentCmd = CMD_NEXT; } @@ -201,7 +200,7 @@ static void level_cmd_jump_if(void) { static void level_cmd_jump_and_link_if(void) { if (eval_script_op(CMD_GET(u8, 2), CMD_GET(s32, 4)) != 0) { *sStackTop++ = (uintptr_t) NEXT_CMD; - sCurrentCmd = (struct LevelCommand*) segmented_to_virtual(CMD_GET(void *, 8)); + sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 8)); } else { sCurrentCmd = CMD_NEXT; } @@ -446,7 +445,7 @@ static void level_cmd_place_object(void) { if (sCurrAreaIndex != -1 && ((CMD_GET(u8, 2) & val7) || CMD_GET(u8, 2) == 0x1F)) { model = CMD_GET(u8, 3); - spawnInfo = (struct SpawnInfo*) alloc_only_pool_alloc(sLevelPool, sizeof(struct SpawnInfo)); + spawnInfo = alloc_only_pool_alloc(sLevelPool, sizeof(struct SpawnInfo)); spawnInfo->startPos[0] = CMD_GET(s16, 4); spawnInfo->startPos[1] = CMD_GET(s16, 6); @@ -472,7 +471,7 @@ static void level_cmd_place_object(void) { static void level_cmd_create_warp_node(void) { if (sCurrAreaIndex != -1) { - struct ObjectWarpNode *warpNode = (struct ObjectWarpNode*) + struct ObjectWarpNode *warpNode = alloc_only_pool_alloc(sLevelPool, sizeof(struct ObjectWarpNode)); warpNode->node.id = CMD_GET(u8, 2); @@ -495,7 +494,7 @@ static void level_cmd_create_instant_warp(void) { if (sCurrAreaIndex != -1) { if (gAreas[sCurrAreaIndex].instantWarps == NULL) { - gAreas[sCurrAreaIndex].instantWarps = (struct InstantWarp*) + gAreas[sCurrAreaIndex].instantWarps = alloc_only_pool_alloc(sLevelPool, 4 * sizeof(struct InstantWarp)); for (i = INSTANT_WARP_INDEX_START; i < INSTANT_WARP_INDEX_STOP; i++) { @@ -531,7 +530,7 @@ static void level_cmd_create_painting_warp_node(void) { if (sCurrAreaIndex != -1) { if (gAreas[sCurrAreaIndex].paintingWarpNodes == NULL) { gAreas[sCurrAreaIndex].paintingWarpNodes = - (struct WarpNode*) alloc_only_pool_alloc(sLevelPool, 45 * sizeof(struct WarpNode)); + alloc_only_pool_alloc(sLevelPool, 45 * sizeof(struct WarpNode)); for (i = 0; i < 45; i++) { gAreas[sCurrAreaIndex].paintingWarpNodes[i].id = 0; @@ -554,7 +553,7 @@ static void level_cmd_3A(void) { if (sCurrAreaIndex != -1) { if ((val4 = gAreas[sCurrAreaIndex].unused28) == NULL) { - val4 = gAreas[sCurrAreaIndex].unused28 = (struct UnusedArea28*) + val4 = gAreas[sCurrAreaIndex].unused28 = alloc_only_pool_alloc(sLevelPool, sizeof(struct UnusedArea28)); } @@ -578,7 +577,7 @@ static void level_cmd_create_whirlpool(void) { || (CMD_GET(u8, 3) == 2 && beatBowser2) || (CMD_GET(u8, 3) == 3 && gCurrActNum >= 2)) { if (sCurrAreaIndex != -1 && index < 2) { if ((whirlpool = gAreas[sCurrAreaIndex].whirlpools[index]) == NULL) { - whirlpool = (struct Whirlpool*) alloc_only_pool_alloc(sLevelPool, sizeof(struct Whirlpool)); + whirlpool = alloc_only_pool_alloc(sLevelPool, sizeof(struct Whirlpool)); gAreas[sCurrAreaIndex].whirlpools[index] = whirlpool; } @@ -602,44 +601,36 @@ static void level_cmd_set_gamma(void) { static void level_cmd_set_terrain_data(void) { if (sCurrAreaIndex != -1) { -#ifndef NO_SEGMENTED_MEMORY - gAreas[sCurrAreaIndex].terrainData = segmented_to_virtual(CMD_GET(void *, 4)); -#else Collision *data; u32 size; // The game modifies the terrain data and must be reset upon level reload. - data = (Collision*) segmented_to_virtual(CMD_GET(void *, 4)); + data = segmented_to_virtual(CMD_GET(void *, 4)); size = get_area_terrain_size(data) * sizeof(Collision); - gAreas[sCurrAreaIndex].terrainData = (s16*) alloc_only_pool_alloc(sLevelPool, size); + gAreas[sCurrAreaIndex].terrainData = alloc_only_pool_alloc(sLevelPool, size); memcpy(gAreas[sCurrAreaIndex].terrainData, data, size); -#endif } sCurrentCmd = CMD_NEXT; } static void level_cmd_set_rooms(void) { if (sCurrAreaIndex != -1) { - gAreas[sCurrAreaIndex].surfaceRooms = (s8*) segmented_to_virtual(CMD_GET(void *, 4)); + gAreas[sCurrAreaIndex].surfaceRooms = segmented_to_virtual(CMD_GET(void *, 4)); } sCurrentCmd = CMD_NEXT; } static void level_cmd_set_macro_objects(void) { if (sCurrAreaIndex != -1) { -#ifndef NO_SEGMENTED_MEMORY - gAreas[sCurrAreaIndex].macroObjects = (s16*) segmented_to_virtual(CMD_GET(void *, 4)); -#else // The game modifies the macro object data (for example marking coins as taken), // so it must be reset when the level reloads. - MacroObject *data = (MacroObject*) segmented_to_virtual(CMD_GET(void *, 4)); + MacroObject *data = segmented_to_virtual(CMD_GET(void *, 4)); s32 len = 0; while (data[len++] != MACRO_OBJECT_END()) { len += 4; } - gAreas[sCurrAreaIndex].macroObjects = (MacroObject*) alloc_only_pool_alloc(sLevelPool, len * sizeof(MacroObject)); + gAreas[sCurrAreaIndex].macroObjects = alloc_only_pool_alloc(sLevelPool, len * sizeof(MacroObject)); memcpy(gAreas[sCurrAreaIndex].macroObjects, data, len * sizeof(MacroObject)); -#endif } sCurrentCmd = CMD_NEXT; } @@ -720,6 +711,8 @@ static void level_cmd_38(void) { sCurrentCmd = CMD_NEXT; } +extern int gPressedStart; + static void level_cmd_get_or_set_var(void) { if (CMD_GET(u8, 2) == 0) { switch (CMD_GET(u8, 3)) { @@ -738,6 +731,9 @@ static void level_cmd_get_or_set_var(void) { case 4: gCurrAreaIndex = sRegister; break; + case 5: + gPressedStart = sRegister; + break; } } else { switch (CMD_GET(u8, 3)) { @@ -756,12 +752,48 @@ static void level_cmd_get_or_set_var(void) { case 4: sRegister = gCurrAreaIndex; break; + case 5: + sRegister = gPressedStart; + break; } } sCurrentCmd = CMD_NEXT; } +int gDemoLevels[7] = { + LEVEL_BOWSER_1, + LEVEL_WF, + LEVEL_CCM, + LEVEL_BBH, + LEVEL_JRB, + LEVEL_HMC, + LEVEL_PSS +}; + +int gDemoLevelID = 0; +int gDemoInputListID_2 = 0; + +extern int start_demo(int); + +static void level_cmd_advdemo(void) +{ + start_demo(0); + if(gDemoLevelID == 6) { + sRegister = gDemoLevels[6]; + gDemoLevelID = 0; + } else { + sRegister = gDemoLevels[gDemoLevelID++]; + } + sCurrentCmd = CMD_NEXT; +} + +static void level_cmd_cleardemoptr(void) +{ + gCurrDemoInput = NULL; + sCurrentCmd = CMD_NEXT; +} + static void (*LevelScriptJumpTable[])(void) = { /*00*/ level_cmd_load_and_execute, /*01*/ level_cmd_exit_and_execute, @@ -824,6 +856,8 @@ static void (*LevelScriptJumpTable[])(void) = { /*3A*/ level_cmd_3A, /*3B*/ level_cmd_create_whirlpool, /*3C*/ level_cmd_get_or_set_var, + /*3D*/ level_cmd_advdemo, + /*3E*/ level_cmd_cleardemoptr, }; struct LevelCommand *level_script_execute(struct LevelCommand *cmd) { diff --git a/src/engine/level_script.h b/src/engine/level_script.h index fa07479b..d41a91c8 100644 --- a/src/engine/level_script.h +++ b/src/engine/level_script.h @@ -3,12 +3,10 @@ #include -#include "util/unused.hpp" - struct LevelCommand; -extern const LevelScript* get_level_script_entry(int& out_count = unused_int); +extern u8 level_script_entry[]; -struct LevelCommand* level_script_execute(struct LevelCommand* cmd); +struct LevelCommand *level_script_execute(struct LevelCommand *cmd); #endif // LEVEL_SCRIPT_H diff --git a/src/engine/math_util.c b/src/engine/math_util.c index 58c5e3f0..ca2a7457 100644 --- a/src/engine/math_util.c +++ b/src/engine/math_util.c @@ -49,6 +49,15 @@ void *vec3f_sum(Vec3f dest, Vec3f a, Vec3f b) { return &dest; //! warning: function returns address of local variable } +/// Multiply vector 'dest' by a +void *vec3f_mul(Vec3f dest, f32 a) +{ + dest[0] *= a; + dest[1] *= a; + dest[2] *= a; + return &dest; //! warning: function returns address of local variable +} + /// Copy vector src to dest void *vec3s_copy(Vec3s dest, Vec3s src) { dest[0] = src[0]; @@ -81,11 +90,11 @@ void *vec3s_sum(Vec3s dest, Vec3s a, Vec3s b) { return &dest; //! warning: function returns address of local variable } -/// Subtract vector a from 'dest' -void *vec3s_sub(Vec3s dest, Vec3s a) { - dest[0] -= a[0]; - dest[1] -= a[1]; - dest[2] -= a[2]; +/// Make 'dest' the difference of vectors a and b. +void *vec3f_dif(Vec3f dest, Vec3f a, Vec3f b) { + dest[0] = a[0] - b[0]; + dest[1] = a[1] - b[1]; + dest[2] = a[2] - b[2]; return &dest; //! warning: function returns address of local variable } @@ -140,6 +149,18 @@ void *vec3f_normalize(Vec3f dest) { return &dest; //! warning: function returns address of local variable } +/// Get length of vector 'a' +f32 vec3f_length(Vec3f a) +{ + return sqrtf(a[0] * a[0] + a[1] * a[1] + a[2] * a[2]); +} + +/// Get dot product of vectors 'a' and 'b' +f32 vec3f_dot(Vec3f a, Vec3f b) +{ + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; +} + #pragma GCC diagnostic pop /// Copy matrix 'src' to 'dest' @@ -356,6 +377,32 @@ void mtxf_billboard(Mat4 dest, Mat4 mtx, Vec3f position, s16 angle) { dest[3][3] = 1; } +// straight up mtxf_billboard but minus the dest[1][n] lines. transform for cylindrical billboards +void mtxf_cylboard(Mat4 dest, Mat4 mtx, Vec3f position, s16 angle) { + dest[0][0] = coss(angle); + dest[0][1] = sins(angle); + dest[0][2] = 0; + dest[0][3] = 0; + + dest[1][0] = mtx[1][0]; + dest[1][1] = mtx[1][1]; + dest[1][2] = mtx[1][2]; + dest[1][3] = 0; + + dest[2][0] = 0; + dest[2][1] = 0; + dest[2][2] = 1; + dest[2][3] = 0; + + dest[3][0] = + mtx[0][0] * position[0] + mtx[1][0] * position[1] + mtx[2][0] * position[2] + mtx[3][0]; + dest[3][1] = + mtx[0][1] * position[0] + mtx[1][1] * position[1] + mtx[2][1] * position[2] + mtx[3][1]; + dest[3][2] = + mtx[0][2] * position[0] + mtx[1][2] * position[1] + mtx[2][2] * position[2] + mtx[3][2]; + dest[3][3] = 1; +} + /** * Set 'dest' to a transformation matrix that aligns an object with the terrain * based on the normal. Used for enemies. diff --git a/src/engine/math_util.h b/src/engine/math_util.h index cb37d52d..00245064 100644 --- a/src/engine/math_util.h +++ b/src/engine/math_util.h @@ -32,10 +32,16 @@ extern f32 gCosineTable[]; #define sqr(x) ((x) * (x)) +#define absx(x) ((x) < 0 ? -(x) : (x)) + +#include "../../include/libc/stdlib.h" + void *vec3f_copy(Vec3f dest, Vec3f src); void *vec3f_set(Vec3f dest, f32 x, f32 y, f32 z); void *vec3f_add(Vec3f dest, Vec3f a); void *vec3f_sum(Vec3f dest, Vec3f a, Vec3f b); +void *vec3f_dif(Vec3f dest, Vec3f a, Vec3f b); +void *vec3f_mul(Vec3f dest, f32 a); void *vec3s_copy(Vec3s dest, Vec3s src); void *vec3s_set(Vec3s dest, s16 x, s16 y, s16 z); void *vec3s_add(Vec3s dest, Vec3s a); @@ -46,6 +52,8 @@ void *vec3f_to_vec3s(Vec3s dest, Vec3f a); void *find_vector_perpendicular_to_plane(Vec3f dest, Vec3f a, Vec3f b, Vec3f c); void *vec3f_cross(Vec3f dest, Vec3f a, Vec3f b); void *vec3f_normalize(Vec3f dest); +f32 vec3f_length(Vec3f a); +f32 vec3f_dot(Vec3f a, Vec3f b); void mtxf_copy(Mat4 dest, Mat4 src); void mtxf_identity(Mat4 mtx); void mtxf_translate(Mat4 dest, Vec3f b); @@ -53,6 +61,7 @@ void mtxf_lookat(Mat4 mtx, Vec3f from, Vec3f to, s16 roll); void mtxf_rotate_zxy_and_translate(Mat4 dest, Vec3f translate, Vec3s rotate); void mtxf_rotate_xyz_and_translate(Mat4 dest, Vec3f b, Vec3s c); void mtxf_billboard(Mat4 dest, Mat4 mtx, Vec3f position, s16 angle); +void mtxf_cylboard(Mat4 dest, Mat4 mtx, Vec3f position, s16 angle); void mtxf_align_terrain_normal(Mat4 dest, Vec3f upDir, Vec3f pos, s16 yaw); void mtxf_align_terrain_triangle(Mat4 mtx, Vec3f pos, s16 yaw, f32 radius); void mtxf_mul(Mat4 dest, Mat4 a, Mat4 b); diff --git a/src/engine/surface_collision.c b/src/engine/surface_collision.c index 9aff62f9..5b6775fe 100644 --- a/src/engine/surface_collision.c +++ b/src/engine/surface_collision.c @@ -7,6 +7,7 @@ #include "game/object_list_processor.h" #include "surface_collision.h" #include "surface_load.h" +#include "math_util.h" /************************************************** * WALLS * @@ -775,3 +776,167 @@ s32 unused_resolve_floor_or_ceil_collisions(s32 checkCeil, f32 *px, f32 *py, f32 return 0; } + +/** + * Raycast functions + */ +s32 ray_surface_intersect(Vec3f orig, Vec3f dir, f32 dir_length, struct Surface *surface, Vec3f hit_pos, f32 *length) +{ + Vec3f v0, v1, v2, e1, e2, h, s, q; + f32 a, f, u, v; + Vec3f add_dir; + + // Get surface normal and some other stuff + vec3s_to_vec3f(v0, surface->vertex1); + vec3s_to_vec3f(v1, surface->vertex2); + vec3s_to_vec3f(v2, surface->vertex3); + + vec3f_dif(e1, v1, v0); + vec3f_dif(e2, v2, v0); + + vec3f_cross(h, dir, e2); + + // Check if we're perpendicular from the surface + a = vec3f_dot(e1, h); + if (a > -0.00001f && a < 0.00001f) + return FALSE; + + // Check if we're making contact with the surface + f = 1.0f / a; + + vec3f_dif(s, orig, v0); + u = f * vec3f_dot(s, h); + if (u < 0.0f || u > 1.0f) + return FALSE; + + vec3f_cross(q, s, e1); + v = f * vec3f_dot(dir, q); + if (v < 0.0f || u + v > 1.0f) + return FALSE; + + // Get the length between our origin and the surface contact point + *length = f * vec3f_dot(e2, q); + if (*length <= 0.00001 || *length > dir_length) + return FALSE; + + // Successful contact + vec3f_copy(add_dir, dir); + vec3f_mul(add_dir, *length); + vec3f_sum(hit_pos, orig, add_dir); + return TRUE; +} + +void find_surface_on_ray_list(struct SurfaceNode *list, Vec3f orig, Vec3f dir, f32 dir_length, struct Surface **hit_surface, Vec3f hit_pos, f32 *max_length) +{ + s32 hit; + f32 length; + Vec3f chk_hit_pos; + f32 top, bottom; + + // Get upper and lower bounds of ray + if (dir[1] >= 0.0f) + { + top = orig[1] + dir[1] * dir_length; + bottom = orig[1]; + } + else + { + top = orig[1]; + bottom = orig[1] + dir[1] * dir_length; + } + + // Iterate through every surface of the list + for (; list != NULL; list = list->next) + { + // Reject surface if out of vertical bounds + if (list->surface->lowerY > top || list->surface->upperY < bottom) + continue; + + // Check intersection between the ray and this surface + if ((hit = ray_surface_intersect(orig, dir, dir_length, list->surface, chk_hit_pos, &length)) != 0) + { + if (length <= *max_length) + { + *hit_surface = list->surface; + vec3f_copy(hit_pos, chk_hit_pos); + *max_length = length; + } + } + } +} + + +void find_surface_on_ray_cell(s16 cellX, s16 cellZ, Vec3f orig, Vec3f normalized_dir, f32 dir_length, struct Surface **hit_surface, Vec3f hit_pos, f32 *max_length) +{ + // Skip if OOB + if (cellX >= 0 && cellX <= 0xF && cellZ >= 0 && cellZ <= 0xF) + { + // Iterate through each surface in this partition + if (normalized_dir[1] > -0.99f) + { + find_surface_on_ray_list(gStaticSurfacePartition[cellZ][cellX][SPATIAL_PARTITION_CEILS].next, orig, normalized_dir, dir_length, hit_surface, hit_pos, max_length); + find_surface_on_ray_list(gDynamicSurfacePartition[cellZ][cellX][SPATIAL_PARTITION_CEILS].next, orig, normalized_dir, dir_length, hit_surface, hit_pos, max_length); + } + if (normalized_dir[1] < 0.99f) + { + find_surface_on_ray_list(gStaticSurfacePartition[cellZ][cellX][SPATIAL_PARTITION_FLOORS].next, orig, normalized_dir, dir_length, hit_surface, hit_pos, max_length); + find_surface_on_ray_list(gDynamicSurfacePartition[cellZ][cellX][SPATIAL_PARTITION_FLOORS].next, orig, normalized_dir, dir_length, hit_surface, hit_pos, max_length); + } + find_surface_on_ray_list(gStaticSurfacePartition[cellZ][cellX][SPATIAL_PARTITION_WALLS].next, orig, normalized_dir, dir_length, hit_surface, hit_pos, max_length); + find_surface_on_ray_list(gDynamicSurfacePartition[cellZ][cellX][SPATIAL_PARTITION_WALLS].next, orig, normalized_dir, dir_length, hit_surface, hit_pos, max_length); + } +} + +void find_surface_on_ray(Vec3f orig, Vec3f dir, struct Surface **hit_surface, Vec3f hit_pos) +{ + f32 max_length; + s16 cellZ, cellX; + f32 fCellZ, fCellX; + f32 dir_length; + Vec3f normalized_dir; + f32 step, dx, dz; + u32 i; + + // Set that no surface has been hit + *hit_surface = NULL; + vec3f_sum(hit_pos, orig, dir); + + // Get normalized direction + dir_length = vec3f_length(dir); + max_length = dir_length; + vec3f_copy(normalized_dir, dir); + vec3f_normalize(normalized_dir); + + // Get our cell coordinate + fCellX = (orig[0] + LEVEL_BOUNDARY_MAX) / CELL_SIZE; + fCellZ = (orig[2] + LEVEL_BOUNDARY_MAX) / CELL_SIZE; + cellX = (s16)fCellX; + cellZ = (s16)fCellZ; + + // Don't do DDA if straight down + if (normalized_dir[1] >= 1.0f || normalized_dir[1] <= -1.0f) + { + find_surface_on_ray_cell(cellX, cellZ, orig, normalized_dir, dir_length, hit_surface, hit_pos, &max_length); + return; + } + + // Get cells we cross using DDA + if (absx(dir[0]) >= absx(dir[2])) + step = absx(dir[0]) / CELL_SIZE; + else + step = absx(dir[2]) / CELL_SIZE; + + dx = dir[0] / step / CELL_SIZE; + dz = dir[2] / step / CELL_SIZE; + + for (i = 0; i < step && *hit_surface == NULL; i++) + { + find_surface_on_ray_cell(cellX, cellZ, orig, normalized_dir, dir_length, hit_surface, hit_pos, &max_length); + + // Move cell coordinate + fCellX += dx; + fCellZ += dz; + cellX = (s16)fCellX; + cellZ = (s16)fCellZ; + } +} diff --git a/src/engine/surface_collision.h b/src/engine/surface_collision.h index 71898d33..6332c481 100644 --- a/src/engine/surface_collision.h +++ b/src/engine/surface_collision.h @@ -36,5 +36,6 @@ f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor); f32 find_water_level(f32 x, f32 z); f32 find_poison_gas_level(f32 x, f32 z); void debug_surface_list_info(f32 xPos, f32 zPos); +void find_surface_on_ray(Vec3f orig, Vec3f dir, struct Surface **hit_surface, Vec3f hit_pos); #endif // SURFACE_COLLISION_H diff --git a/src/engine/surface_load.c b/src/engine/surface_load.c index 6fabd0a6..ac2ee50c 100644 --- a/src/engine/surface_load.c +++ b/src/engine/surface_load.c @@ -525,14 +525,13 @@ static void load_environmental_regions(s16 **data) { */ void alloc_surface_pools(void) { sSurfacePoolSize = 2300; - sSurfaceNodePool = (struct SurfaceNode*) main_pool_alloc(7000 * sizeof(struct SurfaceNode), MEMORY_POOL_LEFT); - sSurfacePool = (struct Surface*) main_pool_alloc(sSurfacePoolSize * sizeof(struct Surface), MEMORY_POOL_LEFT); + sSurfaceNodePool = main_pool_alloc(7000 * sizeof(struct SurfaceNode), MEMORY_POOL_LEFT); + sSurfacePool = main_pool_alloc(sSurfacePoolSize * sizeof(struct Surface), MEMORY_POOL_LEFT); gCCMEnteredSlide = 0; reset_red_coins_collected(); } -#ifdef NO_SEGMENTED_MEMORY /** * Get the size of the terrain data, to get the correct size when copying later. */ @@ -580,7 +579,6 @@ u32 get_area_terrain_size(s16 *data) { return data - startPos; } -#endif /** @@ -759,7 +757,7 @@ void load_object_collision_model(void) { UNUSED s32 unused; s16 vertexData[600]; - s16 *collisionData = (s16*) gCurrentObject->collisionData; + s16 *collisionData = gCurrentObject->collisionData; f32 marioDist = gCurrentObject->oDistanceToMario; f32 tangibleDist = gCurrentObject->oCollisionDistance; @@ -787,9 +785,13 @@ void load_object_collision_model(void) { } } +#ifndef NODRAWINGDISTANCE if (marioDist < gCurrentObject->oDrawingDistance) { +#endif gCurrentObject->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE; +#ifndef NODRAWINGDISTANCE } else { gCurrentObject->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE; } +#endif } diff --git a/src/engine/surface_load.h b/src/engine/surface_load.h index 5e77e929..7d541361 100644 --- a/src/engine/surface_load.h +++ b/src/engine/surface_load.h @@ -30,9 +30,9 @@ extern struct Surface *sSurfacePool; extern s16 sSurfacePoolSize; void alloc_surface_pools(void); -#ifdef NO_SEGMENTED_MEMORY + u32 get_area_terrain_size(s16 *data); -#endif + void load_area_terrain(s16 index, s16 *data, s8 *surfaceRooms, s16 *macroObjects); void clear_dynamic_surfaces(void); void load_object_collision_model(void); diff --git a/src/game/area.c b/src/game/area.c index 08430d31..ba7768a4 100644 --- a/src/game/area.c +++ b/src/game/area.c @@ -6,8 +6,6 @@ #include "gfx_dimensions.h" #include "behavior_data.h" #include "game_init.h" -#include "common/ui/text_to_render.hpp" -#include "common/service_locator.hpp" #include "object_list_processor.h" #include "engine/surface_load.h" #include "ingame_menu.h" @@ -24,6 +22,8 @@ #include "save_file.h" #include "level_table.h" +#include "gfx_dimensions.h" + struct SpawnInfo gPlayerSpawnInfos[1]; struct GraphNode *D_8033A160[0x100]; struct Area gAreaData[8]; @@ -108,6 +108,11 @@ void set_warp_transition_rgb(u8 red, u8 green, u8 blue) { gWarpTransBlue = blue; } +static int scale_x_to_correct_aspect_center(int x) { + f32 aspect = GFX_DIMENSIONS_ASPECT_RATIO; + return x + (SCREEN_HEIGHT * aspect / 2) - (SCREEN_WIDTH / 2); +} + void print_intro_text(void) { #ifdef VERSION_EU int language = eu_get_language(); @@ -117,13 +122,12 @@ void print_intro_text(void) { #ifdef VERSION_EU print_text_centered(SCREEN_WIDTH / 2, 20, gNoControllerMsg[language]); #else - print_text_centered(SCREEN_WIDTH / 2, 20, "NO CONTROLLER"); + print_text_centered(scale_x_to_correct_aspect_center(SCREEN_WIDTH / 2), 20, "NO CONTROLLER"); #endif } else { #ifdef VERSION_EU print_text(20, 20, "START"); #else - auto &text_renderer = ServiceLocator::get_text_renderer(); print_text_centered(60, 38, "PRESS"); print_text_centered(60, 20, "START"); #endif @@ -133,7 +137,7 @@ void print_intro_text(void) { u32 get_mario_spawn_type(struct Object *o) { s32 i; - const BehaviorScript *behavior = (const BehaviorScript*) virtual_to_segmented(0x13, o->behavior); + const BehaviorScript *behavior = virtual_to_segmented(0x13, o->behavior); for (i = 0; i < 20; i++) { if (sWarpBhvSpawnTable[i] == behavior) { diff --git a/src/game/behavior_actions.c b/src/game/behavior_actions.c index 24117f44..b40408b3 100644 --- a/src/game/behavior_actions.c +++ b/src/game/behavior_actions.c @@ -118,7 +118,7 @@ s16 D_8032F0CC[] = { 6047, 5664, 5292, 4934, 4587, 4254, 3933, 3624, 3329, 3046, #include "behaviors/white_puff_explode.inc.c" // not in behavior file -struct SpawnParticlesInfo D_8032F270 = { 2, 20, MODEL_MIST, 0, 40, 5, 30, 20, (s8) 252, 30, 330.0f, 10.0f }; +struct SpawnParticlesInfo D_8032F270 = { 2, 20, MODEL_MIST, 0, 40, 5, 30, 20, 252, 30, 330.0f, 10.0f }; // generate_wind_puffs/dust (something like that) void spawn_mist_particles_variable(s32 count, s32 offsetY, f32 size) { @@ -139,6 +139,7 @@ void spawn_mist_particles_variable(s32 count, s32 offsetY, f32 size) { #include "behaviors/coin.inc.c" #include "behaviors/collide_particles.inc.c" #include "behaviors/door.inc.c" +#include "behaviors/thwomp.inc.c" #include "behaviors/tumbling_bridge.inc.c" #include "behaviors/elevator.inc.c" #include "behaviors/water_mist_particle.inc.c" diff --git a/src/game/behavior_actions.h b/src/game/behavior_actions.h index 80855850..ba6e99b1 100644 --- a/src/game/behavior_actions.h +++ b/src/game/behavior_actions.h @@ -1,8 +1,6 @@ #ifndef BEHAVIOR_ACTIONS_H #define BEHAVIOR_ACTIONS_H -#include "types.h" - void spawn_mist_particles_variable(s32 count, s32 offsetY, f32 size); void bhv_spawn_star_no_level_exit(u32); void bhv_star_door_loop_2(void); @@ -21,6 +19,7 @@ void cur_obj_spawn_strong_wind_particles(s32 windSpread, f32 scale, f32 relPosX, void bhv_cap_switch_loop(void); void bhv_tiny_star_particles_init(void); +void bhv_grindel_thwomp_loop(void); void bhv_koopa_shell_underwater_loop(void); void bhv_door_init(void); void bhv_door_loop(void); diff --git a/src/game/behaviors/bowling_ball.inc.c b/src/game/behaviors/bowling_ball.inc.c index f2b4afbe..f1e16cb1 100644 --- a/src/game/behaviors/bowling_ball.inc.c +++ b/src/game/behaviors/bowling_ball.inc.c @@ -55,15 +55,15 @@ void bowling_ball_set_hitbox(void) { void bowling_ball_set_waypoints(void) { switch (o->oBehParams2ndByte) { case BBALL_BP_STYPE_BOB_UPPER: - o->oPathedStartWaypoint = (struct Waypoint*) segmented_to_virtual(bob_seg7_metal_ball_path0); + o->oPathedStartWaypoint = segmented_to_virtual(bob_seg7_metal_ball_path0); break; case BBALL_BP_STYPE_TTM: - o->oPathedStartWaypoint = (struct Waypoint*) segmented_to_virtual(ttm_seg7_trajectory_070170A0); + o->oPathedStartWaypoint = segmented_to_virtual(ttm_seg7_trajectory_070170A0); break; case BBALL_BP_STYPE_BOB_LOWER: - o->oPathedStartWaypoint = (struct Waypoint*) segmented_to_virtual(bob_seg7_metal_ball_path1); + o->oPathedStartWaypoint = segmented_to_virtual(bob_seg7_metal_ball_path1); break; case BBALL_BP_STYPE_THI_LARGE: diff --git a/src/game/behaviors/bowser.inc.c b/src/game/behaviors/bowser.inc.c index e0818bba..ebc6bf47 100644 --- a/src/game/behaviors/bowser.inc.c +++ b/src/game/behaviors/bowser.inc.c @@ -52,7 +52,7 @@ void bhv_bowser_flame_spawn_loop(void) { f32 sp28; f32 sp24 = coss(bowser->oMoveAngleYaw); f32 sp20 = sins(bowser->oMoveAngleYaw); - s16 *sp1C = (s16*) segmented_to_virtual(bowser_seg6_unkmoveshorts_060576FC); + s16 *sp1C = segmented_to_virtual(bowser_seg6_unkmoveshorts_060576FC); if (bowser->oSoundStateID == 6) { sp30 = bowser->header.gfx.unk38.animFrame + 1.0f; if (bowser->header.gfx.unk38.curAnim->unk08 == sp30) @@ -977,33 +977,33 @@ void (*sBowserActions[])(void) = { bowser_act_default, bowser_act_thrown_droppe bowser_act_spit_fire_into_sky, bowser_act_spit_fire_onto_floor, bowser_act_hit_edge, bowser_act_turn_from_edge, bowser_act_hit_mine, bowser_act_jump, bowser_act_walk_to_mario, bowser_act_breath_fire, bowser_act_teleport, bowser_act_jump_towards_mario, bowser_act_unused_slow_walk, bowser_act_ride_tilting_platform }; -struct SoundState D_8032F5B8[] = { { 0, 0, 0, (s32) NO_SOUND }, - { 0, 0, 0, (s32) NO_SOUND }, - { 0, 0, 0, (s32) NO_SOUND }, - { 0, 0, 0, (s32) NO_SOUND }, - { 0, 0, 0, (s32) NO_SOUND }, - { 0, 0, 0, (s32) NO_SOUND }, - { 0, 0, 0, (s32) NO_SOUND }, - { 0, 0, 0, (s32) NO_SOUND }, - { 1, 0, -1, (s32) SOUND_OBJ_BOWSER_WALK }, - { 1, 0, -1, (s32) SOUND_OBJ2_BOWSER_ROAR }, - { 1, 0, -1, (s32) SOUND_OBJ2_BOWSER_ROAR }, - { 0, 0, 0, (s32) NO_SOUND }, - { 0, 0, 0, (s32) NO_SOUND }, - { 1, 20, 40, (s32) SOUND_OBJ_BOWSER_WALK }, - { 1, 20, -1, (s32) SOUND_OBJ_BOWSER_WALK }, - { 1, 20, 40, (s32) SOUND_OBJ_BOWSER_WALK }, - { 1, 0, -1, (s32) SOUND_OBJ_BOWSER_TAIL_PICKUP }, - { 1, 0, -1, (s32) SOUND_OBJ_BOWSER_DEFEATED }, - { 1, 8, -1, (s32) SOUND_OBJ_BOWSER_WALK }, - { 1, 8, 17, (s32) SOUND_OBJ_BOWSER_WALK }, - { 1, 8, -10, (s32) SOUND_OBJ_BOWSER_WALK }, - { 0, 0, 0, (s32) NO_SOUND }, - { 1, 5, -1, (s32) SOUND_OBJ_FLAME_BLOWN }, - { 0, 0, 0, (s32) NO_SOUND }, - { 0, 0, 0, (s32) NO_SOUND }, - { 1, 0, -1, (s32) SOUND_OBJ_BOWSER_TAIL_PICKUP }, - { 1, 0, -1, (s32) SOUND_OBJ2_BOWSER_ROAR } }; +struct SoundState D_8032F5B8[] = { { 0, 0, 0, NO_SOUND }, + { 0, 0, 0, NO_SOUND }, + { 0, 0, 0, NO_SOUND }, + { 0, 0, 0, NO_SOUND }, + { 0, 0, 0, NO_SOUND }, + { 0, 0, 0, NO_SOUND }, + { 0, 0, 0, NO_SOUND }, + { 0, 0, 0, NO_SOUND }, + { 1, 0, -1, SOUND_OBJ_BOWSER_WALK }, + { 1, 0, -1, SOUND_OBJ2_BOWSER_ROAR }, + { 1, 0, -1, SOUND_OBJ2_BOWSER_ROAR }, + { 0, 0, 0, NO_SOUND }, + { 0, 0, 0, NO_SOUND }, + { 1, 20, 40, SOUND_OBJ_BOWSER_WALK }, + { 1, 20, -1, SOUND_OBJ_BOWSER_WALK }, + { 1, 20, 40, SOUND_OBJ_BOWSER_WALK }, + { 1, 0, -1, SOUND_OBJ_BOWSER_TAIL_PICKUP }, + { 1, 0, -1, SOUND_OBJ_BOWSER_DEFEATED }, + { 1, 8, -1, SOUND_OBJ_BOWSER_WALK }, + { 1, 8, 17, SOUND_OBJ_BOWSER_WALK }, + { 1, 8, -10, SOUND_OBJ_BOWSER_WALK }, + { 0, 0, 0, NO_SOUND }, + { 1, 5, -1, SOUND_OBJ_FLAME_BLOWN }, + { 0, 0, 0, NO_SOUND }, + { 0, 0, 0, NO_SOUND }, + { 1, 0, -1, SOUND_OBJ_BOWSER_TAIL_PICKUP }, + { 1, 0, -1, SOUND_OBJ2_BOWSER_ROAR } }; s8 D_8032F690[4] = { 0, 0, 1, 0 }; s8 D_8032F694[4] = { 1, 1, 3, 0 }; extern u8 bowser_3_seg7_collision_07004B94[]; @@ -1273,7 +1273,7 @@ Gfx *geo_bits_bowser_coloring(s32 run, struct GraphNode *node, UNUSED s32 a2) { sp20->fnNode.node.flags = (sp20->fnNode.node.flags & 0xFF) | GRAPH_NODE_TYPE_FUNCTIONAL; else sp20->fnNode.node.flags = (sp20->fnNode.node.flags & 0xFF) | (GRAPH_NODE_TYPE_FUNCTIONAL | GRAPH_NODE_TYPE_400); - sp28 = sp2C = (Gfx*) alloc_display_list(2 * sizeof(Gfx)); + sp28 = sp2C = alloc_display_list(2 * sizeof(Gfx)); if (sp24->oBowserUnk1B2 != 0) { gSPClearGeometryMode(sp28++, G_LIGHTING); diff --git a/src/game/behaviors/bowser_puzzle_piece.inc.c b/src/game/behaviors/bowser_puzzle_piece.inc.c index 7e27bdbe..14db4de6 100644 --- a/src/game/behaviors/bowser_puzzle_piece.inc.c +++ b/src/game/behaviors/bowser_puzzle_piece.inc.c @@ -161,7 +161,7 @@ void bhv_lll_bowser_puzzle_piece_action_1(void) { * Update the puzzle piece. */ void bhv_lll_bowser_puzzle_piece_update(void) { - s8 *nextAction = (s8*) o->oBowserPuzzlePieceNextAction; + s8 *nextAction = o->oBowserPuzzlePieceNextAction; // If Mario is standing on this puzzle piece, set a flag in the parent. if (gMarioObject->platform == o) diff --git a/src/game/behaviors/bub.inc.c b/src/game/behaviors/bub.inc.c index e8e63096..7bf71690 100644 --- a/src/game/behaviors/bub.inc.c +++ b/src/game/behaviors/bub.inc.c @@ -8,11 +8,15 @@ void bub_spawner_act_0(void) { s32 i; s32 sp18 = o->oBirdChirpChirpUnkF4; +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario < 1500.0f) { +#endif for (i = 0; i < sp18; i++) spawn_object(o, MODEL_BUB, bhvBub); o->oAction = 1; +#ifndef NODRAWINGDISTANCE } +#endif } void bub_spawner_act_1(void) { diff --git a/src/game/behaviors/butterfly/blueprint.cpp b/src/game/behaviors/butterfly/blueprint.cpp deleted file mode 100644 index 2726f040..00000000 --- a/src/game/behaviors/butterfly/blueprint.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "blueprint.hpp" - -#include "common/level/wrapped_object_builder.hpp" -#include "include/behavior_macros.h" - -#include "butterfly.hpp" - -typedef WrappedObjectBuilder WrappedButterflyBuilder; - -std::shared_ptr get_butterfly_blueprint() { - auto blueprint = std::make_shared( - MODEL_BUTTERFLY, - OBJ_LIST_DEFAULT); - (*blueprint).add_scripts({ - OR_INT(oFlags, - (OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW | - OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)), - LOAD_ANIMATIONS(oAnimations, butterfly_seg3_anims_030056B0), - DROP_TO_FLOOR(), - SET_FLOAT(oGraphYOffset, 5), - }); - - return blueprint; -} diff --git a/src/game/behaviors/butterfly/blueprint.hpp b/src/game/behaviors/butterfly/blueprint.hpp deleted file mode 100644 index b1604bb2..00000000 --- a/src/game/behaviors/butterfly/blueprint.hpp +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once -#include - -#include "common/level/i_object_builder.hpp" - -extern std::shared_ptr get_butterfly_blueprint(); \ No newline at end of file diff --git a/src/game/behaviors/butterfly/butterfly.cpp b/src/game/behaviors/butterfly/butterfly.cpp deleted file mode 100644 index 6f23cac0..00000000 --- a/src/game/behaviors/butterfly/butterfly.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include "butterfly.hpp" - -#include "engine/behavior_script.h" -#include "engine/math_util.h" -#include "game/object_helpers.h" -#include "game/object_list_processor.h" -#include "game/obj_behaviors.h" -#include "include/object_fields.h" - -#define o gCurrentObject - -const s32 kStartFollowingMarioDistance = 1000; -const s32 kStartReturningHomeDistance = 1200; - -const s32 kFollowMarioSpeed = 7; -const s32 kReturnHomeSpeed = 7; - -// TODO: Move this to a common file. -s32 is_point_within_radius_of_mario_(f32 x, f32 y, f32 z, s32 dist) { - const auto mGfxX = gMarioObject->header.gfx.pos[0]; - const auto mGfxY = gMarioObject->header.gfx.pos[1]; - const auto mGfxZ = gMarioObject->header.gfx.pos[2]; - - if ((x - mGfxX) * (x - mGfxX) + (y - mGfxY) * (y - mGfxY) + - (z - mGfxZ) * (z - mGfxZ) < - (f32)(dist * dist)) { return TRUE; } - - return FALSE; -} - -// TODO: Move this to a common file. -void set_object_visibility_(struct Object* obj, s32 dist) { - const auto objX = obj->oPosX; - const auto objY = obj->oPosY; - const auto objZ = obj->oPosZ; - - if (is_point_within_radius_of_mario_(objX, objY, objZ, dist) == TRUE) { - obj->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE; - } else { obj->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE; } -} - -void Butterfly::init() { - cur_obj_init_animation(1); - - o->oButterflyYPhase = random_float() * 100.0f; - o->header.gfx.unk38.animFrame = random_float() * 7.0f; - home_.set(position_); -} - -void Butterfly::tick() { - switch (state_) { - case ButterflyState::RESTING: - tick_rest(); - break; - - case ButterflyState::FOLLOW_MARIO: - tick_follow_mario(); - break; - - case ButterflyState::RETURN_HOME: - tick_return_home(); - break; - } - - set_object_visibility_(o, 3000); -} - -// sp28 = speed - -void Butterfly::step(s32 speed) { - const auto yaw = o->oMoveAngleYaw; - const auto pitch = o->oMoveAnglePitch; - const auto y_phase = o->oButterflyYPhase; - - o->oVelX = sins(yaw) * (f32)speed; - o->oVelY = sins(pitch) * (f32)speed; - o->oVelZ = coss(yaw) * (f32)speed; - - o->oPosX += o->oVelX; - o->oPosZ += o->oVelZ; - - if (state_ == ButterflyState::FOLLOW_MARIO) { - o->oPosY -= o->oVelY + coss((s32)(y_phase * 655.36)) * 20.0f / 4; - } else { o->oPosY -= o->oVelY; } - - struct FloorGeometry* sp24; - const auto floor_y = - find_floor_height_and_data(o->oPosX, o->oPosY, o->oPosZ, &sp24); - - if (o->oPosY < floor_y + 2.0f) { - o->oPosY = floor_y + 2.0f; - } - - o->oButterflyYPhase++; - if (o->oButterflyYPhase >= 101) { o->oButterflyYPhase = 0; } -} - -void butterfly_calculate_angle_(void) { - gMarioObject->oPosX += 5 * o->oButterflyYPhase / 4; - gMarioObject->oPosZ += 5 * o->oButterflyYPhase / 4; - obj_turn_toward_object(o, gMarioObject, 16, 0x300); - gMarioObject->oPosX -= 5 * o->oButterflyYPhase / 4; - gMarioObject->oPosZ -= 5 * o->oButterflyYPhase / 4; - - gMarioObject->oPosY += (5 * o->oButterflyYPhase + 0x100) / 4; - obj_turn_toward_object(o, gMarioObject, 15, 0x500); - gMarioObject->oPosY -= (5 * o->oButterflyYPhase + 0x100) / 4; -} - -void Butterfly::tick_rest() { - if (is_point_within_radius_of_mario_( - o->oPosX, - o->oPosY, - o->oPosZ, - kStartFollowingMarioDistance)) { - cur_obj_init_animation(0); - - state_ = ButterflyState::FOLLOW_MARIO; - o->oMoveAngleYaw = gMarioObject->header.gfx.angle[1]; - } -} - -void Butterfly::tick_follow_mario() { - butterfly_calculate_angle_(); - - butterfly_step(kFollowMarioSpeed); - - if (!is_point_within_radius_of_mario_( - o->oHomeX, - o->oHomeY, - o->oHomeZ, - kStartReturningHomeDistance)) { state_ = ButterflyState::RETURN_HOME; } -} - -void Butterfly::tick_return_home() { - s16 h_angle_to_home; - s16 v_angle_to_home; - position_.calc_angle_to(home_, h_angle_to_home, v_angle_to_home); - - o->oMoveAngleYaw = - approach_s16_symmetric(o->oMoveAngleYaw, h_angle_to_home, 0x800); - o->oMoveAnglePitch = - approach_s16_symmetric(o->oMoveAnglePitch, v_angle_to_home, 0x50); - - butterfly_step(kReturnHomeSpeed); - - if (position_.calc_sqr_distance_to(home_) < 144.0f) { - cur_obj_init_animation(1); - - state_ = ButterflyState::RESTING; - position_.set(home_); - } -} diff --git a/src/game/behaviors/butterfly/butterfly.hpp b/src/game/behaviors/butterfly/butterfly.hpp deleted file mode 100644 index 80435386..00000000 --- a/src/game/behaviors/butterfly/butterfly.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once -#include "common/object/i_physical_object_wrapper.hpp" -#include "include/types.h" - -enum class ButterflyState { - RESTING, - FOLLOW_MARIO, - RETURN_HOME -}; - - -class Butterfly : public IPhysicalObjectWrapper { - public: - explicit Butterfly(struct Object* wrapped_object) - : IPhysicalObjectWrapper(wrapped_object) {} - Butterfly(const Butterfly& other) = delete; - - void init() override; - void tick() override; - -private: - void step(s32 speed); - - void tick_rest(); - void tick_follow_mario(); - void tick_return_home(); - - ButterflyState state_ = ButterflyState::RESTING; -}; diff --git a/src/game/behaviors/cannon.inc.c b/src/game/behaviors/cannon.inc.c index 5f55ca83..a8cfcab3 100644 --- a/src/game/behaviors/cannon.inc.c +++ b/src/game/behaviors/cannon.inc.c @@ -17,9 +17,11 @@ void opened_cannon_act_0(void) { cur_obj_enable_rendering(); cur_obj_become_tangible(); } + cur_obj_become_tangible(); + cur_obj_enable_rendering(); if (o->oDistanceToMario < 500.0f) { - cur_obj_become_tangible(); - cur_obj_enable_rendering(); + //cur_obj_become_tangible(); + //cur_obj_enable_rendering(); if (o->oInteractStatus & INT_STATUS_INTERACTED && (!(o->oInteractStatus & INT_STATUS_TOUCHED_BOB_OMB))) // bob-omb explodes when it gets into a cannon @@ -30,8 +32,8 @@ void opened_cannon_act_0(void) { } else o->oInteractStatus = 0; } else { - cur_obj_become_intangible(); - cur_obj_disable_rendering(); + //cur_obj_become_intangible(); + //cur_obj_disable_rendering(); o->oCannonUnk10C = 0; } } diff --git a/src/game/behaviors/capswitch.inc.c b/src/game/behaviors/capswitch.inc.c index 65ae62d2..12fa5b82 100644 --- a/src/game/behaviors/capswitch.inc.c +++ b/src/game/behaviors/capswitch.inc.c @@ -31,9 +31,7 @@ void cap_switch_act_2(void) { cur_obj_shake_screen(SHAKE_POS_SMALL); spawn_mist_particles(); spawn_triangle_break_particles(60, 139, 0.3f, o->oBehParams2ndByte); -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif } } else { sp1C = cur_obj_update_dialog_with_cutscene(1, 0x0C, CUTSCENE_CAP_SWITCH_PRESS, 0); diff --git a/src/game/behaviors/chain_chomp.inc.c b/src/game/behaviors/chain_chomp.inc.c index ae57eb24..9b9c3423 100644 --- a/src/game/behaviors/chain_chomp.inc.c +++ b/src/game/behaviors/chain_chomp.inc.c @@ -53,8 +53,10 @@ static void chain_chomp_act_uninitialized(void) { struct ChainSegment *segments; s32 i; +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario < 3000.0f) { - segments = (struct ChainSegment*) mem_pool_alloc(gObjectMemoryPool, 5 * sizeof(struct ChainSegment)); +#endif + segments = mem_pool_alloc(gObjectMemoryPool, 5 * sizeof(struct ChainSegment)); if (segments != NULL) { // Each segment represents the offset of a chain part to the pivot. // Segment 0 connects the pivot to the chain chomp itself. Segment @@ -81,7 +83,9 @@ static void chain_chomp_act_uninitialized(void) { cur_obj_unhide(); } } +#ifndef NODRAWINGDISTANCE } +#endif } /** @@ -359,10 +363,12 @@ static void chain_chomp_act_move(void) { f32 maxDistToPivot; // Unload chain if mario is far enough +#ifndef NODRAWINGDISTANCE if (o->oChainChompReleaseStatus == CHAIN_CHOMP_NOT_RELEASED && o->oDistanceToMario > 4000.0f) { o->oAction = CHAIN_CHOMP_ACT_UNLOAD_CHAIN; o->oForwardVel = o->oVelY = 0.0f; } else { +#endif cur_obj_update_floor_and_walls(); switch (o->oChainChompReleaseStatus) { @@ -446,7 +452,9 @@ static void chain_chomp_act_move(void) { o->oGravity = -4.0f; o->oChainChompTargetPitch = -0x3000; } +#ifndef NODRAWINGDISTANCE } +#endif } /** diff --git a/src/game/behaviors/cloud.inc.c b/src/game/behaviors/cloud.inc.c index 527e5825..c1d708bf 100644 --- a/src/game/behaviors/cloud.inc.c +++ b/src/game/behaviors/cloud.inc.c @@ -47,10 +47,14 @@ static void cloud_act_spawn_parts(void) { * Wait for mario to approach, then unhide and enter the spawn parts action. */ static void cloud_act_fwoosh_hidden(void) { +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario < 2000.0f) { +#endif cur_obj_unhide(); o->oAction = CLOUD_ACT_SPAWN_PARTS; +#ifndef NODRAWINGDISTANCE } +#endif } /** @@ -58,9 +62,11 @@ static void cloud_act_fwoosh_hidden(void) { * long enough, blow wind at him. */ static void cloud_fwoosh_update(void) { +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario > 2500.0f) { o->oAction = CLOUD_ACT_UNLOAD; } else { +#endif if (o->oCloudBlowing) { o->header.gfx.scale[0] += o->oCloudGrowSpeed; @@ -95,7 +101,9 @@ static void cloud_fwoosh_update(void) { } cur_obj_scale(o->header.gfx.scale[0]); +#ifndef NODRAWINGDISTANCE } +#endif } /** diff --git a/src/game/behaviors/coin.inc.c b/src/game/behaviors/coin.inc.c index 3013a09f..9b7099de 100644 --- a/src/game/behaviors/coin.inc.c +++ b/src/game/behaviors/coin.inc.c @@ -184,17 +184,23 @@ void bhv_coin_formation_loop(void) { s32 bitIndex; switch (o->oAction) { case 0: +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario < 2000.0f) { +#endif for (bitIndex = 0; bitIndex < 8; bitIndex++) { if (!(o->oCoinUnkF4 & (1 << bitIndex))) spawn_coin_in_formation(bitIndex, o->oBehParams2ndByte); } o->oAction++; +#ifndef NODRAWINGDISTANCE } +#endif break; case 1: +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario > 2100.0f) o->oAction++; +#endif break; case 2: o->oAction = 0; @@ -255,6 +261,7 @@ void bhv_coin_sparkles_loop(void) { void bhv_golden_coin_sparkles_loop(void) { struct Object *sp2C; + UNUSED s32 unused; f32 sp24 = 30.0f; sp2C = spawn_object(o, MODEL_SPARKLES, bhvCoinSparkles); sp2C->oPosX += random_float() * sp24 - sp24 / 2; diff --git a/src/game/behaviors/collide_particles.inc.c b/src/game/behaviors/collide_particles.inc.c index 68c61389..ff93a511 100644 --- a/src/game/behaviors/collide_particles.inc.c +++ b/src/game/behaviors/collide_particles.inc.c @@ -1,14 +1,10 @@ // collide_particles.c.inc -s16 D_8032F2CC[] = { - (s16)0xD000, 0, 0x3000, 0, (s16)0xDE67, 0x2199, 0x2199, 0x2199, (s16)0xDE67, - (s16)0xDE67, 0x2199, (s16)0xDE67 -}; +s16 D_8032F2CC[] = { 0xD000, 0, 0x3000, 0, 0xDE67, 0x2199, + 0x2199, 0x2199, 0xDE67, 0xDE67, 0x2199, 0xDE67 }; -s16 D_8032F2E4[] = { - (s16)0xE000, 0, 0, 0, 0x2000, 0, (s16)0xE99A, 0x1666, 0x1666, 0x1666, - (s16)0xE99A, (s16)0xE99A, 0x1666, (s16)0xE99A -}; +s16 D_8032F2E4[] = { 0xE000, 0, 0, 0, 0x2000, 0, 0xE99A, + 0x1666, 0x1666, 0x1666, 0xE99A, 0xE99A, 0x1666, 0xE99A }; void bhv_punch_tiny_triangle_loop(void) { s16 sp1E; diff --git a/src/game/behaviors/corkbox.inc.c b/src/game/behaviors/corkbox.inc.c index b88ea6f8..e9316513 100644 --- a/src/game/behaviors/corkbox.inc.c +++ b/src/game/behaviors/corkbox.inc.c @@ -42,7 +42,7 @@ void bhv_respawner_loop(void) { struct Object *spawnedObject; if (!is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, o->oRespawnerMinSpawnDist)) { - spawnedObject = spawn_object(o, o->oRespawnerModelToRespawn, (const BehaviorScript*) o->oRespawnerBehaviorToRespawn); + spawnedObject = spawn_object(o, o->oRespawnerModelToRespawn, o->oRespawnerBehaviorToRespawn); spawnedObject->oBehParams = o->oBehParams; o->activeFlags = ACTIVE_FLAG_DEACTIVATED; } diff --git a/src/game/behaviors/donut_platform.inc.c b/src/game/behaviors/donut_platform.inc.c index 470762c9..f1503a0e 100644 --- a/src/game/behaviors/donut_platform.inc.c +++ b/src/game/behaviors/donut_platform.inc.c @@ -1,35 +1,15 @@ static Vec3s sDonutPlatformPositions[] = { - { 0x0B4C, (s16) 0xF7D7, 0x19A4 }, - { (s16) 0xF794, 0x08A3, (s16) 0xFFA9 }, - { 0x069C, 0x09D8, (s16) 0xFFE0 }, - { 0x05CF, 0x09D8, (s16) 0xFFE0 }, - { 0x0502, 0x09D8, (s16) 0xFFE0 }, - { 0x054C, (s16) 0xF7D7, 0x19A4 }, - { 0x0A7F, (s16) 0xF7D7, 0x19A4 }, - { 0x09B2, (s16) 0xF7D7, 0x19A4 }, - { 0x06E6, (s16) 0xF7D7, 0x19A4 }, - { 0x0619, (s16) 0xF7D7, 0x19A4 }, - { (s16) 0xEFB5, (s16) 0xF7D7, 0x19A4 }, - { 0x00E6, (s16) 0xF7D7, 0x19A4 }, - { 0x0019, (s16) 0xF7D7, 0x19A4 }, - { (s16) 0xFF4D, (s16) 0xF7D7, 0x19A4 }, - { (s16) 0xF081, (s16) 0xF7D7, 0x19A4 }, - { (s16) 0xE34F, (s16) 0xF671, 0x197A }, - { (s16) 0xEEE8, (s16) 0xF7D7, 0x19A4 }, - { (s16) 0xE74F, (s16) 0xF7D7, 0x197A }, - { (s16) 0xE683, (s16) 0xF7D7, 0x197A }, - { (s16) 0xE5B6, (s16) 0xF7D7, 0x197A }, - { (s16) 0xEE83, (s16) 0xF4A4, 0x19A4 }, - { (s16) 0xE41C, (s16) 0xF671, 0x197A }, - { (s16) 0xE4E9, (s16) 0xF671, 0x197A }, - { (s16) 0xECE9, (s16) 0xF4A4, 0x19A4 }, - { (s16) 0xEDB6, (s16) 0xF4A4, 0x19A4 }, - { (s16) 0xFC3F, 0x0A66, (s16) 0xFF45 }, - { 0x00EF, 0x04CD, (s16) 0xFF53 }, - { 0x0022, 0x04CD, (s16) 0xFF53 }, - { (s16) 0xFF57, 0x04CD, (s16) 0xFF53 }, - { (s16) 0xFB73, 0x0A66, (s16) 0xFF45 }, - { (s16) 0xFD0C, 0x0A66, (s16) 0xFF45 }, + { 0x0B4C, 0xF7D7, 0x19A4 }, { 0xF794, 0x08A3, 0xFFA9 }, { 0x069C, 0x09D8, 0xFFE0 }, + { 0x05CF, 0x09D8, 0xFFE0 }, { 0x0502, 0x09D8, 0xFFE0 }, { 0x054C, 0xF7D7, 0x19A4 }, + { 0x0A7F, 0xF7D7, 0x19A4 }, { 0x09B2, 0xF7D7, 0x19A4 }, { 0x06E6, 0xF7D7, 0x19A4 }, + { 0x0619, 0xF7D7, 0x19A4 }, { 0xEFB5, 0xF7D7, 0x19A4 }, { 0x00E6, 0xF7D7, 0x19A4 }, + { 0x0019, 0xF7D7, 0x19A4 }, { 0xFF4D, 0xF7D7, 0x19A4 }, { 0xF081, 0xF7D7, 0x19A4 }, + { 0xE34F, 0xF671, 0x197A }, { 0xEEE8, 0xF7D7, 0x19A4 }, { 0xE74F, 0xF7D7, 0x197A }, + { 0xE683, 0xF7D7, 0x197A }, { 0xE5B6, 0xF7D7, 0x197A }, { 0xEE83, 0xF4A4, 0x19A4 }, + { 0xE41C, 0xF671, 0x197A }, { 0xE4E9, 0xF671, 0x197A }, { 0xECE9, 0xF4A4, 0x19A4 }, + { 0xEDB6, 0xF4A4, 0x19A4 }, { 0xFC3F, 0x0A66, 0xFF45 }, { 0x00EF, 0x04CD, 0xFF53 }, + { 0x0022, 0x04CD, 0xFF53 }, { 0xFF57, 0x04CD, 0xFF53 }, { 0xFB73, 0x0A66, 0xFF45 }, + { 0xFD0C, 0x0A66, 0xFF45 }, }; void bhv_donut_platform_spawner_update(void) { diff --git a/src/game/behaviors/door.inc.c b/src/game/behaviors/door.inc.c index 1a9668e4..db48e4f9 100644 --- a/src/game/behaviors/door.inc.c +++ b/src/game/behaviors/door.inc.c @@ -6,9 +6,7 @@ struct DoorAction s32 action; }; -struct DoorAction D_8032F300[] = { - {0x40000, 3}, {0x80000, 4}, {0x10000, 1}, {0x20000, 2}, {(u32)-1, 0}, -}; +struct DoorAction D_8032F300[] = { { 0x40000, 3 }, { 0x80000, 4 }, { 0x10000, 1 }, { 0x20000, 2 }, { -1, 0 }, }; s32 D_8032F328[] = { SOUND_GENERAL_OPEN_WOOD_DOOR, SOUND_GENERAL_OPEN_IRON_DOOR }; diff --git a/src/game/behaviors/elevator.inc.c b/src/game/behaviors/elevator.inc.c index f272f245..f9df6856 100644 --- a/src/game/behaviors/elevator.inc.c +++ b/src/game/behaviors/elevator.inc.c @@ -103,11 +103,11 @@ void (*sElevatorActions[])(void) = { elevator_act_0, elevator_act_1, elevator_ac struct SpawnParticlesInfo D_8032F3CC = { 3, 20, MODEL_MIST, 20, 10, 5, 0, 0, 0, 30, 30.0f, 1.5f }; -struct SpawnParticlesInfo D_8032F3E0 = { 0, 5, MODEL_SAND_DUST, 0, 0, 20, 20, 0, (s8) 252, 30, 5.0f, 2.0f }; +struct SpawnParticlesInfo D_8032F3E0 = { 0, 5, MODEL_SAND_DUST, 0, 0, 20, 20, 0, 252, 30, 5.0f, 2.0f }; s16 D_8032F3F4[] = { 2, -8, 1, 4 }; -struct SpawnParticlesInfo D_8032F3FC = { 0, 5, MODEL_WHITE_PARTICLE_DL, 0, 0, 20, 20, 0, (s8) 252, 30, +struct SpawnParticlesInfo D_8032F3FC = { 0, 5, MODEL_WHITE_PARTICLE_DL, 0, 0, 20, 20, 0, 252, 30, 2.0f, 2.0f }; void bhv_elevator_loop(void) { diff --git a/src/game/behaviors/enemy_lakitu.inc.c b/src/game/behaviors/enemy_lakitu.inc.c index 056c3f13..cacd732f 100644 --- a/src/game/behaviors/enemy_lakitu.inc.c +++ b/src/game/behaviors/enemy_lakitu.inc.c @@ -24,12 +24,16 @@ static struct ObjectHitbox sEnemyLakituHitbox = { * Wait for mario to approach, then spawn the cloud and become visible. */ static void enemy_lakitu_act_uninitialized(void) { +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario < 2000.0f) { +#endif spawn_object_relative_with_scale(CLOUD_BP_LAKITU_CLOUD, 0, 0, 0, 2.0f, o, MODEL_MIST, bhvCloud); cur_obj_unhide(); o->oAction = ENEMY_LAKITU_ACT_MAIN; +#ifndef NODRAWINGDISTANCE } +#endif } /** diff --git a/src/game/behaviors/exclamation_box.inc.c b/src/game/behaviors/exclamation_box.inc.c index 86486c35..8034dd3d 100644 --- a/src/game/behaviors/exclamation_box.inc.c +++ b/src/game/behaviors/exclamation_box.inc.c @@ -78,9 +78,7 @@ void exclamation_box_act_2(void) { o->oGravity = -8.0f; o->oFloorHeight = o->oPosY; o->oAction = 3; -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif } load_object_collision_model(); } diff --git a/src/game/behaviors/fish.inc.c b/src/game/behaviors/fish.inc.c index c771176a..d169ecf7 100644 --- a/src/game/behaviors/fish.inc.c +++ b/src/game/behaviors/fish.inc.c @@ -42,7 +42,9 @@ void fish_act_spawn(void) { * If the current level is Secret Aquarium, ignore this requirement. * Fish moves at random with a max-range of 700.0f. */ +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario < minDistToMario || gCurrLevelNum == LEVEL_SA) { +#endif for (i = 0; i < schoolQuantity; i++) { fishObject = spawn_object(o, model, bhvFish); fishObject->oBehParams2ndByte = o->oBehParams2ndByte; @@ -50,7 +52,9 @@ void fish_act_spawn(void) { obj_translate_xyz_random(fishObject, 700.0f); } o->oAction = FISH_ACT_ACTIVE; +#ifndef NODRAWINGDISTANCE } +#endif } /** @@ -58,11 +62,13 @@ void fish_act_spawn(void) { * Y coordinate is greater than 2000.0f then spawn another fish. */ void fish_act_respawn(void) { +#ifndef NODRAWINGDISTANCE if (gCurrLevelNum != LEVEL_SA) { if (gMarioObject->oPosY - o->oPosY > 2000.0f) { o->oAction = FISH_ACT_RESPAWN; } } +#endif } /** diff --git a/src/game/behaviors/goomba.inc.c b/src/game/behaviors/goomba.inc.c index 2dab2fec..bf47dda1 100644 --- a/src/game/behaviors/goomba.inc.c +++ b/src/game/behaviors/goomba.inc.c @@ -78,7 +78,9 @@ void bhv_goomba_triplet_spawner_update(void) { // If mario is close enough and the goombas aren't currently loaded, then // spawn them if (o->oAction == GOOMBA_TRIPLET_SPAWNER_ACT_UNLOADED) { +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario < 3000.0f) { +#endif // The spawner is capable of spawning more than 3 goombas, but this // is not used in the game dAngle = @@ -98,11 +100,13 @@ void bhv_goomba_triplet_spawner_update(void) { } o->oAction += 1; +#ifndef NODRAWINGDISTANCE } } else if (o->oDistanceToMario > 4000.0f) { // If mario is too far away, enter the unloaded action. The goombas // will detect this and unload themselves o->oAction = GOOMBA_TRIPLET_SPAWNER_ACT_UNLOADED; +#endif } } diff --git a/src/game/behaviors/heave_ho.inc.c b/src/game/behaviors/heave_ho.inc.c index 81123f58..1a247607 100644 --- a/src/game/behaviors/heave_ho.inc.c +++ b/src/game/behaviors/heave_ho.inc.c @@ -72,8 +72,12 @@ void heave_ho_act_3(void) { } void heave_ho_act_0(void) { - cur_obj_set_pos_to_home(); +#ifndef NODRAWINGDISTANCE if (find_water_level(o->oPosX, o->oPosZ) < o->oPosY && o->oDistanceToMario < 4000.0f) { +#else + if (find_water_level(o->oPosX, o->oPosZ) < (o->oPosY - 50.0f)) { +#endif + cur_obj_set_pos_to_home(); cur_obj_become_tangible(); cur_obj_unhide(); o->oAction = 1; diff --git a/src/game/behaviors/king_bobomb.inc.c b/src/game/behaviors/king_bobomb.inc.c index e6e824dc..7942b2bb 100644 --- a/src/game/behaviors/king_bobomb.inc.c +++ b/src/game/behaviors/king_bobomb.inc.c @@ -295,10 +295,14 @@ void king_bobomb_move(void) { cur_obj_move_using_fvel_and_gravity(); cur_obj_call_action_function(sKingBobombActions); exec_anim_sound_state(sKingBobombSoundStates); +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario < 5000.0f) +#endif cur_obj_enable_rendering(); +#ifndef NODRAWINGDISTANCE else cur_obj_disable_rendering(); +#endif } void bhv_king_bobomb_loop(void) { diff --git a/src/game/behaviors/koopa.inc.c b/src/game/behaviors/koopa.inc.c index 9d80e9b1..2303906e 100644 --- a/src/game/behaviors/koopa.inc.c +++ b/src/game/behaviors/koopa.inc.c @@ -525,7 +525,7 @@ static void koopa_the_quick_act_show_init_text(void) { o->oForwardVel = 0.0f; o->parentObj = cur_obj_nearest_object_with_behavior(bhvKoopaRaceEndpoint); - o->oPathedStartWaypoint = o->oPathedPrevWaypoint = (struct Waypoint*) + o->oPathedStartWaypoint = o->oPathedPrevWaypoint = segmented_to_virtual(sKoopaTheQuickProperties[o->oKoopaTheQuickRaceIndex].path); o->oKoopaTurningAwayFromWall = FALSE; diff --git a/src/game/behaviors/lll_floating_wood_piece.inc.c b/src/game/behaviors/lll_floating_wood_piece.inc.c index cb4dad48..7994e2d9 100644 --- a/src/game/behaviors/lll_floating_wood_piece.inc.c +++ b/src/game/behaviors/lll_floating_wood_piece.inc.c @@ -14,18 +14,24 @@ void bhv_lll_floating_wood_bridge_loop(void) { s32 i; switch (o->oAction) { case 0: +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario < 2500.0f) { +#endif for (i = 1; i < 4; i++) { sp3C = spawn_object_relative(0, (i - 2) * 300, 0, 0, o, MODEL_LLL_WOOD_BRIDGE, bhvLllWoodPiece); sp3C->oLllWoodPieceOscillationTimer = i * 4096; } o->oAction = 1; +#ifndef NODRAWINGDISTANCE } +#endif break; case 1: +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario > 2600.0f) o->oAction = 2; +#endif break; case 2: o->oAction = 0; diff --git a/src/game/behaviors/lll_octagonal_rotating_mesh.inc.c b/src/game/behaviors/lll_octagonal_rotating_mesh.inc.c index 361ac40d..7fc4936f 100644 --- a/src/game/behaviors/lll_octagonal_rotating_mesh.inc.c +++ b/src/game/behaviors/lll_octagonal_rotating_mesh.inc.c @@ -3,7 +3,7 @@ s16 D_8032F860[] = { 2, 30, 0x4000, 0, 1, 220, 900, 30, 1, 30, 0, -30, 2, 30, -0x4000, 0, 1, 220, 900, 30, 1, 30, 0, -30, 3, 0 }; s16 D_8032F894[] = { 4, 0, 0, 0, 1, 475, 900, 30, 1, 30, 0, -30, 2, - 30, (s16) 0x8000, 0, 1, 475, 900, 30, 1, 30, 0, -30, 3, 0 }; + 30, 0x8000, 0, 1, 475, 900, 30, 1, 30, 0, -30, 3, 0 }; s16 *D_8032F8C8[] = { D_8032F860, D_8032F894 }; diff --git a/src/game/behaviors/lll_rotating_hex_flame.inc.c b/src/game/behaviors/lll_rotating_hex_flame.inc.c index efabfca8..fc707330 100644 --- a/src/game/behaviors/lll_rotating_hex_flame.inc.c +++ b/src/game/behaviors/lll_rotating_hex_flame.inc.c @@ -30,7 +30,9 @@ void fire_bar_spawn_flames(s16 a0) { } void fire_bar_act_0(void) { +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario < 3000.0f) +#endif o->oAction = 1; } @@ -45,8 +47,10 @@ void fire_bar_act_1(void) { void fire_bar_act_2(void) { o->oAngleVelYaw = -0x100; o->oMoveAngleYaw += o->oAngleVelYaw; +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario > 3200.0f) o->oAction = 3; +#endif } void fire_bar_act_3(void) { diff --git a/src/game/behaviors/mips.inc.c b/src/game/behaviors/mips.inc.c index ba720c23..a24cecd1 100644 --- a/src/game/behaviors/mips.inc.c +++ b/src/game/behaviors/mips.inc.c @@ -56,11 +56,11 @@ s16 bhv_mips_find_furthest_waypoint_to_mario(void) { struct Waypoint **pathBase; struct Waypoint *waypoint; - pathBase = (struct Waypoint**) segmented_to_virtual(&inside_castle_seg7_trajectory_mips); + pathBase = segmented_to_virtual(&inside_castle_seg7_trajectory_mips); // For each waypoint in MIPS path... for (i = 0; i < 10; i++) { - waypoint = (struct Waypoint*) segmented_to_virtual(*(pathBase + i)); + waypoint = segmented_to_virtual(*(pathBase + i)); x = waypoint->pos[0]; y = waypoint->pos[1]; z = waypoint->pos[2]; @@ -115,8 +115,8 @@ void bhv_mips_act_follow_path(void) { struct Waypoint *waypoint; // Retrieve current waypoint. - pathBase = (struct Waypoint**) segmented_to_virtual(&inside_castle_seg7_trajectory_mips); - waypoint = (struct Waypoint*) segmented_to_virtual(*(pathBase + o->oMipsStartWaypointIndex)); + pathBase = segmented_to_virtual(&inside_castle_seg7_trajectory_mips); + waypoint = segmented_to_virtual(*(pathBase + o->oMipsStartWaypointIndex)); // Set start waypoint and follow the path from there. o->oPathedStartWaypoint = waypoint; diff --git a/src/game/behaviors/monty_mole.inc.c b/src/game/behaviors/monty_mole.inc.c index 49dde8e8..685f5aae 100644 --- a/src/game/behaviors/monty_mole.inc.c +++ b/src/game/behaviors/monty_mole.inc.c @@ -35,7 +35,7 @@ static struct Object *link_objects_with_behavior(const BehaviorScript *behavior) struct Object *lastObject; struct ObjectNode *listHead; - behaviorAddr = (const BehaviorScript*) segmented_to_virtual(behavior); + behaviorAddr = segmented_to_virtual(behavior); lastObject = NULL; listHead = &gObjectLists[get_object_list_from_behavior(behaviorAddr)]; diff --git a/src/game/behaviors/piranha_plant.inc.c b/src/game/behaviors/piranha_plant.inc.c index e8abe089..328f4518 100644 --- a/src/game/behaviors/piranha_plant.inc.c +++ b/src/game/behaviors/piranha_plant.inc.c @@ -328,7 +328,7 @@ void (*TablePiranhaPlantActions[])(void) = { */ void bhv_piranha_plant_loop(void) { cur_obj_call_action_function(TablePiranhaPlantActions); - + #ifndef NODRAWINGDISTANCE // In WF, hide all Piranha Plants once high enough up. if (gCurrLevelNum == LEVEL_WF) { if (gMarioObject->oPosY > 3400.0f) @@ -336,5 +336,6 @@ void bhv_piranha_plant_loop(void) { else cur_obj_unhide(); } + #endif o->oInteractStatus = 0; } diff --git a/src/game/behaviors/platform_on_track.inc.c b/src/game/behaviors/platform_on_track.inc.c index ac51c6bb..f33a1656 100644 --- a/src/game/behaviors/platform_on_track.inc.c +++ b/src/game/behaviors/platform_on_track.inc.c @@ -60,7 +60,7 @@ void bhv_platform_on_track_init(void) { o->collisionData = segmented_to_virtual(sPlatformOnTrackCollisionModels[o->oPlatformOnTrackType]); - o->oPlatformOnTrackStartWaypoint = (struct Waypoint*) segmented_to_virtual(sPlatformOnTrackPaths[pathIndex]); + o->oPlatformOnTrackStartWaypoint = segmented_to_virtual(sPlatformOnTrackPaths[pathIndex]); o->oPlatformOnTrackIsNotHMC = pathIndex - 4; diff --git a/src/game/behaviors/pokey.inc.c b/src/game/behaviors/pokey.inc.c index df5d11f5..cfcc92c2 100644 --- a/src/game/behaviors/pokey.inc.c +++ b/src/game/behaviors/pokey.inc.c @@ -151,7 +151,9 @@ static void pokey_act_uninitialized(void) { s32 i; s16 partModel; +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario < 2000.0f) { +#endif partModel = MODEL_POKEY_HEAD; for (i = 0; i < 5; i++) { @@ -170,7 +172,9 @@ static void pokey_act_uninitialized(void) { o->oPokeyNumAliveBodyParts = 5; o->oPokeyBottomBodyPartSize = 1.0f; o->oAction = POKEY_ACT_WANDER; +#ifndef NODRAWINGDISTANCE } +#endif } /** @@ -185,9 +189,11 @@ static void pokey_act_wander(void) { if (o->oPokeyNumAliveBodyParts == 0) { obj_mark_for_deletion(o); +#ifndef NODRAWINGDISTANCE } else if (o->oDistanceToMario > 2500.0f) { o->oAction = POKEY_ACT_UNLOAD_PARTS; o->oForwardVel = 0.0f; +#endif } else { treat_far_home_as_mario(1000.0f); cur_obj_update_floor_and_walls(); diff --git a/src/game/behaviors/purple_switch.inc.c b/src/game/behaviors/purple_switch.inc.c index 3035bd6b..9c210acc 100644 --- a/src/game/behaviors/purple_switch.inc.c +++ b/src/game/behaviors/purple_switch.inc.c @@ -32,9 +32,7 @@ void bhv_purple_switch_loop(void) { cur_obj_play_sound_2(SOUND_GENERAL2_PURPLE_SWITCH); o->oAction = PURPLE_SWITCH_TICKING; cur_obj_shake_screen(SHAKE_POS_SMALL); -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif } break; /** diff --git a/src/game/behaviors/racing_penguin.inc.c b/src/game/behaviors/racing_penguin.inc.c index e83d29b0..1703d52e 100644 --- a/src/game/behaviors/racing_penguin.inc.c +++ b/src/game/behaviors/racing_penguin.inc.c @@ -36,7 +36,7 @@ static void racing_penguin_act_show_init_text(void) { child = cur_obj_nearest_object_with_behavior(bhvPenguinRaceShortcutCheck); child->parentObj = o; - o->oPathedStartWaypoint = o->oPathedPrevWaypoint = (struct Waypoint*) + o->oPathedStartWaypoint = o->oPathedPrevWaypoint = segmented_to_virtual(ccm_seg7_trajectory_penguin_race); o->oPathedPrevWaypointFlags = 0; diff --git a/src/game/behaviors/skeeter.inc.c b/src/game/behaviors/skeeter.inc.c index 0583c7b0..a726760f 100644 --- a/src/game/behaviors/skeeter.inc.c +++ b/src/game/behaviors/skeeter.inc.c @@ -16,10 +16,10 @@ struct ObjectHitbox sSkeeterHitbox = { }; struct Struct80331C38 D_80331C38[] = { - {(s16)0xFF7E, (s16)0xFF42}, - {0x0082, (s16)0xFF42}, - {(s16)0xFF4C, 0x0082}, - {0x00B4, 0x0082}, + { 0xFF7E, 0xFF42 }, + { 0x0082, 0xFF42 }, + { 0xFF4C, 0x0082 }, + { 0x00B4, 0x0082 }, }; static void skeeter_spawn_waves(void) { diff --git a/src/game/behaviors/sl_walking_penguin.inc.c b/src/game/behaviors/sl_walking_penguin.inc.c index f5b60a8a..59428acb 100644 --- a/src/game/behaviors/sl_walking_penguin.inc.c +++ b/src/game/behaviors/sl_walking_penguin.inc.c @@ -97,7 +97,9 @@ void bhv_sl_walking_penguin_loop(void) { } cur_obj_move_standard(-78); - if (!cur_obj_hide_if_mario_far_away_y(1000.0f)) +#ifndef NODRAWINGDISTANCE + if (!cur_obj_hide_if_mario_far_away_y(1000.0f)) +#endif play_penguin_walking_sound(PENGUIN_WALK_BIG); // Adjust the position to get a point better lined up with the visual model, for stopping the wind. diff --git a/src/game/behaviors/snowman.inc.c b/src/game/behaviors/snowman.inc.c index 239c2741..174123d1 100644 --- a/src/game/behaviors/snowman.inc.c +++ b/src/game/behaviors/snowman.inc.c @@ -55,7 +55,7 @@ void snowmans_bottom_act_1(void) { s32 sp20; UNUSED s16 sp1E; - o->oPathedStartWaypoint = (struct Waypoint*) segmented_to_virtual(&ccm_seg7_trajectory_snowman); + o->oPathedStartWaypoint = segmented_to_virtual(&ccm_seg7_trajectory_snowman); sp26 = object_step_without_floor_orient(); sp20 = cur_obj_follow_path(sp20); o->oSnowmansBottomUnkF8 = o->oPathedTargetYaw; diff --git a/src/game/behaviors/snufit.inc.c b/src/game/behaviors/snufit.inc.c index f3a0c9ef..2acf442f 100644 --- a/src/game/behaviors/snufit.inc.c +++ b/src/game/behaviors/snufit.inc.c @@ -180,7 +180,10 @@ void bhv_snufit_loop(void) { void bhv_snufit_balls_loop(void) { // If far from Mario or in a different room, despawn. if ((o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM) - || (o->oTimer != 0 && o->oDistanceToMario > 1500.0f)) { +#ifndef NODRAWINGDISTANCE + || (o->oTimer != 0 && o->oDistanceToMario > 1500.0f) +#endif + ){ obj_mark_for_deletion(o); } diff --git a/src/game/behaviors/star_door.inc.c b/src/game/behaviors/star_door.inc.c index 2d7dad1f..4390efcb 100644 --- a/src/game/behaviors/star_door.inc.c +++ b/src/game/behaviors/star_door.inc.c @@ -22,9 +22,7 @@ void bhv_star_door_loop(void) { case 1: if (o->oTimer == 0 && (s16)(o->oMoveAngleYaw) >= 0) { cur_obj_play_sound_2(SOUND_GENERAL_STAR_DOOR_OPEN); -#ifdef VERSION_SH queue_rumble_data(35, 30); -#endif } cur_obj_become_intangible(); o->oUnkBC = -8.0f; @@ -39,9 +37,7 @@ void bhv_star_door_loop(void) { case 3: if (o->oTimer == 0 && (s16)(o->oMoveAngleYaw) >= 0) { cur_obj_play_sound_2(SOUND_GENERAL_STAR_DOOR_CLOSE); -#ifdef VERSION_SH queue_rumble_data(35, 30); -#endif } o->oUnkBC = 8.0f; star_door_update_pos(); diff --git a/src/game/behaviors/thi_top.inc.c b/src/game/behaviors/thi_top.inc.c index 8508d53f..13b847b1 100644 --- a/src/game/behaviors/thi_top.inc.c +++ b/src/game/behaviors/thi_top.inc.c @@ -1,7 +1,7 @@ // thi_top.c.inc struct SpawnParticlesInfo D_8032F134 = { - 0, 30, MODEL_WHITE_PARTICLE_SMALL, 0, 40, 0, 20, 40, (s8) 252, 30, 20.0f, 0.0f + 0, 30, MODEL_WHITE_PARTICLE_SMALL, 0, 40, 0, 20, 40, 252, 30, 20.0f, 0.0f }; UNUSED u8 unused8032F134[] = { 10, 11, 12 }; diff --git a/src/game/behaviors/thwomp.inc.c b/src/game/behaviors/thwomp.inc.c new file mode 100644 index 00000000..fdb3345b --- /dev/null +++ b/src/game/behaviors/thwomp.inc.c @@ -0,0 +1,51 @@ +// thwomp.c.inc + +void grindel_thwomp_act_4(void) { + if (o->oTimer == 0) + o->oThwompRandomTimer = random_float() * 10.0f + 20.0f; + if (o->oTimer > o->oThwompRandomTimer) + o->oAction = 0; +} + +void grindel_thwomp_act_2(void) { + o->oVelY += -4.0f; + o->oPosY += o->oVelY; + if (o->oPosY < o->oHomeY) { + o->oPosY = o->oHomeY; + o->oVelY = 0; + o->oAction = 3; + } +} + +void grindel_thwomp_act_3(void) { + if (o->oTimer == 0) + if (o->oDistanceToMario < 1500.0f) { + cur_obj_shake_screen(SHAKE_POS_SMALL); + cur_obj_play_sound_2(SOUND_OBJ_THWOMP); + } + if (o->oTimer > 9) + o->oAction = 4; +} + +void grindel_thwomp_act_1(void) { + if (o->oTimer == 0) + o->oThwompRandomTimer = random_float() * 30.0f + 10.0f; + if (o->oTimer > o->oThwompRandomTimer) + o->oAction = 2; +} + +void grindel_thwomp_act_0(void) { + if (o->oBehParams2ndByte + 40 < o->oTimer) { + o->oAction = 1; + o->oPosY += 5.0f; + } else + o->oPosY += 10.0f; +} + +void (*sGrindelThwompActions[])(void) = { grindel_thwomp_act_0, grindel_thwomp_act_1, + grindel_thwomp_act_2, grindel_thwomp_act_3, + grindel_thwomp_act_4 }; + +void bhv_grindel_thwomp_loop(void) { + cur_obj_call_action_function(sGrindelThwompActions); +} diff --git a/src/game/behaviors/thwomp/thwomp.cpp b/src/game/behaviors/thwomp/thwomp.cpp deleted file mode 100644 index 820ac97b..00000000 --- a/src/game/behaviors/thwomp/thwomp.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "thwomp.hpp" -#include "audio_defines.h" -#include "common/object/i_object_wrapper.hpp" -#include "engine/behavior_script.h" -#include "game/behavior_actions.h" -#include "game/object_helpers.h" -#include "game/object_list_processor.h" -#include "game/spawn_sound.h" -#include "object_fields.h" - -#define o gCurrentObject - -void grindel_thwomp_act_4(void) { - if (o->oTimer == 0) - o->oThwompRandomTimer = random_float() * 10.0f + 20.0f; - if (o->oTimer > o->oThwompRandomTimer) - o->oAction = 0; -} - -void grindel_thwomp_act_2(void) { - o->oVelY += -4.0f; - o->oPosY += o->oVelY; - if (o->oPosY < o->oHomeY) { - o->oPosY = o->oHomeY; - o->oVelY = 0; - o->oAction = 3; - } -} - -void grindel_thwomp_act_3(void) { - if (o->oTimer == 0) - if (o->oDistanceToMario < 1500.0f) { - cur_obj_shake_screen(SHAKE_POS_SMALL); - cur_obj_play_sound_2(SOUND_OBJ_THWOMP); - } - if (o->oTimer > 9) - o->oAction = 4; -} - -void grindel_thwomp_act_1(void) { - if (o->oTimer == 0) - o->oThwompRandomTimer = random_float() * 30.0f + 10.0f; - if (o->oTimer > o->oThwompRandomTimer) - o->oAction = 2; -} - -void grindel_thwomp_act_0(void) { - if (o->oBehParams2ndByte + 40 < o->oTimer) { - o->oAction = 1; - o->oPosY += 5.0f; - } else - o->oPosY += 10.0f; -} - -void (*sGrindelThwompActions[])(void) = { grindel_thwomp_act_0, grindel_thwomp_act_1, - grindel_thwomp_act_2, grindel_thwomp_act_3, - grindel_thwomp_act_4 }; - -GrindelOrThwomp:: -GrindelOrThwomp(struct Object* wrapped_object) : IObjectWrapper( - wrapped_object) { } - -void GrindelOrThwomp::tick() { - cur_obj_call_action_function(sGrindelThwompActions); -} - -void bhv_grindel_thwomp_loop() { - auto grindel_or_thwomp = - IObjectWrapper::get_or_create_wrapper_for(o); - grindel_or_thwomp->tick(); -} diff --git a/src/game/behaviors/thwomp/thwomp.hpp b/src/game/behaviors/thwomp/thwomp.hpp deleted file mode 100644 index be6fab97..00000000 --- a/src/game/behaviors/thwomp/thwomp.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once -#include "common/object/i_object_wrapper.hpp" - -enum class GrindelOrThwompState { - RISING, // oAction #0 - WAITING_TO_FALL, // oAction #1 - FALLING, // oAction #2 - SHAKING_SCREEN, // oAction #3, - WAITING_TO_RISE, // oAction #4 -}; - -/** - * Wrapped instance of a Grindel/Thwomp. - */ -class GrindelOrThwomp : public IObjectWrapper { -public: - GrindelOrThwomp(struct Object *wrapped_object); - - void tick() override; - -private: -}; - -extern void bhv_grindel_thwomp_loop(); \ No newline at end of file diff --git a/src/game/behaviors/triplet_butterfly.inc.c b/src/game/behaviors/triplet_butterfly.inc.c index 3da4f574..5f971854 100644 --- a/src/game/behaviors/triplet_butterfly.inc.c +++ b/src/game/behaviors/triplet_butterfly.inc.c @@ -54,9 +54,11 @@ static void triplet_butterfly_act_init(void) { } static void triplet_butterfly_act_wander(void) { +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario > 1500.0f) { obj_mark_for_deletion(o); } else { +#endif approach_f32_ptr(&o->oTripletButterflySpeed, 8.0f, 0.5f); if (o->oTimer < 60) { o->oTripletButterflyTargetYaw = cur_obj_angle_to_home(); @@ -82,7 +84,9 @@ static void triplet_butterfly_act_wander(void) { obj_move_pitch_approach(o->oTripletButterflyTargetPitch, 400); cur_obj_rotate_yaw_toward(o->oTripletButterflyTargetYaw, random_linear_offset(400, 800)); +#ifndef NODRAWINGDISTANCE } +#endif } static void triplet_butterfly_act_activate(void) { diff --git a/src/game/behaviors/ttc_treadmill.inc.c b/src/game/behaviors/ttc_treadmill.inc.c index 1ad70a8a..537540b1 100644 --- a/src/game/behaviors/ttc_treadmill.inc.c +++ b/src/game/behaviors/ttc_treadmill.inc.c @@ -27,8 +27,8 @@ extern s16 ttc_movtex_tris_small_surface_treadmill[]; void bhv_ttc_treadmill_init(void) { o->collisionData = segmented_to_virtual(sTTCTreadmillCollisionModels[o->oBehParams2ndByte & 0x1]); - o->oTTCTreadmillBigSurface = (s16*) segmented_to_virtual(ttc_movtex_tris_big_surface_treadmill); - o->oTTCTreadmillSmallSurface = (s16*) segmented_to_virtual(ttc_movtex_tris_small_surface_treadmill); + o->oTTCTreadmillBigSurface = segmented_to_virtual(ttc_movtex_tris_big_surface_treadmill); + o->oTTCTreadmillSmallSurface = segmented_to_virtual(ttc_movtex_tris_small_surface_treadmill); *o->oTTCTreadmillBigSurface = *o->oTTCTreadmillSmallSurface = sTTCTreadmillSpeeds[gTTCSpeedSetting]; diff --git a/src/game/behaviors/unagi.inc.c b/src/game/behaviors/unagi.inc.c index cd7fb10d..df9041e9 100644 --- a/src/game/behaviors/unagi.inc.c +++ b/src/game/behaviors/unagi.inc.c @@ -14,14 +14,14 @@ struct ObjectHitbox sUnagiHitbox = { void bhv_unagi_init(void) { if (o->oBehParams2ndByte != 1) { - o->oPathedStartWaypoint = (struct Waypoint*) segmented_to_virtual(jrb_seg7_trajectory_unagi_1); + o->oPathedStartWaypoint = segmented_to_virtual(jrb_seg7_trajectory_unagi_1); if (o->oBehParams2ndByte == 0) { o->oFaceAnglePitch = -7600; } else { o->oAction = 1; } } else { - o->oPathedStartWaypoint = (struct Waypoint*) segmented_to_virtual(jrb_seg7_trajectory_unagi_2); + o->oPathedStartWaypoint = segmented_to_virtual(jrb_seg7_trajectory_unagi_2); o->oAction = 3; o->oAnimState = 1; diff --git a/src/game/behaviors/water_bomb.inc.c b/src/game/behaviors/water_bomb.inc.c index 0e6c089a..41333803 100644 --- a/src/game/behaviors/water_bomb.inc.c +++ b/src/game/behaviors/water_bomb.inc.c @@ -180,7 +180,7 @@ static void water_bomb_act_shot_from_cannon(void) { /* behParam: */ 0, /* count: */ 1, /* model: */ MODEL_BUBBLE, - /* offsetY: */ (s8) 236, + /* offsetY: */ 236, /* forwardVelBase: */ 20, /* forwardVelRange: */ 5, /* velYBase: */ 0, diff --git a/src/game/behaviors/water_bomb_cannon.inc.c b/src/game/behaviors/water_bomb_cannon.inc.c index 8e9ba33b..fb82e43c 100644 --- a/src/game/behaviors/water_bomb_cannon.inc.c +++ b/src/game/behaviors/water_bomb_cannon.inc.c @@ -38,19 +38,27 @@ void bhv_bubble_cannon_barrel_loop(void) { } void water_bomb_cannon_act_0(void) { +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario < 2000.0f) { +#endif spawn_object(o, MODEL_CANNON_BARREL, bhvCannonBarrelBubbles); cur_obj_unhide(); o->oAction = 1; o->oMoveAnglePitch = o->oWaterCannonUnkFC = 0x1C00; +#ifndef NODRAWINGDISTANCE } +#endif } void water_bomb_cannon_act_1(void) { +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario > 2500.0f) { o->oAction = 2; } else if (o->oBehParams2ndByte == 0) { +#else + if (o->oBehParams2ndByte == 0) { +#endif if (o->oWaterCannonUnkF4 != 0) { o->oWaterCannonUnkF4 -= 1; } else { diff --git a/src/game/behaviors/water_pillar.inc.c b/src/game/behaviors/water_pillar.inc.c index 801069ca..498e9bd0 100644 --- a/src/game/behaviors/water_pillar.inc.c +++ b/src/game/behaviors/water_pillar.inc.c @@ -40,9 +40,7 @@ void water_level_pillar_undrained(void) { (s32) approach_f32_symmetric(gEnvironmentLevels[2], -2450.0f, 5.0f); gEnvironmentLevels[0] = (s32) approach_f32_symmetric(gEnvironmentLevels[0], -2450.0f, 5.0f); -#ifdef VERSION_SH reset_rumble_timers_2(2); -#endif } else o->oAction++; break; diff --git a/src/game/behaviors/wdw_water_level.inc.c b/src/game/behaviors/wdw_water_level.inc.c index 6a8a346b..63d58fc7 100644 --- a/src/game/behaviors/wdw_water_level.inc.c +++ b/src/game/behaviors/wdw_water_level.inc.c @@ -49,9 +49,7 @@ void bhv_water_level_diamond_loop(void) { cur_obj_play_sound_1(SOUND_ENV_WATER_DRAIN); // same as above } o->oAngleVelYaw = 0x800; -#ifdef VERSION_SH reset_rumble_timers_2(2); -#endif } break; case WATER_LEVEL_DIAMOND_ACT_IDLE_SPINNING: diff --git a/src/game/behaviors/whirlpool.inc.c b/src/game/behaviors/whirlpool.inc.c index 405e0518..5aebebd2 100644 --- a/src/game/behaviors/whirlpool.inc.c +++ b/src/game/behaviors/whirlpool.inc.c @@ -35,7 +35,9 @@ void whirpool_orient_graph(void) { } void bhv_whirlpool_loop(void) { +#ifndef NODRAWINGDISTANCE if (o->oDistanceToMario < 5000.0f) { +#endif o->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE; // not sure if actually an array @@ -52,10 +54,12 @@ void bhv_whirlpool_loop(void) { whirpool_orient_graph(); o->oFaceAngleYaw += 0x1F40; +#ifndef NODRAWINGDISTANCE } else { o->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE; gEnvFxBubbleConfig[ENVFX_STATE_PARTICLECOUNT] = 0; } +#endif cur_obj_play_sound_1(SOUND_ENV_WATER); diff --git a/src/game/behaviors/whomp.inc.c b/src/game/behaviors/whomp.inc.c index 41926808..1f3bcb7f 100644 --- a/src/game/behaviors/whomp.inc.c +++ b/src/game/behaviors/whomp.inc.c @@ -246,10 +246,14 @@ void bhv_whomp_loop(void) { cur_obj_call_action_function(sWhompActions); cur_obj_move_standard(-20); if (o->oAction != 9) { +#ifndef NODRAWINGDISTANCE + // o->oBehParams2ndByte here seems to be a flag + // indicating whether this is a normal or king whomp if (o->oBehParams2ndByte != 0) cur_obj_hide_if_mario_far_away_y(2000.0f); else cur_obj_hide_if_mario_far_away_y(1000.0f); +#endif load_object_collision_model(); } } diff --git a/src/game/behaviors/wiggler.inc.c b/src/game/behaviors/wiggler.inc.c index aea292fb..4c465f80 100644 --- a/src/game/behaviors/wiggler.inc.c +++ b/src/game/behaviors/wiggler.inc.c @@ -120,7 +120,7 @@ void wiggler_init_segments(void) { struct ChainSegment *segments; struct Object *bodyPart; - segments = (struct ChainSegment*) mem_pool_alloc(gObjectMemoryPool, 4 * sizeof(struct ChainSegment)); + segments = mem_pool_alloc(gObjectMemoryPool, 4 * sizeof(struct ChainSegment)); if (segments != NULL) { // Each segment represents the global position and orientation of each // object. Segment 0 represents the wiggler's head, and segment i>0 diff --git a/src/game/bettercamera.h b/src/game/bettercamera.h new file mode 100644 index 00000000..2f7cd376 --- /dev/null +++ b/src/game/bettercamera.h @@ -0,0 +1,44 @@ +enum newcam_flagvalues +{ + NC_FLAG_XTURN = 0x0001,//If this flag is set, the camera's yaw can be moved by the player. + NC_FLAG_YTURN = 0x0002, //If this flag is set, the camera's pitch can be moved by the player. + NC_FLAG_ZOOM = 0x0004, //If this flag is set, the camera's distance can be set by the player. + NC_FLAG_8D = 0x0008, //If this flag is set, the camera will snap to an 8 directional axis + NC_FLAG_4D = 0x0010, //If this flag is set, the camera will snap to a 4 directional axis + NC_FLAG_2D = 0x0020, //If this flag is set, the camera will stick to 2D. + NC_FLAG_FOCUSX = 0x0040, //If this flag is set, the camera will point towards its focus on the X axis. + NC_FLAG_FOCUSY = 0x0080, //If this flag is set, the camera will point towards its focus on the Y axis. + NC_FLAG_FOCUSZ = 0x0100, //If this flag is set, the camera will point towards its focus on the Z axis. + NC_FLAG_POSX = 0x0200, //If this flag is set, the camera will move along the X axis. + NC_FLAG_POSY = 0x0400, //If this flag is set, the camera will move along the Y axis. + NC_FLAG_POSZ = 0x0800, //If this flag is set, the camera will move along the Z axis. + NC_FLAG_COLLISION = 0x1000, //If this flag is set, the camera will collide and correct itself with terrain. + NC_FLAG_SLIDECORRECT = 0x2000, //If this flag is set, the camera will attempt to centre itself behind Mario whenever he's sliding. + + NC_MODE_NORMAL = NC_FLAG_XTURN | NC_FLAG_YTURN | NC_FLAG_ZOOM | NC_FLAG_FOCUSX | NC_FLAG_FOCUSY | NC_FLAG_FOCUSZ | NC_FLAG_POSX | NC_FLAG_POSY | NC_FLAG_POSZ | NC_FLAG_COLLISION, + NC_MODE_SLIDE = NC_FLAG_XTURN | NC_FLAG_YTURN | NC_FLAG_ZOOM | NC_FLAG_FOCUSX | NC_FLAG_FOCUSY | NC_FLAG_FOCUSZ | NC_FLAG_POSX | NC_FLAG_POSY | NC_FLAG_POSZ | NC_FLAG_COLLISION | NC_FLAG_SLIDECORRECT, + NC_MODE_FIXED = NC_FLAG_XTURN | NC_FLAG_YTURN | NC_FLAG_ZOOM | NC_FLAG_FOCUSX | NC_FLAG_FOCUSY | NC_FLAG_FOCUSZ, + NC_MODE_2D = NC_FLAG_XTURN | NC_FLAG_YTURN | NC_FLAG_ZOOM | NC_FLAG_FOCUSX | NC_FLAG_FOCUSY | NC_FLAG_FOCUSZ | NC_FLAG_POSX | NC_FLAG_POSY | NC_FLAG_POSZ | NC_FLAG_COLLISION, + NC_MODE_8D = NC_FLAG_XTURN | NC_FLAG_YTURN | NC_FLAG_ZOOM | NC_FLAG_8D | NC_FLAG_FOCUSX | NC_FLAG_FOCUSY | NC_FLAG_FOCUSZ | NC_FLAG_POSX | NC_FLAG_POSY | NC_FLAG_POSZ | NC_FLAG_COLLISION, + NC_MODE_FIXED_NOMOVE = 0x0000, + NC_MODE_NOTURN = NC_FLAG_ZOOM | NC_FLAG_FOCUSX | NC_FLAG_FOCUSY | NC_FLAG_FOCUSZ | NC_FLAG_POSX | NC_FLAG_POSY | NC_FLAG_POSZ | NC_FLAG_COLLISION, + NC_MODE_NOROTATE = NC_FLAG_YTURN | NC_FLAG_ZOOM | NC_FLAG_FOCUSX | NC_FLAG_FOCUSY | NC_FLAG_FOCUSZ | NC_FLAG_POSX | NC_FLAG_POSY | NC_FLAG_POSZ | NC_FLAG_COLLISION + +}; + +extern void newcam_init_settings(void); +extern void newcam_disable(void); +extern void newcam_diagnostics(void); + +extern s16 newcam_sensitivityX; //How quick the camera works. +extern s16 newcam_sensitivityY; +extern s16 newcam_invertX; +extern s16 newcam_invertY; +extern s16 newcam_panlevel; //How much the camera sticks out a bit in the direction you're looking. +extern s16 newcam_aggression; //How much the camera tries to centre itself to Mario's facing and movement. +extern u8 newcam_active; // basically the thing that governs if newcam is on. +extern s16 newcam_analogue; +extern u16 newcam_intendedmode; + +extern u16 newcam_mode; +extern s16 newcam_yaw; diff --git a/src/game/bettercamera.inc.h b/src/game/bettercamera.inc.h new file mode 100644 index 00000000..9f4b8089 --- /dev/null +++ b/src/game/bettercamera.inc.h @@ -0,0 +1,659 @@ +#include "sm64.h" +#include "game/camera.h" +#include "game/level_update.h" +#include "game/print.h" +#include "engine/math_util.h" +#include "game/segment2.h" +#include "game/save_file.h" +#include "bettercamera.h" +#include "include/text_strings.h" +#include "engine/surface_collision.h" +#include "pc/configfile.h" +#include "pc/controller/controller_mouse.h" +#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) +//quick and dirty fix for some older MinGW.org mingwrt +#else +#include +#endif + + +/** +Quick explanation of the camera modes + +NC_MODE_NORMAL: Standard mode, allows dualaxial movement and free control of the camera. +NC_MODE_FIXED: Disables control of camera, and the actual position of the camera doesn't update. +NC_MODE_2D: Disables horizontal control of the camera and locks Mario's direction to the X axis. NYI though. +NC_MODE_8D: 8 directional movement. Similar to standard, except the camera direction snaps to 8 directions. +NC_MODE_FIXED_NOMOVE: Disables control and movement of the camera. +NC_MODE_NOTURN: Disables horizontal and vertical control of the camera. +**/ + +//!A bunch of developer intended options, to cover every base, really. +//#define NEWCAM_DEBUG //Some print values for puppycam. Not useful anymore, but never hurts to keep em around. +//#define nosound //If for some reason you hate the concept of audio, you can disable it. +//#define noaccel //Disables smooth movement of the camera with the C buttons. + +//!Hardcoded camera angle stuff. They're essentially area boxes that when Mario is inside, will trigger some view changes. +///Don't touch this btw, unless you know what you're doing, this has to be above for religious reasons. +struct newcam_hardpos { + u8 newcam_hard_levelID; + u8 newcam_hard_areaID; + u8 newcam_hard_permaswap; + u16 newcam_hard_modeset; + s16 newcam_hard_X1; + s16 newcam_hard_Y1; + s16 newcam_hard_Z1; + s16 newcam_hard_X2; + s16 newcam_hard_Y2; + s16 newcam_hard_Z2; + s16 newcam_hard_camX; + s16 newcam_hard_camY; + s16 newcam_hard_camZ; + s16 newcam_hard_lookX; + s16 newcam_hard_lookY; + s16 newcam_hard_lookZ; +}; + +///This is the bit that defines where the angles happen. They're basically environment boxes that dictate camera behaviour. +//Permaswap is a boolean that simply determines wether or not when the camera changes at this point it stays changed. 0 means it resets when you leave, and 1 means it stays changed. +//The camera position fields accept "32767" as an ignore flag. +struct newcam_hardpos newcam_fixedcam[] = { + { + /*Level ID*/ 16,/*Area ID*/ 1,/*Permaswap*/ 0,/*Mode*/ NC_MODE_FIXED_NOMOVE, //Standard params. + /*X begin*/ -540,/*Y begin*/ 800,/*Z begin*/ -3500, //Where the activation box begins + /*X end*/ 540,/*Y end*/ 2000,/*Z end*/ -1500, //Where the activation box ends. + /*Cam X*/ 0,/*Cam Y*/ 1500,/*Cam Z*/ -1000, //The position the camera gets placed for NC_MODE_FIXED and NC_MODE_FIXED_NOMOVE + /*Look X*/ 0,/*Look Y*/ 800,/*Look Z*/ -2500 //The position the camera looks at for NC_MODE_FIXED_NOMOVE + }, +}; + + +#ifdef noaccel + u8 accel = 255; + #else + u8 accel = 10; +#endif // noaccel + +s16 newcam_yaw; //Z axis rotation +f32 newcam_yaw_acc; +s16 newcam_tilt = 1500; //Y axis rotation +f32 newcam_tilt_acc; +u16 newcam_distance = 750; //The distance the camera stays from the player +u16 newcam_distance_target = 750; //The distance the player camera tries to reach. +f32 newcam_pos_target[3]; //The position the camera is basing calculations off. *usually* Mario. +f32 newcam_pos[3]; //Position the camera is in the world +f32 newcam_lookat[3]; //Position the camera is looking at +f32 newcam_framessincec[2]; +f32 newcam_extheight = 125; +u8 newcam_centering = 0; // The flag that depicts wether the camera's goin gto try centering. +s16 newcam_yaw_target; // The yaw value the camera tries to set itself to when the centre flag is active. Is set to Mario's face angle. +f32 newcam_turnwait; // The amount of time to wait after landing before allowing the camera to turn again +f32 newcam_pan_x; +f32 newcam_pan_z; +u8 newcam_cstick_down = 0; //Just a value that triggers true when the player 2 stick is moved in 8 direction move to prevent holding it down. +u8 newcam_target; +s32 newcam_sintimer = 0; +s16 newcam_coldist; +u8 newcam_xlu = 255; +s8 newcam_stick2[2]; + +s16 newcam_sensitivityX; //How quick the camera works. +s16 newcam_sensitivityY; +s16 newcam_invertX; //Reverses movement of the camera axis. +s16 newcam_invertY; +s16 newcam_panlevel; //How much the camera sticks out a bit in the direction you're looking. +s16 newcam_aggression ; //How much the camera tries to centre itself to Mario's facing and movement. +s16 newcam_degrade = 1; +s16 newcam_analogue = 0; //Wether to accept inputs from a player 2 joystick, and then disables C button input. +s16 newcam_distance_values[] = {750,1250,2000}; +u8 newcam_active = 0; // basically the thing that governs if newcam is on. +u8 newcam_mouse = 0; +u16 newcam_mode; +u16 newcam_intendedmode = 0; // which camera mode the camera's going to try to be in when not forced into another. +u16 newcam_modeflags; + +s16 newcam_saved_mode = -1; +s16 newcam_saved_defmode = -1; + +///This is called at every level initialisation. +void newcam_init(struct Camera *c, u8 dv) { + newcam_tilt = 1500; + newcam_distance_target = newcam_distance_values[dv]; + newcam_yaw = -c->yaw+0x4000; //Mario and the camera's yaw have this offset between them. + newcam_mode = NC_MODE_NORMAL; + ///This here will dictate what modes the camera will start in at the beginning of a level. Below are some examples. + switch (gCurrLevelNum) { + case LEVEL_BITDW: newcam_yaw = 0x4000; newcam_mode = NC_MODE_8D; newcam_tilt = 4000; newcam_distance_target = newcam_distance_values[2]; break; + case LEVEL_BITFS: newcam_yaw = 0x4000; newcam_mode = NC_MODE_8D; newcam_tilt = 4000; newcam_distance_target = newcam_distance_values[2]; break; + case LEVEL_BITS: newcam_yaw = 0x4000; newcam_mode = NC_MODE_8D; newcam_tilt = 4000; newcam_distance_target = newcam_distance_values[2]; break; + case LEVEL_WF: newcam_yaw = 0x4000; newcam_tilt = 2000; newcam_distance_target = newcam_distance_values[1]; break; + case LEVEL_RR: newcam_yaw = 0x6000; newcam_tilt = 2000; newcam_distance_target = newcam_distance_values[2]; break; + case LEVEL_CCM: if (gCurrAreaIndex == 1) {newcam_yaw = -0x4000; newcam_tilt = 2000; newcam_distance_target = newcam_distance_values[1];} else newcam_mode = NC_MODE_SLIDE; break; + case LEVEL_WDW: newcam_yaw = 0x2000; newcam_tilt = 3000; newcam_distance_target = newcam_distance_values[1]; break; + case 27: newcam_mode = NC_MODE_SLIDE; break; + case LEVEL_TTM: if (gCurrAreaIndex == 2) newcam_mode = NC_MODE_SLIDE; break; + } + + // clear these out when entering a new level to prevent "camera mode buffering" + newcam_saved_defmode = -1; + newcam_saved_mode = -1; + + // this will be set in init_settings() if enabled + newcam_active = 0; + + newcam_distance = newcam_distance_target; + newcam_intendedmode = newcam_mode; + newcam_modeflags = newcam_mode; +} + +static s16 newcam_clamp(s16 value, s16 min, s16 max) { + if (value >= max) + return max; + else if (value <= min) + return min; + else + return value; +} + +void newcam_toggle(bool enabled) { + // force-disable if a demo is being played + if (gCurrDemoInput) + enabled = false; + + if (enabled && !newcam_active) { + newcam_active = 1; + newcam_saved_mode = gLakituState.mode; + newcam_saved_defmode = gLakituState.defMode; + gLakituState.mode = CAMERA_MODE_NEWCAM; + gLakituState.defMode = CAMERA_MODE_NEWCAM; + } else if (!enabled && newcam_active) { + if (newcam_saved_mode != -1) { + gLakituState.defMode = newcam_saved_defmode; + gLakituState.mode = newcam_saved_mode; + newcam_saved_defmode = -1; + newcam_saved_mode = -1; + } + newcam_active = 0; + } +} + +///These are the default settings for Puppycam. You may change them to change how they'll be set for first timers. +void newcam_init_settings(void) { + newcam_sensitivityX = newcam_clamp(configCameraXSens, 1, 100) * 5; + newcam_sensitivityY = newcam_clamp(configCameraYSens, 1, 100) * 5; + newcam_aggression = newcam_clamp(configCameraAggr, 0, 100); + newcam_panlevel = newcam_clamp(configCameraPan, 0, 100); + newcam_invertX = (s16)configCameraInvertX; + newcam_invertY = (s16)configCameraInvertY; + newcam_mouse = (u8)configCameraMouse; + newcam_analogue = (s16)configCameraAnalog; + newcam_degrade = (f32)configCameraDegrade; + + newcam_toggle(configEnableCamera); +} + +/** Mathematic calculations. This stuffs so basic even *I* understand it lol +Basically, it just returns a position based on angle */ +static s16 lengthdir_x(f32 length, s16 dir) { + return (s16) (length * coss(dir)); +} +static s16 lengthdir_y(f32 length, s16 dir) { + return (s16) (length * sins(dir)); +} + +void newcam_diagnostics(void) { + print_text_fmt_int(32,192,"Lv %d",gCurrLevelNum); + print_text_fmt_int(32,176,"Area %d",gCurrAreaIndex); + print_text_fmt_int(32,160,"X %d",gMarioState->pos[0]); + print_text_fmt_int(32,144,"Y %d",gMarioState->pos[1]); + print_text_fmt_int(32,128,"Z %d",gMarioState->pos[2]); + print_text_fmt_int(32,112,"FLAGS %d",newcam_modeflags); + print_text_fmt_int(180,112,"INTM %d",newcam_intendedmode); + print_text_fmt_int(32,96,"TILT UP %d",newcam_tilt_acc); + print_text_fmt_int(32,80,"YAW UP %d",newcam_yaw_acc); + print_text_fmt_int(32,64,"YAW %d",newcam_yaw); + print_text_fmt_int(32,48,"TILT %d",newcam_tilt); + print_text_fmt_int(32,32,"DISTANCE %d",newcam_distance); +} + +static s16 newcam_adjust_value(f32 var, f32 val, f32 max) { + if (val > 0.0f) { + var += val; + if (var > max) + var = max; + } else if (val < 0.0f) { + var += val; + if (var < max) + var = max; + } + + return var; +} + +static f32 newcam_approach_float(f32 var, f32 val, f32 inc) { + if (var < val) + return min(var + inc, val); + else + return max(var - inc, val); +} + +static s16 newcam_approach_s16(s16 var, s16 val, s16 inc) { + if (var < val) + return max(var + inc, val); + else + return min(var - inc, val); +} + +static int ivrt(u8 axis) { + if (axis == 0) { + if (newcam_invertX == 0) + return -1; + else + return 1; + } else { + if (newcam_invertY == 0) + return 1; + else + return -1; + } +} + +static void newcam_rotate_button(void) { + f32 intendedXMag; + f32 intendedYMag; + + if ((newcam_modeflags & NC_FLAG_8D || newcam_modeflags & NC_FLAG_4D) && newcam_modeflags & NC_FLAG_XTURN) { + //8 directional camera rotation input for buttons. + if ((gPlayer1Controller->buttonPressed & L_CBUTTONS) && newcam_analogue == 0) { + #ifndef nosound + play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); + #endif + if (newcam_modeflags & NC_FLAG_8D) + newcam_yaw_target = newcam_yaw_target+(ivrt(newcam_invertX)*0x2000); + else + newcam_yaw_target = newcam_yaw_target+(ivrt(newcam_invertX)*0x4000); + newcam_centering = 1; + } else if ((gPlayer1Controller->buttonPressed & R_CBUTTONS) && newcam_analogue == 0) { + #ifndef nosound + play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); + #endif + if (newcam_modeflags & NC_FLAG_8D) + newcam_yaw_target = newcam_yaw_target-(ivrt(newcam_invertX)*0x2000); + else + newcam_yaw_target = newcam_yaw_target-(ivrt(newcam_invertX)*0x4000); + newcam_centering = 1; + } + } else if (newcam_modeflags & NC_FLAG_XTURN) { + //Standard camera movement + if ((gPlayer1Controller->buttonDown & L_CBUTTONS) && newcam_analogue == 0) { + newcam_yaw_acc = newcam_adjust_value(newcam_yaw_acc, -accel, -100); + } else if ((gPlayer1Controller->buttonDown & R_CBUTTONS) && newcam_analogue == 0) { + newcam_yaw_acc = newcam_adjust_value(newcam_yaw_acc, accel, 100); + } else if (!newcam_analogue) { + #ifdef noaccel + newcam_yaw_acc = 0; + #else + newcam_yaw_acc -= (newcam_yaw_acc*((f32)newcam_degrade/100)); + #endif + } + } + + if (gPlayer1Controller->buttonDown & U_CBUTTONS && newcam_modeflags & NC_FLAG_YTURN && newcam_analogue == 0) { + newcam_tilt_acc = newcam_adjust_value(newcam_tilt_acc, accel, 100); + } else if (gPlayer1Controller->buttonDown & D_CBUTTONS && newcam_modeflags & NC_FLAG_YTURN && newcam_analogue == 0) { + newcam_tilt_acc = newcam_adjust_value(newcam_tilt_acc, -accel, -100); + } else if (!newcam_analogue) { + #ifdef noaccel + newcam_tilt_acc = 0; + #else + newcam_tilt_acc -= (newcam_tilt_acc*((f32)newcam_degrade/100)); + #endif + } + + newcam_framessincec[0] ++; + newcam_framessincec[1] ++; + if ((gPlayer1Controller->buttonPressed & L_CBUTTONS) && newcam_modeflags & NC_FLAG_XTURN && !(newcam_modeflags & NC_FLAG_8D) && newcam_analogue == 0) { + if (newcam_framessincec[0] < 6) { + newcam_yaw_target = newcam_yaw+(ivrt(newcam_invertX)*0x3000); + newcam_centering = 1; + #ifndef nosound + play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); + #endif + } + newcam_framessincec[0] = 0; + } + if ((gPlayer1Controller->buttonPressed & R_CBUTTONS) && newcam_modeflags & NC_FLAG_XTURN && !(newcam_modeflags & NC_FLAG_8D) && newcam_analogue == 0) { + if (newcam_framessincec[1] < 6) { + newcam_yaw_target = newcam_yaw-(ivrt(newcam_invertX)*0x3000); + newcam_centering = 1; + #ifndef nosound + play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); + #endif + } + newcam_framessincec[1] = 0; + } + + + //There's not much point in keeping this behind a check, but it wouldn't hurt, just incase any 2player shenanigans ever happen, it makes it easy to disable. + if (newcam_analogue == 1) { + //The joystick values cap at 80, so divide by 8 to get the same net result at maximum turn as the button + intendedXMag = newcam_stick2[0]*1.25; + intendedYMag = newcam_stick2[1]*1.25; + + if (ABS(newcam_stick2[0]) > 20 && newcam_modeflags & NC_FLAG_XTURN) { + if (newcam_modeflags & NC_FLAG_8D) { + if (newcam_cstick_down == 0) { + newcam_cstick_down = 1; + newcam_centering = 1; + #ifndef nosound + play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); + #endif + if (newcam_stick2[0] > 20) { + if (newcam_modeflags & NC_FLAG_8D) + newcam_yaw_target = newcam_yaw_target+(ivrt(newcam_invertX)*0x2000); + else + newcam_yaw_target = newcam_yaw_target+(ivrt(newcam_invertX)*0x4000); + } else { + if (newcam_modeflags & NC_FLAG_8D) + newcam_yaw_target = newcam_yaw_target-(ivrt(newcam_invertX)*0x2000); + else + newcam_yaw_target = newcam_yaw_target-(ivrt(newcam_invertX)*0x4000); + } + } + } else { + newcam_yaw_acc = newcam_adjust_value(newcam_yaw_acc,newcam_stick2[0]*0.125, intendedXMag); + } + } else if (newcam_analogue) { + newcam_cstick_down = 0; + newcam_yaw_acc -= (newcam_yaw_acc*((f32)newcam_degrade/100)); + } + + if (ABS(newcam_stick2[1]) > 20 && newcam_modeflags & NC_FLAG_YTURN) + newcam_tilt_acc = newcam_adjust_value(newcam_tilt_acc, newcam_stick2[1]*0.125, intendedYMag); + else if (newcam_analogue) + newcam_tilt_acc -= (newcam_tilt_acc*((f32)newcam_degrade/100)); + } + + if (newcam_mouse == 1) { + newcam_yaw += ivrt(0) * mouse_x * 16; + newcam_tilt += ivrt(1) * mouse_y * 16; + } +} + +static void newcam_zoom_button(void) { + //Smoothly move the camera to the new spot. + if (newcam_distance > newcam_distance_target) { + newcam_distance -= 250; + if (newcam_distance < newcam_distance_target) + newcam_distance = newcam_distance_target; + } + if (newcam_distance < newcam_distance_target) { + newcam_distance += 250; + if (newcam_distance > newcam_distance_target) + newcam_distance = newcam_distance_target; + } + + if ((gPlayer1Controller->buttonDown & L_TRIG) && (newcam_modeflags & NC_FLAG_ZOOM)) { + //When you press L, set the flag for centering the camera. Afterwards, start setting the yaw to the Player's yaw at the time. + newcam_yaw_target = -gMarioState->faceAngle[1]-0x4000; + newcam_centering = 1; + } else if (gPlayer1Controller->buttonPressed & R_TRIG && newcam_modeflags & NC_FLAG_XTURN) { + //Each time the player presses R, but NOT L the camera zooms out more, until it hits the limit and resets back to close view. + #ifndef nosound + play_sound(SOUND_MENU_CLICK_CHANGE_VIEW, gDefaultSoundArgs); + #endif + + if (newcam_distance_target == newcam_distance_values[0]) + newcam_distance_target = newcam_distance_values[1]; + else if (newcam_distance_target == newcam_distance_values[1]) + newcam_distance_target = newcam_distance_values[2]; + else + newcam_distance_target = newcam_distance_values[0]; + } + + if (newcam_centering && newcam_modeflags & NC_FLAG_XTURN) { + newcam_yaw = approach_s16_symmetric(newcam_yaw,newcam_yaw_target,0x800); + if (newcam_yaw == newcam_yaw_target) + newcam_centering = 0; + } else { + newcam_yaw_target = newcam_yaw; + } +} + +static void newcam_update_values(void) { + //For tilt, this just limits it so it doesn't go further than 90 degrees either way. 90 degrees is actually 16384, but can sometimes lead to issues, so I just leave it shy of 90. + u8 waterflag = 0; + + if (newcam_modeflags & NC_FLAG_XTURN) + newcam_yaw -= ((newcam_yaw_acc*(newcam_sensitivityX/10))*ivrt(newcam_invertX)); + if (((newcam_tilt <= 12000) && (newcam_tilt >= -12000)) && newcam_modeflags & NC_FLAG_YTURN) + newcam_tilt += ((newcam_tilt_acc*ivrt(newcam_invertY))*(newcam_sensitivityY/10)); + + if (newcam_tilt > 12000) + newcam_tilt = 12000; + if (newcam_tilt < -12000) + newcam_tilt = -12000; + + if (newcam_turnwait > 0 && gMarioState->vel[1] == 0) { + newcam_turnwait -= 1; + if (newcam_turnwait < 0) + newcam_turnwait = 0; + } else { + if (gMarioState->intendedMag > 0 && gMarioState->vel[1] == 0 && newcam_modeflags & NC_FLAG_XTURN && !(newcam_modeflags & NC_FLAG_8D) && !(newcam_modeflags & NC_FLAG_4D)) + newcam_yaw = (approach_s16_symmetric(newcam_yaw,-gMarioState->faceAngle[1]-0x4000,((newcam_aggression*(ABS(gPlayer1Controller->rawStickX/10)))*(gMarioState->forwardVel/32)))); + else + newcam_turnwait = 10; + } + + if (newcam_modeflags & NC_FLAG_SLIDECORRECT) { + switch (gMarioState->action) { + case ACT_BUTT_SLIDE: if (gMarioState->forwardVel > 8) waterflag = 1; break; + case ACT_STOMACH_SLIDE: if (gMarioState->forwardVel > 8) waterflag = 1; break; + case ACT_HOLD_BUTT_SLIDE: if (gMarioState->forwardVel > 8) waterflag = 1; break; + case ACT_HOLD_STOMACH_SLIDE: if (gMarioState->forwardVel > 8) waterflag = 1; break; + } + } + + switch (gMarioState->action) { + case ACT_SHOT_FROM_CANNON: waterflag = 1; break; + case ACT_FLYING: waterflag = 1; break; + } + + if (gMarioState->action & ACT_FLAG_SWIMMING) { + if (gMarioState->forwardVel > 2) + waterflag = 1; + } + + if (waterflag && newcam_modeflags & NC_FLAG_XTURN) { + newcam_yaw = (approach_s16_symmetric(newcam_yaw,-gMarioState->faceAngle[1]-0x4000,(gMarioState->forwardVel*128))); + if ((signed)gMarioState->forwardVel > 1) + newcam_tilt = (approach_s16_symmetric(newcam_tilt,(-gMarioState->faceAngle[0]*0.8)+3000,(gMarioState->forwardVel*32))); + else + newcam_tilt = (approach_s16_symmetric(newcam_tilt,3000,32)); + } +} + +static void newcam_collision(void) { + struct Surface *surf; + Vec3f camdir; + Vec3f hitpos; + + camdir[0] = newcam_pos[0]-newcam_lookat[0]; + camdir[1] = newcam_pos[1]-newcam_lookat[1]; + camdir[2] = newcam_pos[2]-newcam_lookat[2]; + + find_surface_on_ray(newcam_pos_target, camdir, &surf, hitpos); + newcam_coldist = sqrtf((newcam_pos_target[0] - hitpos[0]) * (newcam_pos_target[0] - hitpos[0]) + (newcam_pos_target[1] - hitpos[1]) * (newcam_pos_target[1] - hitpos[1]) + (newcam_pos_target[2] - hitpos[2]) * (newcam_pos_target[2] - hitpos[2])); + + if (surf) { + newcam_pos[0] = hitpos[0]; + newcam_pos[1] = approach_f32(hitpos[1],newcam_pos[1],25,-25); + newcam_pos[2] = hitpos[2]; + newcam_pan_x = 0; + newcam_pan_z = 0; + } +} + +static void newcam_set_pan(void) { + //Apply panning values based on Mario's direction. + if (gMarioState->action != ACT_HOLDING_BOWSER && gMarioState->action != ACT_SLEEPING && gMarioState->action != ACT_START_SLEEPING) { + approach_f32_asymptotic_bool(&newcam_pan_x, lengthdir_x((160*newcam_panlevel)/100, -gMarioState->faceAngle[1]-0x4000), 0.05); + approach_f32_asymptotic_bool(&newcam_pan_z, lengthdir_y((160*newcam_panlevel)/100, -gMarioState->faceAngle[1]-0x4000), 0.05); + } else { + approach_f32_asymptotic_bool(&newcam_pan_x, 0, 0.05); + approach_f32_asymptotic_bool(&newcam_pan_z, 0, 0.05); + } + + newcam_pan_x = newcam_pan_x*(min(newcam_distance/newcam_distance_target,1)); + newcam_pan_z = newcam_pan_z*(min(newcam_distance/newcam_distance_target,1)); +} + +static void newcam_position_cam(void) { + f32 floorY = 0; + f32 floorY2 = 0; + s16 shakeX; + s16 shakeY; + + if (!(gMarioState->action & ACT_FLAG_SWIMMING) && newcam_modeflags & NC_FLAG_FOCUSY && newcam_modeflags & NC_FLAG_POSY) + calc_y_to_curr_floor(&floorY, 1.f, 200.f, &floorY2, 0.9f, 200.f); + + newcam_update_values(); + shakeX = gLakituState.shakeMagnitude[1]; + shakeY = gLakituState.shakeMagnitude[0]; + //Fetch Mario's current position. Not hardcoded just for the sake of flexibility, though this specific bit is temp, because it won't always want to be focusing on Mario. + newcam_pos_target[0] = gMarioState->pos[0]; + newcam_pos_target[1] = gMarioState->pos[1]+newcam_extheight; + newcam_pos_target[2] = gMarioState->pos[2]; + //These will set the position of the camera to where Mario is supposed to be, minus adjustments for where the camera should be, on top of. + if (newcam_modeflags & NC_FLAG_POSX) + newcam_pos[0] = newcam_pos_target[0]+lengthdir_x(lengthdir_x(newcam_distance,newcam_tilt+shakeX),newcam_yaw+shakeY); + if (newcam_modeflags & NC_FLAG_POSZ) + newcam_pos[2] = newcam_pos_target[2]+lengthdir_y(lengthdir_x(newcam_distance,newcam_tilt+shakeX),newcam_yaw+shakeY); + if (newcam_modeflags & NC_FLAG_POSY) + newcam_pos[1] = newcam_pos_target[1]+lengthdir_y(newcam_distance,newcam_tilt+gLakituState.shakeMagnitude[0])+floorY; + if ((newcam_modeflags & NC_FLAG_FOCUSX) && (newcam_modeflags & NC_FLAG_FOCUSY) && (newcam_modeflags & NC_FLAG_FOCUSZ)) + newcam_set_pan(); + //Set where the camera wants to be looking at. This is almost always the place it's based off, too. + if (newcam_modeflags & NC_FLAG_FOCUSX) + newcam_lookat[0] = newcam_pos_target[0]-newcam_pan_x; + if (newcam_modeflags & NC_FLAG_FOCUSY) + newcam_lookat[1] = newcam_pos_target[1]+floorY2; + if (newcam_modeflags & NC_FLAG_FOCUSZ) + newcam_lookat[2] = newcam_pos_target[2]-newcam_pan_z; + + if (newcam_modeflags & NC_FLAG_COLLISION) + newcam_collision(); + +} + +//Nested if's baybeeeee +static void newcam_find_fixed(void) { + u8 i = 0; + newcam_mode = newcam_intendedmode; + newcam_modeflags = newcam_mode; + for (i = 0; i < sizeof(newcam_fixedcam) / sizeof(struct newcam_hardpos); i++) { + if (newcam_fixedcam[i].newcam_hard_levelID == gCurrLevelNum && newcam_fixedcam[i].newcam_hard_areaID == gCurrAreaIndex) { + if ((newcam_pos_target[0] > newcam_fixedcam[i].newcam_hard_X1) + && (newcam_pos_target[0] < newcam_fixedcam[i].newcam_hard_X2) + && (newcam_pos_target[1] > newcam_fixedcam[i].newcam_hard_Y1) + && (newcam_pos_target[1] < newcam_fixedcam[i].newcam_hard_Y2) + && (newcam_pos_target[2] > newcam_fixedcam[i].newcam_hard_Z1) + && (newcam_pos_target[2] < newcam_fixedcam[i].newcam_hard_Z2)) { + if (newcam_fixedcam[i].newcam_hard_permaswap) + newcam_intendedmode = newcam_fixedcam[i].newcam_hard_modeset; + newcam_mode = newcam_fixedcam[i].newcam_hard_modeset; + newcam_modeflags = newcam_mode; + + if (newcam_fixedcam[i].newcam_hard_camX != 32767 && !(newcam_modeflags & NC_FLAG_POSX)) + newcam_pos[0] = newcam_fixedcam[i].newcam_hard_camX; + if (newcam_fixedcam[i].newcam_hard_camY != 32767 && !(newcam_modeflags & NC_FLAG_POSY)) + newcam_pos[1] = newcam_fixedcam[i].newcam_hard_camY; + if (newcam_fixedcam[i].newcam_hard_camZ != 32767 && !(newcam_modeflags & NC_FLAG_POSZ)) + newcam_pos[2] = newcam_fixedcam[i].newcam_hard_camZ; + + if (newcam_fixedcam[i].newcam_hard_lookX != 32767 && !(newcam_modeflags & NC_FLAG_FOCUSX)) + newcam_lookat[0] = newcam_fixedcam[i].newcam_hard_lookX; + if (newcam_fixedcam[i].newcam_hard_lookY != 32767 && !(newcam_modeflags & NC_FLAG_FOCUSY)) + newcam_lookat[1] = newcam_fixedcam[i].newcam_hard_lookY; + if (newcam_fixedcam[i].newcam_hard_lookZ != 32767 && !(newcam_modeflags & NC_FLAG_FOCUSZ)) + newcam_lookat[2] = newcam_fixedcam[i].newcam_hard_lookZ; + + newcam_yaw = atan2s(newcam_pos[0]-newcam_pos_target[0],newcam_pos[2]-newcam_pos_target[2]); + } + } + } +} + +static void newcam_apply_values(struct Camera *c) { + c->pos[0] = newcam_pos[0]; + c->pos[1] = newcam_pos[1]; + c->pos[2] = newcam_pos[2]; + + c->focus[0] = newcam_lookat[0]; + c->focus[1] = newcam_lookat[1]; + c->focus[2] = newcam_lookat[2]; + + gLakituState.pos[0] = newcam_pos[0]; + gLakituState.pos[1] = newcam_pos[1]; + gLakituState.pos[2] = newcam_pos[2]; + + gLakituState.focus[0] = newcam_lookat[0]; + gLakituState.focus[1] = newcam_lookat[1]; + gLakituState.focus[2] = newcam_lookat[2]; + + c->yaw = -newcam_yaw+0x4000; + gLakituState.yaw = -newcam_yaw+0x4000; + + //Adds support for wing mario tower + if (gMarioState->floor != NULL) { + if (gMarioState->floor->type == SURFACE_LOOK_UP_WARP) { + if (save_file_get_total_star_count(gCurrSaveFileNum - 1, 0, 0x18) >= 10) { + if (newcam_tilt < -8000 && gMarioState->forwardVel == 0) { + level_trigger_warp(gMarioState, 1); + } + } + } + } +} + +//If puppycam gets too close to its target, start fading it out so you don't see the inside of it. +void newcam_fade_target_closeup(void) { + if (newcam_coldist <= 250 && (newcam_coldist-150)*2.55f < 255) { + if ((newcam_coldist-150)*2.55f > 0) + newcam_xlu = (newcam_coldist-150)*2.55f; + else + newcam_xlu = 0; + } else { + newcam_xlu = 255; + } +} + +//The ingame cutscene system is such a spaghetti mess I actually have to resort to something as stupid as this to cover every base. +void newcam_apply_outside_values(struct Camera *c, u8 bit) { + if (bit) + newcam_yaw = -gMarioState->faceAngle[1]-0x4000; + else + newcam_yaw = -c->yaw+0x4000; +} + +static void newcam_stick_input(void) { + newcam_stick2[0] = gPlayer1Controller->extStickX; + newcam_stick2[1] = gPlayer1Controller->extStickY; +} + +//Main loop. +void newcam_loop(struct Camera *c) { + newcam_stick_input(); + newcam_rotate_button(); + newcam_zoom_button(); + newcam_position_cam(); + newcam_find_fixed(); + if (gMarioObject) + newcam_apply_values(c); + newcam_fade_target_closeup(); + + //Just some visual information on the values of the camera. utilises ifdef because it's better at runtime. + #ifdef NEWCAM_DEBUG + newcam_diagnostics(); + #endif // NEWCAM_DEBUG +} diff --git a/src/game/camera.c b/src/game/camera.c index 81274e48..bde06626 100644 --- a/src/game/camera.c +++ b/src/game/camera.c @@ -28,6 +28,7 @@ #include "paintings.h" #include "engine/graph_node.h" #include "level_table.h" +#include "pc/configfile.h" #define CBUTTON_MASK (U_CBUTTONS | D_CBUTTONS | L_CBUTTONS | R_CBUTTONS) @@ -700,6 +701,10 @@ f32 calc_y_to_curr_floor(f32 *posOff, f32 posMul, f32 posBound, f32 *focOff, f32 *focOff = -focBound; } } +//Compiler gets mad if I put this any further above. thanks refresh 7 +#ifdef BETTERCAMERA +#include "bettercamera.inc.h" +#endif void focus_on_mario(Vec3f focus, Vec3f pos, f32 posYOff, f32 focYOff, f32 dist, s16 pitch, s16 yaw) { Vec3f marioPos; @@ -2852,6 +2857,10 @@ void set_camera_mode(struct Camera *c, s16 mode, s16 frames) { struct LinearTransitionPoint *start = &sModeInfo.transitionStart; struct LinearTransitionPoint *end = &sModeInfo.transitionEnd; +#ifdef BETTERCAMERA + if (mode != CAMERA_MODE_NEWCAM && gLakituState.mode != CAMERA_MODE_NEWCAM) + { +#endif if (mode == CAMERA_MODE_WATER_SURFACE && gCurrLevelArea == AREA_TTM_OUTSIDE) { } else { // Clear movement flags that would affect the transition @@ -2895,6 +2904,9 @@ void set_camera_mode(struct Camera *c, s16 mode, s16 frames) { vec3f_get_dist_and_angle(start->focus, start->pos, &start->dist, &start->pitch, &start->yaw); vec3f_get_dist_and_angle(end->focus, end->pos, &end->dist, &end->pitch, &end->yaw); } +#ifdef BETTERCAMERA + } +#endif } /** @@ -2979,7 +2991,12 @@ void update_lakitu(struct Camera *c) { gLakituState.roll += sHandheldShakeRoll; gLakituState.roll += gLakituState.keyDanceRoll; - if (c->mode != CAMERA_MODE_C_UP && c->cutscene == 0) { + if (c->mode != CAMERA_MODE_C_UP && c->cutscene == 0 +#ifdef BETTERCAMERA + && c->mode != CAMERA_MODE_NEWCAM +#endif + ) + { gCheckingSurfaceCollisionsForCamera = TRUE; distToFloor = find_floor(gLakituState.pos[0], gLakituState.pos[1] + 20.0f, @@ -3012,7 +3029,11 @@ void update_camera(struct Camera *c) { update_camera_hud_status(c); if (c->cutscene == 0) { // Only process R_TRIG if 'fixed' is not selected in the menu - if (cam_select_alt_mode(0) == CAM_SELECTION_MARIO) { + if (cam_select_alt_mode(0) == CAM_SELECTION_MARIO +#ifdef BETTERCAMERA + && c->mode != CAMERA_MODE_NEWCAM +#endif + ) { if (gPlayer1Controller->buttonPressed & R_TRIG) { if (set_cam_angle(0) == CAM_ANGLE_LAKITU) { set_cam_angle(CAM_ANGLE_MARIO); @@ -3050,10 +3071,22 @@ void update_camera(struct Camera *c) { c->mode = gLakituState.mode; c->defMode = gLakituState.defMode; +#ifdef BETTERCAMERA + if (c->mode != CAMERA_MODE_NEWCAM) + { +#endif camera_course_processing(c); stub_camera_3(c); - sCButtonsPressed = find_c_buttons_pressed(sCButtonsPressed, gPlayer1Controller->buttonPressed, - gPlayer1Controller->buttonDown); + sCButtonsPressed = find_c_buttons_pressed(sCButtonsPressed, gPlayer1Controller->buttonPressed,gPlayer1Controller->buttonDown); +#ifdef BETTERCAMERA + } + + if (gMarioState->action == ACT_SHOT_FROM_CANNON && newcam_active) + { + gMarioState->area->camera->mode = CAMERA_MODE_NEWCAM; + gLakituState.mode = CAMERA_MODE_NEWCAM; + } +#endif if (c->cutscene != 0) { sYawSpeed = 0; @@ -3091,6 +3124,12 @@ void update_camera(struct Camera *c) { mode_cannon_camera(c); break; +#ifdef BETTERCAMERA + case CAMERA_MODE_NEWCAM: + newcam_loop(c); + break; +#endif + default: mode_mario_camera(c); } @@ -3150,6 +3189,12 @@ void update_camera(struct Camera *c) { case CAMERA_MODE_SPIRAL_STAIRS: mode_spiral_stairs_camera(c); break; + +#ifdef BETTERCAMERA + case CAMERA_MODE_NEWCAM: + newcam_loop(c); + break; +#endif } } } @@ -3425,6 +3470,11 @@ void init_camera(struct Camera *c) { gLakituState.nextYaw = gLakituState.yaw; c->yaw = gLakituState.yaw; c->nextYaw = gLakituState.yaw; + +#ifdef BETTERCAMERA + newcam_init(c, 0); + newcam_init_settings(); +#endif } /** @@ -3484,7 +3534,7 @@ void select_mario_cam_mode(void) { */ void create_camera(struct GraphNodeCamera *gc, struct AllocOnlyPool *pool) { s16 mode = gc->config.mode; - struct Camera *c = (struct Camera*) alloc_only_pool_alloc(pool, sizeof(struct Camera)); + struct Camera *c = alloc_only_pool_alloc(pool, sizeof(struct Camera)); gc->config.camera = c; c->mode = mode; @@ -3514,11 +3564,11 @@ void update_graph_node_camera(struct GraphNodeCamera *gc) { Gfx *geo_camera_main(s32 callContext, struct GraphNode *g, void *context) { struct GraphNodeCamera *gc = (struct GraphNodeCamera *) g; - UNUSED Mat4 *unusedMat = (Mat4*) context; + UNUSED Mat4 *unusedMat = context; switch (callContext) { case GEO_CONTEXT_CREATE: - create_camera(gc, (struct AllocOnlyPool*) context); + create_camera(gc, context); break; case GEO_CONTEXT_RENDER: update_graph_node_camera(gc); @@ -5513,6 +5563,10 @@ void set_camera_mode_8_directions(struct Camera *c) { s8DirModeBaseYaw = 0; s8DirModeYawOffset = 0; } +#ifdef BETTERCAMERA + if (newcam_active == 1) + c->mode = CAMERA_MODE_NEWCAM; +#endif } /** @@ -5531,6 +5585,10 @@ void set_camera_mode_close_cam(u8 *mode) { sStatusFlags &= ~CAM_FLAG_SMOOTH_MOVEMENT; *mode = CAMERA_MODE_CLOSE; } +#ifdef BETTERCAMERA + if (newcam_active == 1) + *mode = CAMERA_MODE_NEWCAM; +#endif } /** @@ -5555,6 +5613,10 @@ void set_camera_mode_radial(struct Camera *c, s16 transitionTime) { } sModeOffsetYaw = 0; } +#ifdef BETTERCAMERA + if (newcam_active == 1) + c->mode = CAMERA_MODE_NEWCAM; +#endif } /** @@ -6933,6 +6995,9 @@ s16 cutscene_object(u8 cutscene, struct Object *o) { void update_camera_yaw(struct Camera *c) { c->nextYaw = calculate_yaw(c->focus, c->pos); c->yaw = c->nextYaw; +#ifdef BETTERCAMERA + newcam_apply_outside_values(c,0); +#endif } void cutscene_reset_spline(void) { @@ -9201,7 +9266,14 @@ BAD_RETURN(s32) cutscene_non_painting_end(struct Camera *c) { if (c->defMode == CAMERA_MODE_CLOSE) { c->mode = CAMERA_MODE_CLOSE; - } else { + } else +#ifdef BETTERCAMERA + if (c->defMode == CAMERA_MODE_NEWCAM) { + c->mode = CAMERA_MODE_NEWCAM; + } + else +#endif + { c->mode = CAMERA_MODE_FREE_ROAM; } @@ -9957,6 +10029,9 @@ BAD_RETURN(s32) cutscene_sliding_doors_follow_mario(struct Camera *c) { BAD_RETURN(s32) cutscene_sliding_doors_open(struct Camera *c) { UNUSED u32 pad[2]; +#ifdef BETTERCAMERA + newcam_apply_outside_values(c,1); +#endif reset_pan_distance(c); cutscene_event(cutscene_sliding_doors_open_start, c, 0, 8); cutscene_event(cutscene_sliding_doors_open_set_cvars, c, 8, 8); @@ -10153,7 +10228,12 @@ BAD_RETURN(s32) cutscene_unused_exit_focus_mario(struct Camera *c) { * Give control back to the player. */ BAD_RETURN(s32) cutscene_exit_painting_end(struct Camera *c) { - c->mode = CAMERA_MODE_CLOSE; +#ifdef BETTERCAMERA + if (newcam_active == 1) + c->mode = CAMERA_MODE_NEWCAM; + else +#endif + c->mode = CAMERA_MODE_CLOSE; c->cutscene = 0; gCutsceneTimer = CUTSCENE_STOP; sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; @@ -10313,11 +10393,24 @@ BAD_RETURN(s32) cutscene_door_follow_mario(struct Camera *c) { * Ends the door cutscene. Sets the camera mode to close mode unless the default is free roam. */ BAD_RETURN(s32) cutscene_door_end(struct Camera *c) { +#ifndef BETTERCAMERA if (c->defMode == CAMERA_MODE_FREE_ROAM) { c->mode = CAMERA_MODE_FREE_ROAM; } else { c->mode = CAMERA_MODE_CLOSE; } +#else + if (c->defMode == CAMERA_MODE_CLOSE) { + c->mode = CAMERA_MODE_CLOSE; + } else + if (c->defMode == CAMERA_MODE_NEWCAM) { + c->mode = CAMERA_MODE_NEWCAM; + } + else + { + c->mode = CAMERA_MODE_FREE_ROAM; + } +#endif c->cutscene = 0; gCutsceneTimer = CUTSCENE_STOP; @@ -10814,7 +10907,7 @@ u8 sZoomOutAreaMasks[] = { ZOOMOUT_AREA_MASK(0,0,0,0, 0,0,0,0), // Unused | Unused }; -// STATIC_ASSERT(ARRAY_COUNT(sZoomOutAreaMasks) - 1 == LEVEL_MAX / 2, "Make sure you edit sZoomOutAreaMasks when adding / removing courses."); +STATIC_ASSERT(ARRAY_COUNT(sZoomOutAreaMasks) - 1 == LEVEL_MAX / 2, "Make sure you edit sZoomOutAreaMasks when adding / removing courses."); /* * credits spline paths. diff --git a/src/game/camera.h b/src/game/camera.h index f56ed027..173ab8a7 100644 --- a/src/game/camera.h +++ b/src/game/camera.h @@ -112,6 +112,9 @@ #define CAMERA_MODE_8_DIRECTIONS 0x0E // AKA Parallel Camera, Bowser Courses & Rainbow Ride #define CAMERA_MODE_FREE_ROAM 0x10 #define CAMERA_MODE_SPIRAL_STAIRS 0x11 +#ifdef BETTERCAMERA +#define CAMERA_MODE_NEWCAM 0x12 +#endif #define CAM_MOVE_RETURN_TO_MIDDLE 0x0001 #define CAM_MOVE_ZOOMED_OUT 0x0002 diff --git a/src/game/crash_screen.c b/src/game/crash_screen.c deleted file mode 100644 index 4b3dd4f1..00000000 --- a/src/game/crash_screen.c +++ /dev/null @@ -1,324 +0,0 @@ -#include -#include -#include - -#include "sm64.h" - -#if defined(TARGET_N64) && (defined(VERSION_EU) || defined(VERSION_SH)) - -#include "lib/src/printf.h" - -u8 gCrashScreenCharToGlyph[128] = { - -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, 41, -1, -1, -1, 43, -1, -1, 37, 38, -1, 42, - -1, 39, 44, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 36, -1, -1, -1, -1, 40, -1, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -}; - -// really u32, but texture output is u8, so allocate 4x -u8 gCrashScreenFont[(7 * 9 + 1) * 4] = { - #include "textures/crash_screen/crash_font_01234.ia1.inc.c" - #include "textures/crash_screen/crash_font_56789.ia1.inc.c" - #include "textures/crash_screen/crash_font_ABCDE.ia1.inc.c" - #include "textures/crash_screen/crash_font_FGHIJ.ia1.inc.c" - #include "textures/crash_screen/crash_font_KLMNO.ia1.inc.c" - #include "textures/crash_screen/crash_font_PQRST.ia1.inc.c" - #include "textures/crash_screen/crash_font_UVWXY.ia1.inc.c" - #include "textures/crash_screen/crash_font_Zsym1.ia1.inc.c" - #include "textures/crash_screen/crash_font_sym2.ia1.inc.c" -}; - - -char *gCauseDesc[18] = { - "Interrupt", - "TLB modification", - "TLB exception on load", - "TLB exception on store", - "Address error on load", - "Address error on store", - "Bus error on inst.", - "Bus error on data", - "System call exception", - "Breakpoint exception", - "Reserved instruction", - "Coprocessor unusable", - "Arithmetic overflow", - "Trap exception", - "Virtual coherency on inst.", - "Floating point exception", - "Watchpoint exception", - "Virtual coherency on data", -}; - -char *gFpcsrDesc[6] = { - "Unimplemented operation", "Invalid operation", "Division by zero", "Overflow", "Underflow", - "Inexact operation", -}; - - - -extern u64 osClockRate; - -struct { - OSThread thread; - u64 stack[0x800 / sizeof(u64)]; - OSMesgQueue mesgQueue; - OSMesg mesg; - u16 *framebuffer; - u16 width; - u16 height; -} gCrashScreen; - -void crash_screen_draw_rect(s32 x, s32 y, s32 w, s32 h) { - u16 *ptr; - s32 i, j; - - ptr = gCrashScreen.framebuffer + gCrashScreen.width * y + x; - for (i = 0; i < h; i++) { - for (j = 0; j < w; j++) { - // 0xe738 = 0b1110011100111000 - *ptr = ((*ptr & 0xe738) >> 2) | 1; - ptr++; - } - ptr += gCrashScreen.width - w; - } -} - -void crash_screen_draw_glyph(s32 x, s32 y, s32 glyph) { - const u32 *data; - u16 *ptr; - u32 bit; - u32 rowMask; - s32 i, j; - - // TODO: output u32 for these textures and remove this ugly cast - data = &((u32*)gCrashScreenFont)[glyph / 5 * 7]; - ptr = gCrashScreen.framebuffer + gCrashScreen.width * y + x; - - for (i = 0; i < 7; i++) { - bit = 0x80000000U >> ((glyph % 5) * 6); - rowMask = *data++; - - for (j = 0; j < 6; j++) { - *ptr++ = (bit & rowMask) ? 0xffff : 1; - bit >>= 1; - } - ptr += gCrashScreen.width - 6; - } -} - -static char *write_to_buf(char *buffer, const char *data, size_t size) { - return (char *) memcpy(buffer, data, size) + size; -} - -void crash_screen_print(s32 x, s32 y, const char *fmt, ...) { - char *ptr; - u32 glyph; - s32 size; - char buf[0x100]; - - va_list args; - va_start(args, fmt); - - size = _Printf(write_to_buf, buf, fmt, args); - - if (size > 0) { - ptr = buf; - -#ifdef VERSION_SH - while (size > 0) { -#else - while (*ptr) { -#endif - - glyph = gCrashScreenCharToGlyph[*ptr & 0x7f]; - - if (glyph != 0xff) { - crash_screen_draw_glyph(x, y, glyph); - } - -#ifdef VERSION_SH - size--; -#endif - - ptr++; - x += 6; - } - } - - va_end(args); -} - -void crash_screen_sleep(s32 ms) { - u64 cycles = ms * 1000LL * osClockRate / 1000000ULL; - osSetTime(0); - while (osGetTime() < cycles) { - } -} - -void crash_screen_print_float_reg(s32 x, s32 y, s32 regNum, void *addr) { - u32 bits; - s32 exponent; - - bits = *(u32 *) addr; - exponent = ((bits & 0x7f800000U) >> 0x17) - 0x7f; - if ((exponent >= -0x7e && exponent <= 0x7f) || bits == 0) { - crash_screen_print(x, y, "F%02d:%.3e", regNum, *(f32 *) addr); - } else { - crash_screen_print(x, y, "F%02d:---------", regNum); - } -} - -void crash_screen_print_fpcsr(u32 fpcsr) { - s32 i; - u32 bit; - - bit = 1 << 17; - crash_screen_print(30, 155, "FPCSR:%08XH", fpcsr); - for (i = 0; i < 6; i++) { - if (fpcsr & bit) { - crash_screen_print(132, 155, "(%s)", gFpcsrDesc[i]); - return; - } - bit >>= 1; - } -} - -void draw_crash_screen(OSThread *thread) { - s16 cause; - __OSThreadContext *tc = &thread->context; - - cause = (tc->cause >> 2) & 0x1f; - if (cause == 23) // EXC_WATCH - { - cause = 16; - } - if (cause == 31) // EXC_VCED - { - cause = 17; - } - -#ifdef VERSION_SH - osWritebackDCacheAll(); -#endif - - crash_screen_draw_rect(25, 20, 270, 25); - crash_screen_print(30, 25, "THREAD:%d (%s)", thread->id, gCauseDesc[cause]); - crash_screen_print(30, 35, "PC:%08XH SR:%08XH VA:%08XH", tc->pc, tc->sr, tc->badvaddr); -#ifdef VERSION_EU - osWritebackDCacheAll(); -#endif - crash_screen_sleep(2000); - crash_screen_draw_rect(25, 45, 270, 185); - crash_screen_print(30, 50, "AT:%08XH V0:%08XH V1:%08XH", (u32) tc->at, (u32) tc->v0, - (u32) tc->v1); - crash_screen_print(30, 60, "A0:%08XH A1:%08XH A2:%08XH", (u32) tc->a0, (u32) tc->a1, - (u32) tc->a2); - crash_screen_print(30, 70, "A3:%08XH T0:%08XH T1:%08XH", (u32) tc->a3, (u32) tc->t0, - (u32) tc->t1); - crash_screen_print(30, 80, "T2:%08XH T3:%08XH T4:%08XH", (u32) tc->t2, (u32) tc->t3, - (u32) tc->t4); - crash_screen_print(30, 90, "T5:%08XH T6:%08XH T7:%08XH", (u32) tc->t5, (u32) tc->t6, - (u32) tc->t7); - crash_screen_print(30, 100, "S0:%08XH S1:%08XH S2:%08XH", (u32) tc->s0, (u32) tc->s1, - (u32) tc->s2); - crash_screen_print(30, 110, "S3:%08XH S4:%08XH S5:%08XH", (u32) tc->s3, (u32) tc->s4, - (u32) tc->s5); - crash_screen_print(30, 120, "S6:%08XH S7:%08XH T8:%08XH", (u32) tc->s6, (u32) tc->s7, - (u32) tc->t8); - crash_screen_print(30, 130, "T9:%08XH GP:%08XH SP:%08XH", (u32) tc->t9, (u32) tc->gp, - (u32) tc->sp); - crash_screen_print(30, 140, "S8:%08XH RA:%08XH", (u32) tc->s8, (u32) tc->ra); - crash_screen_print_fpcsr(tc->fpcsr); -#ifdef VERSION_EU - osWritebackDCacheAll(); -#endif - crash_screen_print_float_reg(30, 170, 0, &tc->fp0.f.f_even); - crash_screen_print_float_reg(120, 170, 2, &tc->fp2.f.f_even); - crash_screen_print_float_reg(210, 170, 4, &tc->fp4.f.f_even); - crash_screen_print_float_reg(30, 180, 6, &tc->fp6.f.f_even); - crash_screen_print_float_reg(120, 180, 8, &tc->fp8.f.f_even); - crash_screen_print_float_reg(210, 180, 10, &tc->fp10.f.f_even); - crash_screen_print_float_reg(30, 190, 12, &tc->fp12.f.f_even); - crash_screen_print_float_reg(120, 190, 14, &tc->fp14.f.f_even); - crash_screen_print_float_reg(210, 190, 16, &tc->fp16.f.f_even); - crash_screen_print_float_reg(30, 200, 18, &tc->fp18.f.f_even); - crash_screen_print_float_reg(120, 200, 20, &tc->fp20.f.f_even); - crash_screen_print_float_reg(210, 200, 22, &tc->fp22.f.f_even); - crash_screen_print_float_reg(30, 210, 24, &tc->fp24.f.f_even); - crash_screen_print_float_reg(120, 210, 26, &tc->fp26.f.f_even); - crash_screen_print_float_reg(210, 210, 28, &tc->fp28.f.f_even); - crash_screen_print_float_reg(30, 220, 30, &tc->fp30.f.f_even); -#ifdef VERSION_EU - osWritebackDCacheAll(); -#endif - osViBlack(FALSE); - osViSwapBuffer(gCrashScreen.framebuffer); -} - -OSThread *get_crashed_thread(void) { - OSThread *thread; - - thread = __osGetCurrFaultedThread(); - while (thread->priority != -1) { - if (thread->priority > OS_PRIORITY_IDLE && thread->priority < OS_PRIORITY_APPMAX - && (thread->flags & 3) != 0) { - return thread; - } - thread = thread->tlnext; - } - return NULL; -} - -void thread2_crash_screen(UNUSED void *arg) { - OSMesg mesg; - OSThread *thread; - - osSetEventMesg(OS_EVENT_CPU_BREAK, &gCrashScreen.mesgQueue, (OSMesg) 1); - osSetEventMesg(OS_EVENT_FAULT, &gCrashScreen.mesgQueue, (OSMesg) 2); - do { - osRecvMesg(&gCrashScreen.mesgQueue, &mesg, 1); - thread = get_crashed_thread(); - } while (thread == NULL); - draw_crash_screen(thread); - for (;;) { - } -} - -void crash_screen_set_framebuffer(u16 *framebuffer, s16 width, s16 height) { -#ifdef VERSION_EU - gCrashScreen.framebuffer = framebuffer; -#else - gCrashScreen.framebuffer = (u16 *)((uintptr_t)framebuffer | 0xa0000000); -#endif - gCrashScreen.width = width; - gCrashScreen.height = height; -} - -void crash_screen_init(void) { -#ifdef VERSION_EU - gCrashScreen.framebuffer = (u16 *) (osMemSize | 0x80000000) - SCREEN_WIDTH * SCREEN_HEIGHT; -#else - gCrashScreen.framebuffer = (u16 *) (osMemSize | 0xA0000000) - SCREEN_WIDTH * SCREEN_HEIGHT; -#endif - gCrashScreen.width = SCREEN_WIDTH; -#ifdef VERSION_EU - gCrashScreen.height = SCREEN_HEIGHT; -#else - gCrashScreen.height = 0x10; -#endif - osCreateMesgQueue(&gCrashScreen.mesgQueue, &gCrashScreen.mesg, 1); - osCreateThread(&gCrashScreen.thread, 2, thread2_crash_screen, NULL, - (u8 *) gCrashScreen.stack + sizeof(gCrashScreen.stack), -#ifdef VERSION_EU - OS_PRIORITY_APPMAX -#else - OS_PRIORITY_RMON -#endif - ); - osStartThread(&gCrashScreen.thread); -} - -#endif diff --git a/src/game/debug.c b/src/game/debug.c index a39da004..66d808ed 100644 --- a/src/game/debug.c +++ b/src/game/debug.c @@ -392,7 +392,7 @@ static void try_change_debug_page(void) { * sDebugSysCursor. This is used to adjust enemy and effect behaviors * on the fly. (unused) */ -#ifndef VERSION_SH +#ifdef VERSION_SH static #endif void try_modify_debug_controls(void) { @@ -525,7 +525,7 @@ void try_do_mario_debug_object_spawn(void) { } // TODO: figure out what this is -#ifndef VERSION_SH +#ifdef VERSION_SH static #endif void debug_print_obj_move_flags(void) { diff --git a/src/game/display.h b/src/game/display.h new file mode 100644 index 00000000..43eeac3b --- /dev/null +++ b/src/game/display.h @@ -0,0 +1,25 @@ +#ifndef _DISPLAY_H +#define _DISPLAY_H + +#include "types.h" +#include "memory.h" + +extern u16 frameBufferIndex; +extern u32 gGlobalTimer; + +// extern ? my_rdp_init(?); +// extern ? my_rsp_init(?); +// extern ? clear_z_buffer(?); +// extern ? display_frame_buffer(?); +extern void clear_frame_buffer(s32); +extern void clear_viewport(Vp *, s32); +// extern ? draw_screen_borders(?); +void make_viewport_clip_rect(Vp *viewport); +extern void init_render_image(void); +extern void end_master_display_list(void); +extern void func_80247D84(void); +extern void func_80247ED8(void); +extern void func_80247FAC(void); +extern void display_and_vsync(void); + +#endif /* _DISPLAY_H */ diff --git a/src/game/envfx_bubbles.c b/src/game/envfx_bubbles.c index 3cffbfb1..16a92720 100644 --- a/src/game/envfx_bubbles.c +++ b/src/game/envfx_bubbles.c @@ -339,7 +339,7 @@ s32 envfx_init_bubble(s32 mode) { break; } - gEnvFxBuffer = (struct EnvFxParticle*) mem_pool_alloc(gEffectsMemoryPool, sBubbleParticleCount * sizeof(struct EnvFxParticle)); + gEnvFxBuffer = mem_pool_alloc(gEffectsMemoryPool, sBubbleParticleCount * sizeof(struct EnvFxParticle)); if (!gEnvFxBuffer) { return 0; } @@ -408,9 +408,10 @@ void envfx_bubbles_update_switch(s32 mode, Vec3s camTo, Vec3s vertex1, Vec3s ver * * TODO: (Scrub C) */ -void append_bubble_vertex_buffer(Gfx *gfx, s32 index, Vec3s vertex1, Vec3s vertex2, Vec3s vertex3, Vtx* template_) { +void append_bubble_vertex_buffer(Gfx *gfx, s32 index, Vec3s vertex1, Vec3s vertex2, Vec3s vertex3, + Vtx *template) { s32 i = 0; - Vtx *vertBuf = (Vtx*) alloc_display_list(15 * sizeof(Vtx)); + Vtx *vertBuf = alloc_display_list(15 * sizeof(Vtx)); #ifdef VERSION_EU Vtx *p; #endif @@ -420,7 +421,7 @@ void append_bubble_vertex_buffer(Gfx *gfx, s32 index, Vec3s vertex1, Vec3s verte } for (i = 0; i < 15; i += 3) { - vertBuf[i] = template_[0]; + vertBuf[i] = template[0]; #ifdef VERSION_EU p = vertBuf; p += i; @@ -433,7 +434,7 @@ void append_bubble_vertex_buffer(Gfx *gfx, s32 index, Vec3s vertex1, Vec3s verte vertBuf[i].v.ob[2] = gEnvFxBuffer[index + i / 3].zPos + vertex1[2]; #endif - vertBuf[i + 1] = template_[1]; + vertBuf[i + 1] = template[1]; #ifdef VERSION_EU p = vertBuf; p += i; @@ -446,7 +447,7 @@ void append_bubble_vertex_buffer(Gfx *gfx, s32 index, Vec3s vertex1, Vec3s verte vertBuf[i + 1].v.ob[2] = gEnvFxBuffer[index + i / 3].zPos + vertex2[2]; #endif - vertBuf[i + 2] = template_[2]; + vertBuf[i + 2] = template[2]; #ifdef VERSION_EU p = vertBuf; p += i; @@ -474,18 +475,18 @@ void envfx_set_bubble_texture(s32 mode, s16 index) { switch (mode) { case ENVFX_FLOWERS: - imageArr = (void**) segmented_to_virtual(&flower_bubbles_textures_ptr_0B002008); + imageArr = segmented_to_virtual(&flower_bubbles_textures_ptr_0B002008); frame = (gEnvFxBuffer + index)->animFrame; break; case ENVFX_LAVA_BUBBLES: - imageArr = (void**) segmented_to_virtual(&lava_bubble_ptr_0B006020); + imageArr = segmented_to_virtual(&lava_bubble_ptr_0B006020); frame = (gEnvFxBuffer + index)->animFrame; break; case ENVFX_WHIRLPOOL_BUBBLES: case ENVFX_JETSTREAM_BUBBLES: - imageArr = (void**) segmented_to_virtual(&bubble_ptr_0B006848); + imageArr = segmented_to_virtual(&bubble_ptr_0B006848); frame = 0; break; } @@ -508,7 +509,7 @@ Gfx *envfx_update_bubble_particles(s32 mode, UNUSED Vec3s marioPos, Vec3s camFro Gfx *gfxStart; - gfxStart = (Gfx*) alloc_display_list(((sBubbleParticleMaxCount / 5) * 10 + sBubbleParticleMaxCount + 3) + gfxStart = alloc_display_list(((sBubbleParticleMaxCount / 5) * 10 + sBubbleParticleMaxCount + 3) * sizeof(Gfx)); if (gfxStart == NULL) { return NULL; diff --git a/src/game/envfx_snow.c b/src/game/envfx_snow.c index 099ada65..c3c14a5c 100644 --- a/src/game/envfx_snow.c +++ b/src/game/envfx_snow.c @@ -79,7 +79,7 @@ s32 envfx_init_snow(s32 mode) { break; } - gEnvFxBuffer = (struct EnvFxParticle*) mem_pool_alloc(gEffectsMemoryPool, gSnowParticleMaxCount * sizeof(struct EnvFxParticle)); + gEnvFxBuffer = mem_pool_alloc(gEffectsMemoryPool, gSnowParticleMaxCount * sizeof(struct EnvFxParticle)); if (!gEnvFxBuffer) { return 0; } diff --git a/src/game/game_init.c b/src/game/game_init.c index 296e4b5e..c2df4510 100644 --- a/src/game/game_init.c +++ b/src/game/game_init.c @@ -4,6 +4,7 @@ #include "gfx_dimensions.h" #include "audio/external.h" #include "buffers/buffers.h" +#include "gfx_dimensions.h" #include "buffers/gfx_output_buffer.h" #include "buffers/framebuffers.h" #include "buffers/zbuffer.h" @@ -20,8 +21,9 @@ #include "segment_symbols.h" #include "thread6.h" #include - -#include "levels/scripts.h" +#ifdef BETTERCAMERA +#include "bettercamera.h" +#endif // FIXME: I'm not sure all of these variables belong in this file, but I don't // know of a good way to split them @@ -166,10 +168,8 @@ void clear_viewport(Vp *viewport, s32 color) { s16 vpLrx = (viewport->vp.vtrans[0] + viewport->vp.vscale[0]) / 4 - 2; s16 vpLry = (viewport->vp.vtrans[1] + viewport->vp.vscale[1]) / 4 - 2; -#ifdef WIDESCREEN vpUlx = GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(vpUlx); vpLrx = GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(SCREEN_WIDTH - vpLrx); -#endif gDPPipeSync(gDisplayListHead++); @@ -223,13 +223,7 @@ void create_task_structure(void) { gGfxSPTask->msgqueue = &D_80339CB8; gGfxSPTask->msg = (OSMesg) 2; gGfxSPTask->task.t.type = M_GFXTASK; -#if TARGET_N64 - gGfxSPTask->task.t.ucode_boot = rspF3DBootStart; - gGfxSPTask->task.t.ucode_boot_size = ((u8 *) rspF3DBootEnd - (u8 *) rspF3DBootStart); - gGfxSPTask->task.t.flags = 0; - gGfxSPTask->task.t.ucode = rspF3DStart; - gGfxSPTask->task.t.ucode_data = rspF3DDataStart; -#endif + gGfxSPTask->task.t.ucode_size = SP_UCODE_SIZE; // (this size is ignored) gGfxSPTask->task.t.ucode_data_size = SP_UCODE_DATA_SIZE; gGfxSPTask->task.t.dram_stack = (u64 *) gGfxSPTaskStack; @@ -265,33 +259,9 @@ void end_master_display_list(void) { create_task_structure(); } -void draw_reset_bars(void) { - s32 sp24; - s32 sp20; - s32 fbNum; - u64 *sp18; - - if (gResetTimer != 0 && D_8032C648 < 15) { - if (sCurrFBNum == 0) { - fbNum = 2; - } else { - fbNum = sCurrFBNum - 1; - } - - sp18 = (u64 *) PHYSICAL_TO_VIRTUAL(gPhysicalFrameBuffers[fbNum]); - sp18 += D_8032C648++ * (SCREEN_WIDTH / 4); - - for (sp24 = 0; sp24 < ((SCREEN_HEIGHT / 16) + 1); sp24++) { - // Must be on one line to match -O2 - for (sp20 = 0; sp20 < (SCREEN_WIDTH / 4); sp20++) *sp18++ = 0; - sp18 += ((SCREEN_WIDTH / 4) * 14); - } - } - - osWritebackDCacheAll(); - osRecvMesg(&gGameVblankQueue, &D_80339BEC, OS_MESG_BLOCK); - osRecvMesg(&gGameVblankQueue, &D_80339BEC, OS_MESG_BLOCK); -} +//void draw_reset_bars(void) { // TARGET_64 only +// Stubbed. Only N64 target uses this +// } void rendering_init(void) { gGfxPool = &gGfxPools[0]; @@ -485,9 +455,6 @@ void read_controller_inputs(void) { if (gControllerBits) { osRecvMesg(&gSIEventMesgQueue, &D_80339BEC, OS_MESG_BLOCK); osContGetReadData(&gControllerPads[0]); -#ifdef VERSION_SH - release_rumble_pak_control(); -#endif } run_demo_inputs(); @@ -499,15 +466,19 @@ void read_controller_inputs(void) { if (controller->controllerData != NULL) { controller->rawStickX = controller->controllerData->stick_x; controller->rawStickY = controller->controllerData->stick_y; + controller->extStickX = controller->controllerData->ext_stick_x; + controller->extStickY = controller->controllerData->ext_stick_y; controller->buttonPressed = controller->controllerData->button & (controller->controllerData->button ^ controller->buttonDown); // 0.5x A presses are a good meme controller->buttonDown = controller->controllerData->button; adjust_analog_stick(controller); - } else // otherwise, if the controllerData is NULL, 0 out all of the inputs. - { + } else { + // otherwise, if the controllerData is NULL, 0 out all of the inputs. controller->rawStickX = 0; controller->rawStickY = 0; + controller->extStickX = 0; + controller->extStickY = 0; controller->buttonPressed = 0; controller->buttonDown = 0; controller->stickX = 0; @@ -554,13 +525,16 @@ void init_controllers(void) { // into any port in order to play the game. this was probably // so if any of the ports didn't work, you can have controllers // plugged into any of them and it will work. -#ifdef VERSION_SH gControllers[cont].port = port; -#endif gControllers[cont].statusData = &gControllerStatuses[port]; gControllers[cont++].controllerData = &gControllerPads[port]; } } + +#ifdef BETTERCAMERA + // load bettercam settings from the config file + newcam_init_settings(); +#endif } void setup_game_memory(void) { @@ -575,89 +549,58 @@ void setup_game_memory(void) { gPhysicalFrameBuffers[2] = VIRTUAL_TO_PHYSICAL(gFrameBuffer2); D_80339CF0 = main_pool_alloc(0x4000, MEMORY_POOL_LEFT); set_segment_base_addr(17, (void *) D_80339CF0); - func_80278A78(&D_80339D10, gMarioAnims, (struct Animation*) D_80339CF0); + func_80278A78(&D_80339D10, gMarioAnims, D_80339CF0); D_80339CF4 = main_pool_alloc(2048, MEMORY_POOL_LEFT); set_segment_base_addr(24, (void *) D_80339CF4); - func_80278A78(&gDemo, gDemoInputs, (struct Animation*) D_80339CF4); + func_80278A78(&gDemo, gDemoInputs, D_80339CF4); load_segment(0x10, _entrySegmentRomStart, _entrySegmentRomEnd, MEMORY_POOL_LEFT); load_segment_decompress(2, _segment2_mio0SegmentRomStart, _segment2_mio0SegmentRomEnd); - - // TODO: Move this somewhere else? - get_level_main_scripts_entry(); } -#ifndef TARGET_N64 + static struct LevelCommand *levelCommandAddr; -#endif // main game loop thread. runs forever as long as the game // continues. void thread5_game_loop(UNUSED void *arg) { -#ifdef TARGET_N64 - struct LevelCommand *levelCommandAddr; -#endif setup_game_memory(); -#ifdef VERSION_SH init_rumble_pak_scheduler_queue(); -#endif init_controllers(); -#ifdef VERSION_SH create_thread_6(); -#endif save_file_load_all(); - set_vblank_handler(2, &gGameVblankHandler, &gGameVblankQueue, (void**) (OSMesg) 1); + set_vblank_handler(2, &gGameVblankHandler, &gGameVblankQueue, (OSMesg) 1); // point levelCommandAddr to the entry point into the level script data. - levelCommandAddr = (struct LevelCommand*) segmented_to_virtual(get_level_script_entry()); + levelCommandAddr = segmented_to_virtual(level_script_entry); play_music(SEQ_PLAYER_SFX, SEQUENCE_ARGS(0, SEQ_SOUND_PLAYER), 0); set_sound_mode(save_file_get_sound_mode()); -#ifdef TARGET_N64 - rendering_init(); - - while (1) { -#else gGlobalTimer++; } void game_loop_one_iteration(void) { -#endif - // if the reset timer is active, run the process to reset the game. - if (gResetTimer) { - draw_reset_bars(); -#ifdef TARGET_N64 - continue; -#else - return; -#endif - } - profiler_log_thread5_time(THREAD5_START); + profiler_log_thread5_time(THREAD5_START); - // if any controllers are plugged in, start read the data for when - // read_controller_inputs is called later. - if (gControllerBits) { -#ifdef VERSION_SH - block_until_rumble_pak_free(); -#endif - osContStartReadData(&gSIEventMesgQueue); - } - - audio_game_loop_tick(); - config_gfx_pool(); - read_controller_inputs(); - levelCommandAddr = level_script_execute(levelCommandAddr); - display_and_vsync(); - - // when debug info is enabled, print the "BUF %d" information. - if (gShowDebugText) { - // subtract the end of the gfx pool with the display list to obtain the - // amount of free space remaining. - print_text_fmt_int(180, 20, "BUF %d", gGfxPoolEnd - (u8 *) gDisplayListHead); - } -#ifdef TARGET_N64 + // if any controllers are plugged in, start read the data for when + // read_controller_inputs is called later. + if (gControllerBits) { + // block_until_rumble_pak_free(); + osContStartReadData(&gSIEventMesgQueue); + } + + audio_game_loop_tick(); + config_gfx_pool(); + read_controller_inputs(); + levelCommandAddr = level_script_execute(levelCommandAddr); + display_and_vsync(); + + // when debug info is enabled, print the "BUF %d" information. + if (gShowDebugText) { + // subtract the end of the gfx pool with the display list to obtain the + // amount of free space remaining. + print_text_fmt_int(180, 20, "BUF %d", gGfxPoolEnd - (u8 *) gDisplayListHead); } -#endif } diff --git a/src/game/game_init.h b/src/game/game_init.h index a5780d80..2dd25d1c 100644 --- a/src/game/game_init.h +++ b/src/game/game_init.h @@ -9,8 +9,6 @@ #include "types.h" #include "memory.h" -#define GFX_POOL_SIZE 6400 - struct GfxPool { Gfx buffer[GFX_POOL_SIZE]; struct SPTask spTask; @@ -56,7 +54,7 @@ extern struct DemoInput gRecordedDemoInput; extern struct MarioAnimation D_80339D10; extern struct MarioAnimation gDemo; -extern u8* gMarioAnims; +extern u8 gMarioAnims[]; extern u8 gDemoInputs[]; extern u16 frameBufferIndex; diff --git a/src/game/geo_misc.c b/src/game/geo_misc.c index cfcc55b3..72dd0bf0 100644 --- a/src/game/geo_misc.c +++ b/src/game/geo_misc.c @@ -42,11 +42,7 @@ s8 gFlyingCarpetState; * * Texture coordinates are s10.5 fixed-point, which means you should left-shift the actual coordinates by 5. */ -#ifndef GBI_FLOATS -void make_vertex(Vtx *vtx, s32 n, s16 x, s16 y, s16 z, s16 tx, s16 ty, u8 r, u8 g, u8 b, u8 a) { -#else void make_vertex(Vtx *vtx, s32 n, f32 x, f32 y, f32 z, s16 tx, s16 ty, u8 r, u8 g, u8 b, u8 a) { -#endif vtx[n].v.ob[0] = x; vtx[n].v.ob[1] = y; vtx[n].v.ob[2] = z; @@ -87,7 +83,7 @@ Gfx *geo_exec_inside_castle_light(s32 callContext, struct GraphNode *node, UNUSE if (callContext == GEO_CONTEXT_RENDER) { flags = save_file_get_flags(); if (gHudDisplay.stars >= 10 && (flags & SAVE_FLAG_HAVE_WING_CAP) == 0) { - displayList = (Gfx*) alloc_display_list(2 * sizeof(*displayList)); + displayList = alloc_display_list(2 * sizeof(*displayList)); if (displayList == NULL) { return NULL; @@ -135,14 +131,14 @@ Gfx *geo_exec_flying_carpet_create(s32 callContext, struct GraphNode *node, UNUS Vtx *verts; struct GraphNodeGenerated *generatedNode = (struct GraphNodeGenerated *) node; - s16 *sp64 = (s16*) segmented_to_virtual(&flying_carpet_static_vertex_data); + s16 *sp64 = segmented_to_virtual(&flying_carpet_static_vertex_data); Gfx *displayList = NULL; Gfx *displayListHead = NULL; struct Object *curGraphNodeObject; if (callContext == GEO_CONTEXT_RENDER) { - verts = (Vtx*) alloc_display_list(NUM_FLYING_CARPET_VERTICES * sizeof(*verts)); - displayList = (Gfx*) alloc_display_list(7 * sizeof(*displayList)); + verts = alloc_display_list(NUM_FLYING_CARPET_VERTICES * sizeof(*verts)); + displayList = alloc_display_list(7 * sizeof(*displayList)); displayListHead = displayList; if (verts == NULL || displayList == NULL) { @@ -199,7 +195,7 @@ Gfx *geo_exec_cake_end_screen(s32 callContext, struct GraphNode *node, UNUSED f3 Gfx *displayListHead = NULL; if (callContext == GEO_CONTEXT_RENDER) { - displayList = (Gfx*) alloc_display_list(3 * sizeof(*displayList)); + displayList = alloc_display_list(3 * sizeof(*displayList)); displayListHead = displayList; generatedNode->fnNode.node.flags = (generatedNode->fnNode.node.flags & 0xFF) | 0x100; diff --git a/src/game/geo_misc.h b/src/game/geo_misc.h index 904633af..31fa879e 100644 --- a/src/game/geo_misc.h +++ b/src/game/geo_misc.h @@ -13,15 +13,9 @@ enum FlyingCarpetState extern s8 gFlyingCarpetState; -#ifndef GBI_FLOATS -extern void make_vertex( - Vtx *vtx, s32 n, s16 x, s16 y, s16 z, s16 tx, s16 ty, u8 r, u8 g, u8 b, u8 a -); -#else extern void make_vertex( Vtx *vtx, s32 n, f32 x, f32 y, f32 z, s16 tx, s16 ty, u8 r, u8 g, u8 b, u8 a ); -#endif extern s16 round_float(f32); extern Gfx *geo_exec_inside_castle_light(s32 callContext, struct GraphNode *node, UNUSED f32 mtx[4][4]); extern Gfx *geo_exec_flying_carpet_timer_update(s32 callContext, struct GraphNode *node, UNUSED f32 mtx[4][4]); diff --git a/src/game/hud.c b/src/game/hud.c index c1b5efc4..1540b675 100644 --- a/src/game/hud.c +++ b/src/game/hud.c @@ -1,3 +1,4 @@ +#include #include #include "sm64.h" @@ -11,9 +12,9 @@ #include "hud.h" #include "segment2.h" #include "area.h" -#include "common/service_locator.hpp" #include "save_file.h" #include "print.h" +#include "pc/configfile.h" /* @file hud.c * This file implements HUD rendering and power meter animations. @@ -22,20 +23,20 @@ **/ struct PowerMeterHUD { - s8 animation; - s16 x; - s16 y; - f32 unused; + s8 animation; + s16 x; + s16 y; + f32 unused; }; struct UnusedHUDStruct { - u32 unused1; - u16 unused2; - u16 unused3; + u32 unused1; + u16 unused2; + u16 unused3; }; struct CameraHUD { - s16 status; + s16 status; }; // Stores health segmented value defined by numHealthWedges @@ -43,10 +44,10 @@ struct CameraHUD { static s16 sPowerMeterStoredHealth; static struct PowerMeterHUD sPowerMeterHUD = { - POWER_METER_HIDDEN, - 140, - 166, - 1.0, + POWER_METER_HIDDEN, + 140, + 166, + 1.0, }; // Power Meter timer that keeps counting when it's visible. @@ -54,65 +55,54 @@ static struct PowerMeterHUD sPowerMeterHUD = { // when the power meter is hidden. s32 sPowerMeterVisibleTimer = 0; -static struct UnusedHUDStruct sUnusedHUDValues = {0x00, 0x0A, 0x00}; +static struct UnusedHUDStruct sUnusedHUDValues = { 0x00, 0x0A, 0x00 }; -static struct CameraHUD sCameraHUD = {CAM_STATUS_NONE}; +static struct CameraHUD sCameraHUD = { CAM_STATUS_NONE }; /** * Renders a rgba16 16x16 glyph texture from a table list. */ -void render_hud_tex_lut(s32 x, s32 y, u8* texture) { - gDPPipeSync(gDisplayListHead++); - gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, - texture); - gSPDisplayList(gDisplayListHead++, &dl_hud_img_load_tex_block); - gSPTextureRectangle(gDisplayListHead++, x << 2, y << 2, (x + 15) << 2, - (y + 15) << 2, - G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10); +void render_hud_tex_lut(s32 x, s32 y, u8 *texture) { + gDPPipeSync(gDisplayListHead++); + gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, texture); + gSPDisplayList(gDisplayListHead++, &dl_hud_img_load_tex_block); + gSPTextureRectangle(gDisplayListHead++, x << 2, y << 2, (x + 15) << 2, (y + 15) << 2, + G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10); } /** * Renders a rgba16 8x8 glyph texture from a table list. */ -void render_hud_small_tex_lut(s32 x, s32 y, u8* texture) { - gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, - G_TX_LOADTILE, 0, - G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, - G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD); - gDPTileSync(gDisplayListHead++); - gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, - G_TX_RENDERTILE, 0, - G_TX_CLAMP, 3, G_TX_NOLOD, G_TX_CLAMP, 3, G_TX_NOLOD); - gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, - (8 - 1) << G_TEXTURE_IMAGE_FRAC, - (8 - 1) << G_TEXTURE_IMAGE_FRAC); - gDPPipeSync(gDisplayListHead++); - gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, - texture); - gDPLoadSync(gDisplayListHead++); - gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 8 * 8 - 1, - CALC_DXT(8, G_IM_SIZ_16b_BYTES)); - gSPTextureRectangle(gDisplayListHead++, x << 2, y << 2, (x + 7) << 2, - (y + 7) << 2, G_TX_RENDERTILE, - 0, 0, 4 << 10, 1 << 10); +void render_hud_small_tex_lut(s32 x, s32 y, u8 *texture) { + gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, + G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD); + gDPTileSync(gDisplayListHead++); + gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, G_TX_RENDERTILE, 0, + G_TX_CLAMP, 3, G_TX_NOLOD, G_TX_CLAMP, 3, G_TX_NOLOD); + gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, (8 - 1) << G_TEXTURE_IMAGE_FRAC, (8 - 1) << G_TEXTURE_IMAGE_FRAC); + gDPPipeSync(gDisplayListHead++); + gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, texture); + gDPLoadSync(gDisplayListHead++); + gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 8 * 8 - 1, CALC_DXT(8, G_IM_SIZ_16b_BYTES)); + gSPTextureRectangle(gDisplayListHead++, x << 2, y << 2, (x + 7) << 2, (y + 7) << 2, G_TX_RENDERTILE, + 0, 0, 4 << 10, 1 << 10); } /** * Renders power meter health segment texture using a table list. */ void render_power_meter_health_segment(s16 numHealthWedges) { - u8*(*healthLUT)[]; + u8 *(*healthLUT)[]; - healthLUT = (u8*(*)[])segmented_to_virtual(&power_meter_health_segments_lut); + healthLUT = segmented_to_virtual(&power_meter_health_segments_lut); - gDPPipeSync(gDisplayListHead++); - gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, - (*healthLUT)[numHealthWedges - 1]); - gDPLoadSync(gDisplayListHead++); - gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 32 * 32 - 1, - CALC_DXT(32, G_IM_SIZ_16b_BYTES)); - gSP1Triangle(gDisplayListHead++, 0, 1, 2, 0); - gSP1Triangle(gDisplayListHead++, 0, 2, 3, 0); + gDPPipeSync(gDisplayListHead++); + gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, + (*healthLUT)[numHealthWedges - 1]); + gDPLoadSync(gDisplayListHead++); + gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)); + gSP1Triangle(gDisplayListHead++, 0, 1, 2, 0); + gSP1Triangle(gDisplayListHead++, 0, 2, 3, 0); } /** @@ -120,25 +110,27 @@ void render_power_meter_health_segment(s16 numHealthWedges) { * That includes the "POWER" base and the colored health segment textures. */ void render_dl_power_meter(s16 numHealthWedges) { - Mtx* mtx; + Mtx *mtx; - mtx = (Mtx*)alloc_display_list(sizeof(Mtx)); + mtx = alloc_display_list(sizeof(Mtx)); - if (mtx == NULL) { return; } + if (mtx == NULL) { + return; + } - guTranslate(mtx, (f32)sPowerMeterHUD.x, (f32)sPowerMeterHUD.y, 0); + guTranslate(mtx, (f32) sPowerMeterHUD.x, (f32) sPowerMeterHUD.y, 0); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx++), - G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH); - gSPDisplayList(gDisplayListHead++, &dl_power_meter_base); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx++), + G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH); + gSPDisplayList(gDisplayListHead++, &dl_power_meter_base); - if (numHealthWedges != 0) { - gSPDisplayList(gDisplayListHead++, &dl_power_meter_health_segments_begin); - render_power_meter_health_segment(numHealthWedges); - gSPDisplayList(gDisplayListHead++, &dl_power_meter_health_segments_end); - } + if (numHealthWedges != 0) { + gSPDisplayList(gDisplayListHead++, &dl_power_meter_health_segments_begin); + render_power_meter_health_segment(numHealthWedges); + gSPDisplayList(gDisplayListHead++, &dl_power_meter_health_segments_end); + } - gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); + gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); } /** @@ -146,15 +138,16 @@ void render_dl_power_meter(s16 numHealthWedges) { * Checks its timer to later change into deemphasizing mode. */ void animate_power_meter_emphasized(void) { - s16 hudDisplayFlags; - hudDisplayFlags = gHudDisplay.flags; + s16 hudDisplayFlags; + hudDisplayFlags = gHudDisplay.flags; - if (!(hudDisplayFlags & HUD_DISPLAY_FLAG_EMPHASIZE_POWER)) { - if (sPowerMeterVisibleTimer == 45.0) { - sPowerMeterHUD.animation = POWER_METER_DEEMPHASIZING; + if (!(hudDisplayFlags & HUD_DISPLAY_FLAG_EMPHASIZE_POWER)) { + if (sPowerMeterVisibleTimer == 45.0) { + sPowerMeterHUD.animation = POWER_METER_DEEMPHASIZING; + } + } else { + sPowerMeterVisibleTimer = 0; } - } - else { sPowerMeterVisibleTimer = 0; } } /** @@ -162,20 +155,26 @@ void animate_power_meter_emphasized(void) { * Moves power meter y pos speed until it's at 200 to be visible. */ static void animate_power_meter_deemphasizing(void) { - s16 speed = 5; + s16 speed = 5; - if (sPowerMeterHUD.y >= 181) { speed = 3; } + if (sPowerMeterHUD.y >= 181) { + speed = 3; + } - if (sPowerMeterHUD.y >= 191) { speed = 2; } + if (sPowerMeterHUD.y >= 191) { + speed = 2; + } - if (sPowerMeterHUD.y >= 196) { speed = 1; } + if (sPowerMeterHUD.y >= 196) { + speed = 1; + } - sPowerMeterHUD.y += speed; + sPowerMeterHUD.y += speed; - if (sPowerMeterHUD.y >= 201) { - sPowerMeterHUD.y = 200; - sPowerMeterHUD.animation = POWER_METER_VISIBLE; - } + if (sPowerMeterHUD.y >= 201) { + sPowerMeterHUD.y = 200; + sPowerMeterHUD.animation = POWER_METER_VISIBLE; + } } /** @@ -183,46 +182,45 @@ static void animate_power_meter_deemphasizing(void) { * Moves power meter y pos quickly until it's at 301 to be hidden. */ static void animate_power_meter_hiding(void) { - sPowerMeterHUD.y += 20; - if (sPowerMeterHUD.y >= 301) { - sPowerMeterHUD.animation = POWER_METER_HIDDEN; - sPowerMeterVisibleTimer = 0; - } + sPowerMeterHUD.y += 20; + if (sPowerMeterHUD.y >= 301) { + sPowerMeterHUD.animation = POWER_METER_HIDDEN; + sPowerMeterVisibleTimer = 0; + } } /** * Handles power meter actions depending of the health segments values. */ void handle_power_meter_actions(s16 numHealthWedges) { - // Show power meter if health is not full, less than 8 - if (numHealthWedges < 8 && sPowerMeterStoredHealth == 8 && sPowerMeterHUD. - animation == POWER_METER_HIDDEN) { - sPowerMeterHUD.animation = POWER_METER_EMPHASIZED; - sPowerMeterHUD.y = 166; - } - - // Show power meter if health is full, has 8 - if (numHealthWedges == 8 && sPowerMeterStoredHealth == 7) { - sPowerMeterVisibleTimer = 0; - } - - // After health is full, hide power meter - if (numHealthWedges == 8 && sPowerMeterVisibleTimer > 45.0) { - sPowerMeterHUD.animation = POWER_METER_HIDING; - } - - // Update to match health value - sPowerMeterStoredHealth = numHealthWedges; - - // If Mario is swimming, keep power meter visible - if (gPlayerCameraState->action & ACT_FLAG_SWIMMING) { - if (sPowerMeterHUD.animation == POWER_METER_HIDDEN - || sPowerMeterHUD.animation == POWER_METER_EMPHASIZED) { - sPowerMeterHUD.animation = POWER_METER_DEEMPHASIZING; - sPowerMeterHUD.y = 166; + // Show power meter if health is not full, less than 8 + if (numHealthWedges < 8 && sPowerMeterStoredHealth == 8 && sPowerMeterHUD.animation == POWER_METER_HIDDEN) { + sPowerMeterHUD.animation = POWER_METER_EMPHASIZED; + sPowerMeterHUD.y = 166; + } + + // Show power meter if health is full, has 8 + if (numHealthWedges == 8 && sPowerMeterStoredHealth == 7) { + sPowerMeterVisibleTimer = 0; + } + + // After health is full, hide power meter + if (numHealthWedges == 8 && sPowerMeterVisibleTimer > 45.0) { + sPowerMeterHUD.animation = POWER_METER_HIDING; + } + + // Update to match health value + sPowerMeterStoredHealth = numHealthWedges; + + // If Mario is swimming, keep power meter visible + if (gPlayerCameraState->action & ACT_FLAG_SWIMMING) { + if (sPowerMeterHUD.animation == POWER_METER_HIDDEN + || sPowerMeterHUD.animation == POWER_METER_EMPHASIZED) { + sPowerMeterHUD.animation = POWER_METER_DEEMPHASIZING; + sPowerMeterHUD.y = 166; + } + sPowerMeterVisibleTimer = 0; } - sPowerMeterVisibleTimer = 0; - } } /** @@ -231,31 +229,33 @@ void handle_power_meter_actions(s16 numHealthWedges) { * And calls a power meter animation function depending of the value defined. */ void render_hud_power_meter(void) { - s16 shownHealthWedges = gHudDisplay.wedges; + s16 shownHealthWedges = gHudDisplay.wedges; - if (sPowerMeterHUD.animation != POWER_METER_HIDING) { - handle_power_meter_actions(shownHealthWedges); - } + if (sPowerMeterHUD.animation != POWER_METER_HIDING) { + handle_power_meter_actions(shownHealthWedges); + } - if (sPowerMeterHUD.animation == POWER_METER_HIDDEN) { return; } + if (sPowerMeterHUD.animation == POWER_METER_HIDDEN) { + return; + } - switch (sPowerMeterHUD.animation) { - case POWER_METER_EMPHASIZED: - animate_power_meter_emphasized(); - break; - case POWER_METER_DEEMPHASIZING: - animate_power_meter_deemphasizing(); - break; - case POWER_METER_HIDING: - animate_power_meter_hiding(); - break; - default: - break; - } + switch (sPowerMeterHUD.animation) { + case POWER_METER_EMPHASIZED: + animate_power_meter_emphasized(); + break; + case POWER_METER_DEEMPHASIZING: + animate_power_meter_deemphasizing(); + break; + case POWER_METER_HIDING: + animate_power_meter_hiding(); + break; + default: + break; + } - render_dl_power_meter(shownHealthWedges); + render_dl_power_meter(shownHealthWedges); - sPowerMeterVisibleTimer += 1; + sPowerMeterVisibleTimer += 1; } #ifdef VERSION_JP @@ -268,32 +268,18 @@ void render_hud_power_meter(void) { * Renders the amount of lives Mario has. */ void render_hud_mario_lives(void) { - auto& text_renderer = ServiceLocator::get_text_renderer(); - text_renderer.render() - ->scheduled() - ->glyph_at( - GLYPH_MARIO_HEAD, GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(22), - 224 - HUD_TOP_Y) - ->glyph_at( - GLYPH_MULTIPLY, GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(38), - 224 - HUD_TOP_Y); - //print_text(GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(22), HUD_TOP_Y, ","); // 'Mario Head' glyph - //print_text(GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(38), HUD_TOP_Y, "*"); // 'X' glyph - print_text_fmt_int(GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(54), HUD_TOP_Y, "%d", gHudDisplay.lives); + print_text(GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(22), HUD_TOP_Y, ","); // 'Mario Head' glyph + print_text(GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(38), HUD_TOP_Y, "*"); // 'X' glyph + print_text_fmt_int(GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(54), HUD_TOP_Y, "%d", gHudDisplay.lives); } /** * Renders the amount of coins collected. */ void render_hud_coins(void) { - auto& text_renderer = ServiceLocator::get_text_renderer(); - text_renderer.render() - ->scheduled() - ->glyph_at(GLYPH_COIN, 168, 224 - HUD_TOP_Y); - - // print_text(168, HUD_TOP_Y, "+"); // 'Coin' glyph - print_text(184, HUD_TOP_Y, "*"); // 'X' glyph - print_text_fmt_int(198, HUD_TOP_Y, "%d", gHudDisplay.coins); + print_text(168, HUD_TOP_Y, "+"); // 'Coin' glyph + print_text(184, HUD_TOP_Y, "*"); // 'X' glyph + print_text_fmt_int(198, HUD_TOP_Y, "%d", gHudDisplay.coins); } #ifdef VERSION_JP @@ -307,28 +293,22 @@ void render_hud_coins(void) { * Disables "X" glyph when Mario has 100 stars or more. */ void render_hud_stars(void) { - s8 showX = 0; + s8 showX = 0; - if (gHudFlash == 1 && gGlobalTimer & 0x08) { return; } + if (gHudFlash == 1 && gGlobalTimer & 0x08) { + return; + } - if (gHudDisplay.stars < 100) { showX = 1; } + if (gHudDisplay.stars < 100) { + showX = 1; + } - auto& text_renderer = ServiceLocator::get_text_renderer(); - text_renderer.render() - ->scheduled() - ->glyph_at( - GLYPH_STAR, GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(HUD_STARS_X), - 224 - HUD_TOP_Y); - - //print_text(GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(HUD_STARS_X), HUD_TOP_Y, "-"); // 'Star' glyph - if (showX == 1) { - print_text( - GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(HUD_STARS_X) + 16, HUD_TOP_Y, "*"); - // 'X' glyph - } - print_text_fmt_int( - (showX * 14) + GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(HUD_STARS_X - 16), - HUD_TOP_Y, "%d", gHudDisplay.stars); + print_text(GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(HUD_STARS_X), HUD_TOP_Y, "-"); // 'Star' glyph + if (showX == 1) { + print_text(GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(HUD_STARS_X) + 16, HUD_TOP_Y, "*"); // 'X' glyph + } + print_text_fmt_int((showX * 14) + GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(HUD_STARS_X - 16), + HUD_TOP_Y, "%d", gHudDisplay.stars); } /** @@ -336,25 +316,25 @@ void render_hud_stars(void) { * Leftover function from the beta version of the game. */ void render_hud_keys(void) { - s16 i; + s16 i; - for (i = 0; i < gHudDisplay.keys; i++) { - print_text((i * 16) + 220, 142, "/"); // unused glyph - beta key - } + for (i = 0; i < gHudDisplay.keys; i++) { + print_text((i * 16) + 220, 142, "/"); // unused glyph - beta key + } } /** * Renders the timer when Mario start sliding in PSS. */ void render_hud_timer(void) { - u8*(*hudLUT)[58]; - u16 timerValFrames; - u16 timerMins; - u16 timerSecs; - u16 timerFracSecs; + u8 *(*hudLUT)[58]; + u16 timerValFrames; + u16 timerMins; + u16 timerSecs; + u16 timerFracSecs; - hudLUT = (u8*(*)[58])segmented_to_virtual(&main_hud_lut); - timerValFrames = gHudDisplay.timer; + hudLUT = segmented_to_virtual(&main_hud_lut); + timerValFrames = gHudDisplay.timer; #ifdef VERSION_EU switch (eu_get_language()) { case LANGUAGE_ENGLISH: @@ -368,75 +348,72 @@ void render_hud_timer(void) { break; } #endif - timerMins = timerValFrames / (30 * 60); - timerSecs = (timerValFrames - (timerMins * 1800)) / 30; + timerMins = timerValFrames / (30 * 60); + timerSecs = (timerValFrames - (timerMins * 1800)) / 30; - timerFracSecs = ((timerValFrames - (timerMins * 1800) - (timerSecs * 30)) & - 0xFFFF) / 3; + timerFracSecs = ((timerValFrames - (timerMins * 1800) - (timerSecs * 30)) & 0xFFFF) / 3; #ifndef VERSION_EU - print_text(GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(150), 185, "TIME"); + print_text(GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(150), 185, "TIME"); #endif - print_text_fmt_int( - GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(91), 185, "%0d", timerMins); - print_text_fmt_int( - GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(71), 185, "%02d", timerSecs); - print_text_fmt_int( - GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(37), 185, "%d", timerFracSecs); - gSPDisplayList(gDisplayListHead++, dl_hud_img_begin); - render_hud_tex_lut( - GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(81), 32, (*hudLUT)[GLYPH_APOSTROPHE]); - render_hud_tex_lut( - GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(46), 32, (*hudLUT)[GLYPH_DOUBLE_QUOTE]); - gSPDisplayList(gDisplayListHead++, dl_hud_img_end); + print_text_fmt_int(GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(91), 185, "%0d", timerMins); + print_text_fmt_int(GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(71), 185, "%02d", timerSecs); + print_text_fmt_int(GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(37), 185, "%d", timerFracSecs); + gSPDisplayList(gDisplayListHead++, dl_hud_img_begin); + render_hud_tex_lut(GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(81), 32, (*hudLUT)[GLYPH_APOSTROPHE]); + render_hud_tex_lut(GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(46), 32, (*hudLUT)[GLYPH_DOUBLE_QUOTE]); + gSPDisplayList(gDisplayListHead++, dl_hud_img_end); } /** * Sets HUD status camera value depending of the actions * defined in update_camera_status. */ -void set_hud_camera_status(s16 status) { sCameraHUD.status = status; } +void set_hud_camera_status(s16 status) { + sCameraHUD.status = status; +} /** * Renders camera HUD glyphs using a table list, depending of * the camera status called, a defined glyph is rendered. */ void render_hud_camera_status(void) { - u8*(*cameraLUT)[6]; - s32 x; - s32 y; + u8 *(*cameraLUT)[6]; + s32 x; + s32 y; - cameraLUT = (u8*(*)[6])segmented_to_virtual(&main_hud_camera_lut); - x = GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(54); - y = 205; + cameraLUT = segmented_to_virtual(&main_hud_camera_lut); + x = GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(54); + y = 205; - if (sCameraHUD.status == CAM_STATUS_NONE) { return; } + if (sCameraHUD.status == CAM_STATUS_NONE) { + return; + } - gSPDisplayList(gDisplayListHead++, dl_hud_img_begin); - render_hud_tex_lut(x, y, (*cameraLUT)[GLYPH_CAM_CAMERA]); + gSPDisplayList(gDisplayListHead++, dl_hud_img_begin); + render_hud_tex_lut(x, y, (*cameraLUT)[GLYPH_CAM_CAMERA]); - switch (sCameraHUD.status & CAM_STATUS_MODE_GROUP) { - case CAM_STATUS_MARIO: - render_hud_tex_lut(x + 16, y, (*cameraLUT)[GLYPH_CAM_MARIO_HEAD]); - break; - case CAM_STATUS_LAKITU: - render_hud_tex_lut(x + 16, y, (*cameraLUT)[GLYPH_CAM_LAKITU_HEAD]); - break; - case CAM_STATUS_FIXED: - render_hud_tex_lut(x + 16, y, (*cameraLUT)[GLYPH_CAM_FIXED]); - break; - } + switch (sCameraHUD.status & CAM_STATUS_MODE_GROUP) { + case CAM_STATUS_MARIO: + render_hud_tex_lut(x + 16, y, (*cameraLUT)[GLYPH_CAM_MARIO_HEAD]); + break; + case CAM_STATUS_LAKITU: + render_hud_tex_lut(x + 16, y, (*cameraLUT)[GLYPH_CAM_LAKITU_HEAD]); + break; + case CAM_STATUS_FIXED: + render_hud_tex_lut(x + 16, y, (*cameraLUT)[GLYPH_CAM_FIXED]); + break; + } - switch (sCameraHUD.status & CAM_STATUS_C_MODE_GROUP) { - case CAM_STATUS_C_DOWN: - render_hud_small_tex_lut(x + 4, y + 16, - (*cameraLUT)[GLYPH_CAM_ARROW_DOWN]); - break; - case CAM_STATUS_C_UP: - render_hud_small_tex_lut(x + 4, y - 8, (*cameraLUT)[GLYPH_CAM_ARROW_UP]); - break; - } + switch (sCameraHUD.status & CAM_STATUS_C_MODE_GROUP) { + case CAM_STATUS_C_DOWN: + render_hud_small_tex_lut(x + 4, y + 16, (*cameraLUT)[GLYPH_CAM_ARROW_DOWN]); + break; + case CAM_STATUS_C_UP: + render_hud_small_tex_lut(x + 4, y - 8, (*cameraLUT)[GLYPH_CAM_ARROW_UP]); + break; + } - gSPDisplayList(gDisplayListHead++, dl_hud_img_end); + gSPDisplayList(gDisplayListHead++, dl_hud_img_end); } /** @@ -444,19 +421,18 @@ void render_hud_camera_status(void) { * excluding the cannon reticle which detects a camera preset for it. */ void render_hud(void) { - s16 hudDisplayFlags; + s16 hudDisplayFlags; #ifdef VERSION_EU Mtx *mtx; #endif - hudDisplayFlags = gHudDisplay.flags; + hudDisplayFlags = gHudDisplay.flags; - if (hudDisplayFlags == HUD_DISPLAY_NONE) { - sPowerMeterHUD.animation = POWER_METER_HIDDEN; - sPowerMeterStoredHealth = 8; - sPowerMeterVisibleTimer = 0; - } - else { + if (hudDisplayFlags == HUD_DISPLAY_NONE) { + sPowerMeterHUD.animation = POWER_METER_HIDDEN; + sPowerMeterStoredHealth = 8; + sPowerMeterVisibleTimer = 0; + } else { #ifdef VERSION_EU // basically create_dl_ortho_matrix but guOrtho screen width is different @@ -470,25 +446,36 @@ void render_hud(void) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx), G_MTX_PROJECTION | G_MTX_MUL | G_MTX_NOPUSH); #else - create_dl_ortho_matrix(); + create_dl_ortho_matrix(); #endif - if (gCurrentArea != NULL && gCurrentArea->camera->mode == - CAMERA_MODE_INSIDE_CANNON) { render_hud_cannon_reticle(); } + if (gCurrentArea != NULL && gCurrentArea->camera->mode == CAMERA_MODE_INSIDE_CANNON) { + render_hud_cannon_reticle(); + } - if (hudDisplayFlags & HUD_DISPLAY_FLAG_LIVES) { render_hud_mario_lives(); } + if (hudDisplayFlags & HUD_DISPLAY_FLAG_LIVES && configHUD) { + render_hud_mario_lives(); + } - if (hudDisplayFlags & HUD_DISPLAY_FLAG_COIN_COUNT) { render_hud_coins(); } + if (hudDisplayFlags & HUD_DISPLAY_FLAG_COIN_COUNT && configHUD) { + render_hud_coins(); + } - if (hudDisplayFlags & HUD_DISPLAY_FLAG_STAR_COUNT) { render_hud_stars(); } + if (hudDisplayFlags & HUD_DISPLAY_FLAG_STAR_COUNT && configHUD) { + render_hud_stars(); + } - if (hudDisplayFlags & HUD_DISPLAY_FLAG_KEYS) { render_hud_keys(); } + if (hudDisplayFlags & HUD_DISPLAY_FLAG_KEYS && configHUD) { + render_hud_keys(); + } - if (hudDisplayFlags & HUD_DISPLAY_FLAG_CAMERA_AND_POWER) { - render_hud_power_meter(); - render_hud_camera_status(); + if (hudDisplayFlags & HUD_DISPLAY_FLAG_CAMERA_AND_POWER && configHUD) { + render_hud_power_meter(); + render_hud_camera_status(); + } + + if (hudDisplayFlags & HUD_DISPLAY_FLAG_TIMER && configHUD) { + render_hud_timer(); + } } - - if (hudDisplayFlags & HUD_DISPLAY_FLAG_TIMER) { render_hud_timer(); } - } } diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c index 30c81724..7ae9f1e7 100644 --- a/src/game/ingame_menu.c +++ b/src/game/ingame_menu.c @@ -1,5 +1,3 @@ -#include "ingame_menu.h" - #include #include "actors/common1.h" @@ -8,11 +6,11 @@ #include "camera.h" #include "course_table.h" #include "dialog_ids.h" -#include "common/service_locator.hpp" -#include "common/ui/text_to_render.hpp" +#include "engine/math_util.h" #include "eu_translation.h" #include "game_init.h" #include "gfx_dimensions.h" +#include "ingame_menu.h" #include "level_update.h" #include "levels/castle_grounds/header.h" #include "memory.h" @@ -24,7 +22,14 @@ #include "sm64.h" #include "text_strings.h" #include "types.h" -#include "engine/math_util.h" +#include "macros.h" +#include "pc/cheats.h" +#ifdef BETTERCAMERA +#include "bettercamera.h" +#endif +#ifdef EXT_OPTIONS_MENU +#include "options_menu.h" +#endif u16 gDialogColorFadeTimer; s8 gLastDialogLineNum; @@ -114,6 +119,16 @@ u8 gMenuHoldKeyIndex = 0; u8 gMenuHoldKeyTimer = 0; s32 gDialogResponse = 0; +#if !defined(EXTERNAL_DATA) && (defined(VERSION_JP) || defined(VERSION_SH) || defined(VERSION_EU)) +#ifdef VERSION_EU +#define CHCACHE_BUFLEN (8 * 8) // EU only converts 8x8 +#else +#define CHCACHE_BUFLEN (8 * 16) // JP only converts 8x16 or 16x8 characters +#endif +// stores char data unpacked from ia1 to ia8 or ia4 +// so that it won't be reconverted every time a character is rendered +static struct CachedChar { u8 used; u8 data[CHCACHE_BUFLEN]; } charCache[256]; +#endif // VERSION void create_dl_identity_matrix(void) { Mtx *matrix = (Mtx *) alloc_display_list(sizeof(Mtx)); @@ -122,14 +137,7 @@ void create_dl_identity_matrix(void) { return; } -#ifndef GBI_FLOATS - matrix->m[0][0] = 0x00010000; matrix->m[1][0] = 0x00000000; matrix->m[2][0] = 0x00000000; matrix->m[3][0] = 0x00000000; - matrix->m[0][1] = 0x00000000; matrix->m[1][1] = 0x00010000; matrix->m[2][1] = 0x00000000; matrix->m[3][1] = 0x00000000; - matrix->m[0][2] = 0x00000001; matrix->m[1][2] = 0x00000000; matrix->m[2][2] = 0x00000000; matrix->m[3][2] = 0x00000000; - matrix->m[0][3] = 0x00000000; matrix->m[1][3] = 0x00000001; matrix->m[2][3] = 0x00000000; matrix->m[3][3] = 0x00000000; -#else guMtxIdent(matrix); -#endif gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(matrix), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(matrix), G_MTX_PROJECTION | G_MTX_LOAD | G_MTX_NOPUSH); @@ -200,23 +208,19 @@ void create_dl_ortho_matrix(void) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(matrix), G_MTX_PROJECTION | G_MTX_MUL | G_MTX_NOPUSH) } -static u8 *alloc_ia8_text_from_i1(u16 *in, s16 width, s16 height) { +#if defined(VERSION_JP) || defined(VERSION_SH) +static inline void alloc_ia8_text_from_i1(u8 *out, u16 *in, s16 width, s16 height) { s32 inPos; u16 bitMask; - u8 *out; + u16 inWord; s16 outPos = 0; - out = (u8*) alloc_display_list((u32) width * (u32) height); - - if (out == NULL) { - return NULL; - } - for (inPos = 0; inPos < (width * height) / 16; inPos++) { + inWord = BE_TO_HOST16(in[inPos]); bitMask = 0x8000; while (bitMask != 0) { - if (in[inPos] & bitMask) { + if (inWord & bitMask) { out[outPos] = 0xFF; } else { out[outPos] = 0x00; @@ -226,10 +230,22 @@ static u8 *alloc_ia8_text_from_i1(u16 *in, s16 width, s16 height) { outPos++; } } - - return out; } +static inline u8 *convert_ia8_char(u8 c, u16 *tex, s16 w, s16 h) { +#ifdef EXTERNAL_DATA + return (u8 *)tex; // the data's just a name +#else + if (!tex) return NULL; + if (!charCache[c].used) { + charCache[c].used = 1; + alloc_ia8_text_from_i1(charCache[c].data, tex, w, h); + } + return charCache[c].data; +#endif +} +#endif + void render_generic_char(u8 c) { void **fontLUT; void *packedTexture; @@ -237,11 +253,11 @@ void render_generic_char(u8 c) { void *unpackedTexture; #endif - fontLUT = (void**) segmented_to_virtual(main_font_lut); + fontLUT = segmented_to_virtual(main_font_lut); packedTexture = segmented_to_virtual(fontLUT[c]); #if defined(VERSION_JP) || defined(VERSION_SH) - unpackedTexture = alloc_ia8_text_from_i1(packedTexture, 8, 16); + unpackedTexture = convert_ia8_char(c, packedTexture, 8, 16); gDPPipeSync(gDisplayListHead++); gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_IA, G_IM_SIZ_8b, 1, VIRTUAL_TO_PHYSICAL(unpackedTexture)); @@ -259,20 +275,12 @@ void render_generic_char(u8 c) { } #ifdef VERSION_EU -u8 *alloc_ia4_tex_from_i1(u8 *in, s16 width, s16 height) { +static void alloc_ia4_tex_from_i1(u8 *out, u8 *in, s16 width, s16 height) { u32 size = (u32) width * (u32) height; - u8 *out; s32 inPos; - s16 outPos; + s16 outPos = 0; u8 bitMask; - outPos = 0; - out = (u8 *) alloc_display_list(size); - - if (out == NULL) { - return NULL; - } - for (inPos = 0; inPos < (width * height) / 4; inPos++) { bitMask = 0x80; while (bitMask != 0) { @@ -283,8 +291,19 @@ u8 *alloc_ia4_tex_from_i1(u8 *in, s16 width, s16 height) { outPos++; } } +} - return out; +static u8 *convert_ia4_char(u8 c, u8 *tex, s16 w, s16 h) { +#ifdef EXTERNAL_DATA + return tex; // the data's just a name +#else + if (!tex) return NULL; + if (!charCache[c].used) { + charCache[c].used = 1; + alloc_ia4_tex_from_i1(charCache[c].data, tex, w, h); + } + return charCache[c].data; +#endif } void render_generic_char_at_pos(s16 xPos, s16 yPos, u8 c) { @@ -294,7 +313,7 @@ void render_generic_char_at_pos(s16 xPos, s16 yPos, u8 c) { fontLUT = segmented_to_virtual(main_font_lut); packedTexture = segmented_to_virtual(fontLUT[c]); - unpackedTexture = alloc_ia4_tex_from_i1(packedTexture, 8, 8); + unpackedTexture = convert_ia4_char(c, packedTexture, 8, 8); gDPPipeSync(gDisplayListHead++); gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, VIRTUAL_TO_PHYSICAL(unpackedTexture)); @@ -531,8 +550,8 @@ void print_hud_char_umlaut(s16 x, s16 y, u8 chr) { */ void print_hud_lut_string(s8 hudLUT, s16 x, s16 y, const u8 *str) { s32 strPos = 0; - void **hudLUT1 = (void**) segmented_to_virtual(menu_hud_lut); // Japanese Menu HUD Color font - void **hudLUT2 = (void**) segmented_to_virtual(main_hud_lut); // 0-9 A-Z HUD Color Font + void **hudLUT1 = segmented_to_virtual(menu_hud_lut); // Japanese Menu HUD Color font + void **hudLUT2 = segmented_to_virtual(main_hud_lut); // 0-9 A-Z HUD Color Font u32 curX = x; u32 curY = y; @@ -622,7 +641,7 @@ void print_menu_generic_string(s16 x, s16 y, const u8 *str) { s32 strPos = 0; s32 curX = x; s32 curY = y; - void **fontLUT = (void**) segmented_to_virtual(menu_font_lut); + void **fontLUT = segmented_to_virtual(menu_font_lut); while (str[strPos] != DIALOG_CHAR_TERMINATOR) { switch (str[strPos]) { @@ -680,7 +699,7 @@ void print_menu_generic_string(s16 x, s16 y, const u8 *str) { void print_credits_string(s16 x, s16 y, const u8 *str) { s32 strPos = 0; - void **fontLUT = (void**) segmented_to_virtual(main_credits_font_lut); + void **fontLUT = segmented_to_virtual(main_credits_font_lut); u32 curX = x; u32 curY = y; @@ -1019,7 +1038,7 @@ void render_generic_dialog_char_at_pos(struct DialogEntry *dialog, s16 x, s16 y, fontLUT = segmented_to_virtual(main_font_lut); packedTexture = segmented_to_virtual(fontLUT[c]); - unpackedTexture = alloc_ia4_tex_from_i1(packedTexture, 8, 8); + unpackedTexture = convert_ia4_char(c, packedTexture, 8, 8); gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, VIRTUAL_TO_PHYSICAL(unpackedTexture)); gSPDisplayList(gDisplayListHead++, dl_ia_text_tex_settings); @@ -1205,7 +1224,7 @@ void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 l u8 strChar; - u8 *str = (u8*) segmented_to_virtual(dialog->str); + u8 *str = segmented_to_virtual(dialog->str); s8 lineNum = 1; s8 totalLines; @@ -1694,9 +1713,9 @@ void render_dialog_entries(void) { break; } #else - dialogTable = (void**) segmented_to_virtual(seg2_dialog_table); + dialogTable = segmented_to_virtual(seg2_dialog_table); #endif - dialog = (struct DialogEntry*) segmented_to_virtual(dialogTable[gDialogID]); + dialog = segmented_to_virtual(dialogTable[gDialogID]); // if the dialog entry is invalid, set the ID to -1. if (segmented_to_virtual(NULL) == dialog) { @@ -1793,26 +1812,13 @@ void render_dialog_entries(void) { render_dialog_box_type(dialog, dialog->linesPerBox); gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, - // Horizontal scissoring isn't really required and can potentially mess up widescreen enhancements. -#ifdef WIDESCREEN 0, -#else - ensure_nonnegative(dialog->leftOffset), -#endif ensure_nonnegative(DIAG_VAL2 - dialog->width), #ifdef VERSION_EU -#ifdef WIDESCREEN SCREEN_WIDTH, -#else - ensure_nonnegative(dialog->leftOffset + DIAG_VAL3 / gDialogBoxScale), -#endif ensure_nonnegative((240 - dialog->width) + ((dialog->linesPerBox * 80) / DIAG_VAL4) / gDialogBoxScale)); #else -#ifdef WIDESCREEN SCREEN_WIDTH, -#else - ensure_nonnegative(DIAG_VAL3 + dialog->leftOffset), -#endif ensure_nonnegative(240 + ((dialog->linesPerBox * 80) / DIAG_VAL4) - dialog->width)); #endif #if defined(VERSION_JP) || defined(VERSION_SH) @@ -2021,11 +2027,11 @@ void print_peach_letter_message(void) { break; } #else - dialogTable = (void**) segmented_to_virtual(seg2_dialog_table); + dialogTable = segmented_to_virtual(seg2_dialog_table); #endif - dialog = (struct DialogEntry*) segmented_to_virtual(dialogTable[gDialogID]); + dialog = segmented_to_virtual(dialogTable[gDialogID]); - str = (u8*) segmented_to_virtual(dialog->str); + str = segmented_to_virtual(dialog->str); create_dl_translation_matrix(MENU_MTX_PUSH, 97.0f, 118.0f, 0); @@ -2117,16 +2123,13 @@ void change_dialog_camera_angle(void) { } void shade_screen(void) { - create_dl_translation_matrix(MENU_MTX_PUSH, GFX_DIMENSIONS_FROM_LEFT_EDGE(0), SCREEN_HEIGHT, 0); + create_dl_translation_matrix(MENU_MTX_PUSH, GFX_DIMENSIONS_FROM_LEFT_EDGE(0), 240.0f, 0); // This is a bit weird. It reuses the dialog text box (width 130, height -80), // so scale to at least fit the screen. -#ifndef WIDESCREEN - create_dl_scale_matrix(MENU_MTX_NOPUSH, 2.6f, 3.4f, 1.0f); -#else + create_dl_scale_matrix(MENU_MTX_NOPUSH, GFX_DIMENSIONS_ASPECT_RATIO * SCREEN_HEIGHT / 130.0f, 3.0f, 1.0f); -#endif gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, 110); gSPDisplayList(gDisplayListHead++, dl_draw_text_bg_box); @@ -2160,7 +2163,9 @@ void print_animated_red_coin(s16 x, s16 y) { } void render_pause_red_coins(void) { - for (s8 x = 0; x < gRedCoinsCollected; x++) { + s8 x; + + for (x = 0; x < gRedCoinsCollected; x++) { print_animated_red_coin(GFX_DIMENSIONS_FROM_RIGHT_EDGE(30) - x * 20, 16); } } @@ -2214,8 +2219,8 @@ void render_pause_my_score_coins(void) { u8 starFlags; #ifndef VERSION_EU - courseNameTbl = (void**) segmented_to_virtual(seg2_course_name_table); - actNameTbl = (void**) segmented_to_virtual(seg2_act_name_table); + courseNameTbl = segmented_to_virtual(seg2_course_name_table); + actNameTbl = segmented_to_virtual(seg2_act_name_table); #endif courseIndex = gCurrCourseNum - 1; @@ -2255,7 +2260,7 @@ void render_pause_my_score_coins(void) { print_generic_string(MYSCORE_X, 121, textMyScore); } - courseName = (u8*) segmented_to_virtual(courseNameTbl[courseIndex]); + courseName = segmented_to_virtual(courseNameTbl[courseIndex]); if (courseIndex < COURSE_STAGES_COUNT) { #ifdef VERSION_EU @@ -2270,7 +2275,7 @@ void render_pause_my_score_coins(void) { print_generic_string(CRS_NUM_X1, 157, strCourseNum); #endif - actName = (u8*) segmented_to_virtual(actNameTbl[(gCurrCourseNum - 1) * 6 + gDialogCourseActNum - 1]); + actName = segmented_to_virtual(actNameTbl[(gCurrCourseNum - 1) * 6 + gDialogCourseActNum - 1]); if (starFlags & (1 << (gDialogCourseActNum - 1))) { print_generic_string(TXT_STAR_X, 140, textStar); @@ -2373,6 +2378,7 @@ void render_pause_course_options(s16 x, s16 y, s8 *index, s16 yIndex) { { TEXT_EXIT_COURSE_FR }, { TEXT_EXIT_COURSE_DE } }; + u8 textCameraAngleR[][24] = { { TEXT_CAMERA_ANGLE_R }, { TEXT_CAMERA_ANGLE_R_FR }, @@ -2404,9 +2410,7 @@ void render_pause_course_options(s16 x, s16 y, s8 *index, s16 yIndex) { gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, gDialogTextAlpha); gSPDisplayList(gDisplayListHead++, dl_draw_triangle); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); - } - - if (index[0] == 3) { + } else { render_pause_camera_options(x - 42, y - 42, &gDialogCameraAngleIndex, 110); } } @@ -2449,21 +2453,17 @@ void highlight_last_course_complete_stars(void) { void print_hud_pause_colorful_str(void) { u8 textPause[] = { TEXT_PAUSE }; -#ifdef VERSION_EU gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, gDialogTextAlpha); +#ifdef VERSION_EU print_hud_lut_string(HUD_LUT_GLOBAL, get_str_x_pos_from_center_scale( SCREEN_WIDTH / 2, textPause, 12.0f), 81, textPause); - - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); #else - auto& text_renderer = ServiceLocator::get_text_renderer(); - text_renderer.render() - ->with_alpha(gDialogTextAlpha) - ->glyphs_at(textPause, 123, 81); + print_hud_lut_string(HUD_LUT_GLOBAL, 123, 81, textPause); #endif + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); } void render_pause_castle_course_stars(s16 x, s16 y, s16 fileNum, s16 courseNum) { @@ -2510,7 +2510,7 @@ void render_pause_castle_main_strings(s16 x, s16 y) { #ifdef VERSION_EU void **courseNameTbl; #else - void **courseNameTbl = (void**) segmented_to_virtual(seg2_course_name_table); + void **courseNameTbl = segmented_to_virtual(seg2_course_name_table); #endif #ifdef VERSION_EU @@ -2591,7 +2591,7 @@ void render_pause_castle_main_strings(s16 x, s16 y) { } #ifndef VERSION_EU - print_generic_string(x - 9, y + 30, (u8*) courseName); + print_generic_string(x - 9, y + 30, courseName); #endif gSPDisplayList(gDisplayListHead++, dl_ia_text_end); @@ -2608,7 +2608,9 @@ s16 render_pause_courses_and_castle(void) { #ifdef VERSION_EU gInGameLanguage = eu_get_language(); #endif - +#ifdef EXT_OPTIONS_MENU + if (optmenu_open == 0) { +#endif switch (gDialogBoxState) { case DIALOG_STATE_OPENING: gDialogLineNum = 1; @@ -2632,8 +2634,9 @@ s16 render_pause_courses_and_castle(void) { shade_screen(); render_pause_my_score_coins(); render_pause_red_coins(); - - if (gMarioStates[0].action & ACT_FLAG_PAUSE_EXIT) { + +/* Added support for the "Exit course at any time" cheat */ + if ((gMarioStates[0].action & ACT_FLAG_PAUSE_EXIT) || (Cheats.EnableCheats && Cheats.ExitAnywhere)) { render_pause_course_options(99, 93, &gDialogLineNum, 15); } @@ -2684,6 +2687,14 @@ s16 render_pause_courses_and_castle(void) { if (gDialogTextAlpha < 250) { gDialogTextAlpha += 25; } +#ifdef EXT_OPTIONS_MENU + } else { + shade_screen(); + optmenu_draw(); + } + optmenu_check_buttons(); + optmenu_draw_prompt(); +#endif return 0; } @@ -2848,8 +2859,8 @@ void render_course_complete_lvl_info_and_hud_str(void) { break; } #else - actNameTbl = (void**) segmented_to_virtual(seg2_act_name_table); - courseNameTbl = (void**) segmented_to_virtual(seg2_course_name_table); + actNameTbl = segmented_to_virtual(seg2_act_name_table); + courseNameTbl = segmented_to_virtual(seg2_course_name_table); #endif if (gLastCompletedCourseNum <= COURSE_STAGES_MAX) { @@ -2857,9 +2868,9 @@ void render_course_complete_lvl_info_and_hud_str(void) { play_star_fanfare_and_flash_hud(1, 1 << (gLastCompletedStarNum - 1)); if (gLastCompletedStarNum == 7) { - name = (u8*) segmented_to_virtual(actNameTbl[COURSE_STAGES_MAX * 6 + 1]); + name = segmented_to_virtual(actNameTbl[COURSE_STAGES_MAX * 6 + 1]); } else { - name = (u8*) segmented_to_virtual(actNameTbl[(gLastCompletedCourseNum - 1) * 6 + gLastCompletedStarNum - 1]); + name = segmented_to_virtual(actNameTbl[(gLastCompletedCourseNum - 1) * 6 + gLastCompletedStarNum - 1]); } gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); @@ -2872,7 +2883,7 @@ void render_course_complete_lvl_info_and_hud_str(void) { print_generic_string(CRS_NUM_X3, 167, strCourseNum); gSPDisplayList(gDisplayListHead++, dl_ia_text_end); } else if (gLastCompletedCourseNum == COURSE_BITDW || gLastCompletedCourseNum == COURSE_BITFS) { - name = (u8*) segmented_to_virtual(courseNameTbl[gLastCompletedCourseNum - 1]); + name = segmented_to_virtual(courseNameTbl[gLastCompletedCourseNum - 1]); gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, gDialogTextAlpha); #ifdef VERSION_EU @@ -2893,7 +2904,7 @@ void render_course_complete_lvl_info_and_hud_str(void) { play_star_fanfare_and_flash_hud(2, 0); //! 2 isn't defined, originally for key hud? return; } else { - name = (u8*) segmented_to_virtual(actNameTbl[COURSE_STAGES_MAX * 6]); + name = segmented_to_virtual(actNameTbl[COURSE_STAGES_MAX * 6]); print_hud_course_complete_coins(118, 103); play_star_fanfare_and_flash_hud(1, 1 << (gLastCompletedStarNum - 1)); } @@ -2926,11 +2937,13 @@ void render_course_complete_lvl_info_and_hud_str(void) { #if defined(VERSION_JP) || defined(VERSION_SH) #define TXT_SAVECONT_Y 2 #define TXT_SAVEQUIT_Y 18 -#define TXT_CONTNOSAVE_Y 38 +#define TXT_SAVE_EXIT_GAME_Y 38 +#define TXT_CONTNOSAVE_Y 54 #else #define TXT_SAVECONT_Y 0 #define TXT_SAVEQUIT_Y 20 -#define TXT_CONTNOSAVE_Y 40 +#define TXT_SAVE_EXIT_GAME_Y 40 +#define TXT_CONTNOSAVE_Y 60 #endif #ifdef VERSION_EU @@ -2952,28 +2965,39 @@ void render_save_confirmation(s16 x, s16 y, s8 *index, s16 sp6e) { TEXT_SAVE_AND_QUIT_FR }, { TEXT_SAVE_AND_QUIT_DE } }; + + u8 textSaveExitGame[][26] = { // New function to exit game + { TEXT_SAVE_EXIT_GAME }, + { TEXT_SAVE_EXIT_GAME_FR }, + { TEXT_SAVE_EXIT_GAME_DE } + }; + u8 textContinueWithoutSaveArr[][27] = { { TEXT_CONTINUE_WITHOUT_SAVING }, { TEXT_CONTINUE_WITHOUT_SAVING_FR }, { TEXT_CONTINUE_WITHOUT_SAVING_DE } }; + #define textSaveAndContinue textSaveAndContinueArr[gInGameLanguage] #define textSaveAndQuit textSaveAndQuitArr[gInGameLanguage] +#define textSaveExitGame textSaveExitGame[gInGameLanguage] #define textContinueWithoutSave textContinueWithoutSaveArr[gInGameLanguage] s16 xOffset = get_str_x_pos_from_center(160, textContinueWithoutSaveArr[gInGameLanguage], 12.0f); #else u8 textSaveAndContinue[] = { TEXT_SAVE_AND_CONTINUE }; u8 textSaveAndQuit[] = { TEXT_SAVE_AND_QUIT }; + u8 textSaveExitGame[] = { TEXT_SAVE_EXIT_GAME }; u8 textContinueWithoutSave[] = { TEXT_CONTINUE_WITHOUT_SAVING }; #endif - handle_menu_scrolling(MENU_SCROLL_VERTICAL, index, 1, 3); + handle_menu_scrolling(MENU_SCROLL_VERTICAL, index, 1, 4); // Increased to '4' to handle Exit Game gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, gDialogTextAlpha); print_generic_string(TXT_SAVEOPTIONS_X, y + TXT_SAVECONT_Y, textSaveAndContinue); print_generic_string(TXT_SAVEOPTIONS_X, y - TXT_SAVEQUIT_Y, textSaveAndQuit); + print_generic_string(TXT_SAVEOPTIONS_X, y - TXT_SAVE_EXIT_GAME_Y, textSaveExitGame); print_generic_string(TXT_SAVEOPTIONS_X, y - TXT_CONTNOSAVE_Y, textContinueWithoutSave); gSPDisplayList(gDisplayListHead++, dl_ia_text_end); diff --git a/src/game/interaction.c b/src/game/interaction.c index d27b4888..7a9c5203 100644 --- a/src/game/interaction.c +++ b/src/game/interaction.c @@ -698,9 +698,7 @@ u32 take_damage_from_interact_object(struct MarioState *m) { m->hurtCounter += 4 * damage; -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif set_camera_shake_from_hit(shake); return damage; } @@ -748,11 +746,10 @@ u32 interact_coin(struct MarioState *m, UNUSED u32 interactType, struct Object * && m->numCoins >= 100) { bhv_spawn_star_no_level_exit(6); } -#ifdef VERSION_SH + if (o->oDamageOrCoinValue >= 2) { queue_rumble_data(5, 80); } -#endif return FALSE; } @@ -771,9 +768,7 @@ u32 interact_star_or_key(struct MarioState *m, UNUSED u32 interactType, struct O if (m->health >= 0x100) { mario_stop_riding_and_holding(m); -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif if (!noExit) { m->hurtCounter = 0; @@ -875,7 +870,6 @@ u32 interact_warp(struct MarioState *m, UNUSED u32 interactType, struct Object * m->interactObj = o; m->usedObj = o; -#ifdef VERSION_SH if (o->collisionData == segmented_to_virtual(warp_pipe_seg3_collision_03009AC8)) { play_sound(SOUND_MENU_ENTER_PIPE, m->marioObj->header.gfx.cameraToObject); queue_rumble_data(15, 80); @@ -883,12 +877,6 @@ u32 interact_warp(struct MarioState *m, UNUSED u32 interactType, struct Object * play_sound(SOUND_MENU_ENTER_HOLE, m->marioObj->header.gfx.cameraToObject); queue_rumble_data(12, 80); } -#else - play_sound(o->collisionData == segmented_to_virtual(warp_pipe_seg3_collision_03009AC8) - ? SOUND_MENU_ENTER_PIPE - : SOUND_MENU_ENTER_HOLE, - m->marioObj->header.gfx.cameraToObject); -#endif mario_stop_riding_object(m); return set_mario_action(m, ACT_DISAPPEARED, (WARP_OP_WARP_OBJECT << 16) + 2); @@ -1099,9 +1087,8 @@ u32 interact_tornado(struct MarioState *m, UNUSED u32 interactType, struct Objec marioObj->oMarioTornadoPosY = m->pos[1] - o->oPosY; play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject); -#ifdef VERSION_SH queue_rumble_data(30, 60); -#endif + return set_mario_action(m, ACT_TORNADO_TWIRLING, m->action == ACT_TWIRLING); } @@ -1122,9 +1109,8 @@ u32 interact_whirlpool(struct MarioState *m, UNUSED u32 interactType, struct Obj marioObj->oMarioWhirlpoolPosY = m->pos[1] - o->oPosY; play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject); -#ifdef VERSION_SH queue_rumble_data(30, 60); -#endif + return set_mario_action(m, ACT_CAUGHT_IN_WHIRLPOOL, 0); } @@ -1158,9 +1144,8 @@ u32 interact_flame(struct MarioState *m, UNUSED u32 interactType, struct Object if (!sInvulnerable && !(m->flags & MARIO_METAL_CAP) && !(m->flags & MARIO_VANISH_CAP) && !(o->oInteractionSubtype & INT_SUBTYPE_DELAY_INVINCIBILITY)) { -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif + o->oInteractStatus = INT_STATUS_INTERACTED; m->interactObj = o; @@ -1236,9 +1221,7 @@ u32 interact_bully(struct MarioState *m, UNUSED u32 interactType, struct Object m->interactObj = o; if (interaction & INT_ATTACK_NOT_FROM_BELOW) { -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif push_mario_out_of_object(m, o, 5.0f); m->forwardVel = -16.0f; @@ -1261,9 +1244,8 @@ u32 interact_bully(struct MarioState *m, UNUSED u32 interactType, struct Object push_mario_out_of_object(m, o, 5.0f); drop_and_set_mario_action(m, bully_knock_back_mario(m), 0); -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif + return TRUE; } @@ -1280,9 +1262,7 @@ u32 interact_shock(struct MarioState *m, UNUSED u32 interactType, struct Object take_damage_from_interact_object(m); play_sound(SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject); -#ifdef VERSION_SH queue_rumble_data(70, 60); -#endif if (m->action & (ACT_FLAG_SWIMMING | ACT_FLAG_METAL_WATER)) { return drop_and_set_mario_action(m, ACT_WATER_SHOCKED, 0); @@ -1328,9 +1308,7 @@ u32 interact_hit_from_below(struct MarioState *m, UNUSED u32 interactType, struc } if (interaction & INT_ANY_ATTACK) { -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif attack_object(o, interaction); bounce_back_from_attack(m, interaction); @@ -1369,9 +1347,7 @@ u32 interact_bounce_top(struct MarioState *m, UNUSED u32 interactType, struct Ob } if (interaction & INT_ATTACK_NOT_FROM_BELOW) { -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif attack_object(o, interaction); bounce_back_from_attack(m, interaction); @@ -1488,9 +1464,7 @@ u32 check_object_grab_mario(struct MarioState *m, UNUSED u32 interactType, struc update_mario_sound_and_camera(m); play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject); -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif return set_mario_action(m, ACT_GRABBED, 0); } } @@ -1539,9 +1513,7 @@ u32 interact_pole(struct MarioState *m, UNUSED u32 interactType, struct Object * marioObj->oMarioPoleYawVel = (s32)(m->forwardVel * 0x100 + 0x1000); #endif reset_mario_pitch(m); -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif return set_mario_action(m, ACT_GRAB_POLE_FAST, 0); } } @@ -1561,9 +1533,7 @@ u32 interact_hoot(struct MarioState *m, UNUSED u32 interactType, struct Object * m->interactObj = o; m->usedObj = o; -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif update_mario_sound_and_camera(m); return set_mario_action(m, ACT_RIDING_HOOT, 0); } diff --git a/src/game/level_geo.c b/src/game/level_geo.c index 9c404158..4c98e705 100644 --- a/src/game/level_geo.c +++ b/src/game/level_geo.c @@ -34,9 +34,9 @@ Gfx *geo_envfx_main(s32 callContext, struct GraphNode *node, Mat4 mtxf) { vec3f_to_vec3s(marioPos, gPlayerCameraState->pos); particleList = envfx_update_particles(snowMode, marioPos, camTo, camFrom); if (particleList != NULL) { - Mtx *mtx = (Mtx*) alloc_display_list(sizeof(*mtx)); + Mtx *mtx = alloc_display_list(sizeof(*mtx)); - gfx = (Gfx*) alloc_display_list(2 * sizeof(*gfx)); + gfx = alloc_display_list(2 * sizeof(*gfx)); mtxf_to_mtx(mtx, mtxf); gSPMatrix(&gfx[0], VIRTUAL_TO_PHYSICAL(mtx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH); gSPBranchList(&gfx[1], VIRTUAL_TO_PHYSICAL(particleList)); diff --git a/src/game/level_update.c b/src/game/level_update.c index ac9c1997..72a6a607 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -1,4 +1,5 @@ #include +#include #include "sm64.h" #include "seq_ids.h" @@ -28,6 +29,11 @@ #include "level_table.h" #include "course_table.h" #include "thread6.h" +#include "../../include/libc/stdlib.h" + +#include "pc/pc_main.h" +#include "pc/cliopts.h" +#include "pc/configfile.h" #define PLAY_MODE_NORMAL 0 #define PLAY_MODE_PAUSED 2 @@ -130,7 +136,7 @@ struct CreditsEntry sCreditsSequence[] = { { LEVEL_JRB, 1, 18, 22, { 3800, -4840, 2727 }, credits03 }, { LEVEL_CCM, 2, 34, 25, { -5464, 6656, -6575 }, credits04 }, { LEVEL_BBH, 1, 1, 60, { 257, 1922, 2580 }, credits05 }, - { LEVEL_HMC, 1, (u8) -15, 123, { -6469, 1616, -6054 }, credits06 }, + { LEVEL_HMC, 1, -15, 123, { -6469, 1616, -6054 }, credits06 }, { LEVEL_THI, 3, 17, -32, { 508, 1024, 1942 }, credits07 }, { LEVEL_LLL, 2, 33, 124, { -73, 82, -1467 }, credits08 }, { LEVEL_SSL, 1, 65, 98, { -5906, 1024, -2576 }, credits09 }, @@ -143,7 +149,7 @@ struct CreditsEntry sCreditsSequence[] = { { LEVEL_RR, 1, 33, 64, { 1565, 1024, -148 }, credits16 }, { LEVEL_SA, 1, 1, 24, { -1050, -1330, -1559 }, credits17 }, { LEVEL_COTMC, 1, 49, -16, { -254, 415, -6045 }, credits18 }, - { LEVEL_DDD, 2, (u8) -111, -64, { 3948, 1185, -104 }, credits19 }, + { LEVEL_DDD, 2, -111, -64, { 3948, 1185, -104 }, credits19 }, { LEVEL_CCM, 1, 33, 31, { 3169, -4607, 5240 }, credits20 }, { LEVEL_CASTLE_GROUNDS, 1, 1, -128, { 0, 906, -1200 }, NULL }, { LEVEL_NONE, 0, 1, 0, { 0, 0, 0 }, NULL }, @@ -173,7 +179,6 @@ s8 D_8032C9E0 = 0; u8 unused3[4]; u8 unused4[2]; - u16 level_control_timer(s32 timerOp) { switch (timerOp) { case TIMER_CONTROL_SHOW: @@ -678,10 +683,8 @@ void initiate_painting_warp(void) { play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs); fadeout_music(398); -#ifdef VERSION_SH queue_rumble_data(80, 70); func_sh_8024C89C(1); -#endif } } } @@ -955,6 +958,8 @@ void basic_update(UNUSED s16 *arg) { } } +int gPressedStart = 0; + s32 play_mode_normal(void) { if (gCurrDemoInput != NULL) { print_intro_text(); @@ -963,6 +968,7 @@ s32 play_mode_normal(void) { gCurrLevelNum == LEVEL_PSS ? WARP_OP_DEMO_END : WARP_OP_DEMO_NEXT); } else if (!gWarpTransition.isActive && sDelayedWarpOp == WARP_OP_NONE && (gPlayer1Controller->buttonPressed & START_BUTTON)) { + gPressedStart = 1; level_trigger_warp(gMarioState, WARP_OP_DEMO_NEXT); } } @@ -993,9 +999,7 @@ s32 play_mode_normal(void) { set_play_mode(PLAY_MODE_CHANGE_AREA); } else if (pressed_pause()) { lower_background_noise(1); -#ifdef VERSION_SH cancel_rumble(); -#endif gCameraMovementFlags |= CAM_MOVE_PAUSE_SCREEN; set_play_mode(PLAY_MODE_PAUSED); } @@ -1011,9 +1015,8 @@ s32 play_mode_paused(void) { raise_background_noise(1); gCameraMovementFlags &= ~CAM_MOVE_PAUSE_SCREEN; set_play_mode(PLAY_MODE_NORMAL); - } else { + } else if (gPauseScreenMode == 2) { // Exit level - if (gDebugLevelSelect) { fade_into_special_warp(-9, 1); } else { @@ -1021,10 +1024,15 @@ s32 play_mode_paused(void) { fade_into_special_warp(0, 0); gSavedCourseNum = COURSE_NONE; } - - gCameraMovementFlags &= ~CAM_MOVE_PAUSE_SCREEN; + } else if (gPauseScreenMode == 3) { + // We should only be getting "int 3" to here + initiate_warp(LEVEL_CASTLE, 1, 0x1F, 0); + fade_into_special_warp(0, 0); + game_exit(); } + gCameraMovementFlags &= ~CAM_MOVE_PAUSE_SCREEN; + return 0; } @@ -1190,7 +1198,7 @@ s32 init_level(void) { if (gMarioState->action != ACT_UNINITIALIZED) { if (save_file_exists(gCurrSaveFileNum - 1)) { set_mario_action(gMarioState, ACT_IDLE, 0); - } else { + } else if (gCLIOpts.SkipIntro == 0 && configSkipIntro == 0) { set_mario_action(gMarioState, ACT_INTRO_CUTSCENE, 0); val4 = 1; } @@ -1208,11 +1216,10 @@ s32 init_level(void) { set_background_music(gCurrentArea->musicParam, gCurrentArea->musicParam2, 0); } } -#ifdef VERSION_SH + if (gCurrDemoInput == NULL) { cancel_rumble(); } -#endif if (gMarioState->action == ACT_INTRO_CUTSCENE) { sound_banks_disable(2, 0x0330); @@ -1259,7 +1266,7 @@ s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum) { #endif sWarpDest.type = WARP_TYPE_NOT_WARPING; sDelayedWarpOp = WARP_OP_NONE; - gShouldNotPlayCastleMusic = !save_file_exists(gCurrSaveFileNum - 1); + gShouldNotPlayCastleMusic = !save_file_exists(gCurrSaveFileNum - 1) && gCLIOpts.SkipIntro == 0 && configSkipIntro == 0; gCurrLevelNum = levelNum; gCurrCourseNum = COURSE_NONE; diff --git a/src/game/macro_special_objects.c b/src/game/macro_special_objects.c index 0b3bb3c4..17e4e6c4 100644 --- a/src/game/macro_special_objects.c +++ b/src/game/macro_special_objects.c @@ -328,7 +328,7 @@ void spawn_special_objects(s16 areaIndex, s16 **specialObjList) { } } -#ifdef NO_SEGMENTED_MEMORY +// PC Port, so always use below u32 get_special_objects_size(s16 *data) { s16 *startPos = data; s32 numOfSpecialObjects; @@ -372,4 +372,3 @@ u32 get_special_objects_size(s16 *data) { return data - startPos; } -#endif diff --git a/src/game/macro_special_objects.h b/src/game/macro_special_objects.h index 7743df11..c2ba81f4 100644 --- a/src/game/macro_special_objects.h +++ b/src/game/macro_special_objects.h @@ -15,8 +15,6 @@ void spawn_macro_abs_special(u32 model, const BehaviorScript *behavior, s16 x, s void spawn_macro_objects(s16 areaIndex, s16 *macroObjList); void spawn_macro_objects_hardcoded(s16 areaIndex, s16 *macroObjList); void spawn_special_objects(s16 areaIndex, s16 **specialObjList); -#ifdef NO_SEGMENTED_MEMORY u32 get_special_objects_size(s16 *data); -#endif #endif // MACRO_SPECIAL_OBJECTS_H diff --git a/src/game/main.c b/src/game/main.c index 9e53e50b..88855ee5 100644 --- a/src/game/main.c +++ b/src/game/main.c @@ -12,6 +12,12 @@ #include "main.h" #include "thread6.h" +/** + * WARNING! + * This entry point is deprecated because TARGET_N64 is no longer required for building PC version. + * The new entry point is located in 'pc/pc_main.c' + **/ + // Message IDs #define MESG_SP_COMPLETE 100 #define MESG_DP_COMPLETE 101 @@ -24,11 +30,6 @@ OSThread gIdleThread; OSThread gMainThread; OSThread gGameLoopThread; OSThread gSoundThread; -#ifdef VERSION_SH -OSThread gRumblePakThread; - -s32 gRumblePakPfs; // Actually an OSPfs but we don't have that header yet -#endif OSIoMesg gDmaIoMesg; OSMesg D_80339BEC; @@ -37,19 +38,20 @@ OSMesgQueue gSIEventMesgQueue; OSMesgQueue gPIMesgQueue; OSMesgQueue gIntrMesgQueue; OSMesgQueue gSPTaskMesgQueue; -#ifdef VERSION_SH -OSMesgQueue gRumblePakSchedulerMesgQueue; -OSMesgQueue gRumbleThreadVIMesgQueue; -#endif OSMesg gDmaMesgBuf[1]; OSMesg gPIMesgBuf[32]; OSMesg gSIEventMesgBuf[1]; OSMesg gIntrMesgBuf[16]; OSMesg gUnknownMesgBuf[16]; + #ifdef VERSION_SH +OSThread gRumblePakThread; +OSMesgQueue gRumblePakSchedulerMesgQueue; +OSMesgQueue gRumbleThreadVIMesgQueue; OSMesg gRumblePakSchedulerMesgBuf[1]; OSMesg gRumbleThreadVIMesgBuf[1]; +s32 gRumblePakPfs; // Actually an OSPfs but we don't have that header yet struct RumbleData gRumbleDataQueue[3]; struct StructSH8031D9B0 gCurrRumbleSettings; #endif @@ -267,9 +269,8 @@ void handle_vblank(void) { start_sptask(M_GFXTASK); } } -#ifdef VERSION_SH + rumble_thread_update_vi(); -#endif // Notify the game loop about the vblank. if (gVblankHandler1 != NULL) { diff --git a/src/game/main.h b/src/game/main.h index d7efe894..0bf659ca 100644 --- a/src/game/main.h +++ b/src/game/main.h @@ -24,19 +24,11 @@ extern OSThread gIdleThread; extern OSThread gMainThread; extern OSThread gGameLoopThread; extern OSThread gSoundThread; -#ifdef VERSION_SH -extern OSThread gRumblePakThread; - -extern s32 gRumblePakPfs; // Actually an OSPfs but we don't have that header yet -#endif extern OSMesgQueue gPIMesgQueue; extern OSMesgQueue gIntrMesgQueue; extern OSMesgQueue gSPTaskMesgQueue; -#ifdef VERSION_SH -extern OSMesgQueue gRumblePakSchedulerMesgQueue; -extern OSMesgQueue gRumbleThreadVIMesgQueue; -#endif + extern OSMesg gDmaMesgBuf[1]; extern OSMesg gPIMesgBuf[32]; extern OSMesg gSIEventMesgBuf[1]; @@ -46,13 +38,18 @@ extern OSIoMesg gDmaIoMesg; extern OSMesg D_80339BEC; extern OSMesgQueue gDmaMesgQueue; extern OSMesgQueue gSIEventMesgQueue; + #ifdef VERSION_SH +extern OSThread gRumblePakThread; extern OSMesg gRumblePakSchedulerMesgBuf[1]; extern OSMesg gRumbleThreadVIMesgBuf[1]; +extern OSMesgQueue gRumblePakSchedulerMesgQueue; +extern OSMesgQueue gRumbleThreadVIMesgQueue; +#endif +extern s32 gRumblePakPfs; // Actually an OSPfs but we don't have that header yet extern struct RumbleData gRumbleDataQueue[3]; extern struct StructSH8031D9B0 gCurrRumbleSettings; -#endif extern struct VblankHandler *gVblankHandler1; extern struct VblankHandler *gVblankHandler2; diff --git a/src/game/mario.c b/src/game/mario.c index 47d6ab9e..5f8e5114 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -33,6 +33,11 @@ #include "save_file.h" #include "sound_init.h" #include "thread6.h" +#include "pc/configfile.h" +#include "pc/cheats.h" +#ifdef BETTERCAMERA +#include "bettercamera.h" +#endif u32 unused80339F10; s8 filler80339F1C[20]; @@ -67,8 +72,8 @@ s16 set_mario_animation(struct MarioState *m, s32 targetAnimID) { struct Animation *targetAnim = m->animation->targetAnim; if (load_patchable_table(m->animation, targetAnimID)) { - targetAnim->values = (s16*) VIRTUAL_TO_PHYSICAL((u8 *) targetAnim + (uintptr_t) targetAnim->values); - targetAnim->index = (u16*) VIRTUAL_TO_PHYSICAL((u8 *) targetAnim + (uintptr_t) targetAnim->index); + targetAnim->values = (void *) VIRTUAL_TO_PHYSICAL((u8 *) targetAnim + (uintptr_t) targetAnim->values); + targetAnim->index = (void *) VIRTUAL_TO_PHYSICAL((u8 *) targetAnim + (uintptr_t) targetAnim->index); } if (o->header.gfx.unk38.animID != targetAnimID) { @@ -100,8 +105,8 @@ s16 set_mario_anim_with_accel(struct MarioState *m, s32 targetAnimID, s32 accel) struct Animation *targetAnim = m->animation->targetAnim; if (load_patchable_table(m->animation, targetAnimID)) { - targetAnim->values = (s16*) VIRTUAL_TO_PHYSICAL((u8 *) targetAnim + (uintptr_t) targetAnim->values); - targetAnim->index = (u16*) VIRTUAL_TO_PHYSICAL((u8 *) targetAnim + (uintptr_t) targetAnim->index); + targetAnim->values = (void *) VIRTUAL_TO_PHYSICAL((u8 *) targetAnim + (uintptr_t) targetAnim->values); + targetAnim->index = (void *) VIRTUAL_TO_PHYSICAL((u8 *) targetAnim + (uintptr_t) targetAnim->index); } if (o->header.gfx.unk38.animID != targetAnimID) { @@ -184,10 +189,10 @@ s16 find_mario_anim_flags_and_translation(struct Object *obj, s32 yaw, Vec3s tra f32 dx; f32 dz; - struct Animation *curAnim = obj->header.gfx.unk38.curAnim; + struct Animation *curAnim = (void *) obj->header.gfx.unk38.curAnim; s16 animFrame = geo_update_animation_frame(&obj->header.gfx.unk38, NULL); - u16 *animIndex = (u16*) segmented_to_virtual((void *) curAnim->index); - s16 *animValues = (s16*) segmented_to_virtual((void *) curAnim->values); + u16 *animIndex = segmented_to_virtual((void *) curAnim->index); + s16 *animValues = segmented_to_virtual((void *) curAnim->values); f32 s = (f32) sins(yaw); f32 c = (f32) coss(yaw); @@ -1210,8 +1215,23 @@ u8 sSquishScaleOverTime[16] = { 0x46, 0x32, 0x32, 0x3C, 0x46, 0x50, 0x50, 0x3C, void squish_mario_model(struct MarioState *m) { if (m->squishTimer != 0xFF) { // If no longer squished, scale back to default. + // Also handles the Tiny Mario and Huge Mario cheats. if (m->squishTimer == 0) { - vec3f_set(m->marioObj->header.gfx.scale, 1.0f, 1.0f, 1.0f); + if (Cheats.EnableCheats) { + if (Cheats.HugeMario) { + vec3f_set(m->marioObj->header.gfx.scale, 2.5f, 2.5f, 2.5f); + } + else if (Cheats.TinyMario) { + vec3f_set(m->marioObj->header.gfx.scale, 0.2f, 0.2f, 0.2f); + } + else { + vec3f_set(m->marioObj->header.gfx.scale, 1.0f, 1.0f, 1.0f); + } + } + else { + vec3f_set(m->marioObj->header.gfx.scale, 1.0f, 1.0f, 1.0f); + } + } // If timer is less than 16, rubber-band Mario's size scale up and down. else if (m->squishTimer <= 16) { @@ -1306,7 +1326,14 @@ void update_mario_joystick_inputs(struct MarioState *m) { } if (m->intendedMag > 0.0f) { +#ifndef BETTERCAMERA m->intendedYaw = atan2s(-controller->stickY, controller->stickX) + m->area->camera->yaw; +#else + if (gLakituState.mode != CAMERA_MODE_NEWCAM) + m->intendedYaw = atan2s(-controller->stickY, controller->stickX) + m->area->camera->yaw; + else + m->intendedYaw = atan2s(-controller->stickY, controller->stickX)-newcam_yaw+0x4000; +#endif m->input |= INPUT_NONZERO_ANALOG; } else { m->intendedYaw = m->faceAngle[1]; @@ -1386,6 +1413,13 @@ void update_mario_inputs(struct MarioState *m) { update_mario_geometry_inputs(m); debug_print_speed_action_normal(m); + + /* Moonjump cheat */ + while (Cheats.MoonJump == true && Cheats.EnableCheats == true && m->controller->buttonDown & L_TRIG ){ + m->vel[1] = 25; + break; // TODO: Unneeded break? + } + /*End of moonjump cheat */ if (gCameraMovementFlags & CAM_MOVE_C_UP_MODE) { if (m->action & ACT_FLAG_ALLOW_FIRST_PERSON) { @@ -1500,7 +1534,6 @@ void update_mario_health(struct MarioState *m) { // Play a noise to alert the player when Mario is close to drowning. if (((m->action & ACT_GROUP_MASK) == ACT_GROUP_SUBMERGED) && (m->health < 0x300)) { play_sound(SOUND_MOVING_ALMOST_DROWNING, gDefaultSoundArgs); -#ifdef VERSION_SH if (!gRumblePakTimer) { gRumblePakTimer = 36; if (is_rumble_finished_and_queue_empty()) { @@ -1509,7 +1542,6 @@ void update_mario_health(struct MarioState *m) { } } else { gRumblePakTimer = 0; -#endif } } } @@ -1686,7 +1718,6 @@ static void debug_update_mario_cap(u16 button, s32 flags, u16 capTimer, u16 capM } } -#ifdef VERSION_SH void func_sh_8025574C(void) { if (gMarioState->particleFlags & PARTICLE_HORIZONTAL_STAR) { queue_rumble_data(5, 80); @@ -1699,14 +1730,30 @@ void func_sh_8025574C(void) { reset_rumble_timers(); } } -#endif /** * Main function for executing Mario's behavior. */ s32 execute_mario_action(UNUSED struct Object *o) { s32 inLoop = TRUE; + /** + * Cheat stuff + */ + if (Cheats.EnableCheats) + { + if (Cheats.GodMode) + gMarioState->health = 0x880; + + if (Cheats.InfiniteLives && gMarioState->numLives < 99) + gMarioState->numLives += 1; + + if (Cheats.SuperSpeed && gMarioState->forwardVel > 0) + gMarioState->forwardVel += 100; + } + /** + * End of cheat stuff + */ if (gMarioState->action) { gMarioState->marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE; mario_reset_bodystate(gMarioState); @@ -1779,9 +1826,7 @@ s32 execute_mario_action(UNUSED struct Object *o) { play_infinite_stairs_music(); gMarioState->marioObj->oInteractStatus = 0; -#ifdef VERSION_SH func_sh_8025574C(); -#endif return gMarioState->particleFlags; } diff --git a/src/game/mario_actions_airborne.c b/src/game/mario_actions_airborne.c index a9f00890..2c9db90b 100644 --- a/src/game/mario_actions_airborne.c +++ b/src/game/mario_actions_airborne.c @@ -14,6 +14,9 @@ #include "mario_step.h" #include "save_file.h" #include "thread6.h" +#ifdef BETTERCAMERA +#include "bettercamera.h" +#endif void play_flip_sounds(struct MarioState *m, s16 frame1, s16 frame2, s16 frame3) { s32 animFrame = m->marioObj->header.gfx.unk38.animFrame; @@ -81,18 +84,15 @@ s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) { if (m->vel[1] < -55.0f) { if (fallHeight > 3000.0f) { m->hurtCounter += (m->flags & MARIO_CAP_ON_HEAD) ? 16 : 24; -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif set_camera_shake_from_hit(SHAKE_FALL_DAMAGE); play_sound(SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject); return drop_and_set_mario_action(m, hardFallAction, 4); } else if (fallHeight > damageHeight && !mario_floor_is_slippery(m)) { m->hurtCounter += (m->flags & MARIO_CAP_ON_HEAD) ? 8 : 12; m->squishTimer = 30; -#ifdef VERSION_SH + queue_rumble_data(5, 80); -#endif set_camera_shake_from_hit(SHAKE_FALL_DAMAGE); play_sound(SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject); } @@ -134,9 +134,8 @@ s32 check_fall_damage_or_get_stuck(struct MarioState *m, u32 hardFallAction) { #endif m->particleFlags |= PARTICLE_MIST_CIRCLE; drop_and_set_mario_action(m, ACT_FEET_STUCK_IN_GROUND, 0); -#ifdef VERSION_SH + queue_rumble_data(5, 80); -#endif return TRUE; } @@ -386,9 +385,7 @@ u32 common_air_action_step(struct MarioState *m, u32 landAction, s32 animation, set_mario_animation(m, animation); if (m->forwardVel > 16.0f) { -#ifdef VERSION_SH queue_rumble_data(5, 40); -#endif mario_bonk_reflection(m, FALSE); m->faceAngle[1] += 0x8000; @@ -494,11 +491,9 @@ s32 act_triple_jump(struct MarioState *m) { #endif common_air_action_step(m, ACT_TRIPLE_JUMP_LAND, MARIO_ANIM_TRIPLE_JUMP, 0); -#ifdef VERSION_SH if (m->action == ACT_TRIPLE_JUMP_LAND) { queue_rumble_data(5, 40); } -#endif play_flip_sounds(m, 2, 8, 20); return FALSE; } @@ -510,11 +505,10 @@ s32 act_backflip(struct MarioState *m) { play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_YAH_WAH_HOO); common_air_action_step(m, ACT_BACKFLIP_LAND, MARIO_ANIM_BACKFLIP, 0); -#ifdef VERSION_SH + if (m->action == ACT_BACKFLIP_LAND) { queue_rumble_data(5, 40); } -#endif play_flip_sounds(m, 2, 3, 17); return FALSE; } @@ -642,11 +636,10 @@ s32 act_long_jump(struct MarioState *m) { } common_air_action_step(m, ACT_LONG_JUMP_LAND, animation, AIR_STEP_CHECK_LEDGE_GRAB); -#ifdef VERSION_SH + if (m->action == ACT_LONG_JUMP_LAND) { queue_rumble_data(5, 40); } -#endif return FALSE; } @@ -747,9 +740,7 @@ s32 act_dive(struct MarioState *m) { case AIR_STEP_LANDED: if (should_get_stuck_in_ground(m) && m->faceAngle[0] == -0x2AAA) { -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif #ifdef VERSION_JP play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject); #else @@ -945,9 +936,7 @@ s32 act_ground_pound(struct MarioState *m) { stepResult = perform_air_step(m, 0); if (stepResult == AIR_STEP_LANDED) { if (should_get_stuck_in_ground(m)) { -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif #ifdef VERSION_JP play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject); #else @@ -996,9 +985,8 @@ s32 act_burning_jump(struct MarioState *m) { if (m->health < 0x100) { m->health = 0xFF; } -#ifdef VERSION_SH + reset_rumble_timers(); -#endif return FALSE; } @@ -1018,9 +1006,8 @@ s32 act_burning_fall(struct MarioState *m) { if (m->health < 0x100) { m->health = 0xFF; } -#ifdef VERSION_SH + reset_rumble_timers(); -#endif return FALSE; } @@ -1069,9 +1056,7 @@ s32 act_crazy_box_bounce(struct MarioState *m) { m->heldObj = NULL; set_mario_action(m, ACT_STOMACH_SLIDE, 0); } -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif m->particleFlags |= PARTICLE_MIST_CIRCLE; break; @@ -1101,11 +1086,9 @@ u32 common_air_knockback_step(struct MarioState *m, u32 landAction, u32 hardFall break; case AIR_STEP_LANDED: -#ifdef VERSION_SH if (m->action == ACT_SOFT_BONK) { queue_rumble_data(5, 80); } -#endif if (!check_fall_damage_or_get_stuck(m, hardFallAction)) { #ifndef VERSION_JP if (m->action == ACT_THROWN_FORWARD || m->action == ACT_THROWN_BACKWARD) { @@ -1504,14 +1487,11 @@ s32 act_hold_butt_slide_air(struct MarioState *m) { } s32 act_lava_boost(struct MarioState *m) { -#ifdef VERSION_SH if (!(m->flags & MARIO_MARIO_SOUND_PLAYED)) { play_sound_if_no_flag(m, SOUND_MARIO_ON_FIRE, MARIO_MARIO_SOUND_PLAYED); queue_rumble_data(5, 80); } -#else play_sound_if_no_flag(m, SOUND_MARIO_ON_FIRE, MARIO_MARIO_SOUND_PLAYED); -#endif if (!(m->input & INPUT_NONZERO_ANALOG)) { m->forwardVel = approach_f32(m->forwardVel, 0.0f, 0.35f, 0.35f); @@ -1528,9 +1508,7 @@ s32 act_lava_boost(struct MarioState *m) { } m->vel[1] = 84.0f; play_sound(SOUND_MARIO_ON_FIRE, m->marioObj->header.gfx.cameraToObject); -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif } else { play_mario_heavy_landing_sound(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND); if (m->actionState < 2 && m->vel[1] < 0.0f) { @@ -1566,9 +1544,8 @@ s32 act_lava_boost(struct MarioState *m) { } m->marioBodyState->eyeState = MARIO_EYES_DEAD; -#ifdef VERSION_SH + reset_rumble_timers(); -#endif return FALSE; } @@ -1677,10 +1654,18 @@ s32 act_shot_from_cannon(struct MarioState *m) { case AIR_STEP_LANDED: set_mario_action(m, ACT_DIVE_SLIDE, 0); m->faceAngle[0] = 0; +#ifndef BETTERCAMERA set_camera_mode(m->area->camera, m->area->camera->defMode, 1); -#ifdef VERSION_SH - queue_rumble_data(5, 80); +#else + if (newcam_active == 0) + set_camera_mode(m->area->camera, m->area->camera->defMode, 1); + else + { + m->area->camera->mode = CAMERA_MODE_NEWCAM; + gLakituState.mode = CAMERA_MODE_NEWCAM; + } #endif + queue_rumble_data(5, 80); break; case AIR_STEP_HIT_WALL: @@ -1693,7 +1678,17 @@ s32 act_shot_from_cannon(struct MarioState *m) { m->particleFlags |= PARTICLE_VERTICAL_STAR; set_mario_action(m, ACT_BACKWARD_AIR_KB, 0); +#ifndef BETTERCAMERA set_camera_mode(m->area->camera, m->area->camera->defMode, 1); +#else + if (newcam_active == 0) + set_camera_mode(m->area->camera, m->area->camera->defMode, 1); + else + { + m->area->camera->mode = CAMERA_MODE_NEWCAM; + gLakituState.mode = CAMERA_MODE_NEWCAM; + } +#endif break; case AIR_STEP_HIT_LAVA_WALL: @@ -1712,9 +1707,8 @@ s32 act_shot_from_cannon(struct MarioState *m) { if (m->vel[1] > 0.0f) { m->particleFlags |= PARTICLE_DUST; } -#ifdef VERSION_SH + reset_rumble_timers(); -#endif return FALSE; } @@ -1723,20 +1717,50 @@ s32 act_flying(struct MarioState *m) { if (m->input & INPUT_Z_PRESSED) { if (m->area->camera->mode == CAMERA_MODE_BEHIND_MARIO) { +#ifndef BETTERCAMERA set_camera_mode(m->area->camera, m->area->camera->defMode, 1); +#else + if (newcam_active == 0) + set_camera_mode(m->area->camera, m->area->camera->defMode, 1); + else + { + m->area->camera->mode = CAMERA_MODE_NEWCAM; + gLakituState.mode = CAMERA_MODE_NEWCAM; + } +#endif } return set_mario_action(m, ACT_GROUND_POUND, 1); } if (!(m->flags & MARIO_WING_CAP)) { if (m->area->camera->mode == CAMERA_MODE_BEHIND_MARIO) { +#ifndef BETTERCAMERA set_camera_mode(m->area->camera, m->area->camera->defMode, 1); +#else + if (newcam_active == 0) + set_camera_mode(m->area->camera, m->area->camera->defMode, 1); + else + { + m->area->camera->mode = CAMERA_MODE_NEWCAM; + gLakituState.mode = CAMERA_MODE_NEWCAM; + } +#endif } return set_mario_action(m, ACT_FREEFALL, 0); } if (m->area->camera->mode != CAMERA_MODE_BEHIND_MARIO) { +#ifndef BETTERCAMERA set_camera_mode(m->area->camera, CAMERA_MODE_BEHIND_MARIO, 1); +#else + if (newcam_active == 0) + set_camera_mode(m->area->camera, CAMERA_MODE_BEHIND_MARIO, 1); + else + { + m->area->camera->mode = CAMERA_MODE_NEWCAM; + gLakituState.mode = CAMERA_MODE_NEWCAM; + } +#endif } if (m->actionState == 0) { @@ -1776,10 +1800,18 @@ s32 act_flying(struct MarioState *m) { set_anim_to_frame(m, 7); m->faceAngle[0] = 0; +#ifndef BETTERCAMERA set_camera_mode(m->area->camera, m->area->camera->defMode, 1); -#ifdef VERSION_SH - queue_rumble_data(5, 80); +#else + if (newcam_active == 0) + set_camera_mode(m->area->camera, m->area->camera->defMode, 1); + else + { + m->area->camera->mode = CAMERA_MODE_NEWCAM; + gLakituState.mode = CAMERA_MODE_NEWCAM; + } #endif + queue_rumble_data(5, 80); break; case AIR_STEP_HIT_WALL: @@ -1797,7 +1829,17 @@ s32 act_flying(struct MarioState *m) { m->particleFlags |= PARTICLE_VERTICAL_STAR; set_mario_action(m, ACT_BACKWARD_AIR_KB, 0); +#ifndef BETTERCAMERA + set_camera_mode(m->area->camera, m->area->camera->defMode, 1); +#else + if (newcam_active == 0) set_camera_mode(m->area->camera, m->area->camera->defMode, 1); + else + { + m->area->camera->mode = CAMERA_MODE_NEWCAM; + gLakituState.mode = CAMERA_MODE_NEWCAM; + } +#endif } else { if (m->actionTimer++ == 0) { play_sound(SOUND_ACTION_HIT, m->marioObj->header.gfx.cameraToObject); @@ -1832,9 +1874,7 @@ s32 act_flying(struct MarioState *m) { play_sound(SOUND_MARIO_YAHOO_WAHA_YIPPEE + ((gAudioRandom % 5) << 16), m->marioObj->header.gfx.cameraToObject); #endif -#ifdef VERSION_SH queue_rumble_data(50, 40); -#endif } play_sound(SOUND_MOVING_FLYING, m->marioObj->header.gfx.cameraToObject); @@ -1848,9 +1888,7 @@ s32 act_riding_hoot(struct MarioState *m) { m->usedObj->oHootMarioReleaseTime = gGlobalTimer; play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED); -#ifdef VERSION_SH queue_rumble_data(4, 40); -#endif return set_mario_action(m, ACT_FREEFALL, 0); } @@ -1878,7 +1916,17 @@ s32 act_flying_triple_jump(struct MarioState *m) { #ifndef VERSION_JP if (m->input & (INPUT_B_PRESSED | INPUT_Z_PRESSED)) { if (m->area->camera->mode == CAMERA_MODE_BEHIND_MARIO) { +#ifndef BETTERCAMERA set_camera_mode(m->area->camera, m->area->camera->defMode, 1); +#else + if (newcam_active == 0) + set_camera_mode(m->area->camera, m->area->camera->defMode, 1); + else + { + m->area->camera->mode = CAMERA_MODE_NEWCAM; + gLakituState.mode = CAMERA_MODE_NEWCAM; + } +#endif } if (m->input & INPUT_B_PRESSED) { return set_mario_action(m, ACT_DIVE, 0); @@ -1906,9 +1954,7 @@ s32 act_flying_triple_jump(struct MarioState *m) { if (is_anim_past_end(m)) { set_mario_animation(m, MARIO_ANIM_FORWARD_SPINNING); -#ifdef VERSION_SH queue_rumble_data(8, 80); -#endif m->actionState = 1; } } @@ -1919,7 +1965,17 @@ s32 act_flying_triple_jump(struct MarioState *m) { if (m->vel[1] < 4.0f) { if (m->area->camera->mode != CAMERA_MODE_BEHIND_MARIO) { +#ifndef BETTERCAMERA set_camera_mode(m->area->camera, CAMERA_MODE_BEHIND_MARIO, 1); +#else + if (newcam_active == 0) + set_camera_mode(m->area->camera, m->area->camera->defMode, 1); + else + { + m->area->camera->mode = CAMERA_MODE_NEWCAM; + gLakituState.mode = CAMERA_MODE_NEWCAM; + } +#endif } if (m->forwardVel < 32.0f) { @@ -1929,9 +1985,11 @@ s32 act_flying_triple_jump(struct MarioState *m) { set_mario_action(m, ACT_FLYING, 1); } +#ifndef BETTERCAMERA if (m->actionTimer++ == 10 && m->area->camera->mode != CAMERA_MODE_BEHIND_MARIO) { set_camera_mode(m->area->camera, CAMERA_MODE_BEHIND_MARIO, 1); } +#endif update_air_without_turn(m); @@ -1969,9 +2027,7 @@ s32 act_vertical_wind(struct MarioState *m) { set_mario_animation(m, MARIO_ANIM_FORWARD_SPINNING_FLIP); if (m->marioObj->header.gfx.unk38.animFrame == 1) { play_sound(SOUND_ACTION_SPIN, m->marioObj->header.gfx.cameraToObject); -#ifdef VERSION_SH queue_rumble_data(8, 80); -#endif } if (is_anim_past_end(m)) { diff --git a/src/game/mario_actions_automatic.c b/src/game/mario_actions_automatic.c index ee6720bd..a74f4a18 100644 --- a/src/game/mario_actions_automatic.c +++ b/src/game/mario_actions_automatic.c @@ -171,9 +171,7 @@ s32 act_holding_pole(struct MarioState *m) { } } play_climbing_sounds(m, 2); -#ifdef VERSION_SH reset_rumble_timers(); -#endif func_80320A4C(1, marioObj->oMarioPoleYawVel / 0x100 * 2); } else { marioObj->oMarioPoleYawVel = 0; @@ -385,13 +383,9 @@ void update_hang_stationary(struct MarioState *m) { } s32 act_start_hanging(struct MarioState *m) { -#ifdef VERSION_SH if (m->actionTimer++ == 0) { queue_rumble_data(5, 80); } -#else - m->actionTimer++; -#endif if ((m->input & INPUT_NONZERO_ANALOG) && m->actionTimer >= 31) { return set_mario_action(m, ACT_HANGING, 0); @@ -470,9 +464,7 @@ s32 act_hang_moving(struct MarioState *m) { if (m->marioObj->header.gfx.unk38.animFrame == 12) { play_sound(SOUND_ACTION_HANGING_STEP, m->marioObj->header.gfx.cameraToObject); -#ifdef VERSION_SH queue_rumble_data(5, 30); -#endif } if (is_anim_past_end(m)) { @@ -662,9 +654,7 @@ s32 act_grabbed(struct MarioState *m) { m->faceAngle[1] = m->usedObj->oMoveAngleYaw; vec3f_copy(m->pos, m->marioObj->header.gfx.pos); -#ifdef VERSION_SH queue_rumble_data(5, 60); -#endif return set_mario_action(m, (m->forwardVel >= 0.0f) ? ACT_THROWN_FORWARD : ACT_THROWN_BACKWARD, thrown); @@ -744,17 +734,13 @@ s32 act_in_cannon(struct MarioState *m) { m->marioObj->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE; set_mario_action(m, ACT_SHOT_FROM_CANNON, 0); -#ifdef VERSION_SH queue_rumble_data(60, 70); -#endif m->usedObj->oAction = 2; return FALSE; } else { if (m->faceAngle[0] != startFacePitch || m->faceAngle[1] != startFaceYaw) { play_sound(SOUND_MOVING_AIM_CANNON, m->marioObj->header.gfx.cameraToObject); -#ifdef VERSION_SH reset_rumble_timers_2(0); -#endif } } } @@ -840,9 +826,7 @@ s32 act_tornado_twirling(struct MarioState *m) { vec3f_copy(m->marioObj->header.gfx.pos, m->pos); vec3s_set(m->marioObj->header.gfx.angle, 0, m->faceAngle[1] + m->twirlYaw, 0); -#ifdef VERSION_SH reset_rumble_timers(); -#endif return FALSE; } diff --git a/src/game/mario_actions_cutscene.c b/src/game/mario_actions_cutscene.c index 3817fd19..72e76929 100644 --- a/src/game/mario_actions_cutscene.c +++ b/src/game/mario_actions_cutscene.c @@ -28,9 +28,11 @@ #include "seq_ids.h" #include "sound_init.h" #include "thread6.h" +#include "../../include/libc/stdlib.h" +#include "pc/pc_main.h" // TODO: put this elsewhere -enum SaveOption { SAVE_OPT_SAVE_AND_CONTINUE = 1, SAVE_OPT_SAVE_AND_QUIT, SAVE_OPT_CONTINUE_DONT_SAVE }; +enum SaveOption { SAVE_OPT_SAVE_AND_CONTINUE = 1, SAVE_OPT_SAVE_AND_QUIT, SAVE_OPT_SAVE_EXIT_GAME, SAVE_OPT_CONTINUE_DONT_SAVE }; static struct Object *sIntroWarpPipeObj; static struct Object *sEndPeachObj; @@ -253,16 +255,20 @@ void handle_save_menu(struct MarioState *m) { // wait for the menu to show up if (is_anim_past_end(m) && gSaveOptSelectIndex != 0) { // save and continue / save and quit - if (gSaveOptSelectIndex == SAVE_OPT_SAVE_AND_CONTINUE || gSaveOptSelectIndex == SAVE_OPT_SAVE_AND_QUIT) { + if (gSaveOptSelectIndex == SAVE_OPT_SAVE_AND_CONTINUE || gSaveOptSelectIndex == SAVE_OPT_SAVE_EXIT_GAME || gSaveOptSelectIndex == SAVE_OPT_SAVE_AND_QUIT) { save_file_do_save(gCurrSaveFileNum - 1); if (gSaveOptSelectIndex == SAVE_OPT_SAVE_AND_QUIT) { fade_into_special_warp(-2, 0); // reset game + } else if (gSaveOptSelectIndex == SAVE_OPT_SAVE_EXIT_GAME) { + //initiate_warp(LEVEL_CASTLE, 1, 0x1F, 0); + fade_into_special_warp(0, 0); + game_exit(); } } // not quitting - if (gSaveOptSelectIndex != SAVE_OPT_SAVE_AND_QUIT) { + if (gSaveOptSelectIndex != SAVE_OPT_SAVE_EXIT_GAME) { disable_time_stop(); m->faceAngle[1] += 0x8000; // figure out what dialog to show, if we should @@ -1170,9 +1176,7 @@ s32 act_death_exit(struct MarioState *m) { #else play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject); #endif -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif m->numLives--; // restore 7.75 units of health m->healCounter = 31; @@ -1205,9 +1209,7 @@ s32 act_falling_death_exit(struct MarioState *m) { #else play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject); #endif -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif m->numLives--; // restore 7.75 units of health m->healCounter = 31; @@ -1252,9 +1254,7 @@ s32 act_special_death_exit(struct MarioState *m) { } if (launch_mario_until_land(m, ACT_HARD_BACKWARD_GROUND_KB, MARIO_ANIM_BACKWARD_AIR_KB, -24.0f)) { -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif m->numLives--; m->healCounter = 31; } @@ -1338,9 +1338,7 @@ s32 act_bbh_enter_spin(struct MarioState *m) { m->flags &= ~MARIO_UNKNOWN_08; if (perform_air_step(m, 0) == AIR_STEP_LANDED) { level_trigger_warp(m, WARP_OP_UNKNOWN_02); -#ifdef VERSION_SH queue_rumble_data(15, 80); -#endif m->actionState = 4; } if (m->actionState == 2) { @@ -1406,12 +1404,10 @@ s32 act_teleport_fade_out(struct MarioState *m) { set_mario_animation(m, m->prevAction == ACT_CROUCHING ? MARIO_ANIM_CROUCHING : MARIO_ANIM_FIRST_PERSON); -#ifdef VERSION_SH if (m->actionTimer == 0) { queue_rumble_data(30, 70); func_sh_8024C89C(2); } -#endif m->flags |= MARIO_TELEPORTING; @@ -1432,12 +1428,10 @@ s32 act_teleport_fade_in(struct MarioState *m) { play_sound_if_no_flag(m, SOUND_ACTION_TELEPORT, MARIO_ACTION_SOUND_PLAYED); set_mario_animation(m, MARIO_ANIM_FIRST_PERSON); -#ifdef VERSION_SH if (m->actionTimer == 0) { queue_rumble_data(30, 70); func_sh_8024C89C(2); } -#endif if (m->actionTimer < 32) { m->flags |= MARIO_TELEPORTING; @@ -1525,9 +1519,7 @@ s32 act_squished(struct MarioState *m) { // Both of the 1.8's are really floats, but one of them has to // be written as a double for this to match on EU. vec3f_set(m->marioObj->header.gfx.scale, 1.8, 0.05f, 1.8f); -#ifdef VERSION_SH queue_rumble_data(10, 80); -#endif m->actionState = 1; } break; @@ -1629,9 +1621,7 @@ void stuck_in_ground_handler(struct MarioState *m, s32 animation, s32 unstuckFra if (animFrame == -1) { play_sound_and_spawn_particles(m, SOUND_ACTION_TERRAIN_STUCK_IN_GROUND, 1); } else if (animFrame == unstuckFrame) { -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif play_sound_and_spawn_particles(m, SOUND_ACTION_UNSTUCK_FROM_GROUND, 1); } else if (animFrame == target2 || animFrame == target3) { play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_LANDING); diff --git a/src/game/mario_actions_moving.c b/src/game/mario_actions_moving.c index 7dd30971..0ccbccf1 100644 --- a/src/game/mario_actions_moving.c +++ b/src/game/mario_actions_moving.c @@ -12,6 +12,8 @@ #include "memory.h" #include "behavior_data.h" #include "thread6.h" +#include "pc/configfile.h" +#include "pc/cheats.h" struct LandingAction { s16 numFrames; @@ -461,8 +463,14 @@ void update_walking_speed(struct MarioState *m) { m->forwardVel = 48.0f; } - m->faceAngle[1] = - m->intendedYaw - approach_s32((s16)(m->intendedYaw - m->faceAngle[1]), 0, 0x800, 0x800); + /* Handles the "Super responsive controls" cheat. The content of the "else" is Mario's original code for turning around.*/ + + if (Cheats.Responsive == true && Cheats.EnableCheats == true ) { + m->faceAngle[1] = m->intendedYaw; + } + else { + m->faceAngle[1] = m->intendedYaw - approach_s32((s16)(m->intendedYaw - m->faceAngle[1]), 0, 0x800, 0x800); + } apply_slope_accel(m); } @@ -1244,9 +1252,8 @@ s32 act_riding_shell_ground(struct MarioState *m) { } adjust_sound_for_speed(m); -#ifdef VERSION_SH + reset_rumble_timers(); -#endif return FALSE; } @@ -1350,9 +1357,8 @@ s32 act_burning_ground(struct MarioState *m) { } m->marioBodyState->eyeState = MARIO_EYES_DEAD; -#ifdef VERSION_SH + reset_rumble_timers(); -#endif return FALSE; } @@ -1368,9 +1374,7 @@ void common_slide_action(struct MarioState *m, u32 endAction, u32 airAction, s32 vec3f_copy(val14, m->pos); play_sound(SOUND_MOVING_TERRAIN_SLIDE + m->terrainSoundAddend, m->marioObj->header.gfx.cameraToObject); -#ifdef VERSION_SH reset_rumble_timers(); -#endif adjust_sound_for_speed(m); @@ -1494,9 +1498,7 @@ s32 act_crouch_slide(struct MarioState *m) { s32 act_slide_kick_slide(struct MarioState *m) { if (m->input & INPUT_A_PRESSED) { -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif return set_jumping_action(m, ACT_FORWARD_ROLLOUT, 0); } @@ -1526,9 +1528,7 @@ s32 act_slide_kick_slide(struct MarioState *m) { s32 stomach_slide_action(struct MarioState *m, u32 stopAction, u32 airAction, s32 animation) { if (m->actionTimer == 5) { if (!(m->input & INPUT_ABOVE_SLIDE) && (m->input & (INPUT_A_PRESSED | INPUT_B_PRESSED))) { -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif return drop_and_set_mario_action( m, m->forwardVel >= 0.0f ? ACT_FORWARD_ROLLOUT : ACT_BACKWARD_ROLLOUT, 0); } @@ -1562,9 +1562,7 @@ s32 act_hold_stomach_slide(struct MarioState *m) { s32 act_dive_slide(struct MarioState *m) { if (!(m->input & INPUT_ABOVE_SLIDE) && (m->input & (INPUT_A_PRESSED | INPUT_B_PRESSED))) { -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif return set_mario_action(m, m->forwardVel > 0.0f ? ACT_FORWARD_ROLLOUT : ACT_BACKWARD_ROLLOUT, 0); } @@ -1855,7 +1853,7 @@ s32 act_long_jump_land(struct MarioState *m) { m->forwardVel = 0.0f; } #endif - + if (!(m->input & INPUT_Z_DOWN)) { m->input &= ~INPUT_A_PRESSED; } diff --git a/src/game/mario_actions_object.c b/src/game/mario_actions_object.c index 2c6099a2..e34192a5 100644 --- a/src/game/mario_actions_object.c +++ b/src/game/mario_actions_object.c @@ -265,9 +265,7 @@ s32 act_throwing(struct MarioState *m) { mario_throw_held_object(m); play_sound_if_no_flag(m, SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED); play_sound_if_no_flag(m, SOUND_ACTION_THROW, MARIO_ACTION_SOUND_PLAYED); -#ifdef VERSION_SH queue_rumble_data(3, 50); -#endif } animated_stationary_ground_step(m, MARIO_ANIM_GROUND_THROW, ACT_IDLE); @@ -287,9 +285,7 @@ s32 act_heavy_throw(struct MarioState *m) { mario_drop_held_object(m); play_sound_if_no_flag(m, SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED); play_sound_if_no_flag(m, SOUND_ACTION_THROW, MARIO_ACTION_SOUND_PLAYED); -#ifdef VERSION_SH queue_rumble_data(3, 50); -#endif } animated_stationary_ground_step(m, MARIO_ANIM_HEAVY_THROW, ACT_IDLE); @@ -319,9 +315,7 @@ s32 act_picking_up_bowser(struct MarioState *m) { m->angleVel[1] = 0; m->marioBodyState->grabPos = GRAB_POS_BOWSER; mario_grab_used_object(m); -#ifdef VERSION_SH queue_rumble_data(5, 80); -#endif play_sound(SOUND_MARIO_HRMM, m->marioObj->header.gfx.cameraToObject); } @@ -397,15 +391,11 @@ s32 act_holding_bowser(struct MarioState *m) { // play sound on overflow if (m->angleVel[1] <= -0x100 && spin < m->faceAngle[1]) { -#ifdef VERSION_SH queue_rumble_data(4, 20); -#endif play_sound(SOUND_OBJ_BOWSER_SPINNING, m->marioObj->header.gfx.cameraToObject); } if (m->angleVel[1] >= 0x100 && spin > m->faceAngle[1]) { -#ifdef VERSION_SH queue_rumble_data(4, 20); -#endif play_sound(SOUND_OBJ_BOWSER_SPINNING, m->marioObj->header.gfx.cameraToObject); } @@ -422,14 +412,10 @@ s32 act_holding_bowser(struct MarioState *m) { s32 act_releasing_bowser(struct MarioState *m) { if (++m->actionTimer == 1) { if (m->actionArg == 0) { -#ifdef VERSION_SH queue_rumble_data(4, 50); -#endif mario_throw_held_object(m); } else { -#ifdef VERSION_SH queue_rumble_data(4, 50); -#endif mario_drop_held_object(m); } } diff --git a/src/game/mario_actions_stationary.c b/src/game/mario_actions_stationary.c index 3791d113..440610f8 100644 --- a/src/game/mario_actions_stationary.c +++ b/src/game/mario_actions_stationary.c @@ -799,16 +799,12 @@ s32 act_shockwave_bounce(struct MarioState *m) { f32 sp18; if (m->marioObj->oInteractStatus & 0x10) { -#ifdef VERSION_SH queue_rumble_data(70, 40); -#endif return hurt_and_set_mario_action(m, ACT_SHOCKED, 0, 4); } if (m->actionTimer == 0) { -#ifdef VERSION_SH queue_rumble_data(70, 40); -#endif if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_UNK1) { return hurt_and_set_mario_action(m, ACT_BACKWARD_GROUND_KB, 0, 0xc); } diff --git a/src/game/mario_actions_submerged.c b/src/game/mario_actions_submerged.c index 72e845f5..f03e4a93 100644 --- a/src/game/mario_actions_submerged.c +++ b/src/game/mario_actions_submerged.c @@ -554,11 +554,9 @@ static s32 act_breaststroke(struct MarioState *m) { reset_float_globals(m); } -#ifdef VERSION_SH if (m->actionTimer < 6) { func_sh_8024CA04(); } -#endif set_mario_animation(m, MARIO_ANIM_SWIM_PART1); common_swimming_step(m, sSwimStrength); @@ -802,9 +800,7 @@ static s32 act_water_throw(struct MarioState *m) { if (m->actionTimer++ == 5) { mario_throw_held_object(m); -#ifdef VERSION_SH queue_rumble_data(3, 50); -#endif } if (is_anim_at_end(m)) { @@ -978,11 +974,9 @@ static s32 act_water_plunge(struct MarioState *m) { m->particleFlags |= PARTICLE_WATER_SPLASH; m->actionState = 1; -#ifdef VERSION_SH if (m->prevAction & ACT_FLAG_AIR) { queue_rumble_data(5, 80); } -#endif } if (stepResult == WATER_STEP_HIT_FLOOR || m->vel[1] >= endVSpeed || m->actionTimer > 20) { @@ -1087,10 +1081,8 @@ static s32 act_caught_in_whirlpool(struct MarioState *m) { set_mario_animation(m, MARIO_ANIM_GENERAL_FALL); vec3f_copy(m->marioObj->header.gfx.pos, m->pos); vec3s_set(m->marioObj->header.gfx.angle, 0, m->faceAngle[1], 0); -#ifdef VERSION_SH + reset_rumble_timers(); -#endif - return FALSE; } diff --git a/src/game/mario_misc.c b/src/game/mario_misc.c index f2ed0578..e6354e89 100644 --- a/src/game/mario_misc.c +++ b/src/game/mario_misc.c @@ -305,11 +305,11 @@ static Gfx *make_gfx_mario_alpha(struct GraphNodeGenerated *node, s16 alpha) { if (alpha == 255) { node->fnNode.node.flags = (node->fnNode.node.flags & 0xFF) | (LAYER_OPAQUE << 8); - gfxHead = (Gfx*) alloc_display_list(2 * sizeof(*gfxHead)); + gfxHead = alloc_display_list(2 * sizeof(*gfxHead)); gfx = gfxHead; } else { node->fnNode.node.flags = (node->fnNode.node.flags & 0xFF) | (LAYER_TRANSPARENT << 8); - gfxHead = (Gfx*) alloc_display_list(3 * sizeof(*gfxHead)); + gfxHead = alloc_display_list(3 * sizeof(*gfxHead)); gfx = gfxHead; gDPSetAlphaCompare(gfx++, G_AC_DITHER); } @@ -637,7 +637,7 @@ Gfx *geo_mirror_mario_backface_culling(s32 callContext, struct GraphNode *node, Gfx *gfx = NULL; if (callContext == GEO_CONTEXT_RENDER && gCurGraphNodeObject == &gMirrorMario) { - gfx = (Gfx*) alloc_display_list(3 * sizeof(*gfx)); + gfx = alloc_display_list(3 * sizeof(*gfx)); if (asGenerated->parameter == 0) { gSPClearGeometryMode(&gfx[0], G_CULL_BACK); diff --git a/src/game/memory.c b/src/game/memory.c index c9ee9683..14862cca 100644 --- a/src/game/memory.c +++ b/src/game/memory.c @@ -1,7 +1,5 @@ #include -#ifndef TARGET_N64 #include -#endif #include "sm64.h" @@ -76,27 +74,6 @@ void *get_segment_base_addr(s32 segment) { return (void *) (sSegmentTable[segment] | 0x80000000); } -#ifndef NO_SEGMENTED_MEMORY -void *segmented_to_virtual(const void *addr) { - size_t segment = (uintptr_t) addr >> 24; - size_t offset = (uintptr_t) addr & 0x00FFFFFF; - - return (void *) ((sSegmentTable[segment] + offset) | 0x80000000); -} - -void *virtual_to_segmented(u32 segment, const void *addr) { - size_t offset = ((uintptr_t) addr & 0x1FFFFFFF) - sSegmentTable[segment]; - - return (void *) ((segment << 24) + offset); -} - -void move_segment_table_to_dmem(void) { - s32 i; - - for (i = 0; i < 16; i++) - gSPSegment(gDisplayListHead++, i, sSegmentTable[i]); -} -#else void *segmented_to_virtual(const void *addr) { return (void *) addr; } @@ -107,7 +84,7 @@ void *virtual_to_segmented(UNUSED u32 segment, const void *addr) { void move_segment_table_to_dmem(void) { } -#endif + /** * Initialize the main memory pool. This pool is conceptually a pair of stacks @@ -220,7 +197,7 @@ u32 main_pool_push_state(void) { struct MainPoolBlock *lhead = sPoolListHeadL; struct MainPoolBlock *rhead = sPoolListHeadR; - gMainPoolState = (struct MainPoolState*) main_pool_alloc(sizeof(*gMainPoolState), MEMORY_POOL_LEFT); + gMainPoolState = main_pool_alloc(sizeof(*gMainPoolState), MEMORY_POOL_LEFT); gMainPoolState->freeSpace = freeSpace; gMainPoolState->listHeadL = lhead; gMainPoolState->listHeadR = rhead; @@ -236,7 +213,7 @@ u32 main_pool_pop_state(void) { sPoolFreeSpace = gMainPoolState->freeSpace; sPoolListHeadL = gMainPoolState->listHeadL; sPoolListHeadR = gMainPoolState->listHeadR; - gMainPoolState = (struct MainPoolState*) gMainPoolState->prev; + gMainPoolState = gMainPoolState->prev; return sPoolFreeSpace; } @@ -245,23 +222,9 @@ u32 main_pool_pop_state(void) { * function blocks until completion. */ static void dma_read(u8 *dest, u8 *srcStart, u8 *srcEnd) { -#ifdef TARGET_N64 u32 size = ALIGN16(srcEnd - srcStart); - osInvalDCache(dest, size); - while (size != 0) { - u32 copySize = (size >= 0x1000) ? 0x1000 : size; - osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) srcStart, dest, copySize, - &gDmaMesgQueue); - osRecvMesg(&gDmaMesgQueue, &D_80339BEC, OS_MESG_BLOCK); - - dest += copySize; - srcStart += copySize; - size -= copySize; - } -#else memcpy(dest, srcStart, srcEnd - srcStart); -#endif } /** @@ -274,107 +237,11 @@ static void *dynamic_dma_read(u8 *srcStart, u8 *srcEnd, u32 side) { dest = main_pool_alloc(size, side); if (dest != NULL) { - dma_read((u8*) dest, srcStart, srcEnd); + dma_read(dest, srcStart, srcEnd); } return dest; } -#ifndef NO_SEGMENTED_MEMORY -/** - * Load data from ROM into a newly allocated block, and set the segment base - * address to this block. - */ -void *load_segment(s32 segment, u8 *srcStart, u8 *srcEnd, u32 side) { - void *addr = dynamic_dma_read(srcStart, srcEnd, side); - - if (addr != NULL) { - set_segment_base_addr(segment, addr); - } - return addr; -} - -/* - * Allocate a block of memory starting at destAddr and ending at the end of - * the memory pool. Then copy srcStart through srcEnd from ROM to this block. - * If this block is not large enough to hold the ROM data, or that portion - * of the pool is already allocated, return NULL. - */ -void *load_to_fixed_pool_addr(u8 *destAddr, u8 *srcStart, u8 *srcEnd) { - void *dest = NULL; - u32 srcSize = ALIGN16(srcEnd - srcStart); - u32 destSize = ALIGN16((u8 *) sPoolListHeadR - destAddr); - - if (srcSize <= destSize) { - dest = main_pool_alloc(destSize, MEMORY_POOL_RIGHT); - if (dest != NULL) { - bzero(dest, destSize); - osWritebackDCacheAll(); - dma_read(dest, srcStart, srcEnd); - osInvalICache(dest, destSize); - osInvalDCache(dest, destSize); - } - } else { - } - return dest; -} - -/** - * Decompress the block of ROM data from srcStart to srcEnd and return a - * pointer to an allocated buffer holding the decompressed data. Set the - * base address of segment to this address. - */ -void *load_segment_decompress(s32 segment, u8 *srcStart, u8 *srcEnd) { - void *dest = NULL; - - u32 compSize = ALIGN16(srcEnd - srcStart); - u8 *compressed = main_pool_alloc(compSize, MEMORY_POOL_RIGHT); - - // Decompressed size from mio0 header - u32 *size = (u32 *) (compressed + 4); - - if (compressed != NULL) { - dma_read(compressed, srcStart, srcEnd); - dest = main_pool_alloc(*size, MEMORY_POOL_LEFT); - if (dest != NULL) { - decompress(compressed, dest); - set_segment_base_addr(segment, dest); - main_pool_free(compressed); - } else { - } - } else { - } - return dest; -} - -void *load_segment_decompress_heap(u32 segment, u8 *srcStart, u8 *srcEnd) { - UNUSED void *dest = NULL; - u32 compSize = ALIGN16(srcEnd - srcStart); - u8 *compressed = main_pool_alloc(compSize, MEMORY_POOL_RIGHT); - UNUSED u32 *pUncSize = (u32 *) (compressed + 4); - - if (compressed != NULL) { - dma_read(compressed, srcStart, srcEnd); - decompress(compressed, gDecompressionHeap); - set_segment_base_addr(segment, gDecompressionHeap); - main_pool_free(compressed); - } else { - } - return gDecompressionHeap; -} - -void load_engine_code_segment(void) { - void *startAddr = (void *) SEG_ENGINE; - u32 totalSize = SEG_FRAMEBUFFERS - SEG_ENGINE; - UNUSED u32 alignedSize = ALIGN16(_engineSegmentRomEnd - _engineSegmentRomStart); - - bzero(startAddr, totalSize); - osWritebackDCacheAll(); - dma_read(startAddr, _engineSegmentRomStart, _engineSegmentRomEnd); - osInvalICache(startAddr, totalSize); - osInvalDCache(startAddr, totalSize); -} -#endif - /** * Allocate an allocation-only pool from the main pool. This pool doesn't * support freeing allocated memory. @@ -422,7 +289,7 @@ struct AllocOnlyPool *alloc_only_pool_resize(struct AllocOnlyPool *pool, u32 siz struct AllocOnlyPool *newPool; size = ALIGN4(size); - newPool = (struct AllocOnlyPool*) main_pool_realloc(pool, size + sizeof(struct AllocOnlyPool)); + newPool = main_pool_realloc(pool, size + sizeof(struct AllocOnlyPool)); if (newPool != NULL) { pool->totalSpace = size; } @@ -537,20 +404,20 @@ void *alloc_display_list(u32 size) { } static struct MarioAnimDmaRelatedThing *func_802789F0(u8 *srcAddr) { - struct MarioAnimDmaRelatedThing *sp1C = (struct MarioAnimDmaRelatedThing*) dynamic_dma_read(srcAddr, srcAddr + sizeof(u32), + struct MarioAnimDmaRelatedThing *sp1C = dynamic_dma_read(srcAddr, srcAddr + sizeof(u32), MEMORY_POOL_LEFT); u32 size = sizeof(u32) + (sizeof(u8 *) - sizeof(u32)) + sizeof(u8 *) + sp1C->count * sizeof(struct OffsetSizePair); main_pool_free(sp1C); - sp1C = (struct MarioAnimDmaRelatedThing*) dynamic_dma_read(srcAddr, srcAddr + size, MEMORY_POOL_LEFT); + sp1C = dynamic_dma_read(srcAddr, srcAddr + size, MEMORY_POOL_LEFT); sp1C->srcAddr = srcAddr; return sp1C; } void func_80278A78(struct MarioAnimation *a, void *b, struct Animation *target) { if (b != NULL) { - a->animDmaTable = func_802789F0((u8*) b); + a->animDmaTable = func_802789F0(b); } a->currentAnimAddr = NULL; a->targetAnim = target; diff --git a/src/game/memory.h b/src/game/memory.h index 7a51e590..48cd703c 100644 --- a/src/game/memory.h +++ b/src/game/memory.h @@ -8,6 +8,7 @@ #define MEMORY_POOL_LEFT 0 #define MEMORY_POOL_RIGHT 1 +#define GFX_POOL_SIZE (512 * 1024) struct AllocOnlyPool { @@ -18,6 +19,8 @@ struct AllocOnlyPool }; struct MemoryPool; +struct MarioAnimation; +struct Animation; #ifndef INCLUDED_FROM_MEMORY_C // Declaring this variable extern puts it in the wrong place in the bss order @@ -40,19 +43,11 @@ u32 main_pool_available(void); u32 main_pool_push_state(void); u32 main_pool_pop_state(void); -#ifndef NO_SEGMENTED_MEMORY -void *load_segment(s32 segment, u8 *srcStart, u8 *srcEnd, u32 side); -void *load_to_fixed_pool_addr(u8 *destAddr, u8 *srcStart, u8 *srcEnd); -void *load_segment_decompress(s32 segment, u8 *srcStart, u8 *srcEnd); -void *load_segment_decompress_heap(u32 segment, u8 *srcStart, u8 *srcEnd); -void load_engine_code_segment(void); -#else #define load_segment(...) #define load_to_fixed_pool_addr(...) #define load_segment_decompress(...) #define load_segment_decompress_heap(...) #define load_engine_code_segment(...) -#endif struct AllocOnlyPool *alloc_only_pool_init(u32 size, u32 side); void *alloc_only_pool_alloc(struct AllocOnlyPool *pool, s32 size); @@ -63,6 +58,7 @@ void *mem_pool_alloc(struct MemoryPool *pool, u32 size); void mem_pool_free(struct MemoryPool *pool, void *addr); void *alloc_display_list(u32 size); + void func_80278A78(struct MarioAnimation *a, void *b, struct Animation *target); s32 load_patchable_table(struct MarioAnimation *a, u32 b); diff --git a/src/game/moving_texture.c b/src/game/moving_texture.c index fd96e27f..4946508b 100644 --- a/src/game/moving_texture.c +++ b/src/game/moving_texture.c @@ -412,14 +412,14 @@ Gfx *movtex_gen_from_quad(s16 y, struct MovtexQuad *quad) { s16 rotDir = quad->rotDir; s16 alpha = quad->alpha; s16 textureId = quad->textureId; - Vtx *verts = (Vtx*) alloc_display_list(4 * sizeof(*verts)); + Vtx *verts = alloc_display_list(4 * sizeof(*verts)); Gfx *gfxHead; Gfx *gfx; if (textureId == gMovetexLastTextureId) { - gfxHead = (Gfx*) alloc_display_list(3 * sizeof(*gfxHead)); + gfxHead = alloc_display_list(3 * sizeof(*gfxHead)); } else { - gfxHead = (Gfx*) alloc_display_list(8 * sizeof(*gfxHead)); + gfxHead = alloc_display_list(8 * sizeof(*gfxHead)); } if (gfxHead == NULL || verts == NULL) { @@ -468,9 +468,9 @@ Gfx *movtex_gen_from_quad(s16 y, struct MovtexQuad *quad) { * is the number of entries, followed by that number of MovtexQuad structs. */ Gfx *movtex_gen_from_quad_array(s16 y, void *quadArrSegmented) { - s16 *quadArr = (s16*) segmented_to_virtual(quadArrSegmented); + s16 *quadArr = segmented_to_virtual(quadArrSegmented); s16 numLists = quadArr[0]; - Gfx *gfxHead = (Gfx*) alloc_display_list((numLists + 1) * sizeof(*gfxHead)); + Gfx *gfxHead = alloc_display_list((numLists + 1) * sizeof(*gfxHead)); Gfx *gfx = gfxHead; Gfx *subList; s32 i; @@ -499,7 +499,7 @@ Gfx *movtex_gen_from_quad_array(s16 y, void *quadArrSegmented) { * that will be searched. */ Gfx *movtex_gen_quads_id(s16 id, s16 y, void *movetexQuadsSegmented) { - struct MovtexQuadCollection *collection = (struct MovtexQuadCollection*) segmented_to_virtual(movetexQuadsSegmented); + struct MovtexQuadCollection *collection = segmented_to_virtual(movetexQuadsSegmented); s32 i = 0; while (collection[i].id != -1) { @@ -637,7 +637,7 @@ Gfx *geo_movtex_draw_water_regions(s32 callContext, struct GraphNode *node, UNUS return NULL; } numWaterBoxes = gEnvironmentRegions[0]; - gfxHead = (Gfx*) alloc_display_list((numWaterBoxes + 3) * sizeof(*gfxHead)); + gfxHead = alloc_display_list((numWaterBoxes + 3) * sizeof(*gfxHead)); if (gfxHead == NULL) { return NULL; } else { @@ -804,8 +804,8 @@ void movtex_write_vertex_index(Vtx *verts, s32 index, s16 *movtexVerts, struct M * 'attrLayout' is one of MOVTEX_LAYOUT_NOCOLOR and MOVTEX_LAYOUT_COLORED. */ Gfx *movtex_gen_list(s16 *movtexVerts, struct MovtexObject *movtexList, s8 attrLayout) { - Vtx *verts = (Vtx*) alloc_display_list(movtexList->vtx_count * sizeof(*verts)); - Gfx *gfxHead = (Gfx*) alloc_display_list(11 * sizeof(*gfxHead)); + Vtx *verts = alloc_display_list(movtexList->vtx_count * sizeof(*verts)); + Gfx *gfxHead = alloc_display_list(11 * sizeof(*gfxHead)); Gfx *gfx = gfxHead; s32 i; @@ -843,7 +843,7 @@ Gfx *geo_movtex_draw_nocolor(s32 callContext, struct GraphNode *node, UNUSED Mat if (gMovtexNonColored[i].geoId == asGenerated->parameter) { asGenerated->fnNode.node.flags = (asGenerated->fnNode.node.flags & 0xFF) | (gMovtexNonColored[i].layer << 8); - movtexVerts = (s16*) segmented_to_virtual(gMovtexNonColored[i].movtexVerts); + movtexVerts = segmented_to_virtual(gMovtexNonColored[i].movtexVerts); update_moving_texture_offset(movtexVerts, MOVTEX_ATTR_NOCOLOR_S); gfx = movtex_gen_list(movtexVerts, &gMovtexNonColored[i], MOVTEX_LAYOUT_NOCOLOR); // no perVertex colors @@ -871,7 +871,7 @@ Gfx *geo_movtex_draw_colored(s32 callContext, struct GraphNode *node, UNUSED Mat if (gMovtexColored[i].geoId == asGenerated->parameter) { asGenerated->fnNode.node.flags = (asGenerated->fnNode.node.flags & 0xFF) | (gMovtexColored[i].layer << 8); - movtexVerts = (s16*) segmented_to_virtual(gMovtexColored[i].movtexVerts); + movtexVerts = segmented_to_virtual(gMovtexColored[i].movtexVerts); update_moving_texture_offset(movtexVerts, MOVTEX_ATTR_COLORED_S); gfx = movtex_gen_list(movtexVerts, &gMovtexColored[i], MOVTEX_LAYOUT_COLORED); break; @@ -902,7 +902,7 @@ Gfx *geo_movtex_draw_colored_no_update(s32 callContext, struct GraphNode *node, if (gMovtexColored[i].geoId == asGenerated->parameter) { asGenerated->fnNode.node.flags = (asGenerated->fnNode.node.flags & 0xFF) | (gMovtexColored[i].layer << 8); - movtexVerts = (s16*) segmented_to_virtual(gMovtexColored[i].movtexVerts); + movtexVerts = segmented_to_virtual(gMovtexColored[i].movtexVerts); gfx = movtex_gen_list(movtexVerts, &gMovtexColored[i], MOVTEX_LAYOUT_COLORED); break; } @@ -929,7 +929,7 @@ Gfx *geo_movtex_draw_colored_2_no_update(s32 callContext, struct GraphNode *node if (gMovtexColored2[i].geoId == asGenerated->parameter) { asGenerated->fnNode.node.flags = (asGenerated->fnNode.node.flags & 0xFF) | (gMovtexColored2[i].layer << 8); - movtexVerts = (s16*) segmented_to_virtual(gMovtexColored2[i].movtexVerts); + movtexVerts = segmented_to_virtual(gMovtexColored2[i].movtexVerts); gfx = movtex_gen_list(movtexVerts, &gMovtexColored2[i], MOVTEX_LAYOUT_COLORED); break; } @@ -971,7 +971,7 @@ Gfx *geo_movtex_update_horizontal(s32 callContext, struct GraphNode *node, UNUSE movtexVerts = segmented_to_virtual(ttc_movtex_tris_small_surface_treadmill); break; } - update_moving_texture_offset((s16*) movtexVerts, MOVTEX_ATTR_COLORED_S); + update_moving_texture_offset(movtexVerts, MOVTEX_ATTR_COLORED_S); } return NULL; } diff --git a/src/game/obj_behaviors.c b/src/game/obj_behaviors.c index 4fe11c88..601c45f1 100644 --- a/src/game/obj_behaviors.c +++ b/src/game/obj_behaviors.c @@ -104,7 +104,7 @@ Gfx UNUSED *geo_obj_transparency_something(s32 callContext, struct GraphNode *no heldObject = gCurGraphNodeHeldObject->objNode; } - gfxHead = (Gfx*) alloc_display_list(3 * sizeof(Gfx)); + gfxHead = alloc_display_list(3 * sizeof(Gfx)); gfx = gfxHead; obj->header.gfx.node.flags = (obj->header.gfx.node.flags & 0xFF) | (GRAPH_NODE_TYPE_FUNCTIONAL | GRAPH_NODE_TYPE_400); // sets bits 8, 10 and zeros upper byte @@ -221,7 +221,7 @@ void obj_orient_graph(struct Object *obj, f32 normalX, f32 normalY, f32 normalZ) return; } - throwMatrix = (Mat4*) alloc_display_list(sizeof(*throwMatrix)); + throwMatrix = alloc_display_list(sizeof(*throwMatrix)); // If out of memory, fail to try orienting the object. if (throwMatrix == NULL) { return; @@ -530,11 +530,15 @@ void set_object_visibility(struct Object *obj, s32 dist) { f32 objY = obj->oPosY; f32 objZ = obj->oPosZ; +#ifndef NODRAWINGDISTANCE if (is_point_within_radius_of_mario(objX, objY, objZ, dist) == TRUE) { +#endif obj->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE; +#ifndef NODRAWINGDISTANCE } else { obj->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE; } +#endif } /** diff --git a/src/game/object_helpers.c b/src/game/object_helpers.c index cf31667b..22b45b32 100644 --- a/src/game/object_helpers.c +++ b/src/game/object_helpers.c @@ -27,7 +27,7 @@ #include "spawn_object.h" #include "spawn_sound.h" -s8 D_8032F0A0[] = { (s8) 0xF8, 0x08, (s8) 0xFC, 0x04 }; +s8 D_8032F0A0[] = { 0xF8, 0x08, 0xFC, 0x04 }; s16 D_8032F0A4[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; static s8 sLevelsWithRooms[] = { LEVEL_BBH, LEVEL_CASTLE, LEVEL_HMC, -1 }; @@ -69,7 +69,7 @@ Gfx *geo_update_layer_transparency(s32 callContext, struct GraphNode *node, UNUS } objectOpacity = objectGraphNode->oOpacity; - dlStart = (Gfx*) alloc_display_list(sizeof(Gfx) * 3); + dlStart = alloc_display_list(sizeof(Gfx) * 3); dlHead = dlStart; @@ -281,7 +281,7 @@ void obj_set_held_state(struct Object *obj, const BehaviorScript *heldBehavior) obj->oHeldState = HELD_DROPPED; } } else { - obj->curBhvCommand = (const BehaviorScript*) segmented_to_virtual(heldBehavior); + obj->curBhvCommand = segmented_to_virtual(heldBehavior); obj->bhvStackIndex = 0; } } @@ -528,7 +528,7 @@ struct Object *spawn_object_at_origin(struct Object *parent, UNUSED s32 unusedAr struct Object *obj; const BehaviorScript *behaviorAddr; - behaviorAddr = (const BehaviorScript*) segmented_to_virtual(behavior); + behaviorAddr = segmented_to_virtual(behavior); obj = create_object(behaviorAddr); obj->parentObj = parent; @@ -847,7 +847,7 @@ f32 cur_obj_dist_to_nearest_object_with_behavior(const BehaviorScript *behavior) } struct Object *cur_obj_find_nearest_object_with_behavior(const BehaviorScript *behavior, f32 *dist) { - uintptr_t *behaviorAddr = (uintptr_t*) segmented_to_virtual(behavior); + uintptr_t *behaviorAddr = segmented_to_virtual(behavior); struct Object *closestObj = NULL; struct Object *obj; struct ObjectNode *listHead; @@ -898,7 +898,7 @@ s32 count_unimportant_objects(void) { } s32 count_objects_with_behavior(const BehaviorScript *behavior) { - uintptr_t *behaviorAddr = (uintptr_t*) segmented_to_virtual(behavior); + uintptr_t *behaviorAddr = segmented_to_virtual(behavior); struct ObjectNode *listHead = &gObjectLists[get_object_list_from_behavior(behaviorAddr)]; struct ObjectNode *obj = listHead->next; s32 count = 0; @@ -915,7 +915,7 @@ s32 count_objects_with_behavior(const BehaviorScript *behavior) { } struct Object *cur_obj_find_nearby_held_actor(const BehaviorScript *behavior, f32 maxDist) { - const BehaviorScript *behaviorAddr = (const BehaviorScript*) segmented_to_virtual(behavior); + const BehaviorScript *behaviorAddr = segmented_to_virtual(behavior); struct ObjectNode *listHead; struct Object *obj; struct Object *foundObj; @@ -1469,11 +1469,11 @@ s32 obj_check_if_collided_with_object(struct Object *obj1, struct Object *obj2) } void cur_obj_set_behavior(const BehaviorScript *behavior) { - o->behavior = (const BehaviorScript*) segmented_to_virtual(behavior); + o->behavior = segmented_to_virtual(behavior); } void obj_set_behavior(struct Object *obj, const BehaviorScript *behavior) { - obj->behavior = (const BehaviorScript*) segmented_to_virtual(behavior); + obj->behavior = segmented_to_virtual(behavior); } s32 cur_obj_has_behavior(const BehaviorScript *behavior) { @@ -1587,6 +1587,10 @@ void obj_set_billboard(struct Object *obj) { obj->header.gfx.node.flags |= GRAPH_RENDER_BILLBOARD; } +void obj_set_cylboard(struct Object *obj) { + obj->header.gfx.node.flags |= GRAPH_RENDER_CYLBOARD; +} + void cur_obj_set_hitbox_radius_and_height(f32 radius, f32 height) { o->hitboxRadius = radius; o->hitboxHeight = height; @@ -2255,7 +2259,7 @@ s32 cur_obj_set_direction_table(s8 *a0) { s32 cur_obj_progress_direction_table(void) { s8 spF; - s8 *sp8 = (s8*) o->oToxBoxMovementPattern; + s8 *sp8 = o->oToxBoxMovementPattern; s32 sp4 = o->oToxBoxMovementStep + 1; if (sp8[sp4] != -1) { diff --git a/src/game/object_list_processor.c b/src/game/object_list_processor.c index 83c1120c..7113e7c8 100644 --- a/src/game/object_list_processor.c +++ b/src/game/object_list_processor.c @@ -474,7 +474,7 @@ void spawn_objects_from_info(UNUSED s32 unused, struct SpawnInfo *spawnInfo) { const BehaviorScript *script; UNUSED s16 arg16 = (s16)(spawnInfo->behaviorArg & 0xFFFF); - script = (const BehaviorScript*) segmented_to_virtual(spawnInfo->behaviorScript); + script = segmented_to_virtual(spawnInfo->behaviorScript); // If the object was previously killed/collected, don't respawn it if ((spawnInfo->behaviorArg & (RESPAWN_INFO_DONT_RESPAWN << 8)) diff --git a/src/game/object_list_processor.h b/src/game/object_list_processor.h index e3884f34..205ec3f1 100644 --- a/src/game/object_list_processor.h +++ b/src/game/object_list_processor.h @@ -23,7 +23,12 @@ /** * The maximum number of objects that can be loaded at once. */ + +#ifdef NODRAWINGDISTANCE +#define OBJECT_POOL_CAPACITY 960 +#else #define OBJECT_POOL_CAPACITY 240 +#endif /** * Every object is categorized into an object list, which controls the order diff --git a/src/game/options_menu.c b/src/game/options_menu.c new file mode 100644 index 00000000..56dba619 --- /dev/null +++ b/src/game/options_menu.c @@ -0,0 +1,631 @@ +#ifdef EXT_OPTIONS_MENU + +#include "sm64.h" +#include "include/text_strings.h" +#include "engine/math_util.h" +#include "audio/external.h" +#include "game/camera.h" +#include "game/level_update.h" +#include "game/print.h" +#include "game/segment2.h" +#include "game/save_file.h" +#ifdef BETTERCAMERA +#include "game/bettercamera.h" +#endif +#include "game/mario_misc.h" +#include "game/game_init.h" +#include "game/ingame_menu.h" +#include "game/options_menu.h" +#include "pc/pc_main.h" +#include "pc/cliopts.h" +#include "pc/cheats.h" +#include "pc/configfile.h" +#include "pc/controller/controller_api.h" + +#include +#include "../../include/libc/stdlib.h" + +u8 optmenu_open = 0; + +static u8 optmenu_binding = 0; +static u8 optmenu_bind_idx = 0; + +/* Keeps track of how many times the user has pressed L while in the options menu, so cheats can be unlocked */ +static s32 l_counter = 0; + +// How to add stuff: +// strings: add them to include/text_strings.h.in +// and to menuStr[] / opts*Str[] +// options: add them to the relevant options list +// menus: add a new submenu definition and a new +// option to the optsMain list + +static const u8 toggleStr[][16] = { + { TEXT_OPT_DISABLED }, + { TEXT_OPT_ENABLED }, +}; + +static const u8 menuStr[][32] = { + { TEXT_OPT_HIGHLIGHT }, + { TEXT_OPT_BUTTON1 }, + { TEXT_OPT_BUTTON2 }, + { TEXT_OPT_OPTIONS }, + { TEXT_OPT_CAMERA }, + { TEXT_OPT_CONTROLS }, + { TEXT_OPT_VIDEO }, + { TEXT_OPT_AUDIO }, + { TEXT_EXIT_GAME }, + { TEXT_OPT_CHEATS }, + +}; + +static const u8 optsCameraStr[][32] = { + { TEXT_OPT_CAMX }, + { TEXT_OPT_CAMY }, + { TEXT_OPT_INVERTX }, + { TEXT_OPT_INVERTY }, + { TEXT_OPT_CAMC }, + { TEXT_OPT_CAMP }, + { TEXT_OPT_ANALOGUE }, + { TEXT_OPT_MOUSE }, + { TEXT_OPT_CAMD }, + { TEXT_OPT_CAMON }, +}; + +static const u8 optsVideoStr[][32] = { + { TEXT_OPT_FSCREEN }, + { TEXT_OPT_TEXFILTER }, + { TEXT_OPT_NEAREST }, + { TEXT_OPT_LINEAR }, + { TEXT_OPT_RESETWND }, + { TEXT_OPT_VSYNC }, + { TEXT_OPT_AUTO }, + { TEXT_OPT_HUD }, + { TEXT_OPT_THREEPT }, + { TEXT_OPT_APPLY }, +}; + +static const u8 optsAudioStr[][32] = { + { TEXT_OPT_MVOLUME }, + { TEXT_OPT_MUSVOLUME }, + { TEXT_OPT_SFXVOLUME }, + { TEXT_OPT_ENVVOLUME }, +}; + +static const u8 optsCheatsStr[][64] = { + { TEXT_OPT_CHEAT1 }, + { TEXT_OPT_CHEAT2 }, + { TEXT_OPT_CHEAT3 }, + { TEXT_OPT_CHEAT4 }, + { TEXT_OPT_CHEAT5 }, + { TEXT_OPT_CHEAT6 }, + { TEXT_OPT_CHEAT7 }, + { TEXT_OPT_CHEAT8 }, + { TEXT_OPT_CHEAT9 }, +}; + +static const u8 bindStr[][32] = { + { TEXT_OPT_UNBOUND }, + { TEXT_OPT_PRESSKEY }, + { TEXT_BIND_A }, + { TEXT_BIND_B }, + { TEXT_BIND_START }, + { TEXT_BIND_L }, + { TEXT_BIND_R }, + { TEXT_BIND_Z }, + { TEXT_BIND_C_UP }, + { TEXT_BIND_C_DOWN }, + { TEXT_BIND_C_LEFT }, + { TEXT_BIND_C_RIGHT }, + { TEXT_BIND_UP }, + { TEXT_BIND_DOWN }, + { TEXT_BIND_LEFT }, + { TEXT_BIND_RIGHT }, + { TEXT_OPT_DEADZONE }, + { TEXT_OPT_RUMBLE } +}; + +static const u8 *filterChoices[] = { + optsVideoStr[2], + optsVideoStr[3], + optsVideoStr[8], +}; + +static const u8 *vsyncChoices[] = { + toggleStr[0], + toggleStr[1], + optsVideoStr[6], +}; + +enum OptType { + OPT_INVALID = 0, + OPT_TOGGLE, + OPT_CHOICE, + OPT_SCROLL, + OPT_SUBMENU, + OPT_BIND, + OPT_BUTTON, +}; + +struct SubMenu; + +struct Option { + enum OptType type; + const u8 *label; + union { + u32 *uval; + bool *bval; + }; + union { + struct { + const u8 **choices; + u32 numChoices; + }; + struct { + u32 scrMin; + u32 scrMax; + u32 scrStep; + }; + struct SubMenu *nextMenu; + void (*actionFn)(struct Option *, s32); + }; +}; + +struct SubMenu { + struct SubMenu *prev; // this is set at runtime to avoid needless complication + const u8 *label; + struct Option *opts; + s32 numOpts; + s32 select; + s32 scroll; +}; + +/* helper macros */ + +#define DEF_OPT_TOGGLE(lbl, bv) \ + { .type = OPT_TOGGLE, .label = lbl, .bval = bv } +#define DEF_OPT_SCROLL(lbl, uv, min, max, st) \ + { .type = OPT_SCROLL, .label = lbl, .uval = uv, .scrMin = min, .scrMax = max, .scrStep = st } +#define DEF_OPT_CHOICE(lbl, uv, ch) \ + { .type = OPT_CHOICE, .label = lbl, .uval = uv, .choices = ch, .numChoices = sizeof(ch) / sizeof(ch[0]) } +#define DEF_OPT_SUBMENU(lbl, nm) \ + { .type = OPT_SUBMENU, .label = lbl, .nextMenu = nm } +#define DEF_OPT_BIND(lbl, uv) \ + { .type = OPT_BIND, .label = lbl, .uval = uv } +#define DEF_OPT_BUTTON(lbl, act) \ + { .type = OPT_BUTTON, .label = lbl, .actionFn = act } +#define DEF_SUBMENU(lbl, opt) \ + { .label = lbl, .opts = opt, .numOpts = sizeof(opt) / sizeof(opt[0]) } + +/* button action functions */ + +static void optmenu_act_exit(UNUSED struct Option *self, s32 arg) { + if (!arg) game_exit(); // only exit on A press and not directions +} + +static void optvideo_reset_window(UNUSED struct Option *self, s32 arg) { + if (!arg) { + // Restrict reset to A press and not directions + configWindow.reset = true; + configWindow.settings_changed = true; + } +} + +static void optvideo_apply(UNUSED struct Option *self, s32 arg) { + if (!arg) configWindow.settings_changed = true; +} + +/* submenu option lists */ + +#ifdef BETTERCAMERA +static struct Option optsCamera[] = { + DEF_OPT_TOGGLE( optsCameraStr[9], &configEnableCamera ), + DEF_OPT_TOGGLE( optsCameraStr[6], &configCameraAnalog ), + DEF_OPT_TOGGLE( optsCameraStr[7], &configCameraMouse ), + DEF_OPT_TOGGLE( optsCameraStr[2], &configCameraInvertX ), + DEF_OPT_TOGGLE( optsCameraStr[3], &configCameraInvertY ), + DEF_OPT_SCROLL( optsCameraStr[0], &configCameraXSens, 1, 100, 1 ), + DEF_OPT_SCROLL( optsCameraStr[1], &configCameraYSens, 1, 100, 1 ), + DEF_OPT_SCROLL( optsCameraStr[4], &configCameraAggr, 0, 100, 1 ), + DEF_OPT_SCROLL( optsCameraStr[5], &configCameraPan, 0, 100, 1 ), + DEF_OPT_SCROLL( optsCameraStr[8], &configCameraDegrade, 0, 100, 1 ), +}; +#endif + +static struct Option optsControls[] = { + DEF_OPT_BIND( bindStr[ 2], configKeyA ), + DEF_OPT_BIND( bindStr[ 3], configKeyB ), + DEF_OPT_BIND( bindStr[ 4], configKeyStart ), + DEF_OPT_BIND( bindStr[ 5], configKeyL ), + DEF_OPT_BIND( bindStr[ 6], configKeyR ), + DEF_OPT_BIND( bindStr[ 7], configKeyZ ), + DEF_OPT_BIND( bindStr[ 8], configKeyCUp ), + DEF_OPT_BIND( bindStr[ 9], configKeyCDown ), + DEF_OPT_BIND( bindStr[10], configKeyCLeft ), + DEF_OPT_BIND( bindStr[11], configKeyCRight ), + DEF_OPT_BIND( bindStr[12], configKeyStickUp ), + DEF_OPT_BIND( bindStr[13], configKeyStickDown ), + DEF_OPT_BIND( bindStr[14], configKeyStickLeft ), + DEF_OPT_BIND( bindStr[15], configKeyStickRight ), + // max deadzone is 31000; this is less than the max range of ~32768, but this + // way, the player can't accidentally lock themselves out of using the stick + DEF_OPT_SCROLL( bindStr[16], &configStickDeadzone, 0, 100, 1 ), + DEF_OPT_SCROLL( bindStr[17], &configRumbleStrength, 0, 100, 1) +}; + +static struct Option optsVideo[] = { + DEF_OPT_TOGGLE( optsVideoStr[0], &configWindow.fullscreen ), + DEF_OPT_TOGGLE( optsVideoStr[5], &configWindow.vsync ), + DEF_OPT_CHOICE( optsVideoStr[1], &configFiltering, filterChoices ), + DEF_OPT_TOGGLE( optsVideoStr[7], &configHUD ), + DEF_OPT_BUTTON( optsVideoStr[4], optvideo_reset_window ), + DEF_OPT_BUTTON( optsVideoStr[9], optvideo_apply ), +}; + +static struct Option optsAudio[] = { + DEF_OPT_SCROLL( optsAudioStr[0], &configMasterVolume, 0, MAX_VOLUME, 1 ), + DEF_OPT_SCROLL( optsAudioStr[1], &configMusicVolume, 0, MAX_VOLUME, 1), + DEF_OPT_SCROLL( optsAudioStr[2], &configSfxVolume, 0, MAX_VOLUME, 1), + DEF_OPT_SCROLL( optsAudioStr[3], &configEnvVolume, 0, MAX_VOLUME, 1), +}; + +static struct Option optsCheats[] = { + DEF_OPT_TOGGLE( optsCheatsStr[0], &Cheats.EnableCheats ), + DEF_OPT_TOGGLE( optsCheatsStr[1], &Cheats.MoonJump ), + DEF_OPT_TOGGLE( optsCheatsStr[2], &Cheats.GodMode ), + DEF_OPT_TOGGLE( optsCheatsStr[3], &Cheats.InfiniteLives ), + DEF_OPT_TOGGLE( optsCheatsStr[4], &Cheats.SuperSpeed ), + DEF_OPT_TOGGLE( optsCheatsStr[5], &Cheats.Responsive ), + DEF_OPT_TOGGLE( optsCheatsStr[6], &Cheats.ExitAnywhere ), + DEF_OPT_TOGGLE( optsCheatsStr[7], &Cheats.HugeMario ), + DEF_OPT_TOGGLE( optsCheatsStr[8], &Cheats.TinyMario ), + +}; + +/* submenu definitions */ + +#ifdef BETTERCAMERA +static struct SubMenu menuCamera = DEF_SUBMENU( menuStr[4], optsCamera ); +#endif +static struct SubMenu menuControls = DEF_SUBMENU( menuStr[5], optsControls ); +static struct SubMenu menuVideo = DEF_SUBMENU( menuStr[6], optsVideo ); +static struct SubMenu menuAudio = DEF_SUBMENU( menuStr[7], optsAudio ); +static struct SubMenu menuCheats = DEF_SUBMENU( menuStr[9], optsCheats ); + +/* main options menu definition */ + +static struct Option optsMain[] = { +#ifdef BETTERCAMERA + DEF_OPT_SUBMENU( menuStr[4], &menuCamera ), +#endif + DEF_OPT_SUBMENU( menuStr[5], &menuControls ), + DEF_OPT_SUBMENU( menuStr[6], &menuVideo ), + DEF_OPT_SUBMENU( menuStr[7], &menuAudio ), + DEF_OPT_BUTTON ( menuStr[8], optmenu_act_exit ), + // NOTE: always keep cheats the last option here because of the half-assed way I toggle them + DEF_OPT_SUBMENU( menuStr[9], &menuCheats ) +}; + +static struct SubMenu menuMain = DEF_SUBMENU( menuStr[3], optsMain ); + +/* implementation */ + +static s32 optmenu_option_timer = 0; +static u8 optmenu_hold_count = 0; + +static struct SubMenu *currentMenu = &menuMain; + +static inline s32 wrap_add(s32 a, const s32 b, const s32 min, const s32 max) { + a += b; + if (a < min) a = max - (min - a) + 1; + else if (a > max) a = min + (a - max) - 1; + return a; +} + +static void uint_to_hex(u32 num, u8 *dst) { + u8 places = 4; + while (places--) { + const u32 digit = num & 0xF; + dst[places] = digit; + num >>= 4; + } + dst[4] = DIALOG_CHAR_TERMINATOR; +} + +//Displays a box. +static void optmenu_draw_box(s16 x1, s16 y1, s16 x2, s16 y2, u8 r, u8 g, u8 b) { + gDPPipeSync(gDisplayListHead++); + gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2); + gDPSetCycleType(gDisplayListHead++, G_CYC_FILL); + gDPSetFillColor(gDisplayListHead++, GPACK_RGBA5551(r, g, b, 255)); + gDPFillRectangle(gDisplayListHead++, x1, y1, x2 - 1, y2 - 1); + gDPPipeSync(gDisplayListHead++); + gDPSetCycleType(gDisplayListHead++, G_CYC_1CYCLE); +} + +static void optmenu_draw_text(s16 x, s16 y, const u8 *str, u8 col) { + const u8 textX = get_str_x_pos_from_center(x, (u8*)str, 10.0f); + gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, 255); + print_generic_string(textX+1, y-1, str); + if (col == 0) { + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255); + } else { + gDPSetEnvColor(gDisplayListHead++, 255, 32, 32, 255); + } + print_generic_string(textX, y, str); +} + +static void optmenu_draw_opt(const struct Option *opt, s16 x, s16 y, u8 sel) { + u8 buf[32] = { 0 }; + + if (opt->type == OPT_SUBMENU || opt->type == OPT_BUTTON) + y -= 6; + + optmenu_draw_text(x, y, opt->label, sel); + + switch (opt->type) { + case OPT_TOGGLE: + optmenu_draw_text(x, y-13, toggleStr[(int)*opt->bval], sel); + break; + + case OPT_CHOICE: + optmenu_draw_text(x, y-13, opt->choices[*opt->uval], sel); + break; + + case OPT_SCROLL: + int_to_str(*opt->uval, buf); + optmenu_draw_text(x, y-13, buf, sel); + break; + + case OPT_BIND: + x = 112; + for (u8 i = 0; i < MAX_BINDS; ++i, x += 48) { + const u8 white = (sel && (optmenu_bind_idx == i)); + // TODO: button names + if (opt->uval[i] == VK_INVALID) { + if (optmenu_binding && white) + optmenu_draw_text(x, y-13, bindStr[1], 1); + else + optmenu_draw_text(x, y-13, bindStr[0], white); + } else { + uint_to_hex(opt->uval[i], buf); + optmenu_draw_text(x, y-13, buf, white); + } + } + break; + + default: break; + }; +} + +static void optmenu_opt_change(struct Option *opt, s32 val) { + switch (opt->type) { + case OPT_TOGGLE: + *opt->bval = !*opt->bval; + break; + + case OPT_CHOICE: + *opt->uval = wrap_add(*opt->uval, val, 0, opt->numChoices - 1); + break; + + case OPT_SCROLL: + *opt->uval = wrap_add(*opt->uval, opt->scrStep * val, opt->scrMin, opt->scrMax); + break; + + case OPT_SUBMENU: + opt->nextMenu->prev = currentMenu; + currentMenu = opt->nextMenu; + break; + + case OPT_BUTTON: + if (opt->actionFn) + opt->actionFn(opt, val); + break; + + case OPT_BIND: + if (val == 0xFF) { + // clear the bind + opt->uval[optmenu_bind_idx] = VK_INVALID; + } else if (val == 0) { + opt->uval[optmenu_bind_idx] = VK_INVALID; + optmenu_binding = 1; + controller_get_raw_key(); // clear the last key, which is probably A + } else { + optmenu_bind_idx = wrap_add(optmenu_bind_idx, val, 0, MAX_BINDS - 1); + } + break; + + default: break; + } +} + +static inline s16 get_hudstr_centered_x(const s16 sx, const u8 *str) { + const u8 *chr = str; + s16 len = 0; + while (*chr != GLOBAR_CHAR_TERMINATOR) ++chr, ++len; + return sx - len * 6; // stride is 12 +} + +//Options menu +void optmenu_draw(void) { + s16 scroll; + s16 scrollpos; + + const s16 labelX = get_hudstr_centered_x(160, currentMenu->label); + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255); + print_hud_lut_string(HUD_LUT_GLOBAL, labelX, 40, currentMenu->label); + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); + + if (currentMenu->numOpts > 4) { + optmenu_draw_box(272, 90, 280, 208, 0x80, 0x80, 0x80); + scrollpos = 54 * ((f32)currentMenu->scroll / (currentMenu->numOpts-4)); + optmenu_draw_box(272, 90+scrollpos, 280, 154+scrollpos, 0xFF, 0xFF, 0xFF); + } + + gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); + gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, 80, SCREEN_WIDTH, SCREEN_HEIGHT); + for (u8 i = 0; i < currentMenu->numOpts; i++) { + scroll = 140 - 32 * i + currentMenu->scroll * 32; + // FIXME: just start from the first visible option bruh + if (scroll <= 140 && scroll > 32) + optmenu_draw_opt(¤tMenu->opts[i], 160, scroll, (currentMenu->select == i)); + } + + gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); + gSPDisplayList(gDisplayListHead++, dl_ia_text_end); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255); + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); + print_hud_lut_string(HUD_LUT_GLOBAL, 80, 90 + (32 * (currentMenu->select - currentMenu->scroll)), menuStr[0]); + print_hud_lut_string(HUD_LUT_GLOBAL, 224, 90 + (32 * (currentMenu->select - currentMenu->scroll)), menuStr[0]); + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); +} + +//This has been separated for interesting reasons. Don't question it. +void optmenu_draw_prompt(void) { + gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); + optmenu_draw_text(264, 212, menuStr[1 + optmenu_open], 0); + gSPDisplayList(gDisplayListHead++, dl_ia_text_end); +} + +void optmenu_toggle(void) { + if (optmenu_open == 0) { + #ifndef nosound + play_sound(SOUND_MENU_CHANGE_SELECT, gDefaultSoundArgs); + #endif + + // HACK: hide the last option in main if cheats are disabled + menuMain.numOpts = sizeof(optsMain) / sizeof(optsMain[0]); + if (!Cheats.EnableCheats) { + menuMain.numOpts--; + if (menuMain.select >= menuMain.numOpts) { + menuMain.select = 0; // don't bother + menuMain.scroll = 0; + } + } + + currentMenu = &menuMain; + optmenu_open = 1; + + /* Resets l_counter to 0 every time the options menu is open */ + l_counter = 0; + } else { + #ifndef nosound + play_sound(SOUND_MENU_MARIO_CASTLE_WARP2, gDefaultSoundArgs); + #endif + optmenu_open = 0; + #ifdef BETTERCAMERA + newcam_init_settings(); // load bettercam settings from config vars + #endif + controller_reconfigure(); // rebind using new config values + configfile_save(configfile_name()); + } +} + +void optmenu_check_buttons(void) { + if (optmenu_binding) { + u32 key = controller_get_raw_key(); + if (key != VK_INVALID) { + #ifndef nosound + play_sound(SOUND_MENU_CHANGE_SELECT, gDefaultSoundArgs); + #endif + currentMenu->opts[currentMenu->select].uval[optmenu_bind_idx] = key; + optmenu_binding = 0; + optmenu_option_timer = 12; + } + return; + } + + if (gPlayer1Controller->buttonPressed & R_TRIG) + optmenu_toggle(); + + /* Enables cheats if the user press the L trigger 3 times while in the options menu. Also plays a sound. */ + + if ((gPlayer1Controller->buttonPressed & L_TRIG) && !Cheats.EnableCheats) { + if (l_counter == 2) { + Cheats.EnableCheats = true; + play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs); + l_counter = 0; + } else { + l_counter++; + } + } + + if (!optmenu_open) return; + + u8 allowInput = 0; + + optmenu_option_timer--; + if (optmenu_option_timer <= 0) { + if (optmenu_hold_count == 0) { + optmenu_hold_count++; + optmenu_option_timer = 10; + } else { + optmenu_option_timer = 3; + } + allowInput = 1; + } + + if (ABS(gPlayer1Controller->stickY) > 60) { + if (allowInput) { + #ifndef nosound + play_sound(SOUND_MENU_CHANGE_SELECT, gDefaultSoundArgs); + #endif + + if (gPlayer1Controller->stickY >= 60) { + currentMenu->select--; + if (currentMenu->select < 0) + currentMenu->select = currentMenu->numOpts-1; + } else { + currentMenu->select++; + if (currentMenu->select >= currentMenu->numOpts) + currentMenu->select = 0; + } + + if (currentMenu->select < currentMenu->scroll) + currentMenu->scroll = currentMenu->select; + else if (currentMenu->select > currentMenu->scroll + 3) + currentMenu->scroll = currentMenu->select - 3; + } + } else if (ABS(gPlayer1Controller->stickX) > 60) { + if (allowInput) { + #ifndef nosound + play_sound(SOUND_MENU_CHANGE_SELECT, gDefaultSoundArgs); + #endif + if (gPlayer1Controller->stickX >= 60) + optmenu_opt_change(¤tMenu->opts[currentMenu->select], 1); + else + optmenu_opt_change(¤tMenu->opts[currentMenu->select], -1); + } + } else if (gPlayer1Controller->buttonPressed & A_BUTTON) { + if (allowInput) { + #ifndef nosound + play_sound(SOUND_MENU_CHANGE_SELECT, gDefaultSoundArgs); + #endif + optmenu_opt_change(¤tMenu->opts[currentMenu->select], 0); + } + } else if (gPlayer1Controller->buttonPressed & B_BUTTON) { + if (allowInput) { + if (currentMenu->prev) { + #ifndef nosound + play_sound(SOUND_MENU_CHANGE_SELECT, gDefaultSoundArgs); + #endif + currentMenu = currentMenu->prev; + } else { + // can't go back, exit the menu altogether + optmenu_toggle(); + } + } + } else if (gPlayer1Controller->buttonPressed & Z_TRIG) { + // HACK: clear binds with Z + if (allowInput && currentMenu->opts[currentMenu->select].type == OPT_BIND) + optmenu_opt_change(¤tMenu->opts[currentMenu->select], 0xFF); + } else if (gPlayer1Controller->buttonPressed & START_BUTTON) { + if (allowInput) optmenu_toggle(); + } else { + optmenu_hold_count = 0; + optmenu_option_timer = 0; + } +} + +#endif // EXT_OPTIONS_MENU diff --git a/src/game/options_menu.h b/src/game/options_menu.h new file mode 100644 index 00000000..4828ae9d --- /dev/null +++ b/src/game/options_menu.h @@ -0,0 +1,11 @@ +#ifndef OPTIONS_MENU_H +#define OPTIONS_MENU_H + +void optmenu_toggle(void); +void optmenu_draw(void); +void optmenu_draw_prompt(void); +void optmenu_check_buttons(void); + +extern u8 optmenu_open; + +#endif // OPTIONS_MENU_H diff --git a/src/game/paintings.c b/src/game/paintings.c index 79089cd0..6cae19c0 100644 --- a/src/game/paintings.c +++ b/src/game/paintings.c @@ -198,7 +198,7 @@ void stop_other_paintings(s16 *idptr, struct Painting *paintingGroup[]) { index = 0; while (paintingGroup[index] != NULL) { - struct Painting *painting = (struct Painting*) segmented_to_virtual(paintingGroup[index]); + struct Painting *painting = segmented_to_virtual(paintingGroup[index]); // stop all rippling except for the selected painting if (painting->id != id) { @@ -675,7 +675,7 @@ s16 ripple_if_movable(struct Painting *painting, s16 movable, s16 posX, s16 posY void painting_generate_mesh(struct Painting *painting, s16 *mesh, s16 numTris) { s16 i; - gPaintingMesh = (struct PaintingMeshVertex*) mem_pool_alloc(gEffectsMemoryPool, numTris * sizeof(struct PaintingMeshVertex)); + gPaintingMesh = mem_pool_alloc(gEffectsMemoryPool, numTris * sizeof(struct PaintingMeshVertex)); if (gPaintingMesh == NULL) { } // accesses are off by 1 since the first entry is the number of vertices @@ -707,7 +707,7 @@ void painting_generate_mesh(struct Painting *painting, s16 *mesh, s16 numTris) { void painting_calculate_triangle_normals(s16 *mesh, s16 numVtx, s16 numTris) { s16 i; - gPaintingTriNorms = (Vec3f*) mem_pool_alloc(gEffectsMemoryPool, numTris * sizeof(Vec3f)); + gPaintingTriNorms = mem_pool_alloc(gEffectsMemoryPool, numTris * sizeof(Vec3f)); if (gPaintingTriNorms == NULL) { } for (i = 0; i < numTris; i++) { @@ -833,8 +833,8 @@ Gfx *render_painting(u8 *img, s16 tWidth, s16 tHeight, s16 *textureMap, s16 mapV s16 numVtx = mapTris * 3; s16 commands = triGroups * 2 + remGroupTris + 7; - Vtx *verts = (Vtx*) alloc_display_list(numVtx * sizeof(Vtx)); - Gfx *dlist = (Gfx*) alloc_display_list(commands * sizeof(Gfx)); + Vtx *verts = alloc_display_list(numVtx * sizeof(Vtx)); + Gfx *dlist = alloc_display_list(commands * sizeof(Gfx)); Gfx *gfx = dlist; if (verts == NULL || dlist == NULL) { @@ -899,11 +899,11 @@ Gfx *render_painting(u8 *img, s16 tWidth, s16 tHeight, s16 *textureMap, s16 mapV */ Gfx *painting_model_view_transform(struct Painting *painting) { f32 sizeRatio = painting->size / PAINTING_SIZE; - Mtx *rotX = (Mtx*) alloc_display_list(sizeof(Mtx)); - Mtx *rotY = (Mtx*) alloc_display_list(sizeof(Mtx)); - Mtx *translate = (Mtx*) alloc_display_list(sizeof(Mtx)); - Mtx *scale = (Mtx*) alloc_display_list(sizeof(Mtx)); - Gfx *dlist = (Gfx*) alloc_display_list(5 * sizeof(Gfx)); + Mtx *rotX = alloc_display_list(sizeof(Mtx)); + Mtx *rotY = alloc_display_list(sizeof(Mtx)); + Mtx *translate = alloc_display_list(sizeof(Mtx)); + Mtx *scale = alloc_display_list(sizeof(Mtx)); + Gfx *dlist = alloc_display_list(5 * sizeof(Gfx)); Gfx *gfx = dlist; if (rotX == NULL || rotY == NULL || translate == NULL || dlist == NULL) { @@ -934,9 +934,9 @@ Gfx *painting_ripple_image(struct Painting *painting) { s16 imageCount = painting->imageCount; s16 tWidth = painting->textureWidth; s16 tHeight = painting->textureHeight; - s16 **textureMaps = (s16**) segmented_to_virtual(painting->textureMaps); - u8 **textures = (u8**) segmented_to_virtual(painting->textureArray); - Gfx *dlist = (Gfx*) alloc_display_list((imageCount + 6) * sizeof(Gfx)); + s16 **textureMaps = segmented_to_virtual(painting->textureMaps); + u8 **textures = segmented_to_virtual(painting->textureArray); + Gfx *dlist = alloc_display_list((imageCount + 6) * sizeof(Gfx)); Gfx *gfx = dlist; if (dlist == NULL) { @@ -949,7 +949,7 @@ Gfx *painting_ripple_image(struct Painting *painting) { // Map each image to the mesh's vertices for (i = 0; i < imageCount; i++) { - textureMap = (s16*) segmented_to_virtual(textureMaps[i]); + textureMap = segmented_to_virtual(textureMaps[i]); meshVerts = textureMap[0]; meshTris = textureMap[meshVerts * 3 + 1]; gSPDisplayList(gfx++, render_painting(textures[i], tWidth, tHeight, textureMap, meshVerts, meshTris, painting->alpha)); @@ -973,9 +973,9 @@ Gfx *painting_ripple_env_mapped(struct Painting *painting) { s16 *textureMap; s16 tWidth = painting->textureWidth; s16 tHeight = painting->textureHeight; - s16 **textureMaps = (s16**) segmented_to_virtual(painting->textureMaps); - u8 **tArray = (u8**) segmented_to_virtual(painting->textureArray); - Gfx *dlist = (Gfx*) alloc_display_list(7 * sizeof(Gfx)); + s16 **textureMaps = segmented_to_virtual(painting->textureMaps); + u8 **tArray = segmented_to_virtual(painting->textureArray); + Gfx *dlist = alloc_display_list(7 * sizeof(Gfx)); Gfx *gfx = dlist; if (dlist == NULL) { @@ -987,7 +987,7 @@ Gfx *painting_ripple_env_mapped(struct Painting *painting) { gSPDisplayList(gfx++, painting->rippleDisplayList); // Map the image to the mesh's vertices - textureMap = (s16*) segmented_to_virtual(textureMaps[0]); + textureMap = segmented_to_virtual(textureMaps[0]); meshVerts = textureMap[0]; meshTris = textureMap[meshVerts * 3 + 1]; gSPDisplayList(gfx++, render_painting(tArray[0], tWidth, tHeight, textureMap, meshVerts, meshTris, painting->alpha)); @@ -1006,8 +1006,8 @@ Gfx *painting_ripple_env_mapped(struct Painting *painting) { * The mesh and vertex normals are regenerated and freed every frame. */ Gfx *display_painting_rippling(struct Painting *painting) { - s16 *mesh = (s16*) segmented_to_virtual(seg2_painting_triangle_mesh); - s16 *neighborTris = (s16*) segmented_to_virtual(seg2_painting_mesh_neighbor_tris); + s16 *mesh = segmented_to_virtual(seg2_painting_triangle_mesh); + s16 *neighborTris = segmented_to_virtual(seg2_painting_mesh_neighbor_tris); s16 numVtx = mesh[0]; s16 numTris = mesh[numVtx * 3 + 1]; Gfx *dlist; @@ -1037,7 +1037,7 @@ Gfx *display_painting_rippling(struct Painting *painting) { * Render a normal painting. */ Gfx *display_painting_not_rippling(struct Painting *painting) { - Gfx *dlist = (Gfx*) alloc_display_list(4 * sizeof(Gfx)); + Gfx *dlist = alloc_display_list(4 * sizeof(Gfx)); Gfx *gfx = dlist; if (dlist == NULL) { @@ -1063,7 +1063,6 @@ void reset_painting(struct Painting *painting) { gRipplingPainting = NULL; -#ifdef NO_SEGMENTED_MEMORY // Make sure all variables are reset correctly. // With segmented memory the segments that contain the relevant // Painting structs are reloaded from ROM upon level load. @@ -1080,7 +1079,6 @@ void reset_painting(struct Painting *painting) { // that moves the painting stops during level unload. painting->posX = 3456.0f; } -#endif } /** @@ -1128,7 +1126,6 @@ void move_ddd_painting(struct Painting *painting, f32 frontPos, f32 backPos, f32 gDddPaintingStatus = BOWSERS_SUB_BEATEN | DDD_BACK; } } - /** * Set the painting's node's layer based on its alpha */ @@ -1221,7 +1218,7 @@ Gfx *geo_painting_draw(s32 callContext, struct GraphNode *node, UNUSED void *con s32 id = gen->parameter & 0xFF; Gfx *paintingDlist = NULL; struct Painting **paintingGroup = sPaintingGroups[group]; - struct Painting *painting = (struct Painting*) segmented_to_virtual(paintingGroup[id]); + struct Painting *painting = segmented_to_virtual(paintingGroup[id]); if (callContext != GEO_CONTEXT_RENDER) { reset_painting(painting); diff --git a/src/game/print.c b/src/game/print.c index 1882c74f..f7a83865 100644 --- a/src/game/print.c +++ b/src/game/print.c @@ -6,7 +6,6 @@ #include "memory.h" #include "print.h" #include "segment2.h" -#include "common/service_locator.hpp" /** * This file handles printing and formatting the colorful text that @@ -24,7 +23,7 @@ struct TextLabel { * Stores the text to be rendered on screen * and how they are to be rendered. */ -struct TextLabel *sTextLabels[52]; +struct TextLabel *sTextLabels[256]; s16 sTextLabelsCount = 0; /** @@ -178,7 +177,7 @@ void print_text_fmt_int(s32 x, s32 y, const char *str, s32 n) { s32 srcIndex = 0; // Don't continue if there is no memory to do so. - if ((sTextLabels[sTextLabelsCount] = (struct TextLabel*) mem_pool_alloc(gEffectsMemoryPool, + if ((sTextLabels[sTextLabelsCount] = mem_pool_alloc(gEffectsMemoryPool, sizeof(struct TextLabel))) == NULL) { return; } @@ -229,7 +228,7 @@ void print_text(s32 x, s32 y, const char *str) { s32 srcIndex = 0; // Don't continue if there is no memory to do so. - if ((sTextLabels[sTextLabelsCount] = (struct TextLabel*) mem_pool_alloc(gEffectsMemoryPool, + if ((sTextLabels[sTextLabelsCount] = mem_pool_alloc(gEffectsMemoryPool, sizeof(struct TextLabel))) == NULL) { return; } @@ -262,7 +261,7 @@ void print_text_centered(s32 x, s32 y, const char *str) { s32 srcIndex = 0; // Don't continue if there is no memory to do so. - if ((sTextLabels[sTextLabelsCount] = (struct TextLabel*) mem_pool_alloc(gEffectsMemoryPool, + if ((sTextLabels[sTextLabelsCount] = mem_pool_alloc(gEffectsMemoryPool, sizeof(struct TextLabel))) == NULL) { return; } @@ -354,36 +353,13 @@ s8 char_to_glyph_index(char c) { * Adds an individual glyph to be rendered. */ void add_glyph_texture(s8 glyphIndex) { - const u8 *const *glyphs = (const u8* const*) segmented_to_virtual(main_hud_lut); + const u8 *const *glyphs = segmented_to_virtual(main_hud_lut); gDPPipeSync(gDisplayListHead++); gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, glyphs[glyphIndex]); gSPDisplayList(gDisplayListHead++, dl_hud_img_load_tex_block); } -#ifndef WIDESCREEN -/** - * Clips textrect into the boundaries defined. - */ -void clip_to_bounds(s32 *x, s32 *y) { - if (*x < TEXRECT_MIN_X) { - *x = TEXRECT_MIN_X; - } - - if (*x > TEXRECT_MAX_X) { - *x = TEXRECT_MAX_X; - } - - if (*y < TEXRECT_MIN_Y) { - *y = TEXRECT_MIN_Y; - } - - if (*y > TEXRECT_MAX_Y) { - *y = TEXRECT_MAX_Y; - } -} -#endif - /** * Renders the glyph that's set at the given position. */ @@ -393,10 +369,6 @@ void render_textrect(s32 x, s32 y, s32 pos) { s32 rectX; s32 rectY; -#ifndef WIDESCREEN - // For widescreen we must allow drawing outside the usual area - clip_to_bounds(&rectBaseX, &rectBaseY); -#endif rectX = rectBaseX; rectY = rectBaseY; gSPTextureRectangle(gDisplayListHead++, rectX << 2, rectY << 2, (rectX + 15) << 2, @@ -413,14 +385,11 @@ void render_text_labels(void) { s8 glyphIndex; Mtx *mtx; - auto &text_renderer = ServiceLocator::get_text_renderer(); - text_renderer.render_scheduled_text(); - if (sTextLabelsCount == 0) { return; } - mtx = (Mtx*) alloc_display_list(sizeof(*mtx)); + mtx = alloc_display_list(sizeof(*mtx)); if (mtx == NULL) { sTextLabelsCount = 0; diff --git a/src/game/print.h b/src/game/print.h index 891f7e3c..95597e8a 100644 --- a/src/game/print.h +++ b/src/game/print.h @@ -8,7 +8,7 @@ #define TEXRECT_MIN_Y 5 #define TEXRECT_MAX_Y 220 -#define GLYPH_SPACE (u8) -1 +#define GLYPH_SPACE -1 #define GLYPH_U 30 #define GLYPH_EXCLAMATION_PNT 36 #define GLYPH_TWO_EXCLAMATION 37 diff --git a/src/game/rendering_graph_node.c b/src/game/rendering_graph_node.c index 181f9284..d5bf5778 100644 --- a/src/game/rendering_graph_node.c +++ b/src/game/rendering_graph_node.c @@ -180,8 +180,8 @@ static void geo_append_display_list(void *displayList, s16 layer) { gSPLookAt(gDisplayListHead++, &lookAt); #endif if (gCurGraphNodeMasterList != 0) { - struct DisplayListNode *listNode = - (struct DisplayListNode*) alloc_only_pool_alloc(gDisplayListHeap, sizeof(struct DisplayListNode)); + struct DisplayListNode *listNode = + alloc_only_pool_alloc(gDisplayListHeap, sizeof(struct DisplayListNode)); listNode->transform = gMatStackFixed[gMatStackIndex]; listNode->displayList = displayList; @@ -218,7 +218,7 @@ static void geo_process_master_list(struct GraphNodeMasterList *node) { */ static void geo_process_ortho_projection(struct GraphNodeOrthoProjection *node) { if (node->node.children != NULL) { - Mtx *mtx = (Mtx*) alloc_display_list(sizeof(*mtx)); + Mtx *mtx = alloc_display_list(sizeof(*mtx)); f32 left = (gCurGraphNodeRoot->x - gCurGraphNodeRoot->width) / 2.0f * node->scale; f32 right = (gCurGraphNodeRoot->x + gCurGraphNodeRoot->width) / 2.0f * node->scale; f32 top = (gCurGraphNodeRoot->y - gCurGraphNodeRoot->height) / 2.0f * node->scale; @@ -241,7 +241,7 @@ static void geo_process_perspective(struct GraphNodePerspective *node) { } if (node->fnNode.node.children != NULL) { u16 perspNorm; - Mtx *mtx = (Mtx*) alloc_display_list(sizeof(*mtx)); + Mtx *mtx = alloc_display_list(sizeof(*mtx)); #ifdef VERSION_EU f32 aspect = ((f32) gCurGraphNodeRoot->width / (f32) gCurGraphNodeRoot->height) * 1.1f; @@ -267,20 +267,8 @@ static void geo_process_perspective(struct GraphNodePerspective *node) { * range of this node. */ static void geo_process_level_of_detail(struct GraphNodeLevelOfDetail *node) { -#ifdef GBI_FLOATS - Mtx *mtx = gMatStackFixed[gMatStackIndex]; - s16 distanceFromCam = (s32) -mtx->m[3][2]; // z-component of the translation column -#else - // The fixed point Mtx type is defined as 16 longs, but it's actually 16 - // shorts for the integer parts followed by 16 shorts for the fraction parts - Mtx *mtx = gMatStackFixed[gMatStackIndex]; - s16 distanceFromCam = -GET_HIGH_S16_OF_32(mtx->m[1][3]); // z-component of the translation column -#endif - -#ifndef TARGET_N64 // We assume modern hardware is powerful enough to draw the most detailed variant - distanceFromCam = 0; -#endif + s16 distanceFromCam = 0; if (node->minDistance <= distanceFromCam && distanceFromCam < node->maxDistance) { if (node->node.children != 0) { @@ -314,8 +302,8 @@ static void geo_process_switch(struct GraphNodeSwitchCase *node) { */ static void geo_process_camera(struct GraphNodeCamera *node) { Mat4 cameraTransform; - Mtx *rollMtx = (Mtx*) alloc_display_list(sizeof(*rollMtx)); - Mtx *mtx = (Mtx*) alloc_display_list(sizeof(*mtx)); + Mtx *rollMtx = alloc_display_list(sizeof(*rollMtx)); + Mtx *mtx = alloc_display_list(sizeof(*mtx)); if (node->fnNode.func != NULL) { node->fnNode.func(GEO_CONTEXT_RENDER, &node->fnNode.node, gMatStack[gMatStackIndex]); @@ -347,7 +335,7 @@ static void geo_process_camera(struct GraphNodeCamera *node) { static void geo_process_translation_rotation(struct GraphNodeTranslationRotation *node) { Mat4 mtxf; Vec3f translation; - Mtx *mtx = (Mtx*) alloc_display_list(sizeof(*mtx)); + Mtx *mtx = alloc_display_list(sizeof(*mtx)); vec3s_to_vec3f(translation, node->translation); mtxf_rotate_zxy_and_translate(mtxf, translation, node->rotation); @@ -372,7 +360,7 @@ static void geo_process_translation_rotation(struct GraphNodeTranslationRotation static void geo_process_translation(struct GraphNodeTranslation *node) { Mat4 mtxf; Vec3f translation; - Mtx *mtx = (Mtx*) alloc_display_list(sizeof(*mtx)); + Mtx *mtx = alloc_display_list(sizeof(*mtx)); vec3s_to_vec3f(translation, node->translation); mtxf_rotate_zxy_and_translate(mtxf, translation, gVec3sZero); @@ -396,7 +384,7 @@ static void geo_process_translation(struct GraphNodeTranslation *node) { */ static void geo_process_rotation(struct GraphNodeRotation *node) { Mat4 mtxf; - Mtx *mtx = (Mtx*) alloc_display_list(sizeof(*mtx)); + Mtx *mtx = alloc_display_list(sizeof(*mtx)); mtxf_rotate_zxy_and_translate(mtxf, gVec3fZero, node->rotation); mtxf_mul(gMatStack[gMatStackIndex + 1], mtxf, gMatStack[gMatStackIndex]); @@ -420,7 +408,7 @@ static void geo_process_rotation(struct GraphNodeRotation *node) { static void geo_process_scale(struct GraphNodeScale *node) { UNUSED Mat4 transform; Vec3f scaleVec; - Mtx *mtx = (Mtx*) alloc_display_list(sizeof(*mtx)); + Mtx *mtx = alloc_display_list(sizeof(*mtx)); vec3f_set(scaleVec, node->scale, node->scale, node->scale); mtxf_scale_vec3f(gMatStack[gMatStackIndex + 1], gMatStack[gMatStackIndex], scaleVec); @@ -444,7 +432,7 @@ static void geo_process_scale(struct GraphNodeScale *node) { */ static void geo_process_billboard(struct GraphNodeBillboard *node) { Vec3f translation; - Mtx *mtx = (Mtx*) alloc_display_list(sizeof(*mtx)); + Mtx *mtx = alloc_display_list(sizeof(*mtx)); gMatStackIndex++; vec3s_to_vec3f(translation, node->translation); @@ -517,9 +505,9 @@ static void geo_process_background(struct GraphNodeBackground *node) { geo_append_display_list((void *) VIRTUAL_TO_PHYSICAL(list), node->fnNode.node.flags >> 8); } else if (gCurGraphNodeMasterList != NULL) { #ifndef F3DEX_GBI_2E - Gfx *gfxStart = (Gfx*) alloc_display_list(sizeof(Gfx) * 7); + Gfx *gfxStart = alloc_display_list(sizeof(Gfx) * 7); #else - Gfx *gfxStart = (Gfx*) alloc_display_list(sizeof(Gfx) * 8); + Gfx *gfxStart = alloc_display_list(sizeof(Gfx) * 8); #endif Gfx *gfx = gfxStart; @@ -547,7 +535,7 @@ static void geo_process_animated_part(struct GraphNodeAnimatedPart *node) { Mat4 matrix; Vec3s rotation; Vec3f translation; - Mtx *matrixPtr = (Mtx*) alloc_display_list(sizeof(*matrixPtr)); + Mtx *matrixPtr = alloc_display_list(sizeof(*matrixPtr)); vec3s_copy(rotation, gVec3sZero); vec3f_set(translation, node->translation[0], node->translation[1], node->translation[2]); @@ -626,8 +614,8 @@ void geo_set_animation_globals(struct GraphNodeObject_sub *node, s32 hasAnimatio gCurrAnimFrame = node->animFrame; gCurAnimEnabled = (anim->flags & ANIM_FLAG_5) == 0; - gCurrAnimAttribute = (u16*) segmented_to_virtual((void *) anim->index); - gCurAnimData = (s16*) segmented_to_virtual((void *) anim->values); + gCurrAnimAttribute = segmented_to_virtual((void *) anim->index); + gCurAnimData = segmented_to_virtual((void *) anim->values); if (anim->unk02 == 0) { gCurAnimTranslationMultiplier = 1.0f; @@ -693,7 +681,7 @@ static void geo_process_shadow(struct GraphNodeShadow *node) { shadowList = create_shadow_below_xyz(shadowPos[0], shadowPos[1], shadowPos[2], shadowScale, node->shadowSolidity, node->shadowType); if (shadowList != NULL) { - mtx = (Mtx*) alloc_display_list(sizeof(*mtx)); + mtx = alloc_display_list(sizeof(*mtx)); gMatStackIndex++; mtxf_translate(mtxf, shadowPos); mtxf_mul(gMatStack[gMatStackIndex], mtxf, *gCurGraphNodeCamera->matrixPtr); @@ -767,11 +755,9 @@ static int obj_is_in_view(struct GraphNodeObject *node, Mat4 matrix) { // the amount of units between the center of the screen and the horizontal edge // given the distance from the object to the camera. -#ifdef WIDESCREEN // This multiplication should really be performed on 4:3 as well, // but the issue will be more apparent on widescreen. hScreenEdge *= GFX_DIMENSIONS_ASPECT_RATIO; -#endif if (geo != NULL && geo->type == GRAPH_NODE_TYPE_CULLING_RADIUS) { cullingRadius = @@ -814,6 +800,9 @@ static void geo_process_object(struct Object *node) { if (node->header.gfx.throwMatrix != NULL) { mtxf_mul(gMatStack[gMatStackIndex + 1], *node->header.gfx.throwMatrix, gMatStack[gMatStackIndex]); + } else if (node->header.gfx.node.flags & GRAPH_RENDER_CYLBOARD) { + mtxf_cylboard(gMatStack[gMatStackIndex + 1], gMatStack[gMatStackIndex], + node->header.gfx.pos, gCurGraphNodeCamera->roll); } else if (node->header.gfx.node.flags & GRAPH_RENDER_BILLBOARD) { mtxf_billboard(gMatStack[gMatStackIndex + 1], gMatStack[gMatStackIndex], node->header.gfx.pos, gCurGraphNodeCamera->roll); @@ -834,7 +823,7 @@ static void geo_process_object(struct Object *node) { geo_set_animation_globals(&node->header.gfx.unk38, hasAnimation); } if (obj_is_in_view(&node->header.gfx, gMatStack[gMatStackIndex])) { - Mtx *mtx = (Mtx*) alloc_display_list(sizeof(*mtx)); + Mtx *mtx = alloc_display_list(sizeof(*mtx)); mtxf_to_mtx(mtx, gMatStack[gMatStackIndex]); gMatStackFixed[gMatStackIndex] = mtx; @@ -878,7 +867,7 @@ static void geo_process_object_parent(struct GraphNodeObjectParent *node) { void geo_process_held_object(struct GraphNodeHeldObject *node) { Mat4 mat; Vec3f translation; - Mtx *mtx = (Mtx*) alloc_display_list(sizeof(*mtx)); + Mtx *mtx = alloc_display_list(sizeof(*mtx)); #ifdef F3DEX_GBI_2 gSPLookAt(gDisplayListHead++, &lookAt); @@ -916,7 +905,7 @@ void geo_process_held_object(struct GraphNodeHeldObject *node) { gGeoTempState.attribute = gCurrAnimAttribute; gGeoTempState.data = gCurAnimData; gCurAnimType = 0; - gCurGraphNodeHeldObject = (struct GraphNodeHeldObject*) node; + gCurGraphNodeHeldObject = (void *) node; if (node->objNode->header.gfx.unk38.curAnim != NULL) { geo_set_animation_globals(&node->objNode->header.gfx.unk38, hasAnimation); } @@ -1049,11 +1038,11 @@ void geo_process_root(struct GraphNodeRoot *node, Vp *b, Vp *c, s32 clearColor) if (node->node.flags & GRAPH_RENDER_ACTIVE) { Mtx *initialMatrix; - Vp *viewport = (Vp*) alloc_display_list(sizeof(*viewport)); + Vp *viewport = alloc_display_list(sizeof(*viewport)); gDisplayListHeap = alloc_only_pool_init(main_pool_available() - sizeof(struct AllocOnlyPool), MEMORY_POOL_LEFT); - initialMatrix = (Mtx*) alloc_display_list(sizeof(*initialMatrix)); + initialMatrix = alloc_display_list(sizeof(*initialMatrix)); gMatStackIndex = 0; gCurAnimType = 0; vec3s_set(viewport->vp.vtrans, node->x * 4, node->y * 4, 511); diff --git a/src/game/save_file.c b/src/game/save_file.c index 36fb58fa..45ac71f4 100644 --- a/src/game/save_file.c +++ b/src/game/save_file.c @@ -1,5 +1,4 @@ #include - #include "sm64.h" #include "game_init.h" #include "main.h" @@ -11,11 +10,13 @@ #include "level_table.h" #include "course_table.h" #include "thread6.h" +#include "macros.h" +#include "pc/ini.h" #define MENU_DATA_MAGIC 0x4849 #define SAVE_FILE_MAGIC 0x4441 -//STATIC_ASSERT(sizeof(struct SaveBuffer) == EEPROM_SIZE, "eeprom buffer size must match"); +STATIC_ASSERT(sizeof(struct SaveBuffer) == EEPROM_SIZE, "eeprom buffer size must match"); extern struct SaveBuffer gSaveBuffer; @@ -41,8 +42,14 @@ s8 gLevelToCourseNumTable[] = { #undef STUB_LEVEL #undef DEFINE_LEVEL -/*STATIC_ASSERT(ARRAY_COUNT(gLevelToCourseNumTable) == LEVEL_COUNT - 1, - "change this array if you are adding levels");*/ +STATIC_ASSERT(ARRAY_COUNT(gLevelToCourseNumTable) == LEVEL_COUNT - 1, + "change this array if you are adding levels"); + +#ifdef TEXTSAVES + +#include "text_save.inc.h" + +#endif // This was probably used to set progress to 100% for debugging, but // it was removed from the release ROM. @@ -50,6 +57,38 @@ static void stub_save_file_1(void) { UNUSED s32 pad; } +/** + * Byteswap all multibyte fields in a SaveBlockSignature. + */ +static inline void bswap_signature(struct SaveBlockSignature *data) { + data->magic = BSWAP16(data->magic); + data->chksum = BSWAP16(data->chksum); // valid as long as the checksum is a literal sum +} + +/** + * Byteswap all multibyte fields in a MainMenuSaveData. + */ +static inline void bswap_menudata(struct MainMenuSaveData *data) { + for (int i = 0; i < NUM_SAVE_FILES; ++i) + data->coinScoreAges[i] = BSWAP32(data->coinScoreAges[i]); + data->soundMode = BSWAP16(data->soundMode); +#ifdef VERSION_EU + data->language = BSWAP16(data->language); +#endif + bswap_signature(&data->signature); +} + +/** + * Byteswap all multibyte fields in a SaveFile. + */ +static inline void bswap_savefile(struct SaveFile *data) { + data->capPos[0] = BSWAP16(data->capPos[0]); + data->capPos[1] = BSWAP16(data->capPos[1]); + data->capPos[2] = BSWAP16(data->capPos[2]); + data->flags = BSWAP32(data->flags); + bswap_signature(&data->signature); +} + /** * Read from EEPROM to a given address. * The EEPROM address is computed using the offset of the destination address from gSaveBuffer. @@ -64,14 +103,10 @@ static s32 read_eeprom_data(void *buffer, s32 size) { u32 offset = (u32)((u8 *) buffer - (u8 *) &gSaveBuffer) / 8; do { -#ifdef VERSION_SH block_until_rumble_pak_free(); -#endif triesLeft--; - status = osEepromLongRead(&gSIEventMesgQueue, offset, (u8*) buffer, size); -#ifdef VERSION_SH + status = osEepromLongRead(&gSIEventMesgQueue, offset, buffer, size); release_rumble_pak_control(); -#endif } while (triesLeft > 0 && status != 0); } @@ -80,32 +115,62 @@ static s32 read_eeprom_data(void *buffer, s32 size) { /** * Write data to EEPROM. - * The EEPROM address is computed using the offset of the source address from gSaveBuffer. + * The EEPROM address was originally computed using the offset of the source address from gSaveBuffer. * Try at most 4 times, and return 0 on success. On failure, return the status returned from * osEepromLongWrite. Unlike read_eeprom_data, return 1 if EEPROM isn't loaded. */ -static s32 write_eeprom_data(void *buffer, s32 size) { +static s32 write_eeprom_data(void *buffer, s32 size, const uintptr_t baseofs) { s32 status = 1; if (gEepromProbe != 0) { s32 triesLeft = 4; - u32 offset = (u32)((u8 *) buffer - (u8 *) &gSaveBuffer) >> 3; + u32 offset = (u32)baseofs >> 3; do { -#ifdef VERSION_SH block_until_rumble_pak_free(); -#endif triesLeft--; - status = osEepromLongWrite(&gSIEventMesgQueue, offset, (u8*) buffer, size); -#ifdef VERSION_SH + status = osEepromLongWrite(&gSIEventMesgQueue, offset, buffer, size); release_rumble_pak_control(); -#endif } while (triesLeft > 0 && status != 0); } return status; } +/** + * Wrappers that byteswap the data on LE platforms before writing it to 'EEPROM' + */ + +static inline s32 write_eeprom_savefile(const u32 file, const u32 slot, const u32 num) { + // calculate the EEPROM address using the file number and slot + const uintptr_t ofs = (u8*)&gSaveBuffer.files[file][slot] - (u8*)&gSaveBuffer; + +#if IS_BIG_ENDIAN + return write_eeprom_data(&gSaveBuffer.files[file][slot], num * sizeof(struct SaveFile), ofs); +#else + // byteswap the data and then write it + struct SaveFile sf[num]; + bcopy(&gSaveBuffer.files[file][slot], sf, num * sizeof(sf[0])); + for (u32 i = 0; i < num; ++i) bswap_savefile(&sf[i]); + return write_eeprom_data(&sf, sizeof(sf), ofs); +#endif +} + +static inline s32 write_eeprom_menudata(const u32 slot, const u32 num) { + // calculate the EEPROM address using the slot + const uintptr_t ofs = (u8*)&gSaveBuffer.menuData[slot] - (u8*)&gSaveBuffer; + +#if IS_BIG_ENDIAN + return write_eeprom_data(&gSaveBuffer.menuData[slot], num * sizeof(struct MainMenuSaveData), ofs); +#else + // byteswap the data and then write it + struct MainMenuSaveData md[num]; + bcopy(&gSaveBuffer.menuData[slot], md, num * sizeof(md[0])); + for (u32 i = 0; i < num; ++i) bswap_menudata(&md[i]); + return write_eeprom_data(&md, sizeof(md), ofs); +#endif +} + /** * Sum the bytes in data to data + size - 2. The last two bytes are ignored * because that is where the checksum is stored. @@ -128,7 +193,7 @@ static s32 verify_save_block_signature(void *buffer, s32 size, u16 magic) { if (sig->magic != magic) { return FALSE; } - if (sig->chksum != calc_checksum((u8*) buffer, size)) { + if (sig->chksum != calc_checksum(buffer, size)) { return FALSE; } return TRUE; @@ -141,7 +206,7 @@ static void add_save_block_signature(void *buffer, s32 size, u16 magic) { struct SaveBlockSignature *sig = (struct SaveBlockSignature *) ((size - 4) + (u8 *) buffer); sig->magic = magic; - sig->chksum = calc_checksum((u8*) buffer, size); + sig->chksum = calc_checksum(buffer, size); } /** @@ -157,7 +222,7 @@ static void restore_main_menu_data(s32 srcSlot) { bcopy(&gSaveBuffer.menuData[srcSlot], &gSaveBuffer.menuData[destSlot], sizeof(gSaveBuffer.menuData[destSlot])); // Write destination data to EEPROM - write_eeprom_data(&gSaveBuffer.menuData[destSlot], sizeof(gSaveBuffer.menuData[destSlot])); + write_eeprom_menudata(destSlot, 1); } static void save_main_menu_data(void) { @@ -169,7 +234,7 @@ static void save_main_menu_data(void) { bcopy(&gSaveBuffer.menuData[0], &gSaveBuffer.menuData[1], sizeof(gSaveBuffer.menuData[1])); // Write to EEPROM - write_eeprom_data(gSaveBuffer.menuData, sizeof(gSaveBuffer.menuData)); + write_eeprom_menudata(0, 2); gMainMenuDataModified = FALSE; } @@ -245,12 +310,51 @@ static void restore_save_file_data(s32 fileIndex, s32 srcSlot) { sizeof(gSaveBuffer.files[fileIndex][destSlot])); // Write destination data to EEPROM - write_eeprom_data(&gSaveBuffer.files[fileIndex][destSlot], - sizeof(gSaveBuffer.files[fileIndex][destSlot])); + write_eeprom_savefile(fileIndex, destSlot, 1); +} + +/** + * Check if the 'EEPROM' save has different endianness (e.g. it's from an actual N64). + */ +static u8 save_file_need_bswap(const struct SaveBuffer *buf) { + // check all signatures just in case + for (int i = 0; i < 2; ++i) { + if (buf->menuData[i].signature.magic == BSWAP16(MENU_DATA_MAGIC)) + return TRUE; + for (int j = 0; j < NUM_SAVE_FILES; ++j) { + if (buf->files[j][i].signature.magic == BSWAP16(SAVE_FILE_MAGIC)) + return TRUE; + } + } + return FALSE; +} + +/** + * Byteswap all multibyte fields in a SaveBuffer. + */ +static void save_file_bswap(struct SaveBuffer *buf) { + bswap_menudata(buf->menuData + 0); + bswap_menudata(buf->menuData + 1); + for (int i = 0; i < NUM_SAVE_FILES; ++i) { + bswap_savefile(buf->files[i] + 0); + bswap_savefile(buf->files[i] + 1); + } } void save_file_do_save(s32 fileIndex) { - if (gSaveFileModified) { + if (fileIndex < 0 || fileIndex >= NUM_SAVE_FILES) + return; + + if (gSaveFileModified) +#ifdef TEXTSAVES + { + // Write to text file + write_text_save(fileIndex); + gSaveFileModified = FALSE; + gMainMenuDataModified = FALSE; + } +#else + { // Compute checksum add_save_block_signature(&gSaveBuffer.files[fileIndex][0], sizeof(gSaveBuffer.files[fileIndex][0]), SAVE_FILE_MAGIC); @@ -260,15 +364,18 @@ void save_file_do_save(s32 fileIndex) { sizeof(gSaveBuffer.files[fileIndex][1])); // Write to EEPROM - write_eeprom_data(gSaveBuffer.files[fileIndex], sizeof(gSaveBuffer.files[fileIndex])); - + write_eeprom_savefile(fileIndex, 0, 2); + gSaveFileModified = FALSE; } - save_main_menu_data(); +#endif } void save_file_erase(s32 fileIndex) { + if (fileIndex < 0 || fileIndex >= NUM_SAVE_FILES) + return; + touch_high_score_ages(fileIndex); bzero(&gSaveBuffer.files[fileIndex][0], sizeof(gSaveBuffer.files[fileIndex][0])); @@ -278,7 +385,8 @@ void save_file_erase(s32 fileIndex) { //! Needs to be s32 to match on -O2, despite no return value. BAD_RETURN(s32) save_file_copy(s32 srcFileIndex, s32 destFileIndex) { - UNUSED s32 pad; + if (srcFileIndex < 0 || srcFileIndex >= NUM_SAVE_FILES || destFileIndex < 0 || destFileIndex >= NUM_SAVE_FILES) + return; touch_high_score_ages(destFileIndex); bcopy(&gSaveBuffer.files[srcFileIndex][0], &gSaveBuffer.files[destFileIndex][0], @@ -290,14 +398,25 @@ BAD_RETURN(s32) save_file_copy(s32 srcFileIndex, s32 destFileIndex) { void save_file_load_all(void) { s32 file; - s32 validSlots; gMainMenuDataModified = FALSE; gSaveFileModified = FALSE; bzero(&gSaveBuffer, sizeof(gSaveBuffer)); + +#ifdef TEXTSAVES + for (file = 0; file < NUM_SAVE_FILES; file++) { + read_text_save(file); + } + gSaveFileModified = TRUE; + gMainMenuDataModified = TRUE; +#else + s32 validSlots; read_eeprom_data(&gSaveBuffer, sizeof(gSaveBuffer)); + if (save_file_need_bswap(&gSaveBuffer)) + save_file_bswap(&gSaveBuffer); + // Verify the main menu data and create a backup copy if only one of the slots is valid. validSlots = verify_save_block_signature(&gSaveBuffer.menuData[0], sizeof(gSaveBuffer.menuData[0]), MENU_DATA_MAGIC); validSlots |= verify_save_block_signature(&gSaveBuffer.menuData[1], sizeof(gSaveBuffer.menuData[1]),MENU_DATA_MAGIC) << 1; @@ -329,7 +448,7 @@ void save_file_load_all(void) { break; } } - +#endif // TEXTSAVES stub_save_file_1(); } @@ -590,6 +709,9 @@ void eu_set_language(u16 language) { } u16 eu_get_language(void) { + // check if the language is in range, in case we loaded a US save with garbage padding or something + if (gSaveBuffer.menuData[0].language >= LANGUAGE_MAX) + eu_set_language(LANGUAGE_ENGLISH); // reset it to english if not return gSaveBuffer.menuData[0].language; } #endif @@ -636,4 +758,4 @@ s32 check_warp_checkpoint(struct WarpNode *warpNode) { } return isWarpCheckpointActive; -} +} \ No newline at end of file diff --git a/src/game/save_file.h b/src/game/save_file.h index 3ee5a19a..c292a156 100644 --- a/src/game/save_file.h +++ b/src/game/save_file.h @@ -153,7 +153,8 @@ s32 check_warp_checkpoint(struct WarpNode *warpNode); enum EuLanguages { LANGUAGE_ENGLISH, LANGUAGE_FRENCH, - LANGUAGE_GERMAN + LANGUAGE_GERMAN, + LANGUAGE_MAX }; void eu_set_language(u16 language); diff --git a/src/game/screen_transition.c b/src/game/screen_transition.c index b30a81d5..b49ddaf5 100644 --- a/src/game/screen_transition.c +++ b/src/game/screen_transition.c @@ -44,7 +44,7 @@ u8 set_transition_color_fade_alpha(s8 fadeType, s8 fadeTimer, u8 transTime) { } Vtx *vertex_transition_color(struct WarpTransitionData *transData, u8 alpha) { - Vtx *verts = (Vtx*) alloc_display_list(4 * sizeof(*verts)); + Vtx *verts = alloc_display_list(4 * sizeof(*verts)); u8 r = transData->red; u8 g = transData->green; u8 b = transData->blue; @@ -172,7 +172,7 @@ s32 render_textured_transition(s8 fadeTimer, s8 transTime, struct WarpTransition s16 centerTransX = center_tex_transition_x(transData, texTransTime, texTransPos); s16 centerTransY = center_tex_transition_y(transData, texTransTime, texTransPos); s16 texTransRadius = calc_tex_transition_radius(fadeTimer, transTime, transData); - Vtx *verts = (Vtx*) alloc_display_list(8 * sizeof(*verts)); + Vtx *verts = alloc_display_list(8 * sizeof(*verts)); if (verts != NULL) { load_tex_transition_vertex(verts, fadeTimer, transData, centerTransX, centerTransY, texTransRadius, transTexType); @@ -242,13 +242,8 @@ int render_screen_transition(s8 fadeTimer, s8 transType, u8 transTime, struct Wa } Gfx *render_cannon_circle_base(void) { -#ifdef WIDESCREEN - Vtx *verts = (Vtx*) alloc_display_list(8 * sizeof(*verts)); - Gfx *dlist = (Gfx*) alloc_display_list(20 * sizeof(*dlist)); -#else - Vtx *verts = (Vtx*) alloc_display_list(4 * sizeof(*verts)); - Gfx *dlist = (Gfx*) alloc_display_list(16 * sizeof(*dlist)); -#endif + Vtx *verts = alloc_display_list(8 * sizeof(*verts)); + Gfx *dlist = alloc_display_list(20 * sizeof(*dlist)); Gfx *g = dlist; if (verts != NULL && dlist != NULL) { @@ -257,13 +252,11 @@ Gfx *render_cannon_circle_base(void) { make_vertex(verts, 2, SCREEN_WIDTH, SCREEN_HEIGHT, -1, 1152, 192, 0, 0, 0, 255); make_vertex(verts, 3, 0, SCREEN_HEIGHT, -1, -1152, 192, 0, 0, 0, 255); -#ifdef WIDESCREEN // Render black rectangles outside the 4:3 area. make_vertex(verts, 4, GFX_DIMENSIONS_FROM_LEFT_EDGE(0), 0, -1, 0, 0, 0, 0, 0, 255); make_vertex(verts, 5, GFX_DIMENSIONS_FROM_RIGHT_EDGE(0), 0, -1, 0, 0, 0, 0, 0, 255); make_vertex(verts, 6, GFX_DIMENSIONS_FROM_RIGHT_EDGE(0), SCREEN_HEIGHT, -1, 0, 0, 0, 0, 0, 255); make_vertex(verts, 7, GFX_DIMENSIONS_FROM_LEFT_EDGE(0), SCREEN_HEIGHT, -1, 0, 0, 0, 0, 0, 255); -#endif gSPDisplayList(g++, dl_proj_mtx_fullscreen); gDPSetCombineMode(g++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); @@ -274,12 +267,12 @@ Gfx *render_cannon_circle_base(void) { gSPVertex(g++, VIRTUAL_TO_PHYSICAL(verts), 4, 0); gSPDisplayList(g++, dl_draw_quad_verts_0123); gSPTexture(g++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF); -#ifdef WIDESCREEN + gDPSetCombineMode(g++, G_CC_SHADE, G_CC_SHADE); gSPVertex(g++, VIRTUAL_TO_PHYSICAL(verts + 4), 4, 4); gSP2Triangles(g++, 4, 0, 3, 0, 4, 3, 7, 0); gSP2Triangles(g++, 1, 5, 6, 0, 1, 6, 2, 0); -#endif + gSPDisplayList(g++, dl_screen_transition_end); gSPEndDisplayList(g); } else { diff --git a/src/game/segment2.h b/src/game/segment2.h index 1f2b99bb..7eecce54 100644 --- a/src/game/segment2.h +++ b/src/game/segment2.h @@ -4,14 +4,12 @@ #include #include -#include "ingame_menu.h" - -extern const u8* const seg2_course_name_table[]; -extern const u8* const seg2_act_name_table[]; -extern const Gfx dl_rgba16_text_begin[]; -extern const Gfx dl_rgba16_text_end[]; -extern const Gfx dl_ia_text_begin[]; -extern const Gfx dl_ia_text_end[]; +extern u8 seg2_course_name_table[]; +extern u8 seg2_act_name_table[]; +extern Gfx dl_rgba16_text_begin[]; +extern Gfx dl_rgba16_text_end[]; +extern Gfx dl_ia_text_begin[]; +extern Gfx dl_ia_text_end[]; extern u8 texture_transition_star_half[]; extern u8 texture_transition_circle_half[]; extern u8 texture_transition_mario[]; @@ -21,49 +19,49 @@ extern u8 texture_waterbox_mist[]; extern u8 texture_waterbox_jrb_water[]; extern u8 texture_waterbox_unknown_water[]; extern u8 texture_waterbox_lava[]; -extern const Gfx dl_proj_mtx_fullscreen[]; -extern const Gfx dl_draw_quad_verts_0123[]; -extern const Gfx dl_screen_transition_end[]; -extern const Gfx dl_transition_draw_filled_region[]; -extern const Gfx dl_shadow_circle[]; -extern const Gfx dl_shadow_square[]; -extern const Gfx dl_shadow_9_verts[]; -extern const Gfx dl_shadow_4_verts[]; -extern const Gfx dl_shadow_end[]; -extern const Gfx dl_skybox_begin[]; -extern const Gfx dl_skybox_tile_tex_settings[]; -extern const Gfx dl_skybox_end[]; -extern const Gfx dl_waterbox_ia16_begin[]; +extern Gfx dl_proj_mtx_fullscreen[]; +extern Gfx dl_draw_quad_verts_0123[]; +extern Gfx dl_screen_transition_end[]; +extern Gfx dl_transition_draw_filled_region[]; +extern Gfx dl_shadow_circle[]; +extern Gfx dl_shadow_square[]; +extern Gfx dl_shadow_9_verts[]; +extern Gfx dl_shadow_4_verts[]; +extern Gfx dl_shadow_end[]; +extern Gfx dl_skybox_begin[]; +extern Gfx dl_skybox_tile_tex_settings[]; +extern Gfx dl_skybox_end[]; +extern Gfx dl_waterbox_ia16_begin[]; extern Gfx dl_waterbox_rgba16_begin[]; extern Gfx dl_waterbox_end[]; -extern const Gfx dl_paintings_draw_ripples[]; -extern const Gfx dl_paintings_rippling_begin[]; -extern const Gfx dl_paintings_rippling_end[]; -extern const Gfx dl_paintings_env_mapped_begin[]; -extern const Gfx dl_paintings_env_mapped_end[]; -extern const s16 seg2_painting_triangle_mesh[]; -extern const s16 seg2_painting_mesh_neighbor_tris[]; -extern const u8* const main_hud_lut[58]; -extern const Gfx dl_hud_img_load_tex_block[]; -extern const Gfx dl_hud_img_begin[]; -extern const Gfx dl_hud_img_end[]; -extern const u8 *const main_font_lut[]; -extern const Gfx dl_ia_text_tex_settings[]; -extern const Gfx dl_rgba16_load_tex_block[]; -extern const u8 *const main_credits_font_lut[]; -extern const u8 *const main_hud_camera_lut[6]; -extern const Gfx dl_draw_text_bg_box[]; -extern const Gfx dl_draw_triangle[]; -extern const struct DialogEntry* const seg2_dialog_table[]; -extern const Gfx dl_billboard_num_0[]; -extern const Gfx dl_billboard_num_1[]; -extern const Gfx dl_billboard_num_2[]; -extern const Gfx dl_billboard_num_3[]; -extern const Gfx dl_billboard_num_4[]; -extern const Gfx dl_billboard_num_5[]; -extern const Gfx dl_billboard_num_6[]; -extern const Gfx dl_billboard_num_7[]; -extern const Gfx dl_billboard_num_8[]; -extern const Gfx dl_billboard_num_9[]; +extern Gfx dl_paintings_draw_ripples[]; +extern Gfx dl_paintings_rippling_begin[]; +extern Gfx dl_paintings_rippling_end[]; +extern Gfx dl_paintings_env_mapped_begin[]; +extern Gfx dl_paintings_env_mapped_end[]; +extern u8 seg2_painting_triangle_mesh[]; +extern u8 seg2_painting_mesh_neighbor_tris[]; +extern u8* main_hud_lut[58]; +extern Gfx dl_hud_img_load_tex_block[]; +extern Gfx dl_hud_img_begin[]; +extern Gfx dl_hud_img_end[]; +extern void *main_font_lut[]; +extern Gfx dl_ia_text_tex_settings[]; +extern Gfx dl_rgba16_load_tex_block[]; +extern void *main_credits_font_lut[]; +extern u8* main_hud_camera_lut[6]; +extern Gfx dl_draw_text_bg_box[]; +extern Gfx dl_draw_triangle[]; +extern void *seg2_dialog_table[]; +extern Gfx dl_billboard_num_0[]; +extern Gfx dl_billboard_num_1[]; +extern Gfx dl_billboard_num_2[]; +extern Gfx dl_billboard_num_3[]; +extern Gfx dl_billboard_num_4[]; +extern Gfx dl_billboard_num_5[]; +extern Gfx dl_billboard_num_6[]; +extern Gfx dl_billboard_num_7[]; +extern Gfx dl_billboard_num_8[]; +extern Gfx dl_billboard_num_9[]; #endif // SEGMENT2_H diff --git a/src/game/segment7.h b/src/game/segment7.h index 6692ac6b..14fc0390 100644 --- a/src/game/segment7.h +++ b/src/game/segment7.h @@ -24,7 +24,7 @@ extern const u8 eu_course_strings_de_table[]; #endif // from intro_segment7 -extern Gfx *intro_seg7_dl_0700B3A0; +extern Gfx *titletest_test_mesh; extern Gfx *intro_seg7_dl_0700C6A0; extern f32 intro_seg7_table_0700C790[]; extern f32 intro_seg7_table_0700C880[]; diff --git a/src/game/shadow.c b/src/game/shadow.c index b5d1882e..324400e5 100644 --- a/src/game/shadow.c +++ b/src/game/shadow.c @@ -13,10 +13,8 @@ #include "shadow.h" #include "sm64.h" -#ifndef TARGET_N64 // Avoid Z-fighting #define find_floor_height_and_data 0.4 + find_floor_height_and_data -#endif /** * @file shadow.c @@ -627,8 +625,8 @@ Gfx *create_shadow_player(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 soli return NULL; } - verts = (Vtx*) alloc_display_list(9 * sizeof(Vtx)); - displayList = (Gfx*) alloc_display_list(5 * sizeof(Gfx)); + verts = alloc_display_list(9 * sizeof(Vtx)); + displayList = alloc_display_list(5 * sizeof(Gfx)); if (verts == NULL || displayList == NULL) { return NULL; } @@ -655,8 +653,8 @@ Gfx *create_shadow_circle_9_verts(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, return NULL; } - verts = (Vtx*) alloc_display_list(9 * sizeof(Vtx)); - displayList = (Gfx*) alloc_display_list(5 * sizeof(Gfx)); + verts = alloc_display_list(9 * sizeof(Vtx)); + displayList = alloc_display_list(5 * sizeof(Gfx)); if (verts == NULL || displayList == NULL) { return 0; @@ -681,8 +679,8 @@ Gfx *create_shadow_circle_4_verts(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, return NULL; } - verts = (Vtx*) alloc_display_list(4 * sizeof(Vtx)); - displayList = (Gfx*) alloc_display_list(5 * sizeof(Gfx)); + verts = alloc_display_list(4 * sizeof(Vtx)); + displayList = alloc_display_list(5 * sizeof(Gfx)); if (verts == NULL || displayList == NULL) { return 0; @@ -714,8 +712,8 @@ Gfx *create_shadow_circle_assuming_flat_ground(f32 xPos, f32 yPos, f32 zPos, s16 distBelowFloor = floorHeight - yPos; } - verts = (Vtx*) alloc_display_list(4 * sizeof(Vtx)); - displayList = (Gfx*) alloc_display_list(5 * sizeof(Gfx)); + verts = alloc_display_list(4 * sizeof(Vtx)); + displayList = alloc_display_list(5 * sizeof(Gfx)); if (verts == NULL || displayList == NULL) { return 0; @@ -735,8 +733,8 @@ Gfx *create_shadow_circle_assuming_flat_ground(f32 xPos, f32 yPos, f32 zPos, s16 * underneath the shadow is totally flat. */ Gfx *create_shadow_rectangle(f32 halfWidth, f32 halfLength, f32 relY, u8 solidity) { - Vtx *verts = (Vtx*) alloc_display_list(4 * sizeof(Vtx)); - Gfx *displayList = (Gfx*) alloc_display_list(5 * sizeof(Gfx)); + Vtx *verts = alloc_display_list(4 * sizeof(Vtx)); + Gfx *displayList = alloc_display_list(5 * sizeof(Gfx)); f32 frontLeftX, frontLeftZ, frontRightX, frontRightZ, backLeftX, backLeftZ, backRightX, backRightZ; if (verts == NULL || displayList == NULL) { diff --git a/src/game/skybox.c b/src/game/skybox.c index 3e00a36c..09deeaf0 100644 --- a/src/game/skybox.c +++ b/src/game/skybox.c @@ -1,5 +1,3 @@ -#include "skybox.h" - #include #include "area.h" @@ -12,9 +10,6 @@ #include "segment2.h" #include "sm64.h" -#ifndef TARGET_N64 -#define BETTER_SKYBOX_POSITION_PRECISION -#endif /** * @file skybox.c @@ -54,17 +49,10 @@ struct Skybox { u16 yaw; /// The camera's pitch, which is bounded by +-16384, which maps to -90 to 90 degrees s16 pitch; -#ifdef BETTER_SKYBOX_POSITION_PRECISION /// The skybox's X position in world space f32 scaledX; /// The skybox's Y position in world space f32 scaledY; -#else - /// The skybox's X position in world space - s32 scaledX; - /// The skybox's Y position in world space - s32 scaledY; -#endif /// The index of the upper-left tile in the 3x3 grid that gets drawn s32 upperLeftTile; @@ -72,6 +60,19 @@ struct Skybox { struct Skybox sSkyBoxInfo[2]; +typedef const u8 *const SkyboxTexture[80]; + +extern SkyboxTexture bbh_skybox_ptrlist; +extern SkyboxTexture bidw_skybox_ptrlist; +extern SkyboxTexture bitfs_skybox_ptrlist; +extern SkyboxTexture bits_skybox_ptrlist; +extern SkyboxTexture ccm_skybox_ptrlist; +extern SkyboxTexture cloud_floor_skybox_ptrlist; +extern SkyboxTexture clouds_skybox_ptrlist; +extern SkyboxTexture ssl_skybox_ptrlist; +extern SkyboxTexture water_skybox_ptrlist; +extern SkyboxTexture wdw_skybox_ptrlist; + SkyboxTexture *sSkyboxTextures[10] = { &water_skybox_ptrlist, &bitfs_skybox_ptrlist, @@ -134,32 +135,15 @@ u8 sSkyboxColors[][3] = { * (how far is the camera rotated from 0, scaled 0 to 1) * * (the screen width) */ -#ifdef BETTER_SKYBOX_POSITION_PRECISION -f32 -#else -s32 -#endif -calculate_skybox_scaled_x(s8 player, f32 fov) { +f32 calculate_skybox_scaled_x(s8 player, f32 fov) { f32 yaw = sSkyBoxInfo[player].yaw; //! double literals are used instead of floats - f32 yawScaled = SCREEN_WIDTH * 360.0 * yaw / (fov * 65536.0); - -#ifdef BETTER_SKYBOX_POSITION_PRECISION - f32 scaledX = yawScaled; + f32 scaledX = SCREEN_WIDTH * 360.0 * yaw / (fov * 65536.0); if (scaledX > SKYBOX_WIDTH) { scaledX -= (s32) scaledX / SKYBOX_WIDTH * SKYBOX_WIDTH; } -#else - // Round the scaled yaw. Since yaw is a u16, it doesn't need to check for < 0 - s32 scaledX = yawScaled + 0.5; - - if (scaledX > SKYBOX_WIDTH) { - scaledX -= scaledX / SKYBOX_WIDTH * SKYBOX_WIDTH; - } -#endif - return SKYBOX_WIDTH - scaledX; } @@ -169,27 +153,16 @@ calculate_skybox_scaled_x(s8 player, f32 fov) { * fov may have been used in an earlier version, but the developers changed the function to always use * 90 degrees. */ -#ifdef BETTER_SKYBOX_POSITION_PRECISION -f32 -#else -s32 -#endif -calculate_skybox_scaled_y(s8 player, UNUSED f32 fov) { +f32 calculate_skybox_scaled_y(s8 player, UNUSED f32 fov) { // Convert pitch to degrees. Pitch is bounded between -90 (looking down) and 90 (looking up). f32 pitchInDegrees = (f32) sSkyBoxInfo[player].pitch * 360.0 / 65535.0; // Scale by 360 / fov f32 degreesToScale = 360.0f * pitchInDegrees / 90.0; -#ifdef BETTER_SKYBOX_POSITION_PRECISION - f32 scaledY = degreesToScale + 5 * SKYBOX_TILE_HEIGHT; -#else - s32 roundedY = round_float(degreesToScale); - // Since pitch can be negative, and the tile grid starts 1 octant above the camera's focus, add // 5 octants to the y position - s32 scaledY = roundedY + 5 * SKYBOX_TILE_HEIGHT; -#endif + f32 scaledY = degreesToScale + 5 * SKYBOX_TILE_HEIGHT; if (scaledY > SKYBOX_HEIGHT) { scaledY = SKYBOX_HEIGHT; @@ -218,7 +191,7 @@ static int get_top_left_tile_idx(s8 player) { * SKYBOX_TILE_WIDTH to get a point in world space. */ Vtx *make_skybox_rect(s32 tileIndex, s8 colorIndex) { - Vtx *verts = (Vtx*) alloc_display_list(4 * sizeof(*verts)); + Vtx *verts = alloc_display_list(4 * sizeof(*verts)); s16 x = tileIndex % SKYBOX_COLS * SKYBOX_TILE_WIDTH; s16 y = SKYBOX_HEIGHT - tileIndex / SKYBOX_COLS * SKYBOX_TILE_HEIGHT; @@ -264,9 +237,8 @@ void *create_skybox_ortho_matrix(s8 player) { f32 right = sSkyBoxInfo[player].scaledX + SCREEN_WIDTH; f32 bottom = sSkyBoxInfo[player].scaledY - SCREEN_HEIGHT; f32 top = sSkyBoxInfo[player].scaledY; - Mtx *mtx = (Mtx*) alloc_display_list(sizeof(*mtx)); + Mtx *mtx = alloc_display_list(sizeof(*mtx)); -#ifdef WIDESCREEN f32 half_width = (4.0f / 3.0f) / GFX_DIMENSIONS_ASPECT_RATIO * SCREEN_WIDTH / 2; f32 center = (sSkyBoxInfo[player].scaledX + SCREEN_WIDTH / 2); if (half_width < SCREEN_WIDTH / 2) { @@ -274,7 +246,6 @@ void *create_skybox_ortho_matrix(s8 player) { left = center - half_width; right = center + half_width; } -#endif if (mtx != NULL) { guOrtho(mtx, left, right, bottom, top, 0.0f, 3.0f, 1.0f); @@ -289,13 +260,13 @@ void *create_skybox_ortho_matrix(s8 player) { */ Gfx *init_skybox_display_list(s8 player, s8 background, s8 colorIndex) { s32 dlCommandCount = 5 + (3 * 3) * 7; // 5 for the start and end, plus 9 skybox tiles - Gfx *skybox = (Gfx*) alloc_display_list(dlCommandCount * sizeof(Gfx)); + void *skybox = alloc_display_list(dlCommandCount * sizeof(Gfx)); Gfx *dlist = skybox; if (skybox == NULL) { return NULL; } else { - Mtx *ortho = (Mtx*) create_skybox_ortho_matrix(player); + Mtx *ortho = create_skybox_ortho_matrix(player); gSPDisplayList(dlist++, dl_skybox_begin); gSPMatrix(dlist++, VIRTUAL_TO_PHYSICAL(ortho), G_MTX_PROJECTION | G_MTX_MUL | G_MTX_NOPUSH); diff --git a/src/game/skybox.h b/src/game/skybox.h index ea0813f3..39220447 100644 --- a/src/game/skybox.h +++ b/src/game/skybox.h @@ -8,17 +8,4 @@ Gfx *create_skybox_facing_camera(s8 player, s8 background, f32 fov, f32 posX, f32 posY, f32 posZ, f32 focX, f32 focY, f32 focZ); -typedef const u8 *const SkyboxTexture[80]; - -extern SkyboxTexture bbh_skybox_ptrlist; -extern SkyboxTexture bidw_skybox_ptrlist; -extern SkyboxTexture bitfs_skybox_ptrlist; -extern SkyboxTexture bits_skybox_ptrlist; -extern SkyboxTexture ccm_skybox_ptrlist; -extern SkyboxTexture cloud_floor_skybox_ptrlist; -extern SkyboxTexture clouds_skybox_ptrlist; -extern SkyboxTexture ssl_skybox_ptrlist; -extern SkyboxTexture water_skybox_ptrlist; -extern SkyboxTexture wdw_skybox_ptrlist; - #endif // SKYBOX_H diff --git a/src/game/sound_init.c b/src/game/sound_init.c index 40e943cd..e8627562 100644 --- a/src/game/sound_init.c +++ b/src/game/sound_init.c @@ -153,11 +153,10 @@ void play_menu_sounds(s16 soundMenuFlags) { if (soundMenuFlags & 0x100) { play_menu_sounds_extra(20, NULL); } -#ifdef VERSION_SH + if ((soundMenuFlags & 0x20) != 0) { queue_rumble_data(10, 60); } -#endif } /** @@ -266,7 +265,7 @@ void stop_cap_music(void) { } void play_menu_sounds_extra(s32 a, void *b) { - play_sound(menuSoundsExtra[a], (f32*) b); + play_sound(menuSoundsExtra[a], b); } void audio_game_loop_tick(void) { @@ -284,7 +283,7 @@ void thread4_sound(UNUSED void *arg) { vec3f_copy(unused80339DC0, gVec3fZero); osCreateMesgQueue(&sSoundMesgQueue, sSoundMesgBuf, ARRAY_COUNT(sSoundMesgBuf)); - set_vblank_handler(1, &sSoundVblankHandler, &sSoundMesgQueue, (void**) (OSMesg) 512); + set_vblank_handler(1, &sSoundVblankHandler, &sSoundMesgQueue, (OSMesg) 512); while (TRUE) { OSMesg msg; diff --git a/src/game/spawn_object.c b/src/game/spawn_object.c index 9adcaa38..ee77f564 100644 --- a/src/game/spawn_object.c +++ b/src/game/spawn_object.c @@ -1,7 +1,6 @@ #include #include "audio/external.h" -#include "common/object/i_object_wrapper.hpp" #include "engine/geo_layout.h" #include "engine/graph_node.h" #include "engine/math_util.h" @@ -161,8 +160,7 @@ void clear_object_lists(struct ObjectNode *objLists) { } /** - * This function looks broken, but it appears to attempt to delete the leaf - * graph nodes under obj and obj's siblings. + * Delete the leaf graph nodes under obj and obj's siblings. */ static void unused_delete_leaf_nodes(struct Object *obj) { struct Object *children; @@ -176,8 +174,7 @@ static void unused_delete_leaf_nodes(struct Object *obj) { mark_obj_for_deletion(obj); } - // Probably meant to be != - while ((sibling = (struct Object *) obj->header.gfx.node.next) == obj0) { + while ((sibling = (struct Object *) obj->header.gfx.node.next) != obj0) { unused_delete_leaf_nodes(sibling); obj = (struct Object *) sibling->header.gfx.node.next; } @@ -196,11 +193,10 @@ void unload_object(struct Object *obj) { geo_add_child(&gObjParentGraphNode, &obj->header.gfx.node); obj->header.gfx.node.flags &= ~GRAPH_RENDER_BILLBOARD; + obj->header.gfx.node.flags &= ~GRAPH_RENDER_CYLBOARD; obj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE; deallocate_object(&gFreeObjectList, &obj->header); - - IObjectWrapper::destroy_wrapper_for(obj); } /** diff --git a/src/game/spawn_sound.c b/src/game/spawn_sound.c index a8f52f72..b94dd82d 100644 --- a/src/game/spawn_sound.c +++ b/src/game/spawn_sound.c @@ -68,7 +68,7 @@ void cur_obj_play_sound_1(s32 soundMagic) { void cur_obj_play_sound_2(s32 soundMagic) { if (gCurrentObject->header.gfx.node.flags & GRAPH_RENDER_ACTIVE) { play_sound(soundMagic, gCurrentObject->header.gfx.cameraToObject); -#ifdef VERSION_SH + if (soundMagic == SOUND_OBJ_BOWSER_WALK) { queue_rumble_data(3, 60); } @@ -78,7 +78,6 @@ void cur_obj_play_sound_2(s32 soundMagic) { if (soundMagic == SOUND_OBJ_WHOMP_LOWPRIO) { queue_rumble_data(5, 80); } -#endif } } diff --git a/src/game/text_save.inc.h b/src/game/text_save.inc.h new file mode 100644 index 00000000..a9ce6c2a --- /dev/null +++ b/src/game/text_save.inc.h @@ -0,0 +1,334 @@ +#include +#include +#include +#include "course_table.h" +#include "pc/ini.h" +#include "pc/platform.h" +#include "pc/fs/fs.h" + +#define FILENAME_FORMAT "%s/sm64_save_file_%d.sav" +#define NUM_COURSES 15 +#define NUM_BONUS_COURSES 10 +#define NUM_FLAGS 21 +#define NUM_CAP_ON 4 + +const char *sav_flags[NUM_FLAGS] = { + "file_exists", "wing_cap", "metal_cap", "vanish_cap", "key_1", "key_2", + "basement_door", "upstairs_door", "ddd_moved_back", "moat_drained", + "pps_door", "wf_door", "ccm_door", "jrb_door", "bitdw_door", + "bitfs_door", "", "", "", "", "50star_door" // 4 Cap flags are processed in their own section +}; + +const char *sav_courses[NUM_COURSES] = { + "bob", "wf", "jrb", "ccm", "bbh", "hmc", "lll", + "ssl", "ddd", "sl", "wdw", "ttm", "thi", "ttc", "rr" +}; + +const char *sav_bonus_courses[NUM_BONUS_COURSES] = { + "bitdw", "bitfs", "bits", "pss", "cotmc", + "totwc", "vcutm", "wmotr", "sa", "hub" // hub is Castle Grounds +}; + +const char *cap_on_types[NUM_CAP_ON] = { + "ground", "klepto", "ukiki", "mrblizzard" +}; + +const char *sound_modes[3] = { + "stereo", "mono", "headset" +}; + +/* Get current timestamp string */ +static void get_timestamp(char* buffer) { + time_t timer; + struct tm* tm_info; + + timer = time(NULL); + tm_info = localtime(&timer); + + strftime(buffer, 26, "%Y-%m-%d %H:%M:%S", tm_info); +} + +/* Convert 'binary' integer to decimal integer */ +static u32 bin_to_int(u32 n) { + s32 dec = 0, i = 0, rem; + while (n != 0) { + rem = n % 10; + n /= 10; + dec += rem * (1 << i); + ++i; + } + return dec; +} + +/* Convert decimal integer to 'binary' integer */ +static u32 int_to_bin(u32 n) { + s32 bin = 0, rem, i = 1; + while (n != 0) { + rem = n % 2; + n /= 2; + bin += rem * i; + i *= 10; + } + return bin; +} + +/** + * Write SaveFile and MainMenuSaveData structs to a text-based savefile + */ +static s32 write_text_save(s32 fileIndex) { + FILE* file; + struct SaveFile *savedata; + struct MainMenuSaveData *menudata; + char filename[SYS_MAX_PATH] = { 0 }; + char value[64]; + u32 i, bit, flags, coins, stars, starFlags; + + if (snprintf(filename, sizeof(filename), FILENAME_FORMAT, fs_writepath, fileIndex) < 0) + return -1; + + file = fopen(filename, "wt"); + if (file == NULL) { + printf("Savefile '%s' not found!\n", filename); + return -1; + } else + printf("Saving updated progress to '%s'\n", filename); + + fprintf(file, "# Super Mario 64 save file\n"); + fprintf(file, "# Comment starts with #\n"); + fprintf(file, "# True = 1, False = 0\n"); + + get_timestamp(value); + fprintf(file, "# %s\n", value); + + menudata = &gSaveBuffer.menuData[0]; + fprintf(file, "\n[menu]\n"); + fprintf(file, "coin_score_age = %d\n", menudata->coinScoreAges[fileIndex]); + + if (menudata->soundMode == 0) { + fprintf(file, "sound_mode = %s\n", sound_modes[0]); // stereo + } + else if (menudata->soundMode == 3) { + fprintf(file, "sound_mode = %s\n", sound_modes[1]); // mono + } + else if (menudata->soundMode == 1) { + fprintf(file, "sound_mode = %s\n", sound_modes[2]); // headset + } + else { + printf("Undefined sound mode!"); + return -1; + } + + fprintf(file, "\n[flags]\n"); + for (i = 1; i < NUM_FLAGS; i++) { + if (strcmp(sav_flags[i], "")) { + flags = save_file_get_flags(); + flags = (flags & (1 << i)); // Get 'star' flag bit + flags = (flags) ? 1 : 0; + + fprintf(file, "%s = %d\n", sav_flags[i], flags); + } + } + + fprintf(file, "\n[courses]\n"); + for (i = 0; i < NUM_COURSES; i++) { + stars = save_file_get_star_flags(fileIndex, i); + coins = save_file_get_course_coin_score(fileIndex, i); + starFlags = int_to_bin(stars); // 63 -> 111111 + + fprintf(file, "%s = \"%d, %07d\"\n", sav_courses[i], coins, starFlags); + } + + fprintf(file, "\n[bonus]\n"); + for (i = 0; i < NUM_BONUS_COURSES; i++) { + char *format; + + if (i == NUM_BONUS_COURSES-1) { + // Process Castle Grounds + stars = save_file_get_star_flags(fileIndex, -1); + format = "%05d"; + } else if (i == 3) { + // Process Princess's Secret Slide + stars = save_file_get_star_flags(fileIndex, 18); + format = "%02d"; + } else { + // Process bonus courses + stars = save_file_get_star_flags(fileIndex, i+15); + format = "%d"; + } + + starFlags = int_to_bin(stars); + if (sprintf(value, format, starFlags) < 0) + return -1; + fprintf(file, "%s = %s\n", sav_bonus_courses[i], value); + } + + fprintf(file, "\n[cap]\n"); + for (i = 0; i < NUM_CAP_ON; i++) { + flags = save_file_get_flags(); + bit = (1 << (i+16)); // Determine current flag + flags = (flags & bit); // Get 'cap' flag bit + flags = (flags) ? 1 : 0; + if (flags) { + fprintf(file, "type = %s\n", cap_on_types[i]); + break; + } + } + + savedata = &gSaveBuffer.files[fileIndex][0]; + switch(savedata->capLevel) { + case COURSE_SSL: + fprintf(file, "level = %s\n", "ssl"); + break; + case COURSE_SL: + fprintf(file, "level = %s\n", "sl"); + break; + case COURSE_TTM: + fprintf(file, "level = %s\n", "ttm"); + break; + default: + break; + } + if (savedata->capLevel) { + fprintf(file, "area = %d\n", savedata->capArea); + } + + // Backup is nessecary for saving recent progress after gameover + bcopy(&gSaveBuffer.files[fileIndex][0], &gSaveBuffer.files[fileIndex][1], + sizeof(gSaveBuffer.files[fileIndex][1])); + + fclose(file); + return 1; +} + +/** + * Read gSaveBuffer data from a text-based savefile + */ +static s32 read_text_save(s32 fileIndex) { + char filename[SYS_MAX_PATH] = { 0 }; + const char *value; + ini_t *savedata; + + u32 i, flag, coins, stars, starFlags; + u32 capArea; + + if (snprintf(filename, sizeof(filename), FILENAME_FORMAT, fs_writepath, fileIndex) < 0) + return -1; + + savedata = ini_load(filename); + if (savedata == NULL) { + return -1; + } else { + printf("Loading savefile from '%s'\n", filename); + } + + ini_sget(savedata, "menu", "coin_score_age", "%d", + &gSaveBuffer.menuData[0].coinScoreAges[fileIndex]); + + value = ini_get(savedata, "menu", "sound_mode"); + if (value) { + if (strcmp(value, sound_modes[0]) == 0) { + gSaveBuffer.menuData[0].soundMode = 0; // stereo + } + else if (strcmp(value, sound_modes[1]) == 0) { + gSaveBuffer.menuData[0].soundMode = 3; // mono + } + else if (strcmp(value, sound_modes[2]) == 0) { + gSaveBuffer.menuData[0].soundMode = 1; // headset + } + } + else { + printf("Invalid 'menu:sound_mode' flag!\n"); + return -1; + } + + for (i = 1; i < NUM_FLAGS; i++) { + value = ini_get(savedata, "flags", sav_flags[i]); + if (value) { + flag = value[0] - '0'; // Flag should be 0 or 1 + if (flag) { + flag = 1 << i; // Flags defined in 'save_file' header + gSaveBuffer.files[fileIndex][0].flags |= flag; + } + } + } + + for (i = 0; i < NUM_COURSES; i++) { + value = ini_get(savedata, "courses", sav_courses[i]); + if (value) { + sscanf(value, "%d, %d", &coins, &stars); + starFlags = bin_to_int(stars); // 111111 -> 63 + + save_file_set_star_flags(fileIndex, i, starFlags); + gSaveBuffer.files[fileIndex][0].courseCoinScores[i] = coins; + } + } + + for (i = 0; i < NUM_BONUS_COURSES; i++) { + value = ini_get(savedata, "bonus", sav_bonus_courses[i]); + if (value) { + sscanf(value, "%d", &stars); + starFlags = bin_to_int(stars); + + if (strlen(value) == 5) { + // Process Castle Grounds + save_file_set_star_flags(fileIndex, -1, starFlags); + } else if (strlen(value) == 2) { + // Process Princess's Secret Slide + save_file_set_star_flags(fileIndex, 18, starFlags); + } else { + // Process bonus courses + save_file_set_star_flags(fileIndex, i+15, starFlags); + } + } + } + + for (i = 0; i < NUM_CAP_ON; i++) { + value = ini_get(savedata, "cap", "type"); + if (value) { + if (!strcmp(value, cap_on_types[i])) { + flag = (1 << (16 + i)); + gSaveBuffer.files[fileIndex][0].flags |= flag; + break; + } + } + } + + value = ini_get(savedata, "cap", "level"); + if (value) { + if (strcmp(value, "ssl") == 0) { + gSaveBuffer.files[fileIndex][0].capLevel = COURSE_SSL; // ssl + } + else if (strcmp(value, "sl") == 0) { + gSaveBuffer.files[fileIndex][0].capLevel = COURSE_SL; // sl + } + else if (strcmp(value, "ttm") == 0) { + gSaveBuffer.files[fileIndex][0].capLevel = COURSE_TTM; // ttm + } + else { + printf("Invalid 'cap:level' flag!\n"); + return -1; + } + } + + value = ini_get(savedata, "cap", "area"); + if (value) { + sscanf(value, "%d", &capArea); + if (capArea > 1 && capArea < 2) { + printf("Invalid 'cap:area' flag: %d!\n", capArea); + return -1; + } + else { + gSaveBuffer.files[fileIndex][0].capArea = capArea; + } + } + + // Good, file exists for gSaveBuffer + gSaveBuffer.files[fileIndex][0].flags |= SAVE_FLAG_FILE_EXISTS; + + // Backup is nessecary for saving recent progress after gameover + bcopy(&gSaveBuffer.files[fileIndex][0], &gSaveBuffer.files[fileIndex][1], + sizeof(gSaveBuffer.files[fileIndex][1])); + + ini_free(savedata); + return 0; +} diff --git a/src/game/thread6.c b/src/game/thread6.c index 6f3e524b..6cb7a834 100644 --- a/src/game/thread6.c +++ b/src/game/thread6.c @@ -5,8 +5,6 @@ #include "main.h" #include "thread6.h" -#ifdef VERSION_SH - static s8 D_SH_8030CCB4; static s32 sUnusedDisableRumble; static s32 sRumblePakThreadActive; @@ -15,22 +13,23 @@ static s32 sRumblePakErrorCount; s32 gRumblePakTimer; // These void* are OSPfs* but we don't have that header +// And in general, it is not necessary =) extern s32 osMotorStop(void *); extern s32 osMotorStart(void *); extern u32 osMotorInit(OSMesgQueue *, void *, s32); void init_rumble_pak_scheduler_queue(void) { - osCreateMesgQueue(&gRumblePakSchedulerMesgQueue, gRumblePakSchedulerMesgBuf, 1); - osSendMesg(&gRumblePakSchedulerMesgQueue, (OSMesg) 0, OS_MESG_NOBLOCK); + // osCreateMesgQueue(&gRumblePakSchedulerMesgQueue, gRumblePakSchedulerMesgBuf, 1); + // osSendMesg(&gRumblePakSchedulerMesgQueue, (OSMesg) 0, OS_MESG_NOBLOCK); } void block_until_rumble_pak_free(void) { - OSMesg msg; - osRecvMesg(&gRumblePakSchedulerMesgQueue, &msg, OS_MESG_BLOCK); + // OSMesg msg; + // osRecvMesg(&gRumblePakSchedulerMesgQueue, &msg, OS_MESG_BLOCK); } void release_rumble_pak_control(void) { - osSendMesg(&gRumblePakSchedulerMesgQueue, (OSMesg) 0, OS_MESG_NOBLOCK); + // osSendMesg(&gRumblePakSchedulerMesgQueue, (OSMesg) 0, OS_MESG_NOBLOCK); } static void start_rumble(void) { @@ -225,32 +224,24 @@ void func_sh_8024CA04(void) { gCurrRumbleSettings.unk0C = 4; } -static void thread6_rumble_loop(UNUSED void *a0) { - OSMesg msg; +void thread6_rumble_loop(UNUSED void *a0) { + // OSMesg msg; + // osRecvMesg(&gRumbleThreadVIMesgQueue, &msg, OS_MESG_BLOCK); - cancel_rumble(); + update_rumble_data_queue(); + update_rumble_pak(); - sRumblePakThreadActive = TRUE; - - while (TRUE) { - // Block until VI - osRecvMesg(&gRumbleThreadVIMesgQueue, &msg, OS_MESG_BLOCK); - - update_rumble_data_queue(); - update_rumble_pak(); - - if (sRumblePakActive) { - if (sRumblePakErrorCount >= 30) { - sRumblePakActive = FALSE; - } - } else if (gGlobalTimer % 60 == 0) { - sRumblePakActive = osMotorInit(&gSIEventMesgQueue, &gRumblePakPfs, gPlayer1Controller->port) < 1; - sRumblePakErrorCount = 0; + if (sRumblePakActive) { + if (sRumblePakErrorCount >= 30) { + sRumblePakActive = FALSE; } + } else if (gGlobalTimer % 60 == 0) { + sRumblePakActive = osMotorInit(&gSIEventMesgQueue, &gRumblePakPfs, gPlayer1Controller->port) < 1; + sRumblePakErrorCount = 0; + } - if (gRumblePakTimer > 0) { - gRumblePakTimer--; - } + if (gRumblePakTimer > 0) { + gRumblePakTimer--; } } @@ -272,9 +263,9 @@ void cancel_rumble(void) { } void create_thread_6(void) { - osCreateMesgQueue(&gRumbleThreadVIMesgQueue, gRumbleThreadVIMesgBuf, 1); - osCreateThread(&gRumblePakThread, 6, thread6_rumble_loop, NULL, gThread6Stack + 0x2000, 30); - osStartThread(&gRumblePakThread); + // osCreateMesgQueue(&gRumbleThreadVIMesgQueue, gRumbleThreadVIMesgBuf, 1); + // osCreateThread(&gRumblePakThread, 6, thread6_rumble_loop, NULL, gThread6Stack + 0x2000, 30); + // osStartThread(&gRumblePakThread); } void rumble_thread_update_vi(void) { @@ -282,8 +273,5 @@ void rumble_thread_update_vi(void) { return; } - // 0x56525443 = 'VRTC' - osSendMesg(&gRumbleThreadVIMesgQueue, (OSMesg) 0x56525443, OS_MESG_NOBLOCK); + // osSendMesg(&gRumbleThreadVIMesgQueue, (OSMesg) 0x56525443, OS_MESG_NOBLOCK); } - -#endif diff --git a/src/game/thread6.h b/src/game/thread6.h index be967a12..a19f6746 100644 --- a/src/game/thread6.h +++ b/src/game/thread6.h @@ -1,8 +1,6 @@ #ifndef THREAD6_H #define THREAD6_H -#ifdef VERSION_SH - extern s32 gRumblePakTimer; void init_rumble_pak_scheduler_queue(void); @@ -17,7 +15,6 @@ void func_sh_8024CA04(void); void cancel_rumble(void); void create_thread_6(void); void rumble_thread_update_vi(void); - -#endif // VERSION_SH +void thread6_rumble_loop(void *a0); #endif // THREAD6_H diff --git a/src/goddard/debug_utils.c b/src/goddard/debug_utils.c index 936a4878..10984bbb 100644 --- a/src/goddard/debug_utils.c +++ b/src/goddard/debug_utils.c @@ -670,7 +670,7 @@ void ascii_to_uppercase(char *str) { char *gd_strdup(const char *src) { char *dst; // sp24 - dst = (char*) gd_malloc_perm((gd_strlen(src) + 1) * sizeof(char)); + dst = gd_malloc_perm((gd_strlen(src) + 1) * sizeof(char)); if (dst == NULL) { fatal_printf("gd_strdup(): out of memory"); @@ -779,7 +779,7 @@ struct GdFile *gd_fopen(const char *filename, const char *mode) { return NULL; } - f = (struct GdFile*) gd_malloc_perm(sizeof(struct GdFile)); + f = gd_malloc_perm(sizeof(struct GdFile)); if (f == NULL) { fatal_printf("gd_fopen() Out of memory loading '%s'", filename); return NULL; diff --git a/src/goddard/draw_objects.c b/src/goddard/draw_objects.c index 8cf5e9eb..e6d24d28 100644 --- a/src/goddard/draw_objects.c +++ b/src/goddard/draw_objects.c @@ -14,6 +14,8 @@ #include "shape_helper.h" #include "draw_objects.h" +#include "gfx_dimensions.h" + /** * @file draw_objects.c * This file contains the functions and helpers for rendering the various @@ -693,14 +695,19 @@ void func_80179B64(struct ObjGroup *group) { (applyproc_t) Unknown80179ACC, group); } -/* 22836C -> 228498 */ -void func_80179B9C(struct GdVec3f *pos, struct ObjCamera *cam, struct ObjView *view) { +// plc again +void func_80179B9C(struct GdVec3f *pos, struct ObjCamera *cam, struct ObjView *view) +{ + f32 aspect = GFX_DIMENSIONS_ASPECT_RATIO; + aspect *= 0.75; + //func_80196430(pos, &cam->unkE8); gd_rotate_and_translate_vec3f(pos, &cam->unkE8); + if (pos->z > -256.0f) { return; } - - pos->x *= 256.0 / -pos->z; + + pos->x *= 256.0 / -pos->z / aspect; pos->y *= 256.0 / pos->z; pos->x += view->lowerRight.x / 2.0f; pos->y += view->lowerRight.y / 2.0f; @@ -800,8 +807,7 @@ void drawscene(enum SceneType process, struct ObjGroup *interactables, struct Ob sSceneProcessType = process; if ((sNumActiveLights = sUpdateViewState.view->flags & VIEW_LIGHT)) { - sUpdateViewState.view->flags = (enum GdViewFlags)( - sUpdateViewState.view->flags & ~VIEW_LIGHT); + sUpdateViewState.view->flags &= ~VIEW_LIGHT; } sNumActiveLights = 1; @@ -1400,7 +1406,7 @@ void update_view(struct ObjView *view) { sUpdateViewState.unused18 = 0; if (!(view->flags & VIEW_UPDATE)) { - view->flags = (enum GdViewFlags) (view->flags & ~VIEW_WAS_UPDATED); + view->flags &= ~VIEW_WAS_UPDATED; return; } @@ -1410,7 +1416,7 @@ void update_view(struct ObjView *view) { } if (!(view->flags & VIEW_WAS_UPDATED)) { - view->flags = (enum GdViewFlags)(view->flags | VIEW_WAS_UPDATED); + view->flags |= VIEW_WAS_UPDATED; } gViewUpdateCamera = NULL; diff --git a/src/goddard/dynlist_proc.c b/src/goddard/dynlist_proc.c index 2c74c952..7621f0e0 100644 --- a/src/goddard/dynlist_proc.c +++ b/src/goddard/dynlist_proc.c @@ -172,7 +172,7 @@ struct GdObj *proc_dynlist(struct DynList *dylist) { d_copystr_to_idbuf(Dyn1AsStr(dylist)); break; case 15: - d_makeobj((enum DObjTypes) Dyn2AsInt(dylist), Dyn1AsID(dylist)); + d_makeobj(Dyn2AsInt(dylist), Dyn1AsID(dylist)); break; case 46: d_add_net_with_subgroup(Dyn2AsInt(dylist), Dyn1AsID(dylist)); @@ -206,7 +206,7 @@ struct GdObj *proc_dynlist(struct DynList *dylist) { d_link_with_ptr(Dyn1AsPtr(dylist)); break; case 12: - proc_dynlist((struct DynList*) Dyn1AsPtr(dylist)); + proc_dynlist(Dyn1AsPtr(dylist)); break; case 0: dynid_is_int(Dyn2AsInt(dylist)); @@ -239,10 +239,10 @@ struct GdObj *proc_dynlist(struct DynList *dylist) { d_set_shape_offset(DynVecX(dylist), DynVecY(dylist), DynVecZ(dylist)); break; case 44: - d_set_parm_f((enum DParmF) Dyn2AsInt(dylist), DynVecX(dylist)); + d_set_parm_f(Dyn2AsInt(dylist), DynVecX(dylist)); break; case 45: - d_set_parm_ptr((enum DParmPtr) Dyn2AsInt(dylist), Dyn1AsPtr(dylist)); + d_set_parm_ptr(Dyn2AsInt(dylist), Dyn1AsPtr(dylist)); break; case 8: d_set_flags(Dyn2AsInt(dylist)); @@ -251,7 +251,7 @@ struct GdObj *proc_dynlist(struct DynList *dylist) { d_clear_flags(Dyn2AsInt(dylist)); break; case 7: - d_set_obj_draw_flag((enum ObjDrawingFlags) Dyn2AsInt(dylist)); + d_set_obj_draw_flag(Dyn2AsInt(dylist)); break; case 39: d_attach(Dyn1AsID(dylist)); @@ -275,7 +275,7 @@ struct GdObj *proc_dynlist(struct DynList *dylist) { d_set_planegroup(Dyn1AsID(dylist)); break; case 24: - d_set_shapeptrptr((struct ObjShape**) Dyn1AsPtr(dylist)); + d_set_shapeptrptr(Dyn1AsPtr(dylist)); break; case 25: d_set_shapeptr(Dyn1AsID(dylist)); @@ -326,7 +326,7 @@ struct GdObj *proc_dynlist(struct DynList *dylist) { d_make_netfromshapeid(Dyn1AsID(dylist)); break; case 55: - d_make_netfromshape_ptrptr((struct ObjShape**) Dyn1AsPtr(dylist)); + d_make_netfromshape_ptrptr(Dyn1AsPtr(dylist)); break; default: fatal_printf("proc_dynlist(): unkown command"); @@ -537,7 +537,7 @@ void add_to_dynobj_list(struct GdObj *newobj, DynId id) { start_memtracker("dynlist"); if (sGdDynObjList == NULL) { - sGdDynObjList = (struct DynObjInfo*) gd_malloc_temp(DYNOBJ_LIST_SIZE * sizeof(struct DynObjInfo)); + sGdDynObjList = gd_malloc_temp(DYNOBJ_LIST_SIZE * sizeof(struct DynObjInfo)); if (sGdDynObjList == NULL) { fatal_printf("dMakeObj(): Cant allocate dynlist memory"); } @@ -878,7 +878,7 @@ void alloc_animdata(struct ObjAnimator *animator) { animCnt++; } - animDst = (struct AnimDataInfo*) gd_malloc_perm(animCnt * sizeof(struct AnimDataInfo)); // gd_alloc_perm + animDst = gd_malloc_perm(animCnt * sizeof(struct AnimDataInfo)); // gd_alloc_perm if ((animDataArr = animDst) == NULL) { fatal_printf("cant allocate animation data"); } @@ -944,7 +944,7 @@ void alloc_animdata(struct ObjAnimator *animator) { } curAnimSrc->type = GD_ANIM_MTX_VEC; } else { - copy_bytes((u8*) curAnimSrc->data, (u8*) allocSpace, curAnimSrc->count * datasize); + copy_bytes(curAnimSrc->data, allocSpace, curAnimSrc->count * datasize); } } @@ -955,7 +955,7 @@ void alloc_animdata(struct ObjAnimator *animator) { curAnimSrc++; // next anim data struct } - animgrp->link1C->obj = (struct GdObj*) animDataArr; + animgrp->link1C->obj = (void *) animDataArr; stop_memtracker("animdata"); } @@ -1007,7 +1007,7 @@ void chk_shapegen(struct ObjShape *shape) { fatal_printf("shapegen() too many vertices"); } - vtxbuf = (struct ObjVertex**) gd_malloc_temp(VTX_BUF_SIZE * sizeof(struct ObjVertex *)); + vtxbuf = gd_malloc_temp(VTX_BUF_SIZE * sizeof(struct ObjVertex *)); oldObjHead = gGdObjectList; for (i = 0; i < vtxdata->count; i++) { @@ -2331,9 +2331,9 @@ void d_add_valptr(DynId objId, u32 vflags, s32 type, size_t offset) { fatal_printf("dAddValPtr(\"%s\"): Undefined object", DynIdAsStr(objId)); } - valptr = make_valptrs(info->obj, vflags, (enum ValPtrType) type, offset); + valptr = make_valptrs(info->obj, vflags, type, offset); } else { - valptr = make_valptrs((struct GdObj*) objId, vflags, (enum ValPtrType) type, offset); + valptr = make_valptrs(objId, vflags, type, offset); } switch (sDynListCurObj->type) { @@ -2392,17 +2392,17 @@ void d_link_with_ptr(void *ptr) { add_to_stacktrace("dLinkWithPtr"); switch (sDynListCurObj->type) { case OBJ_TYPE_CAMERAS: - ((struct ObjCamera *) dynobj)->unk30 = (struct GdObj*) ptr; + ((struct ObjCamera *) dynobj)->unk30 = ptr; break; case OBJ_TYPE_GROUPS: - link = make_link_to_obj(NULL, (struct GdObj*) ptr); + link = make_link_to_obj(NULL, ptr); ((struct ObjGroup *) dynobj)->link1C = link; break; case OBJ_TYPE_BONES: - add_joint2bone((struct ObjBone *) dynobj, (struct ObjJoint*) ptr); + add_joint2bone((struct ObjBone *) dynobj, ptr); break; case OBJ_TYPE_VIEWS: - ((struct ObjView *) dynobj)->components = (struct ObjGroup*) ptr; + ((struct ObjView *) dynobj)->components = ptr; ((struct ObjView *) dynobj)->unk1C = setup_view_buffers(((struct ObjView *) dynobj)->namePtr, ((struct ObjView *) dynobj), (s32)((struct ObjView *) dynobj)->upperLeft.x, @@ -2416,7 +2416,7 @@ void d_link_with_ptr(void *ptr) { fatal_printf("too many points"); } - ((struct ObjFace *) dynobj)->vertices[((struct ObjFace *) dynobj)->vtxCount] = (struct ObjVertex*) ptr; + ((struct ObjFace *) dynobj)->vertices[((struct ObjFace *) dynobj)->vtxCount] = ptr; ((struct ObjFace *) dynobj)->vtxCount++; if (((struct ObjFace *) dynobj)->vtxCount >= 3) { @@ -2429,10 +2429,10 @@ void d_link_with_ptr(void *ptr) { ((struct ObjAnimator *) dynobj)->unk14 = make_group(0); } - addto_group(((struct ObjAnimator *) dynobj)->unk14, (struct GdObj*) ptr); + addto_group(((struct ObjAnimator *) dynobj)->unk14, ptr); break; case OBJ_TYPE_LABELS: - valptr = make_valptrs((struct GdObj*) ptr, OBJ_TYPE_ALL, (enum ValPtrType) 0, 0); + valptr = make_valptrs(ptr, OBJ_TYPE_ALL, 0, 0); ((struct ObjLabel *) dynobj)->valptr = valptr; break; default: @@ -2493,7 +2493,7 @@ void d_set_flags(s32 flags) { ((struct ObjCamera *) dynobj)->unk2C |= flags; break; case OBJ_TYPE_VIEWS: - ((struct ObjView *) dynobj)->flags = (enum GdViewFlags) (((struct ObjView *) dynobj)->flags | flags); + ((struct ObjView *) dynobj)->flags |= flags; break; case OBJ_TYPE_SHAPES: ((struct ObjShape *) dynobj)->flag |= flags; @@ -2610,7 +2610,7 @@ void d_set_parm_ptr(enum DParmPtr param, void *ptr) { case OBJ_TYPE_LABELS: switch (param) { case PARM_PTR_CHAR: - ((struct ObjLabel *) sDynListCurObj)->fmtstr = (char*) ptr; + ((struct ObjLabel *) sDynListCurObj)->fmtstr = ptr; break; default: fatal_printf("Bad parm"); @@ -2619,7 +2619,7 @@ void d_set_parm_ptr(enum DParmPtr param, void *ptr) { case OBJ_TYPE_VIEWS: switch (param) { case PARM_PTR_CHAR: - ((struct ObjView *) sDynListCurObj)->namePtr = (const char*) ptr; + ((struct ObjView *) sDynListCurObj)->namePtr = ptr; break; default: fatal_printf("Bad parm"); @@ -2632,7 +2632,7 @@ void d_set_parm_ptr(enum DParmPtr param, void *ptr) { fatal_printf("dsetparmp() too many points"); } ((struct ObjFace *) sDynListCurObj) - ->vertices[((struct ObjFace *) sDynListCurObj)->vtxCount++] = (struct ObjVertex*) ptr; + ->vertices[((struct ObjFace *) sDynListCurObj)->vtxCount++] = ptr; break; default: fatal_printf("Bad parm"); diff --git a/src/goddard/gd_memory.c b/src/goddard/gd_memory.c index d02e8f82..5d0d1509 100644 --- a/src/goddard/gd_memory.c +++ b/src/goddard/gd_memory.c @@ -81,7 +81,7 @@ struct GMemBlock *into_free_memblock(struct GMemBlock *block) { empty_mem_block(block); freeBlock = make_mem_block(G_MEM_BLOCK_FREE, permanence); - freeBlock->ptr = (u8*) ptr; + freeBlock->ptr = ptr; freeBlock->size = space; freeBlock->permFlag = permanence; @@ -152,7 +152,7 @@ struct GMemBlock *make_mem_block(u32 blockType, u8 permFlag) { u32 gd_free_mem(void *ptr) { register struct GMemBlock *curBlock; u32 bytesFreed; - register u8 *targetBlock = (u8*) ptr; + register u8 *targetBlock = ptr; for (curBlock = sUsedBlockListHead; curBlock != NULL; curBlock = curBlock->next) { if (targetBlock == curBlock->ptr) { @@ -232,7 +232,7 @@ struct GMemBlock *gd_add_mem_to_heap(u32 size, void *addr, u8 permanence) { addr = (void *)(((uintptr_t) addr + 8) & ~7); newBlock = make_mem_block(G_MEM_BLOCK_FREE, permanence); - newBlock->ptr = (u8*) addr; + newBlock->ptr = addr; newBlock->size = size; return newBlock; diff --git a/src/goddard/objects.c b/src/goddard/objects.c index 5ac39bf2..46000fd1 100644 --- a/src/goddard/objects.c +++ b/src/goddard/objects.c @@ -82,7 +82,7 @@ void func_8017BCB0(void) { /* Initialize Plane? */ void func_8017BD20(void *a0) { struct GdVec3f sp1c; - set_cur_dynobj((struct GdObj*) a0); + set_cur_dynobj(a0); d_get_world_pos(&sp1c); if (sp1c.x < D_801B9DA0.p0.x) { @@ -297,7 +297,7 @@ struct GdObj *make_object(enum ObjTypeFlag objType) { objNameStr = get_obj_name_str(objType); start_memtracker(objNameStr); - newObj = (struct GdObj*) gd_malloc(objSize, objPermanence); + newObj = gd_malloc(objSize, objPermanence); if (newObj == NULL) { fatal_printf("Cant allocate object '%s' memory!", objNameStr); @@ -364,7 +364,7 @@ struct Links *make_link_to_obj(struct Links *head, struct GdObj *a1) { start_memtracker("links"); - newLink = (struct Links*) gd_malloc_perm(sizeof(struct Links)); + newLink = gd_malloc_perm(sizeof(struct Links)); if (newLink == NULL) { fatal_print("Cant allocate link memory!"); @@ -387,7 +387,7 @@ struct Links *make_link_to_obj(struct Links *head, struct GdObj *a1) { struct VtxLink *make_vtx_link(struct VtxLink *prevlink, Vtx *data) { struct VtxLink *newLink; - newLink = (struct VtxLink*) gd_malloc_perm(sizeof(struct VtxLink)); + newLink = gd_malloc_perm(sizeof(struct VtxLink)); if (newLink == NULL) { fatal_print("Cant allocate link memory!"); @@ -614,7 +614,7 @@ struct ObjView *make_view(const char *name, s32 flags, s32 a2, s32 ulx, s32 uly, addto_group(gGdViewsGroup, &newView->header); - newView->flags = (enum GdViewFlags) (flags | VIEW_UPDATE | VIEW_LIGHT); + newView->flags = flags | VIEW_UPDATE | VIEW_LIGHT; newView->id = sGdViewInfo.count++; if ((newView->components = parts) != NULL) { @@ -1640,7 +1640,7 @@ void move_animator(struct ObjAnimator *animObj) { break; case GD_ANIM_CAMERA: // s16(*)[6]? if (linkedObj->type == OBJ_TYPE_CAMERAS) { - camPlaneHArr = (s16 (*)[6]) animData->data; + camPlaneHArr = animData->data; tri1.p2.x = (f32) camPlaneHArr[sp38][0]; tri1.p2.y = (f32) camPlaneHArr[sp38][1]; diff --git a/src/goddard/old_menu.c b/src/goddard/old_menu.c index be9a2649..f6269438 100644 --- a/src/goddard/old_menu.c +++ b/src/goddard/old_menu.c @@ -31,7 +31,7 @@ void func_8018BCB8(struct ObjGadget *); /* 239EC0 -> 239F78 */ void get_objvalue(union ObjVarVal *dst, enum ValPtrType type, void *base, size_t offset) { - union ObjVarVal *objAddr = (union ObjVarVal*) ((u8 *) base + offset); + union ObjVarVal *objAddr = (void *) ((u8 *) base + offset); switch (type) { case OBJ_VALUE_INT: @@ -49,7 +49,7 @@ void get_objvalue(union ObjVarVal *dst, enum ValPtrType type, void *base, size_t void Unknown8018B7A8(void *a0) { struct GdVec3f sp1C; - set_cur_dynobj((struct GdObj*) a0); + set_cur_dynobj(a0); d_get_init_pos(&sp1C); sp1C.x += sStaticVec.x; @@ -60,7 +60,7 @@ void Unknown8018B7A8(void *a0) { /* 23A00C -> 23A068 */ void Proc8018B83C(void *a0) { - struct ObjGroup *argGroup = (struct ObjGroup*) a0; + struct ObjGroup *argGroup = a0; apply_to_obj_types_in_group(OBJ_TYPE_GADGETS, (applyproc_t) func_8018BCB8, argGroup); apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t) func_801A43DC, gGdViewsGroup); } @@ -127,7 +127,7 @@ struct ObjGadget *make_gadget(UNUSED s32 a0, s32 a1) { /* 23A32C -> 23A3E4 */ void set_objvalue(union ObjVarVal *src, enum ValPtrType type, void *base, size_t offset) { - union ObjVarVal *dst = (union ObjVarVal*) ((u8 *) base + offset); + union ObjVarVal *dst = (void *) ((u8 *) base + offset); switch (type) { case OBJ_VALUE_INT: dst->i = src->i; diff --git a/src/goddard/particles.c b/src/goddard/particles.c index 20ad4660..aa353b9b 100644 --- a/src/goddard/particles.c +++ b/src/goddard/particles.c @@ -65,7 +65,7 @@ void func_80181C00(struct ObjVertex *vtx1, struct ObjVertex *vtx2) { link = gGdSkinNet->unk1C0->link1C; while (link != NULL) { // FIXME: types - struct Connection *sp24 = (struct Connection*) link->obj; + struct Connection *sp24 = (void *) link->obj; if ((sp24->unk1C.vtx == vtx1 || sp24->unk1C.vtx == vtx2) && (sp24->unk20.vtx == vtx1 || sp24->unk20.vtx == vtx2)) { @@ -75,7 +75,7 @@ void func_80181C00(struct ObjVertex *vtx1, struct ObjVertex *vtx2) { } if (link == NULL) { // FIXME: types - sp2C = (struct GdObj*) func_801825FC(vtx1, vtx2); + sp2C = (void *) func_801825FC(vtx1, vtx2); addto_group(gGdSkinNet->unk1C0, sp2C); } } @@ -227,7 +227,7 @@ struct ObjParticle *make_particle(u32 a, s32 b, f32 x, f32 y, f32 z) { /* 230DCC -> 230F48 */ struct Connection *func_801825FC(struct ObjVertex *vtx1, struct ObjVertex *vtx2) { - struct Connection *sp34 = (struct Connection*) gd_malloc_perm(44); + struct Connection *sp34 = gd_malloc_perm(44); struct GdVec3f sp28; struct GdVec3f sp1C; @@ -393,7 +393,7 @@ void move_particle(struct ObjParticle *ptc) { ptc->unk6C = make_group(0); for (sp58 = 0; sp58 < 30; sp58++) { sp60 = make_particle(1, -1, ptc->unk20.x, ptc->unk20.y, ptc->unk20.z); - sp60->unk1C = (struct ObjShape*) ptc->unk1C; + sp60->unk1C = (void *) ptc->unk1C; addto_group(ptc->unk6C, &sp60->header); sp60->unk54 &= ~8; } diff --git a/src/goddard/renderer.c b/src/goddard/renderer.c index adf704b7..3d2a8356 100644 --- a/src/goddard/renderer.c +++ b/src/goddard/renderer.c @@ -21,18 +21,15 @@ #include "shape_helper.h" #include "skin.h" +#include "config.h" +#include "gfx_dimensions.h" + #define MAX_GD_DLS 1000 #define OS_MESG_SI_COMPLETE 0x33333333 -#ifndef NO_SEGMENTED_MEMORY -#define GD_VIRTUAL_TO_PHYSICAL(addr) ((uintptr_t)(addr) &0x0FFFFFFF) -#define GD_LOWER_24(addr) ((uintptr_t)(addr) &0x00FFFFFF) -#define GD_LOWER_29(addr) (((uintptr_t)(addr)) & 0x1FFFFFFF) -#else #define GD_VIRTUAL_TO_PHYSICAL(addr) (addr) #define GD_LOWER_24(addr) ((uintptr_t)(addr)) #define GD_LOWER_29(addr) (((uintptr_t)(addr))) -#endif #define MTX_INTPART_PACK(w1, w2) (((w1) &0xFFFF0000) | (((w2) >> 16) & 0xFFFF)) #define MTX_FRACPART_PACK(w1, w2) ((((w1) << 16) & 0xFFFF0000) | ((w2) &0xFFFF)) @@ -495,6 +492,7 @@ ALIGNED8 static u8 gd_texture_sparkle_4[] = { //! No reference to this texture. Two DL's uses the same previous texture // instead of using this texture. +// Fixed via setting TEXTURE_FIX to 1. ALIGNED8 static u8 gd_texture_sparkle_5[] = { #include "textures/intro_raw/sparkle_5.rgba16.inc.c" }; @@ -571,6 +569,7 @@ static Gfx gd_dl_red_sparkle_4[] = { gsSPBranchList(gd_dl_sparkle), }; +#ifndef TEXTURE_FIX static Gfx gd_dl_red_sparkle_4_dup[] ={ gsDPPipeSync(), gsSPDisplayList(gd_dl_sparkle_red_color), @@ -578,6 +577,15 @@ static Gfx gd_dl_red_sparkle_4_dup[] ={ gsSPBranchList(gd_dl_sparkle), }; +#else +static Gfx gd_dl_red_sparkle_5[] ={ + gsDPPipeSync(), + gsSPDisplayList(gd_dl_sparkle_red_color), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_5), + gsSPBranchList(gd_dl_sparkle), +}; +#endif + static Gfx gd_dl_silver_sparkle_0[] = { gsDPPipeSync(), gsSPDisplayList(gd_dl_sparkle_white_color), @@ -613,6 +621,7 @@ static Gfx gd_dl_silver_sparkle_4[] = { gsSPBranchList(gd_dl_sparkle), }; +#ifndef TEXTURE_FIX static Gfx gd_dl_silver_sparkle_4_dup[] = { gsDPPipeSync(), gsSPDisplayList(gd_dl_sparkle_white_color), @@ -620,6 +629,15 @@ static Gfx gd_dl_silver_sparkle_4_dup[] = { gsSPBranchList(gd_dl_sparkle), }; +#else +static Gfx gd_dl_silver_sparkle_5[] = { + gsDPPipeSync(), + gsSPDisplayList(gd_dl_sparkle_white_color), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_5), + gsSPBranchList(gd_dl_sparkle), +}; +#endif + static Gfx *gd_red_sparkle_dl_array[] = { gd_dl_red_sparkle_4, gd_dl_red_sparkle_4, @@ -631,8 +649,13 @@ static Gfx *gd_red_sparkle_dl_array[] = { gd_dl_red_sparkle_1, gd_dl_red_sparkle_0, gd_dl_red_sparkle_0, +#ifndef TEXTURE_FIX gd_dl_red_sparkle_4_dup, gd_dl_red_sparkle_4_dup, +#else + gd_dl_red_sparkle_5, + gd_dl_red_sparkle_5, +#endif }; static Gfx *gd_silver_sparkle_dl_array[] = { @@ -646,8 +669,13 @@ static Gfx *gd_silver_sparkle_dl_array[] = { gd_dl_silver_sparkle_1, gd_dl_silver_sparkle_0, gd_dl_silver_sparkle_0, +#ifndef TEXTURE_FIX gd_dl_silver_sparkle_4_dup, gd_dl_silver_sparkle_4_dup, +#else + gd_dl_silver_sparkle_5, + gd_dl_silver_sparkle_5, +#endif }; static Gfx gd_texture3_dummy_aligner1[] = { @@ -1137,7 +1165,7 @@ void gdm_init(void *blockpool, u32 size) { size = (size - 8) & ~7; // Align to next double word boundry? blockpool = (void *) (((uintptr_t) blockpool + 8) & ~7); - sMemBlockPoolBase = (u8*) blockpool; + sMemBlockPoolBase = blockpool; sMemBlockPoolSize = size; sMemBlockPoolUsed = 0; sAllocMemory = 0; @@ -1297,7 +1325,7 @@ void *gdm_gettestdl(s32 id) { //! @bug Code treats `sYoshiSceneView` as group; not called in game though apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t) update_view, (struct ObjGroup *) sYoshiSceneView); - dobj = d_use_obj((DynId) "yoshi_scene"); + dobj = d_use_obj("yoshi_scene"); gddl = sGdDLArray[((struct ObjView *) dobj)->gdDlNum]; sUpdateYoshiScene = TRUE; break; @@ -1305,7 +1333,7 @@ void *gdm_gettestdl(s32 id) { if (sYoshiSceneGrp == NULL) { fatal_printf("gdm_gettestdl(): DL number %d undefined", id); } - dobj = d_use_obj((DynId) "yoshi_sh_l1"); + dobj = d_use_obj("yoshi_sh_l1"); gddl = sGdDLArray[((struct ObjShape *) dobj)->gdDls[gGdFrameBuf]]; sUpdateYoshiScene = TRUE; break; @@ -1328,14 +1356,14 @@ void *gdm_gettestdl(s32 id) { //! @bug Code treats `sCarSceneView` as group; not called in game though apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t) update_view, (struct ObjGroup *) sCarSceneView); - dobj = d_use_obj((DynId) "car_scene"); + dobj = d_use_obj("car_scene"); gddl = sGdDLArray[((struct ObjView *) dobj)->gdDlNum]; sUpdateCarScene = TRUE; break; case 5: sActiveView = sScreenView2; set_gd_mtx_parameters(G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH); - dobj = d_use_obj((DynId) "testnet2"); + dobj = d_use_obj("testnet2"); sCarGdDlNum = gd_startdisplist(8); if (sCarGdDlNum == 0) { @@ -1363,7 +1391,7 @@ void gdm_getpos(s32 id, struct GdVec3f *dst) { switch (id) { case 5: set_gd_mtx_parameters(G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH); - dobj = d_use_obj((DynId)"testnet2"); + dobj = d_use_obj("testnet2"); dst->x = ((struct ObjNet *) dobj)->unk14.x; dst->y = ((struct ObjNet *) dobj)->unk14.y; dst->z = ((struct ObjNet *) dobj)->unk14.z; @@ -1400,7 +1428,7 @@ void fatal_no_dl_mem(void) { struct GdDisplayList *alloc_displaylist(u32 id) { struct GdDisplayList *gdDl; - gdDl = (struct GdDisplayList*) gd_malloc_perm(sizeof(struct GdDisplayList)); + gdDl = gd_malloc_perm(sizeof(struct GdDisplayList)); if (gdDl == NULL) { fatal_no_dl_mem(); } @@ -1460,7 +1488,7 @@ struct GdDisplayList *new_gd_dl(s32 id, s32 gfxs, s32 verts, s32 mtxs, s32 light } dl->curVtxIdx = 0; dl->totalVtx = verts; - if ((dl->vtx = (Vtx*) gd_malloc_perm(verts * sizeof(Vtx))) == NULL) { + if ((dl->vtx = gd_malloc_perm(verts * sizeof(Vtx))) == NULL) { fatal_no_dl_mem(); } @@ -1469,7 +1497,7 @@ struct GdDisplayList *new_gd_dl(s32 id, s32 gfxs, s32 verts, s32 mtxs, s32 light } dl->curMtxIdx = 0; dl->totalMtx = mtxs; - if ((dl->mtx = (Mtx*) gd_malloc_perm(mtxs * sizeof(Mtx))) == NULL) { + if ((dl->mtx = gd_malloc_perm(mtxs * sizeof(Mtx))) == NULL) { fatal_no_dl_mem(); } @@ -1478,7 +1506,7 @@ struct GdDisplayList *new_gd_dl(s32 id, s32 gfxs, s32 verts, s32 mtxs, s32 light } dl->curLightIdx = 0; dl->totalLights = lights; - if ((dl->light = (Lights4*) gd_malloc_perm(lights * sizeof(Lights4))) == NULL) { + if ((dl->light = gd_malloc_perm(lights * sizeof(Lights4))) == NULL) { fatal_no_dl_mem(); } @@ -1487,7 +1515,7 @@ struct GdDisplayList *new_gd_dl(s32 id, s32 gfxs, s32 verts, s32 mtxs, s32 light } dl->curGfxIdx = 0; dl->totalGfx = gfxs; - if ((dl->gfx = (Gfx*) gd_malloc_perm(gfxs * sizeof(Gfx))) == NULL) { + if ((dl->gfx = gd_malloc_perm(gfxs * sizeof(Gfx))) == NULL) { fatal_no_dl_mem(); } @@ -1496,7 +1524,7 @@ struct GdDisplayList *new_gd_dl(s32 id, s32 gfxs, s32 verts, s32 mtxs, s32 light } dl->curVpIdx = 0; dl->totalVp = vps; - if ((dl->vp = (Vp*) gd_malloc_perm(vps * sizeof(Vp))) == NULL) { + if ((dl->vp = gd_malloc_perm(vps * sizeof(Vp))) == NULL) { fatal_no_dl_mem(); } @@ -1688,27 +1716,7 @@ u32 Unknown8019EC88(Gfx *dl, UNUSED s32 arg1) { /* 24D4C4 -> 24D63C; orig name: func_8019ECF4 */ void mat4_to_mtx(Mat4f *src, Mtx *dst) { -#ifndef GBI_FLOATS - s32 i; // 14 - s32 j; // 10 - s32 w1; - s32 w2; - s32 *mtxInt = (s32 *) dst->m[0]; // s32 part - s32 *mtxFrc = (s32 *) dst->m[2]; // frac part - - for (i = 0; i < 4; i++) { - for (j = 0; j < 2; j++) { - w1 = (s32)((*src)[i][j * 2] * 65536.0f); - w2 = (s32)((*src)[i][j * 2 + 1] * 65536.0f); - *mtxInt = MTX_INTPART_PACK(w1, w2); - mtxInt++; - *mtxFrc = MTX_FRACPART_PACK(w1, w2); - mtxFrc++; - } - } -#else guMtxF2L(*src, dst); -#endif } /* 24D63C -> 24D6E4; orig name: func_8019EE6C */ @@ -2278,6 +2286,7 @@ void gddl_is_loading_shine_dl(s32 dlLoad) { } else { gSPTexture(next_gfx(), 0x8000, 0x8000, 0, G_TX_RENDERTILE, G_OFF); gDPSetCombineMode(next_gfx(), G_CC_SHADE, G_CC_SHADE); + ; } } @@ -2321,9 +2330,7 @@ void start_view_dl(struct ObjView *view) { uly = lry - 1.0f; } -#ifdef TARGET_N64 - gDPSetScissor(next_gfx(), G_SC_NON_INTERLACE, ulx, uly, lrx, lry); -#endif + // gDPSetScissor(next_gfx(), G_SC_NON_INTERLACE, ulx, uly, lrx, lry); // N64 only gSPClearGeometryMode(next_gfx(), 0xFFFFFFFF); gSPSetGeometryMode(next_gfx(), G_LIGHTING | G_CULL_BACK | G_SHADING_SMOOTH | G_SHADE); if (view->flags & VIEW_ALLOC_ZBUF) { @@ -2342,7 +2349,9 @@ void parse_p1_controller(void) { OSContPad *p1contPrev; // 30 u8 *gdCtrlBytes; // 2C u8 *prevGdCtrlBytes; // 28 - + f32 aspect = GFX_DIMENSIONS_ASPECT_RATIO; + aspect *= 0.75; + gdctrl = &gGdCtrl; gdCtrlBytes = (u8 *) gdctrl; prevGdCtrlBytes = (u8 *) gdctrl->prevFrame; @@ -2424,13 +2433,11 @@ void parse_p1_controller(void) { } for (i = 0; ((s32) i) < D_801A86F0; i++) { - D_801BD7A0[i]->flags = (enum GdViewFlags)( - D_801BD7A0[i]->flags & ~VIEW_UPDATE); + D_801BD7A0[i]->flags &= ~VIEW_UPDATE; } if (sNewZPresses) { - D_801BD7A0[sNewZPresses - 1]->flags = (enum GdViewFlags)( - D_801BD7A0[sNewZPresses - 1]->flags | VIEW_UPDATE); + D_801BD7A0[sNewZPresses - 1]->flags |= VIEW_UPDATE; } // deadzone checks? if (ABS(gdctrl->stickX) >= 6) { @@ -2441,14 +2448,14 @@ void parse_p1_controller(void) { gdctrl->csrY -= gdctrl->stickY * 0.1; //? 0.1f } // border checks? is this for the cursor finger movement? - if ((f32) gdctrl->csrX < (sScreenView2->parent->upperLeft.x + 16.0f)) { - gdctrl->csrX = (s32)(sScreenView2->parent->upperLeft.x + 16.0f); + if ((f32) gdctrl->csrX < (sScreenView2->parent->upperLeft.x + (16.0f/aspect))) { + gdctrl->csrX = (s32)(sScreenView2->parent->upperLeft.x + (16.0f/aspect)); } if ((f32) gdctrl->csrX - > (sScreenView2->parent->upperLeft.x + sScreenView2->parent->lowerRight.x - 48.0f)) { + > (sScreenView2->parent->upperLeft.x + sScreenView2->parent->lowerRight.x - (48.0/aspect))) { gdctrl->csrX = - (s32)(sScreenView2->parent->upperLeft.x + sScreenView2->parent->lowerRight.x - 48.0f); + (s32)(sScreenView2->parent->upperLeft.x + sScreenView2->parent->lowerRight.x - (48.0/aspect)); } if ((f32) gdctrl->csrY < (sScreenView2->parent->upperLeft.y + 16.0f)) { @@ -2967,12 +2974,12 @@ void update_cursor(void) { } if (gGdCtrl.frameCount - gGdCtrl.frameAbtnPressed < 300) { - sHandView->flags = (enum GdViewFlags) (sHandView->flags | VIEW_UPDATE); + sHandView->flags |= VIEW_UPDATE; // by playing the sfx every frame, it will only play once as it // never leaves the "sfx played last frame" buffer gd_play_sfx(GD_SFX_HAND_APPEAR); } else { - sHandView->flags = (enum GdViewFlags) (sHandView->flags & ~VIEW_UPDATE); + sHandView->flags &= ~VIEW_UPDATE; gd_play_sfx(GD_SFX_HAND_DISAPPEAR); } @@ -2982,9 +2989,9 @@ void update_cursor(void) { reset_dlnum_indices(sHandShape->gdDls[gGdFrameBuf]); if (gGdCtrl.btnApressed) { - gd_put_sprite((u16 *) gd_texture_hand_closed, sHandView->upperLeft.x, sHandView->upperLeft.y, 0x20, 0x20); + gd_put_sprite((u16 *) gd_texture_hand_closed, sHandView->upperLeft.x, sHandView->upperLeft.y, 32, 32); } else { - gd_put_sprite((u16 *) gd_texture_hand_open, sHandView->upperLeft.x, sHandView->upperLeft.y, 0x20, 0x20); + gd_put_sprite((u16 *) gd_texture_hand_open, sHandView->upperLeft.x, sHandView->upperLeft.y, 32, 32); } gd_enddlsplist_parent(); @@ -3014,9 +3021,9 @@ void Unknown801A4F58(void) { register s16 b; // t2 register s32 i; // t3 - cbufOff = (s16*) sScreenView2->colourBufs[gGdFrameBuf ^ 1]; - cbufOn = (s16*) sScreenView2->colourBufs[gGdFrameBuf]; - zbuf = (u16*) sScreenView2->zbuf; + cbufOff = sScreenView2->colourBufs[gGdFrameBuf ^ 1]; + cbufOn = sScreenView2->colourBufs[gGdFrameBuf]; + zbuf = sScreenView2->zbuf; for (i = 0; i < (320 * 240); i++) { // L801A4FCC colour = cbufOff[i]; @@ -3120,7 +3127,7 @@ void gd_init(void) { add_to_stacktrace("gd_init"); i = (u32)(sMemBlockPoolSize - DOUBLE_SIZE_ON_64_BIT(0x3E800)); - data = (s8*) gd_allocblock(i); + data = gd_allocblock(i); gd_add_mem_to_heap(i, data, 0x10); D_801BB184 = (u16) 0xff; D_801A867C = 0; @@ -3178,7 +3185,7 @@ void gd_init(void) { sScreenView2->colour.g = 0.0f; sScreenView2->colour.b = 0.0f; sScreenView2->parent = sScreenView2; - sScreenView2->flags = (enum GdViewFlags) (sScreenView2->flags & ~VIEW_UPDATE); + sScreenView2->flags &= ~VIEW_UPDATE; sActiveView = sScreenView2; data = (s8 *) &gGdCtrl; @@ -3299,15 +3306,15 @@ void Unknown801A5C80(struct ObjGroup *parentGroup) { struct ObjLabel *label; // 3c struct ObjGroup *debugGroup; // 38 - d_start_group((DynId) "debugg"); + d_start_group("debugg"); label = (struct ObjLabel *) d_makeobj(D_LABEL, 0); d_set_rel_pos(10.0f, 230.0f, 0.0f); d_set_parm_ptr(PARM_PTR_CHAR, gd_strdup("FT %2.2f")); d_add_valptr(AsDynId(0), 0, OBJ_VALUE_FLOAT, (uintptr_t) &sTracked1FrameTime); label->unk30 = 3; - d_end_group((DynId) "debugg"); + d_end_group("debugg"); - debugGroup = (struct ObjGroup *) d_use_obj((DynId) "debugg"); + debugGroup = (struct ObjGroup *) d_use_obj("debugg"); make_view("debugview", (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_1_CYCLE | VIEW_DRAW), 2, 0, 0, 320, 240, debugGroup); @@ -3375,7 +3382,7 @@ void Unknown801A5D90(struct ObjGroup *arg0) { memview->colour.g = 0.0f; memview->colour.b = 0.0f; addto_group(arg0, &labelgrp->header); - memview->flags = (enum GdViewFlags) (memview->flags & ~VIEW_UPDATE); + memview->flags &= ~VIEW_UPDATE; func_801A5BE8(memview); } } @@ -3388,8 +3395,8 @@ void Unknown801A5FF8(struct ObjGroup *arg0) { struct ObjGroup *menugrp; // 34 UNUSED u32 pad2C[2]; - d_start_group((DynId) "menug"); - sMenuGadgets[0] = d_makeobj(D_GADGET, (DynId) "menu0"); + d_start_group("menug"); + sMenuGadgets[0] = d_makeobj(D_GADGET, "menu0"); d_set_obj_draw_flag(OBJ_IS_GRABBALE); d_set_world_pos(5.0f, 0.0f, 0.0f); d_set_scale(100.0f, 20.0f, 0.0f); @@ -3397,10 +3404,10 @@ void Unknown801A5FF8(struct ObjGroup *arg0) { d_set_colour_num(2); label = (struct ObjLabel *) d_makeobj(D_LABEL, AsDynId(0)); d_set_rel_pos(5.0f, 18.0f, 0.0f); - d_set_parm_ptr(PARM_PTR_CHAR, (void*) "ITEM 1"); - d_add_valptr((DynId) "menu0", 0x40000, 0, (uintptr_t) NULL); + d_set_parm_ptr(PARM_PTR_CHAR, "ITEM 1"); + d_add_valptr("menu0", 0x40000, 0, (uintptr_t) NULL); - sMenuGadgets[1] = d_makeobj(D_GADGET, (DynId) "menu1"); + sMenuGadgets[1] = d_makeobj(D_GADGET, "menu1"); d_set_obj_draw_flag(OBJ_IS_GRABBALE); d_set_world_pos(5.0f, 25.0f, 0.0f); d_set_scale(100.0f, 20.0f, 0.0f); @@ -3408,10 +3415,10 @@ void Unknown801A5FF8(struct ObjGroup *arg0) { d_set_colour_num(4); label = (struct ObjLabel *) d_makeobj(D_LABEL, AsDynId(0)); d_set_rel_pos(5.0f, 18.0f, 0.0f); - d_set_parm_ptr(PARM_PTR_CHAR, (void *) "ITEM 2"); - d_add_valptr((DynId) "menu1", 0x40000, 0, (uintptr_t) NULL); + d_set_parm_ptr(PARM_PTR_CHAR, "ITEM 2"); + d_add_valptr("menu1", 0x40000, 0, (uintptr_t) NULL); - sMenuGadgets[2] = d_makeobj(D_GADGET, (DynId) "menu2"); + sMenuGadgets[2] = d_makeobj(D_GADGET, "menu2"); d_set_obj_draw_flag(OBJ_IS_GRABBALE); d_set_world_pos(5.0f, 50.0f, 0.0f); d_set_scale(100.0f, 20.0f, 0.0f); @@ -3419,12 +3426,12 @@ void Unknown801A5FF8(struct ObjGroup *arg0) { d_set_colour_num(3); label = (struct ObjLabel *) d_makeobj(D_LABEL, AsDynId(0)); d_set_rel_pos(5.0f, 18.0f, 0.0f); - d_set_parm_ptr(PARM_PTR_CHAR, (void *) "ITEM 3"); - d_add_valptr((DynId) "menu2", 0x40000, 0, (uintptr_t) NULL); + d_set_parm_ptr(PARM_PTR_CHAR, "ITEM 3"); + d_add_valptr("menu2", 0x40000, 0, (uintptr_t) NULL); sItemsInMenu = 3; - d_end_group((DynId) "menug"); + d_end_group("menug"); - menugrp = (struct ObjGroup *) d_use_obj((DynId) "menug"); + menugrp = (struct ObjGroup *) d_use_obj("menug"); menuview = make_view( "menuview", (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_BORDERED | VIEW_UNK_2000 | VIEW_UNK_4000), 2, 100, 20, 110, 150, menugrp); @@ -3436,10 +3443,14 @@ void Unknown801A5FF8(struct ObjGroup *arg0) { } /* 254AC0 -> 254DFC; orig name: PutSprite */ +// thanks to gamemasterplc again for fixing this void gd_put_sprite(u16 *sprite, s32 x, s32 y, s32 wx, s32 wy) { s32 c; // 5c s32 r; // 58 - + // Must be game screen aspect ratio, not GFX window aspect ratio + f32 aspect = ((float) SCREEN_WIDTH) / ((float) SCREEN_HEIGHT ) * 0.75; + x *= aspect; + gSPDisplayList(next_gfx(), osVirtualToPhysical(gd_dl_sprite_start_tex_block)); for (r = 0; r < wy; r += 32) { for (c = 0; c < wx; c += 32) { @@ -3470,18 +3481,18 @@ void gd_setup_cursor(struct ObjGroup *parentgrp) { gd_put_sprite((u16 *) gd_texture_hand_open, 100, 100, 32, 32); gd_enddlsplist_parent(); - d_start_group((DynId) "mouseg"); + d_start_group("mouseg"); net = (struct ObjNet *) d_makeobj(D_NET, AsDynId(0)); d_set_init_pos(0.0f, 0.0f, 0.0f); d_set_type(3); d_set_shapeptrptr(&sHandShape); - d_end_group((DynId) "mouseg"); + d_end_group("mouseg"); - mousegrp = (struct ObjGroup *) d_use_obj((DynId) "mouseg"); + mousegrp = (struct ObjGroup *) d_use_obj("mouseg"); mouseview = make_view("mouseview", (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_1_CYCLE | VIEW_MOVEMENT | VIEW_DRAW), 2, 0, 0, 32, 32, mousegrp); - mouseview->flags = (enum GdViewFlags) (mouseview->flags & ~VIEW_UPDATE); + mouseview->flags &= ~VIEW_UPDATE; sHandView = mouseview; if (parentgrp != NULL) { addto_group(parentgrp, &mousegrp->header); @@ -3516,8 +3527,8 @@ void make_timer_gadgets(void) { s32 i; // 48 char timerNameBuf[0x20]; // 28 - d_start_group((DynId) "timerg"); - d_makeobj(D_GADGET, (DynId) "bar1"); + d_start_group("timerg"); + d_makeobj(D_GADGET, "bar1"); d_set_obj_draw_flag(OBJ_IS_GRABBALE); d_set_world_pos(20.0f, 5.0f, 0.0f); d_set_scale(50.0f, 5.0f, 0.0f); @@ -3525,10 +3536,10 @@ void make_timer_gadgets(void) { d_set_parm_f(PARM_F_RANGE_LEFT, 0); d_set_parm_f(PARM_F_RANGE_RIGHT, sTimeScaleFactor); d_add_valptr(AsDynId(0), 0, 2, (uintptr_t) &sTimeScaleFactor); - bar1 = (struct ObjGadget *) d_use_obj((DynId) "bar1"); + bar1 = (struct ObjGadget *) d_use_obj("bar1"); bar1->unk5C = 1; - d_makeobj(D_GADGET, (DynId) "bar2"); + d_makeobj(D_GADGET, "bar2"); d_set_obj_draw_flag(OBJ_IS_GRABBALE); d_set_world_pos(70.0f, 5.0f, 0.0f); d_set_scale(50.0f, 5.0f, 0.0f); @@ -3536,10 +3547,10 @@ void make_timer_gadgets(void) { d_set_parm_f(PARM_F_RANGE_LEFT, 0); d_set_parm_f(PARM_F_RANGE_RIGHT, sTimeScaleFactor); d_add_valptr(AsDynId(0), 0, 2, (uintptr_t) &sTimeScaleFactor); - bar2 = (struct ObjGadget *) d_use_obj((DynId) "bar2"); + bar2 = (struct ObjGadget *) d_use_obj("bar2"); bar2->unk5C = 9; - d_makeobj(D_GADGET, (DynId) "bar3"); + d_makeobj(D_GADGET, "bar3"); d_set_obj_draw_flag(OBJ_IS_GRABBALE); d_set_world_pos(120.0f, 5.0f, 0.0f); d_set_scale(50.0f, 5.0f, 0.0f); @@ -3547,10 +3558,10 @@ void make_timer_gadgets(void) { d_set_parm_f(PARM_F_RANGE_LEFT, 0); d_set_parm_f(PARM_F_RANGE_RIGHT, sTimeScaleFactor); d_add_valptr(AsDynId(0), 0, 2, (uintptr_t) &sTimeScaleFactor); - bar3 = (struct ObjGadget *) d_use_obj((DynId) "bar3"); + bar3 = (struct ObjGadget *) d_use_obj("bar3"); bar3->unk5C = 1; - d_makeobj(D_GADGET, (DynId) "bar4"); + d_makeobj(D_GADGET, "bar4"); d_set_obj_draw_flag(OBJ_IS_GRABBALE); d_set_world_pos(170.0f, 5.0f, 0.0f); d_set_scale(50.0f, 5.0f, 0.0f); @@ -3558,10 +3569,10 @@ void make_timer_gadgets(void) { d_set_parm_f(PARM_F_RANGE_LEFT, 0); d_set_parm_f(PARM_F_RANGE_RIGHT, sTimeScaleFactor); d_add_valptr(AsDynId(0), 0, 2, (uintptr_t) &sTimeScaleFactor); - bar4 = (struct ObjGadget *) d_use_obj((DynId) "bar4"); + bar4 = (struct ObjGadget *) d_use_obj("bar4"); bar4->unk5C = 9; - d_makeobj(D_GADGET, (DynId) "bar5"); + d_makeobj(D_GADGET, "bar5"); d_set_obj_draw_flag(OBJ_IS_GRABBALE); d_set_world_pos(220.0f, 5.0f, 0.0f); d_set_scale(50.0f, 5.0f, 0.0f); @@ -3569,10 +3580,10 @@ void make_timer_gadgets(void) { d_set_parm_f(PARM_F_RANGE_LEFT, 0); d_set_parm_f(PARM_F_RANGE_RIGHT, sTimeScaleFactor); d_add_valptr(AsDynId(0), 0, 2, (uintptr_t) &sTimeScaleFactor); - bar5 = (struct ObjGadget *) d_use_obj((DynId) "bar5"); + bar5 = (struct ObjGadget *) d_use_obj("bar5"); bar5->unk5C = 1; - d_makeobj(D_GADGET, (DynId) "bar6"); + d_makeobj(D_GADGET, "bar6"); d_set_obj_draw_flag(OBJ_IS_GRABBALE); d_set_world_pos(270.0f, 5.0f, 0.0f); d_set_scale(50.0f, 5.0f, 0.0f); @@ -3580,7 +3591,7 @@ void make_timer_gadgets(void) { d_set_parm_f(PARM_F_RANGE_LEFT, 0); d_set_parm_f(PARM_F_RANGE_RIGHT, sTimeScaleFactor); d_add_valptr(AsDynId(0), 0, 2, (uintptr_t) &sTimeScaleFactor); - bar6 = (struct ObjGadget *) d_use_obj((DynId) "bar6"); + bar6 = (struct ObjGadget *) d_use_obj("bar6"); bar6->unk5C = 9; for (i = 0; i < GD_NUM_TIMERS; i++) { @@ -3603,15 +3614,15 @@ void make_timer_gadgets(void) { timerLabel->unk30 = 3; } - d_end_group((DynId) "timerg"); - timerg = (struct ObjGroup *) d_use_obj((DynId) "timerg"); + d_end_group("timerg"); + timerg = (struct ObjGroup *) d_use_obj("timerg"); timersview = make_view( "timersview", (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_1_CYCLE | VIEW_MOVEMENT | VIEW_DRAW), 2, 0, 10, 320, 270, timerg); timersview->colour.r = 0.0f; timersview->colour.g = 0.0f; timersview->colour.b = 0.0f; - timersview->flags = (enum GdViewFlags) (timersview->flags & ~VIEW_UPDATE); + timersview->flags &= ~VIEW_UPDATE; timersview->proc = view_proc_print_timers; func_801A5BE8(timersview); @@ -3626,89 +3637,9 @@ void Unknown801A6E30(UNUSED u32 a0) { void Unknown801A6E44(UNUSED u32 a0) { } -#ifndef NO_SEGMENTED_MEMORY -/* 255628 -> 255704; orig name: func_801A6E58 */ -void gd_block_dma(u32 devAddr, void *vAddr, s32 size) { - s32 transfer; // 2c - - do { - if ((transfer = size) > 0x1000) { - transfer = 0x1000; - } - - osPiStartDma(&D_801BE980, OS_MESG_PRI_NORMAL, OS_READ, devAddr, vAddr, transfer, &sGdDMAQueue); - osRecvMesg(&sGdDMAQueue, &D_801BE97C, OS_MESG_BLOCK); - devAddr += transfer; - vAddr = (void *) ((uintptr_t) vAddr + transfer); - size -= 0x1000; - } while (size > 0); -} - -/* 255704 -> 255988 */ -struct GdObj *load_dynlist(struct DynList *dynlist) { - u32 segSize; // 4c - u8 *allocSegSpace; // 48 - void *allocPtr; // 44 - uintptr_t dynlistSegStart; // 40 - uintptr_t dynlistSegEnd; // 3c - s32 i; // 38 - s32 sp34; // tlbPage - struct GdObj *loadedList; // 30 - - i = -1; - - while (sDynLists[++i].list != NULL) { - if (sDynLists[i].list == dynlist) { - break; - } - } - - if (sDynLists[i].list == NULL) { - fatal_printf("load_dynlist() ptr not found in any banks"); - } - - switch (sDynLists[i].flag) { - case STD_LIST_BANK: - dynlistSegStart = (uintptr_t) _gd_dynlistsSegmentRomStart; - dynlistSegEnd = (uintptr_t) _gd_dynlistsSegmentRomEnd; - break; - default: - fatal_printf("load_dynlist() unkown bank"); - } - - segSize = dynlistSegEnd - dynlistSegStart; - allocSegSpace = gd_malloc_temp(segSize + 0x10000); - - if ((allocPtr = (void *) allocSegSpace) == NULL) { - fatal_printf("Not enough DRAM for DATA segment \n"); - } - - allocSegSpace = (u8 *) (((uintptr_t) allocSegSpace + 0x10000) & 0xFFFF0000); - gd_block_dma(dynlistSegStart, (void *) allocSegSpace, segSize); - osUnmapTLBAll(); - - sp34 = (segSize / 0x10000) / 2 + 1; //? has to be written this way - if (sp34 >= 31) { - fatal_printf("load_dynlist() too many TLBs"); - } - - for (i = 0; i < sp34; i++) { - osMapTLB(i, OS_PM_64K, (void *) (uintptr_t) (0x04000000 + (i * 2 * 0x10000)), - GD_LOWER_24(((uintptr_t) allocSegSpace) + (i * 2 * 0x10000)), - GD_LOWER_24(((uintptr_t) allocSegSpace) + (i * 2 * 0x10000) + 0x10000), -1); - } - - loadedList = proc_dynlist(dynlist); - gd_free(allocPtr); - osUnmapTLBAll(); - - return loadedList; -} -#else struct GdObj *load_dynlist(struct DynList *dynlist) { return proc_dynlist(dynlist); } -#endif /* 255988 -> 25599C */ void stub_801A71B8(UNUSED u32 a0) { diff --git a/src/goddard/shape_helper.c b/src/goddard/shape_helper.c index 47ca5126..adca3b94 100644 --- a/src/goddard/shape_helper.c +++ b/src/goddard/shape_helper.c @@ -639,8 +639,8 @@ void get_3DG1_shape(struct ObjShape *shape) { shape->mtlGroup = make_group(0); add_to_stacktrace("get_3DG1_shape"); - vtxPtrArr = (struct ObjVertex**) gd_malloc_perm(72000 * sizeof(struct ObjVertex *)); // 288,000 = 72,000 * 4 - facePtrArr = (struct ObjFace**) gd_malloc_perm(76000 * sizeof(struct ObjFace *)); // 304,000 = 76,000 * 4 + vtxPtrArr = gd_malloc_perm(72000 * sizeof(struct ObjVertex *)); // 288,000 = 72,000 * 4 + facePtrArr = gd_malloc_perm(76000 * sizeof(struct ObjFace *)); // 304,000 = 76,000 * 4 tempNormal.x = 0.0f; tempNormal.y = 0.0f; @@ -1147,12 +1147,10 @@ struct ObjShape *make_grid_shape(enum ObjTypeFlag gridType, s32 a1, s32 a2, s32 sp40 = D_801BAC9C; } - add_3_vtx_to_face(D_801BAC9C, (struct ObjVertex *) objBuf[row][col + 1], - (struct ObjVertex *) objBuf[row + 1][col + 1], - (struct ObjVertex *) objBuf[row][col]); - add_3_vtx_to_face(D_801BACA0, (struct ObjVertex *) objBuf[row + 1][col + 1], - (struct ObjVertex *) objBuf[row + 1][col], - (struct ObjVertex *) objBuf[row][col]); + add_3_vtx_to_face(D_801BAC9C, objBuf[row][col + 1], objBuf[row + 1][col + 1], + objBuf[row][col]); + add_3_vtx_to_face(D_801BACA0, objBuf[row + 1][col + 1], objBuf[row + 1][col], + objBuf[row][col]); } } @@ -1354,69 +1352,69 @@ s32 load_mario_head(void (*aniFn)(struct ObjAnimator *)) { sp24 = make_particle(0, 1, 0.0f, 0.0f, 0.0f); sp24->unk60 = 3; sp24->unk64 = 2; - sp24->unkBC = d_use_obj((DynId) "N228l"); // probably a camera + sp24->unkBC = d_use_obj("N228l"); // probably a camera sp24->unk1C = gShapeSilverSpark; addto_group(gGdLightGroup, &sp24->header); sp24 = make_particle(0, 2, 0.0f, 0.0f, 0.0f); sp24->unk60 = 3; sp24->unk64 = 2; - sp24->unkBC = d_use_obj((DynId) "N231l"); // probably a camera + sp24->unkBC = d_use_obj("N231l"); // probably a camera sp24->unk1C = gShapeRedSpark; addto_group(gGdLightGroup, &sp24->header); - sp3C = (struct ObjGroup *) d_use_obj((DynId) "N1000l"); + sp3C = (struct ObjGroup *) d_use_obj("N1000l"); create_gddl_for_shapes(sp3C); sp38 = gGdObjectList; sp30 = make_joint_withshape(D_801A82E8, 0, -500.0f, 0.0f, -150.0f); - sp34 = d_use_obj((DynId) "N167l"); + sp34 = d_use_obj("N167l"); sp30->unk1F8 = make_group(1, sp34); sp30 = make_joint_withshape(D_801A82E8, 0, 500.0f, 0.0f, -150.0f); - sp34 = d_use_obj((DynId) "N176l"); + sp34 = d_use_obj("N176l"); sp30->unk1F8 = make_group(1, sp34); sp30 = make_joint_withshape(D_801A82E8, 0, 0.0f, 700.0f, 300.0f); - sp34 = d_use_obj((DynId) "N131l"); + sp34 = d_use_obj("N131l"); sp30->unk1F8 = make_group(1, sp34); - sp34 = d_use_obj((DynId) "N206l"); + sp34 = d_use_obj("N206l"); addto_group(sp30->unk1F8, sp34); - sp34 = d_use_obj((DynId) "N215l"); + sp34 = d_use_obj("N215l"); addto_group(sp30->unk1F8, sp34); - sp34 = d_use_obj((DynId) "N31l"); + sp34 = d_use_obj("N31l"); addto_group(sp30->unk1F8, sp34); - sp34 = d_use_obj((DynId) "N65l"); + sp34 = d_use_obj("N65l"); addto_group(sp30->unk1F8, sp34); sp30 = make_joint_withshape(D_801A82E8, 0, 0.0f, 0.0f, 600.0f); - sp34 = d_use_obj((DynId) "N185l"); + sp34 = d_use_obj("N185l"); sp30->unk1F8 = make_group(1, sp34); sp30 = make_joint_withshape(D_801A82E8, 0, 0.0f, -300.0f, 300.0f); - sp34 = d_use_obj((DynId) "N194l"); + sp34 = d_use_obj("N194l"); sp30->unk1F8 = make_group(1, sp34); sp30 = make_joint_withshape(D_801A82E8, 0, 250.0f, -150.0f, 300.0f); - sp34 = d_use_obj((DynId) "N158l"); + sp34 = d_use_obj("N158l"); sp30->unk1F8 = make_group(1, sp34); - sp34 = d_use_obj((DynId) "N15l"); + sp34 = d_use_obj("N15l"); addto_group(sp30->unk1F8, sp34); sp30 = make_joint_withshape(D_801A82E8, 0, -250.0f, -150.0f, 300.0f); - sp34 = d_use_obj((DynId) "N149l"); + sp34 = d_use_obj("N149l"); sp30->unk1F8 = make_group(1, sp34); - sp34 = d_use_obj((DynId) "N6l"); + sp34 = d_use_obj("N6l"); addto_group(sp30->unk1F8, sp34); sp30 = make_joint_withshape(D_801A82E8, 0, 100.0f, 200.0f, 400.0f); - sp34 = d_use_obj((DynId) "N112l"); + sp34 = d_use_obj("N112l"); sp30->unk1F8 = make_group(1, sp34); sp30->fn2C = &func_8018EBE8; @@ -1424,7 +1422,7 @@ s32 load_mario_head(void (*aniFn)(struct ObjAnimator *)) { sp30->header.drawFlags &= ~OBJ_IS_GRABBALE; sp30 = make_joint_withshape(D_801A82E8, 0, -100.0f, 200.0f, 400.0f); - sp34 = d_use_obj((DynId) "N96l"); + sp34 = d_use_obj("N96l"); sp30->unk1F8 = make_group(1, sp34); sp30->fn2C = &func_8018EBE8; diff --git a/src/goddard/skin.c b/src/goddard/skin.c index a6f174ff..7b285a10 100644 --- a/src/goddard/skin.c +++ b/src/goddard/skin.c @@ -304,9 +304,6 @@ void convert_gd_verts_to_Vn(struct ObjGroup *grp) { u8 nx, ny, nz; // 24, 25, 26 UNUSED u32 pad20; register struct VtxLink *vtxlink; // a1 -#ifndef GBI_FLOATS - register s16 *vnPos; // a2 -#endif register s16 x; // a3 register s16 y; // t0 register s16 z; // t1 @@ -326,18 +323,10 @@ void convert_gd_verts_to_Vn(struct ObjGroup *grp) { nz = (u8)(vtx->normal.z * 255.0f); for (vtxlink = vtx->gbiVerts; vtxlink != NULL; vtxlink = vtxlink->prev) { -#ifndef GBI_FLOATS - vnPos = vtxlink->data->n.ob; - vn = vtxlink->data; - *vnPos++ = x; - *vnPos++ = y; - *vnPos++ = z; -#else vn = vtxlink->data; vn->n.ob[0] = x; vn->n.ob[1] = y; vn->n.ob[2] = z; -#endif vn->n.n[0] = nx; vn->n.n[1] = ny; vn->n.n[2] = nz; @@ -349,9 +338,6 @@ void convert_gd_verts_to_Vn(struct ObjGroup *grp) { void convert_gd_verts_to_Vtx(struct ObjGroup *grp) { UNUSED u32 pad24[6]; register struct VtxLink *vtxlink; // a1 -#ifndef GBI_FLOATS - register s16 *vtxcoords; // a2 -#endif register s16 x; // a3 register s16 y; // t0 register s16 z; // t1 @@ -367,16 +353,9 @@ void convert_gd_verts_to_Vtx(struct ObjGroup *grp) { z = (s16) vtx->pos.z; for (vtxlink = vtx->gbiVerts; vtxlink != NULL; vtxlink = vtxlink->prev) { -#ifndef GBI_FLOATS - vtxcoords = vtxlink->data->v.ob; - vtxcoords[0] = x; - vtxcoords[1] = y; - vtxcoords[2] = z; -#else vtxlink->data->v.ob[0] = x; vtxlink->data->v.ob[1] = y; vtxlink->data->v.ob[2] = z; -#endif } } } diff --git a/src/menu/file_select.c b/src/menu/file_select.c new file mode 100644 index 00000000..df28306a --- /dev/null +++ b/src/menu/file_select.c @@ -0,0 +1,2850 @@ +#include +#include + +#include "audio/external.h" +#include "behavior_data.h" +#include "dialog_ids.h" +#include "engine/behavior_script.h" +#include "engine/graph_node.h" +#include "engine/math_util.h" +#include "file_select.h" +#include "game/area.h" +#include "game/game_init.h" +#include "game/ingame_menu.h" +#include "game/object_helpers.h" +#include "game/object_list_processor.h" +#include "game/print.h" +#include "game/save_file.h" +#include "game/segment2.h" +#include "game/segment7.h" +#include "game/spawn_object.h" +#include "sm64.h" +#include "text_strings.h" + +#include "eu_translation.h" +#ifdef VERSION_EU +#undef LANGUAGE_FUNCTION +#define LANGUAGE_FUNCTION sLanguageMode +#endif + +/** + * @file file_select.c + * This file implements how the file select and it's menus render and function. + * That includes button IDs rendered as object models, strings, hand cursor, + * special menu messages and phases, button states and button clicked checks. + */ + +#ifdef VERSION_US +// The current sound mode is automatically centered on US due to +// the large length difference between options. +// sSoundTextY unused (EU supports its existence). +static s16 sSoundTextX; +static s16 sSoundTextY; +#endif + +//! @Bug (UB Array Access) For PAL, more buttons were added than the array was extended. +//! This causes no currently known issues on console (as the other variables are not changed +//! while this is used) but can cause issues with other compilers. +#ifdef VERSION_EU + #ifdef AVOID_UB + #define NUM_BUTTONS 36 + #else + #define NUM_BUTTONS 34 + #endif +#else +#define NUM_BUTTONS 32 +#endif + +// Amount of main menu buttons defined in the code called by spawn_object_rel_with_rot. +// See file_select.h for the names in MenuButtonTypes. +static struct Object *sMainMenuButtons[NUM_BUTTONS]; + +#ifdef VERSION_EU +// The current sound mode is automatically centered on US due to +// the large length difference between options. +// sSoundTextY is unused +static s16 sSoundTextX; +static s16 sSoundTextY; +#endif + +// Used to defined yes/no fade colors after a file is selected in the erase menu. +// sYesNoColor[0]: YES | sYesNoColor[1]: NO +static u8 sYesNoColor[2]; + +// Unused variable that is written to define centered X value for some strings. +#ifdef VERSION_EU +static s16 sCenteredX; +#endif + +// The button that is selected when it is clicked. +static s8 sSelectedButtonID = MENU_BUTTON_NONE; + +// Whether we are on the main menu or one of the submenus. +static s8 sCurrentMenuLevel = MENU_LAYER_MAIN; + +// Used for text opacifying. If it is below 250, it is constantly incremented. +static u8 sTextBaseAlpha = 0; + +// 2D position of the cursor on the screen. +// sCursorPos[0]: X | sCursorPos[1]: Y +static f32 sCursorPos[] = {0, 0}; + +// Determines which graphic to use for the cursor. +static s16 sCursorClickingTimer = 0; + +// Equal to sCursorPos if the cursor gets clicked, {-10000, -10000} otherwise. +static s16 sClickPos[] = {-10000, -10000}; + +// Used for determining which file has been selected during copying and erasing. +static s8 sSelectedFileIndex = -1; + +// Whether to fade out text or not. +static s8 sFadeOutText = FALSE; + +// The message currently being displayed at the top of a menu. +static s8 sStatusMessageID = 0; + +// Used for text fading. The alpha value of text is calculated as +// sTextBaseAlpha - sTextFadeAlpha. +static u8 sTextFadeAlpha = 0; + +// File select timer that keeps counting until it reaches 1000. +// Used to prevent buttons from being clickable as soon as a menu loads. +// Gets reset when you click an empty save, existing saves in copy and erase menus +// and when you click yes/no in the erase confirmation prompt. +static s16 sMainMenuTimer = 0; + +// Sound mode menu buttonID, has different values compared to gSoundMode in audio. +// 0: gSoundMode = 0 (Stereo) | 1: gSoundMode = 3 (Mono) | 2: gSoundMode = 1 (Headset) +static s8 sSoundMode = 0; + +// Active language for PAL arrays, values defined similar to sSoundMode +// 0: English | 1: French | 2: German +#ifdef VERSION_EU +static s8 sLanguageMode = LANGUAGE_ENGLISH; +#endif + +// Tracks which button will be pressed in the erase confirmation prompt (yes/no). +static s8 sEraseYesNoHoverState = MENU_ERASE_HOVER_NONE; + +// Used for the copy menu, defines if the game as all 4 save slots with data. +// if TRUE, it doesn't allow copying more files. +static s8 sAllFilesExist = FALSE; + +// Defines the value of the save slot selected in the menu. +// Mario A: 1 | Mario B: 2 | Mario C: 3 | Mario D: 4 +static s8 sSelectedFileNum = 0; + +// Which coin score mode to use when scoring files. 0 for local +// coin high score, 1 for high score across all files. +static s8 sScoreFileCoinScoreMode = 0; + +// In PAL, if no save file exists, open the language menu so the user can find it. +#ifdef VERSION_EU +static s8 sOpenLangSettings = FALSE; +#endif + +#ifndef VERSION_EU +static unsigned char textReturn[] = { TEXT_RETURN }; +#else +static unsigned char textReturn[][8] = {{ TEXT_RETURN }, { TEXT_RETURN_FR }, { TEXT_RETURN_DE }}; +#endif + +#ifndef VERSION_EU +static unsigned char textViewScore[] = { TEXT_CHECK_SCORE }; +#else +static unsigned char textViewScore[][12] = {{ TEXT_CHECK_SCORE }, {TEXT_CHECK_SCORE_FR}, {TEXT_CHECK_SCORE_DE}}; +#endif + +#ifndef VERSION_EU +static unsigned char textCopyFileButton[] = { TEXT_COPY_FILE_BUTTON }; +#else +static unsigned char textCopyFileButton[][15] = {{ TEXT_COPY_FILE }, { TEXT_COPY_FILE_FR }, { TEXT_COPY_FILE_DE }}; +#endif + +#ifndef VERSION_EU +static unsigned char textEraseFileButton[] = { TEXT_ERASE_FILE_BUTTON }; +#else +static unsigned char textEraseFileButton[][16] = { {TEXT_ERASE_FILE}, {TEXT_ERASE_FILE_FR}, {TEXT_ERASE_FILE_DE} }; +#endif + +#ifndef VERSION_EU +static unsigned char textSoundModes[][8] = { { TEXT_STEREO }, { TEXT_MONO }, { TEXT_HEADSET } }; +#endif + +static unsigned char textMarioA[] = { TEXT_FILE_MARIO_A }; +static unsigned char textMarioB[] = { TEXT_FILE_MARIO_B }; +static unsigned char textMarioC[] = { TEXT_FILE_MARIO_C }; +static unsigned char textMarioD[] = { TEXT_FILE_MARIO_D }; + +#ifndef VERSION_EU +static unsigned char textNew[] = { TEXT_NEW }; +static unsigned char starIcon[] = { GLYPH_STAR, GLYPH_SPACE }; +static unsigned char xIcon[] = { GLYPH_MULTIPLY, GLYPH_SPACE }; +#endif + +#ifndef VERSION_EU +static unsigned char textSelectFile[] = { TEXT_SELECT_FILE }; +#else +static unsigned char textSelectFile[][17] = {{ TEXT_SELECT_FILE }, { TEXT_SELECT_FILE_FR }, { TEXT_SELECT_FILE_DE }}; +#endif + +#ifndef VERSION_EU +static unsigned char textScore[] = { TEXT_SCORE }; +#else +static unsigned char textScore[][9] = {{ TEXT_SCORE }, { TEXT_SCORE_FR }, { TEXT_SCORE_DE }}; +#endif + +#ifndef VERSION_EU +static unsigned char textCopy[] = { TEXT_COPY }; +#else +static unsigned char textCopy[][9] = {{ TEXT_COPY }, { TEXT_COPY_FR }, { TEXT_COPY_DE }}; +#endif + +#ifndef VERSION_EU +static unsigned char textErase[] = { TEXT_ERASE }; +#else +static unsigned char textErase[][8] = {{ TEXT_ERASE }, { TEXT_ERASE_FR }, { TEXT_ERASE_DE }}; +#endif + +#ifdef VERSION_EU +static unsigned char textOption[][9] = {{ TEXT_OPTION }, { TEXT_OPTION_FR }, { TEXT_OPTION_DE } }; +#endif + +#ifndef VERSION_EU +static unsigned char textCheckFile[] = { TEXT_CHECK_FILE }; +#else +static unsigned char textCheckFile[][18] = {{ TEXT_CHECK_FILE }, { TEXT_CHECK_FILE_FR }, { TEXT_CHECK_FILE_DE }}; +#endif + +#ifndef VERSION_EU +static unsigned char textNoSavedDataExists[] = { TEXT_NO_SAVED_DATA_EXISTS }; +#else +static unsigned char textNoSavedDataExists[][30] = {{ TEXT_NO_SAVED_DATA_EXISTS }, { TEXT_NO_SAVED_DATA_EXISTS_FR }, { TEXT_NO_SAVED_DATA_EXISTS_DE }}; +#endif + +#ifndef VERSION_EU +static unsigned char textCopyFile[] = { TEXT_COPY_FILE }; +#else +static unsigned char textCopyFile[][16] = {{ TEXT_COPY_FILE_BUTTON }, { TEXT_COPY_FILE_BUTTON_FR }, { TEXT_COPY_FILE_BUTTON_DE }}; +#endif + +#ifndef VERSION_EU +static unsigned char textCopyItToWhere[] = { TEXT_COPY_IT_TO_WHERE }; +#else +static unsigned char textCopyItToWhere[][18] = {{ TEXT_COPY_IT_TO_WHERE }, { TEXT_COPY_IT_TO_WHERE_FR }, { TEXT_COPY_IT_TO_WHERE_DE }}; +#endif + +#ifndef VERSION_EU +static unsigned char textNoSavedDataExistsCopy[] = { TEXT_NO_SAVED_DATA_EXISTS }; +#endif + +#ifndef VERSION_EU +static unsigned char textCopyCompleted[] = { TEXT_COPYING_COMPLETED }; +#else +static unsigned char textCopyCompleted[][18] = {{ TEXT_COPYING_COMPLETED }, { TEXT_COPYING_COMPLETED_FR }, { TEXT_COPYING_COMPLETED_DE }}; +#endif + +#ifndef VERSION_EU +static unsigned char textSavedDataExists[] = { TEXT_SAVED_DATA_EXISTS }; +#else +static unsigned char textSavedDataExists[][20] = {{ TEXT_SAVED_DATA_EXISTS }, { TEXT_SAVED_DATA_EXISTS_FR }, { TEXT_SAVED_DATA_EXISTS_DE }}; +#endif + +#ifndef VERSION_EU +static unsigned char textNoFileToCopyFrom[] = { TEXT_NO_FILE_TO_COPY_FROM }; +#else +static unsigned char textNoFileToCopyFrom[][21] = {{ TEXT_NO_FILE_TO_COPY_FROM }, { TEXT_NO_FILE_TO_COPY_FROM_FR }, { TEXT_NO_FILE_TO_COPY_FROM_DE }}; +#endif + +#ifndef VERSION_EU +static unsigned char textYes[] = { TEXT_YES }; +#else +static unsigned char textYes[][4] = {{ TEXT_YES }, { TEXT_YES_FR }, { TEXT_YES_DE }}; +#endif + +#ifndef VERSION_EU +static unsigned char textNo[] = { TEXT_NO }; +#else +static unsigned char textNo[][5] = {{ TEXT_NO }, { TEXT_NO_FR }, { TEXT_NO_DE }}; +#endif + +#ifdef VERSION_EU +// In EU, Erase File and Sound Select strings are outside it's print string function +static unsigned char textEraseFile[][17] = { + { TEXT_ERASE_FILE_BUTTON }, { TEXT_ERASE_FILE_BUTTON_FR }, { TEXT_ERASE_FILE_BUTTON_DE } +}; +static unsigned char textSure[][8] = {{ TEXT_SURE }, { TEXT_SURE_FR }, { TEXT_SURE_DE }}; +static unsigned char textMarioAJustErased[][20] = { + { TEXT_FILE_MARIO_A_JUST_ERASED }, { TEXT_FILE_MARIO_A_JUST_ERASED_FR }, { TEXT_FILE_MARIO_A_JUST_ERASED_DE } +}; + +static unsigned char textSoundSelect[][13] = { + { TEXT_SOUND_SELECT }, { TEXT_SOUND_SELECT_FR }, { TEXT_SOUND_SELECT_DE } +}; + +static unsigned char textLanguageSelect[][17] = { + { TEXT_LANGUAGE_SELECT }, { TEXT_LANGUAGE_SELECT_FR }, { TEXT_LANGUAGE_SELECT_DE } +}; + +static unsigned char textSoundModes[][10] = { + { TEXT_STEREO }, { TEXT_MONO }, { TEXT_HEADSET }, + { TEXT_STEREO_FR }, { TEXT_MONO_FR }, { TEXT_HEADSET_FR }, + { TEXT_STEREO_DE }, { TEXT_MONO_DE }, { TEXT_HEADSET_DE } +}; + +static unsigned char textLanguage[][9] = {{ TEXT_ENGLISH }, { TEXT_FRENCH }, { TEXT_GERMAN }}; + +static unsigned char textMario[] = { TEXT_MARIO }; +static unsigned char textHiScore[][15] = {{ TEXT_HI_SCORE }, { TEXT_HI_SCORE_FR }, { TEXT_HI_SCORE_DE }}; +static unsigned char textMyScore[][10] = {{ TEXT_MY_SCORE }, { TEXT_MY_SCORE_FR }, { TEXT_MY_SCORE_DE }}; + +static unsigned char textNew[][5] = {{ TEXT_NEW }, { TEXT_NEW_FR }, { TEXT_NEW_DE }}; +static unsigned char starIcon[] = { GLYPH_STAR, GLYPH_SPACE }; +static unsigned char xIcon[] = { GLYPH_MULTIPLY, GLYPH_SPACE }; +#endif + +/** + * Yellow Background Menu Initial Action + * Rotates the background at 180 grades and it's scale. + * Although the scale is properly applied in the loop function. + */ +void beh_yellow_background_menu_init(void) { + gCurrentObject->oFaceAngleYaw = 0x8000; + gCurrentObject->oMenuButtonScale = 9.0f; +} + +/** + * Yellow Background Menu Loop Action + * Properly scales the background in the main menu. + */ +void beh_yellow_background_menu_loop(void) { + cur_obj_scale(9.0f); +} + +/** + * Check if a button was clicked. + * depth = 200.0 for main menu, 22.0 for submenus. + */ +s32 check_clicked_button(s16 x, s16 y, f32 depth) { + f32 a = 52.4213; + f32 newX = ((f32) x * 160.0) / (a * depth); + f32 newY = ((f32) y * 120.0) / (a * 3 / 4 * depth); + s16 maxX = newX + 25.0f; + s16 minX = newX - 25.0f; + s16 maxY = newY + 21.0f; + s16 minY = newY - 21.0f; + + if (sClickPos[0] < maxX && minX < sClickPos[0] && sClickPos[1] < maxY && minY < sClickPos[1]) { + return TRUE; + } + return FALSE; +} + +/** + * Grow from main menu, used by selecting files and menus. + */ +static void bhv_menu_button_growing_from_main_menu(struct Object *button) { + if (button->oMenuButtonTimer < 16) { + button->oFaceAngleYaw += 0x800; + } + if (button->oMenuButtonTimer < 8) { + button->oFaceAnglePitch += 0x800; + } + if (button->oMenuButtonTimer >= 8 && button->oMenuButtonTimer < 16) { + button->oFaceAnglePitch -= 0x800; + } + button->oParentRelativePosX -= button->oMenuButtonOrigPosX / 16.0; + button->oParentRelativePosY -= button->oMenuButtonOrigPosY / 16.0; + if (button->oPosZ < button->oMenuButtonOrigPosZ + 17800.0) { + button->oParentRelativePosZ += 1112.5; + } + button->oMenuButtonTimer++; + if (button->oMenuButtonTimer == 16) { + button->oParentRelativePosX = 0.0f; + button->oParentRelativePosY = 0.0f; + button->oMenuButtonState = MENU_BUTTON_STATE_FULLSCREEN; + button->oMenuButtonTimer = 0; + } +} + +/** + * Shrink back to main menu, used to return back while inside menus. + */ +static void bhv_menu_button_shrinking_to_main_menu(struct Object *button) { + if (button->oMenuButtonTimer < 16) { + button->oFaceAngleYaw -= 0x800; + } + if (button->oMenuButtonTimer < 8) { + button->oFaceAnglePitch -= 0x800; + } + if (button->oMenuButtonTimer >= 8 && button->oMenuButtonTimer < 16) { + button->oFaceAnglePitch += 0x800; + } + button->oParentRelativePosX += button->oMenuButtonOrigPosX / 16.0; + button->oParentRelativePosY += button->oMenuButtonOrigPosY / 16.0; + if (button->oPosZ > button->oMenuButtonOrigPosZ) { + button->oParentRelativePosZ -= 1112.5; + } + button->oMenuButtonTimer++; + if (button->oMenuButtonTimer == 16) { + button->oParentRelativePosX = button->oMenuButtonOrigPosX; + button->oParentRelativePosY = button->oMenuButtonOrigPosY; + button->oMenuButtonState = MENU_BUTTON_STATE_DEFAULT; + button->oMenuButtonTimer = 0; + } +} + +/** + * Grow from submenu, used by selecting a file in the score menu. + */ +static void bhv_menu_button_growing_from_submenu(struct Object *button) { + if (button->oMenuButtonTimer < 16) { + button->oFaceAngleYaw += 0x800; + } + if (button->oMenuButtonTimer < 8) { + button->oFaceAnglePitch += 0x800; + } + if (button->oMenuButtonTimer >= 8 && button->oMenuButtonTimer < 16) { + button->oFaceAnglePitch -= 0x800; + } + button->oParentRelativePosX -= button->oMenuButtonOrigPosX / 16.0; + button->oParentRelativePosY -= button->oMenuButtonOrigPosY / 16.0; + button->oParentRelativePosZ -= 116.25; + button->oMenuButtonTimer++; + if (button->oMenuButtonTimer == 16) { + button->oParentRelativePosX = 0.0f; + button->oParentRelativePosY = 0.0f; + button->oMenuButtonState = MENU_BUTTON_STATE_FULLSCREEN; + button->oMenuButtonTimer = 0; + } +} + +/** + * Shrink back to submenu, used to return back while inside a score save menu. + */ +static void bhv_menu_button_shrinking_to_submenu(struct Object *button) { + if (button->oMenuButtonTimer < 16) { + button->oFaceAngleYaw -= 0x800; + } + if (button->oMenuButtonTimer < 8) { + button->oFaceAnglePitch -= 0x800; + } + if (button->oMenuButtonTimer >= 8 && button->oMenuButtonTimer < 16) { + button->oFaceAnglePitch += 0x800; + } + button->oParentRelativePosX += button->oMenuButtonOrigPosX / 16.0; + button->oParentRelativePosY += button->oMenuButtonOrigPosY / 16.0; + if (button->oPosZ > button->oMenuButtonOrigPosZ) { + button->oParentRelativePosZ += 116.25; + } + button->oMenuButtonTimer++; + if (button->oMenuButtonTimer == 16) { + button->oParentRelativePosX = button->oMenuButtonOrigPosX; + button->oParentRelativePosY = button->oMenuButtonOrigPosY; + button->oMenuButtonState = MENU_BUTTON_STATE_DEFAULT; + button->oMenuButtonTimer = 0; + } +} + +/** + * A small increase and decrease in size. + * Used by failed copy/erase/score operations and sound mode select. + */ +static void bhv_menu_button_zoom_in_out(struct Object *button) { + if (sCurrentMenuLevel == MENU_LAYER_MAIN) { + if (button->oMenuButtonTimer < 4) { + button->oParentRelativePosZ -= 20.0f; + } + if (button->oMenuButtonTimer >= 4) { + button->oParentRelativePosZ += 20.0f; + } + } else { + if (button->oMenuButtonTimer < 4) { + button->oParentRelativePosZ += 20.0f; + } + if (button->oMenuButtonTimer >= 4) { + button->oParentRelativePosZ -= 20.0f; + } + } + button->oMenuButtonTimer++; + if (button->oMenuButtonTimer == 8) { + button->oMenuButtonState = MENU_BUTTON_STATE_DEFAULT; + button->oMenuButtonTimer = 0; + } +} + +/** + * A small temporary increase in size. + * Used while selecting a target copy/erase file or yes/no erase confirmation prompt. + */ +static void bhv_menu_button_zoom_in(struct Object *button) { + button->oMenuButtonScale += 0.0022; + button->oMenuButtonTimer++; + if (button->oMenuButtonTimer == 10) { + button->oMenuButtonState = MENU_BUTTON_STATE_DEFAULT; + button->oMenuButtonTimer = 0; + } +} + +/** + * A small temporary decrease in size. + * Used after selecting a target copy/erase file or + * yes/no erase confirmation prompt to undo the zoom in. + */ +static void bhv_menu_button_zoom_out(struct Object *button) { + button->oMenuButtonScale -= 0.0022; + button->oMenuButtonTimer++; + if (button->oMenuButtonTimer == 10) { + button->oMenuButtonState = MENU_BUTTON_STATE_DEFAULT; + button->oMenuButtonTimer = 0; + } +} + +/** + * Menu Buttons Menu Initial Action + * Aligns menu buttons so they can stay in their original + * positions when you choose a button. + */ +void bhv_menu_button_init(void) { + gCurrentObject->oMenuButtonOrigPosX = gCurrentObject->oParentRelativePosX; + gCurrentObject->oMenuButtonOrigPosY = gCurrentObject->oParentRelativePosY; +} + +/** + * Menu Buttons Menu Loop Action + * Handles the functions of the button states and + * object scale for each button. + */ +void bhv_menu_button_loop(void) { + switch (gCurrentObject->oMenuButtonState) { + case MENU_BUTTON_STATE_DEFAULT: // Button state + gCurrentObject->oMenuButtonOrigPosZ = gCurrentObject->oPosZ; + break; + case MENU_BUTTON_STATE_GROWING: // Switching from button to menu state + if (sCurrentMenuLevel == MENU_LAYER_MAIN) { + bhv_menu_button_growing_from_main_menu(gCurrentObject); + } + if (sCurrentMenuLevel == MENU_LAYER_SUBMENU) { + bhv_menu_button_growing_from_submenu(gCurrentObject); // Only used for score files + } + sTextBaseAlpha = 0; + sCursorClickingTimer = 4; + break; + case MENU_BUTTON_STATE_FULLSCREEN: // Menu state + break; + case MENU_BUTTON_STATE_SHRINKING: // Switching from menu to button state + if (sCurrentMenuLevel == MENU_LAYER_MAIN) { + bhv_menu_button_shrinking_to_main_menu(gCurrentObject); + } + if (sCurrentMenuLevel == MENU_LAYER_SUBMENU) { + bhv_menu_button_shrinking_to_submenu(gCurrentObject); // Only used for score files + } + sTextBaseAlpha = 0; + sCursorClickingTimer = 4; + break; + case MENU_BUTTON_STATE_ZOOM_IN_OUT: + bhv_menu_button_zoom_in_out(gCurrentObject); + sCursorClickingTimer = 4; + break; + case MENU_BUTTON_STATE_ZOOM_IN: + bhv_menu_button_zoom_in(gCurrentObject); + sCursorClickingTimer = 4; + break; + case MENU_BUTTON_STATE_ZOOM_OUT: + bhv_menu_button_zoom_out(gCurrentObject); + sCursorClickingTimer = 4; + break; + } + cur_obj_scale(gCurrentObject->oMenuButtonScale); +} + +/** + * Handles how to exit the score file menu using button states. + */ +void exit_score_file_to_score_menu(struct Object *scoreFileButton, s8 scoreButtonID) { + // Begin exit + if (scoreFileButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN + && sCursorClickingTimer == 2) { + play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs); + scoreFileButton->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING; + } + // End exit + if (scoreFileButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT) { + sSelectedButtonID = scoreButtonID; + if (sCurrentMenuLevel == MENU_LAYER_SUBMENU) { + sCurrentMenuLevel = MENU_LAYER_MAIN; + } + } +} + +/** + * Render buttons for the score menu. + * Also check if the save file exists to render a different Mario button. + */ +void render_score_menu_buttons(struct Object *scoreButton) { + // File A + if (save_file_exists(SAVE_FILE_A) == TRUE) { + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A] = + spawn_object_rel_with_rot(scoreButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, + 711, 311, -100, 0, -0x8000, 0); + } else { + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A] = + spawn_object_rel_with_rot(scoreButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, + 311, -100, 0, -0x8000, 0); + } + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A]->oMenuButtonScale = 0.11111111f; + // File B + if (save_file_exists(SAVE_FILE_B) == TRUE) { + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B] = + spawn_object_rel_with_rot(scoreButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, + -166, 311, -100, 0, -0x8000, 0); + } else { + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B] = + spawn_object_rel_with_rot(scoreButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, + -166, 311, -100, 0, -0x8000, 0); + } + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B]->oMenuButtonScale = 0.11111111f; + // File C + if (save_file_exists(SAVE_FILE_C) == TRUE) { + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_C] = spawn_object_rel_with_rot( + scoreButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, 711, 0, -100, 0, -0x8000, 0); + } else { + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_C] = spawn_object_rel_with_rot( + scoreButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, 0, -100, 0, -0x8000, 0); + } + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_C]->oMenuButtonScale = 0.11111111f; + // File D + if (save_file_exists(SAVE_FILE_D) == TRUE) { + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_D] = + spawn_object_rel_with_rot(scoreButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, + -166, 0, -100, 0, -0x8000, 0); + } else { + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_D] = spawn_object_rel_with_rot( + scoreButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, -166, 0, -100, 0, -0x8000, 0); + } + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_D]->oMenuButtonScale = 0.11111111f; + // Return to main menu button + sMainMenuButtons[MENU_BUTTON_SCORE_RETURN] = spawn_object_rel_with_rot( + scoreButton, MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, bhvMenuButton, 711, -388, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_SCORE_RETURN]->oMenuButtonScale = 0.11111111f; + // Switch to copy menu button + sMainMenuButtons[MENU_BUTTON_SCORE_COPY_FILE] = spawn_object_rel_with_rot( + scoreButton, MODEL_MAIN_MENU_BLUE_COPY_BUTTON, bhvMenuButton, 0, -388, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_SCORE_COPY_FILE]->oMenuButtonScale = 0.11111111f; + // Switch to erase menu button + sMainMenuButtons[MENU_BUTTON_SCORE_ERASE_FILE] = spawn_object_rel_with_rot( + scoreButton, MODEL_MAIN_MENU_RED_ERASE_BUTTON, bhvMenuButton, -711, -388, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_SCORE_ERASE_FILE]->oMenuButtonScale = 0.11111111f; +} + +#ifdef VERSION_EU + #define SCORE_TIMER 46 +#else + #define SCORE_TIMER 31 +#endif +/** + * In the score menu, checks if a button was clicked to play a sound, button state and other functions. + */ +void check_score_menu_clicked_buttons(struct Object *scoreButton) { + if (scoreButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { + s32 buttonID; + // Configure score menu button group + for (buttonID = MENU_BUTTON_SCORE_MIN; buttonID < MENU_BUTTON_SCORE_MAX; buttonID++) { + s16 buttonX = sMainMenuButtons[buttonID]->oPosX; + s16 buttonY = sMainMenuButtons[buttonID]->oPosY; + + if (check_clicked_button(buttonX, buttonY, 22.0f) == TRUE && sMainMenuTimer >= SCORE_TIMER) { + // If menu button clicked, select it + if (buttonID == MENU_BUTTON_SCORE_RETURN || buttonID == MENU_BUTTON_SCORE_COPY_FILE + || buttonID == MENU_BUTTON_SCORE_ERASE_FILE) { + play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); + sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; + sSelectedButtonID = buttonID; + } + else { // Check if a save file is clicked + if (sMainMenuTimer >= SCORE_TIMER) { + // If clicked in a existing save file, select it too see it's score + if (save_file_exists(buttonID - MENU_BUTTON_SCORE_MIN) == TRUE) { + play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); + sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_GROWING; + sSelectedButtonID = buttonID; + } + else { + // If clicked in a non-existing save file, play buzz sound + play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs); + sMainMenuButtons[buttonID]->oMenuButtonState = + MENU_BUTTON_STATE_ZOOM_IN_OUT; + if (sMainMenuTimer >= SCORE_TIMER) { + sFadeOutText = TRUE; + sMainMenuTimer = 0; + } + } + } + } + sCurrentMenuLevel = MENU_LAYER_SUBMENU; + break; + } + } + } +} +#undef SCORE_TIMER + +/** + * Render buttons for the copy menu. + * Also check if the save file exists to render a different Mario button. + */ +void render_copy_menu_buttons(struct Object *copyButton) { + // File A + if (save_file_exists(SAVE_FILE_A) == TRUE) { + sMainMenuButtons[MENU_BUTTON_COPY_FILE_A] = + spawn_object_rel_with_rot(copyButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, 711, + 311, -100, 0, -0x8000, 0); + } else { + sMainMenuButtons[MENU_BUTTON_COPY_FILE_A] = spawn_object_rel_with_rot( + copyButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, 311, -100, 0, -0x8000, 0); + } + sMainMenuButtons[MENU_BUTTON_COPY_FILE_A]->oMenuButtonScale = 0.11111111f; + // File B + if (save_file_exists(SAVE_FILE_B) == TRUE) { + sMainMenuButtons[MENU_BUTTON_COPY_FILE_B] = + spawn_object_rel_with_rot(copyButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, + -166, 311, -100, 0, -0x8000, 0); + } else { + sMainMenuButtons[MENU_BUTTON_COPY_FILE_B] = + spawn_object_rel_with_rot(copyButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, -166, + 311, -100, 0, -0x8000, 0); + } + sMainMenuButtons[MENU_BUTTON_COPY_FILE_B]->oMenuButtonScale = 0.11111111f; + // File C + if (save_file_exists(SAVE_FILE_C) == TRUE) { + sMainMenuButtons[MENU_BUTTON_COPY_FILE_C] = spawn_object_rel_with_rot( + copyButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, 711, 0, -100, 0, -0x8000, 0); + } else { + sMainMenuButtons[MENU_BUTTON_COPY_FILE_C] = spawn_object_rel_with_rot( + copyButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, 0, -100, 0, -0x8000, 0); + } + sMainMenuButtons[MENU_BUTTON_COPY_FILE_C]->oMenuButtonScale = 0.11111111f; + // File D + if (save_file_exists(SAVE_FILE_D) == TRUE) { + sMainMenuButtons[MENU_BUTTON_COPY_FILE_D] = spawn_object_rel_with_rot( + copyButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, -166, 0, -100, 0, -0x8000, 0); + } else { + sMainMenuButtons[MENU_BUTTON_COPY_FILE_D] = spawn_object_rel_with_rot( + copyButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, -166, 0, -100, 0, -0x8000, 0); + } + sMainMenuButtons[MENU_BUTTON_COPY_FILE_D]->oMenuButtonScale = 0.11111111f; + // Return to main menu button + sMainMenuButtons[MENU_BUTTON_COPY_RETURN] = spawn_object_rel_with_rot( + copyButton, MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, bhvMenuButton, 711, -388, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_COPY_RETURN]->oMenuButtonScale = 0.11111111f; + // Switch to scire menu button + sMainMenuButtons[MENU_BUTTON_COPY_CHECK_SCORE] = spawn_object_rel_with_rot( + copyButton, MODEL_MAIN_MENU_GREEN_SCORE_BUTTON, bhvMenuButton, 0, -388, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_COPY_CHECK_SCORE]->oMenuButtonScale = 0.11111111f; + // Switch to erase menu button + sMainMenuButtons[MENU_BUTTON_COPY_ERASE_FILE] = spawn_object_rel_with_rot( + copyButton, MODEL_MAIN_MENU_RED_ERASE_BUTTON, bhvMenuButton, -711, -388, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_COPY_ERASE_FILE]->oMenuButtonScale = 0.11111111f; +} + +#ifdef VERSION_EU + #define BUZZ_TIMER 36 +#else + #define BUZZ_TIMER 21 +#endif + +/** + * Copy Menu phase actions that handles what to do when a file button is clicked. + */ +void copy_action_file_button(struct Object *copyButton, s32 copyFileButtonID) { + switch (copyButton->oMenuButtonActionPhase) { + case COPY_PHASE_MAIN: // Copy Menu Main Phase + if (sAllFilesExist == TRUE) { // Don't enable copy if all save files exists + return; + } + if (save_file_exists(copyFileButtonID - MENU_BUTTON_COPY_MIN) == TRUE) { + // If clicked in a existing save file, ask where it wants to copy + play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); + sMainMenuButtons[copyFileButtonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN; + sSelectedFileIndex = copyFileButtonID - MENU_BUTTON_COPY_MIN; + copyButton->oMenuButtonActionPhase = COPY_PHASE_COPY_WHERE; + sFadeOutText = TRUE; + sMainMenuTimer = 0; + } else { + // If clicked in a non-existing save file, play buzz sound + play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs); + sMainMenuButtons[copyFileButtonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; + if (sMainMenuTimer >= BUZZ_TIMER) { + sFadeOutText = TRUE; + sMainMenuTimer = 0; + } + } + break; + case COPY_PHASE_COPY_WHERE: // Copy Menu "COPY IT TO WHERE?" Phase (after a file is selected) + sMainMenuButtons[copyFileButtonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; + if (save_file_exists(copyFileButtonID - MENU_BUTTON_COPY_MIN) == FALSE) { + // If clicked in a non-existing save file, copy the file + play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs); + copyButton->oMenuButtonActionPhase = COPY_PHASE_COPY_COMPLETE; + sFadeOutText = TRUE; + sMainMenuTimer = 0; + save_file_copy(sSelectedFileIndex, copyFileButtonID - MENU_BUTTON_COPY_MIN); + sMainMenuButtons[copyFileButtonID]->header.gfx.sharedChild = + gLoadedGraphNodes[MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE]; + sMainMenuButtons[copyFileButtonID - MENU_BUTTON_COPY_MIN]->header.gfx.sharedChild = + gLoadedGraphNodes[MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE]; + } else { + // If clicked in a existing save file, play buzz sound + if (MENU_BUTTON_COPY_FILE_A + sSelectedFileIndex == copyFileButtonID) { + play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs); + sMainMenuButtons[MENU_BUTTON_COPY_FILE_A + sSelectedFileIndex]->oMenuButtonState = + MENU_BUTTON_STATE_ZOOM_OUT; + copyButton->oMenuButtonActionPhase = COPY_PHASE_MAIN; + sFadeOutText = TRUE; + return; + } + if (sMainMenuTimer >= BUZZ_TIMER) { + sFadeOutText = TRUE; + sMainMenuTimer = 0; + } + } + break; + } +} + +#ifdef VERSION_EU + #define ACTION_TIMER 41 + #define MAIN_RETURN_TIMER 36 +#else + #define ACTION_TIMER 31 + #define MAIN_RETURN_TIMER 31 +#endif + +/** + * In the copy menu, checks if a button was clicked to play a sound, button state and other functions. + */ +void check_copy_menu_clicked_buttons(struct Object *copyButton) { + if (copyButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { + s32 buttonID; + // Configure copy menu button group + for (buttonID = MENU_BUTTON_COPY_MIN; buttonID < MENU_BUTTON_COPY_MAX; buttonID++) { + s16 buttonX = sMainMenuButtons[buttonID]->oPosX; + s16 buttonY = sMainMenuButtons[buttonID]->oPosY; + + if (check_clicked_button(buttonX, buttonY, 22.0f) == TRUE) { + // If menu button clicked, select it + if (buttonID == MENU_BUTTON_COPY_RETURN || buttonID == MENU_BUTTON_COPY_CHECK_SCORE + || buttonID == MENU_BUTTON_COPY_ERASE_FILE) { + if (copyButton->oMenuButtonActionPhase == COPY_PHASE_MAIN) { + play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); + sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; + sSelectedButtonID = buttonID; + } + } + else { + // Check if a file button is clicked to play a copy action + if (sMainMenuButtons[buttonID]->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT + && sMainMenuTimer >= ACTION_TIMER) { + copy_action_file_button(copyButton, buttonID); + } + } + sCurrentMenuLevel = MENU_LAYER_SUBMENU; + break; + } + } + + // After copy is complete, return to main copy phase + if (copyButton->oMenuButtonActionPhase == COPY_PHASE_COPY_COMPLETE + && sMainMenuTimer >= MAIN_RETURN_TIMER) { + copyButton->oMenuButtonActionPhase = COPY_PHASE_MAIN; + sMainMenuButtons[MENU_BUTTON_COPY_MIN + sSelectedFileIndex]->oMenuButtonState = + MENU_BUTTON_STATE_ZOOM_OUT; + } + } +} + +/** + * Render buttons for the erase menu. + * Also check if the save file exists to render a different Mario button. + */ +void render_erase_menu_buttons(struct Object *eraseButton) { + // File A + if (save_file_exists(SAVE_FILE_A) == TRUE) { + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_A] = + spawn_object_rel_with_rot(eraseButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, + 711, 311, -100, 0, -0x8000, 0); + } else { + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_A] = + spawn_object_rel_with_rot(eraseButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, + 311, -100, 0, -0x8000, 0); + } + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_A]->oMenuButtonScale = 0.11111111f; + // File B + if (save_file_exists(SAVE_FILE_B) == TRUE) { + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_B] = + spawn_object_rel_with_rot(eraseButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, + -166, 311, -100, 0, -0x8000, 0); + } else { + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_B] = + spawn_object_rel_with_rot(eraseButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, + -166, 311, -100, 0, -0x8000, 0); + } + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_B]->oMenuButtonScale = 0.11111111f; + // File C + if (save_file_exists(SAVE_FILE_C) == TRUE) { + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_C] = spawn_object_rel_with_rot( + eraseButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, 711, 0, -100, 0, -0x8000, 0); + } else { + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_C] = spawn_object_rel_with_rot( + eraseButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, 0, -100, 0, -0x8000, 0); + } + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_C]->oMenuButtonScale = 0.11111111f; + // File D + if (save_file_exists(SAVE_FILE_D) == TRUE) { + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_D] = + spawn_object_rel_with_rot(eraseButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, + -166, 0, -100, 0, -0x8000, 0); + } else { + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_D] = spawn_object_rel_with_rot( + eraseButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, -166, 0, -100, 0, -0x8000, 0); + } + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_D]->oMenuButtonScale = 0.11111111f; + // Return to main menu button + sMainMenuButtons[MENU_BUTTON_ERASE_RETURN] = spawn_object_rel_with_rot( + eraseButton, MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, bhvMenuButton, 711, -388, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_ERASE_RETURN]->oMenuButtonScale = 0.11111111f; + // Switch to score menu button + sMainMenuButtons[MENU_BUTTON_ERASE_CHECK_SCORE] = spawn_object_rel_with_rot( + eraseButton, MODEL_MAIN_MENU_GREEN_SCORE_BUTTON, bhvMenuButton, 0, -388, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_ERASE_CHECK_SCORE]->oMenuButtonScale = 0.11111111f; + // Switch to copy menu button + sMainMenuButtons[MENU_BUTTON_ERASE_COPY_FILE] = spawn_object_rel_with_rot( + eraseButton, MODEL_MAIN_MENU_BLUE_COPY_BUTTON, bhvMenuButton, -711, -388, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_ERASE_COPY_FILE]->oMenuButtonScale = 0.11111111f; +} + +/** + * Erase Menu phase actions that handles what to do when a file button is clicked. + */ +void erase_action_file_button(struct Object *eraseButton, s32 eraseFileButtonID) { + switch (eraseButton->oMenuButtonActionPhase) { + case ERASE_PHASE_MAIN: // Erase Menu Main Phase + if (save_file_exists(eraseFileButtonID - MENU_BUTTON_ERASE_MIN) == TRUE) { + // If clicked in a existing save file, ask if it wants to delete it + play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); + sMainMenuButtons[eraseFileButtonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN; + sSelectedFileIndex = eraseFileButtonID - MENU_BUTTON_ERASE_MIN; + eraseButton->oMenuButtonActionPhase = ERASE_PHASE_PROMPT; + sFadeOutText = TRUE; + sMainMenuTimer = 0; + } else { + // If clicked in a non-existing save file, play buzz sound + play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs); + sMainMenuButtons[eraseFileButtonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; + + if (sMainMenuTimer >= BUZZ_TIMER) { + sFadeOutText = TRUE; + sMainMenuTimer = 0; + } + } + break; + case ERASE_PHASE_PROMPT: // Erase Menu "SURE? YES NO" Phase (after a file is selected) + if (MENU_BUTTON_ERASE_MIN + sSelectedFileIndex == eraseFileButtonID) { + // If clicked in a existing save file, play click sound and zoom out button + // Note: The prompt functions are actually called when the ERASE_MSG_PROMPT + // message is displayed with print_erase_menu_prompt + play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); + sMainMenuButtons[MENU_BUTTON_ERASE_MIN + sSelectedFileIndex]->oMenuButtonState = + MENU_BUTTON_STATE_ZOOM_OUT; + eraseButton->oMenuButtonActionPhase = ERASE_PHASE_MAIN; + sFadeOutText = TRUE; + } + break; + } +} +#undef BUZZ_TIMER + +/** + * In the erase menu, checks if a button was clicked to play a sound, button state and other functions. + */ +void check_erase_menu_clicked_buttons(struct Object *eraseButton) { + if (eraseButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { + s32 buttonID; + // Configure erase menu button group + for (buttonID = MENU_BUTTON_ERASE_MIN; buttonID < MENU_BUTTON_ERASE_MAX; buttonID++) { + s16 buttonX = sMainMenuButtons[buttonID]->oPosX; + s16 buttonY = sMainMenuButtons[buttonID]->oPosY; + + if (check_clicked_button(buttonX, buttonY, 22.0f) == TRUE) { + // If menu button clicked, select it + if (buttonID == MENU_BUTTON_ERASE_RETURN || buttonID == MENU_BUTTON_ERASE_CHECK_SCORE + || buttonID == MENU_BUTTON_ERASE_COPY_FILE) { + if (eraseButton->oMenuButtonActionPhase == ERASE_PHASE_MAIN) { + play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); + sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; + sSelectedButtonID = buttonID; + } + } + else { + // Check if a file button is clicked to play an erase action + if (sMainMenuTimer >= ACTION_TIMER) { + erase_action_file_button(eraseButton, buttonID); + } + } + sCurrentMenuLevel = MENU_LAYER_SUBMENU; + break; + } + } + // After erase is complete, return to main erase phase + if (eraseButton->oMenuButtonActionPhase == ERASE_PHASE_MARIO_ERASED + && sMainMenuTimer >= MAIN_RETURN_TIMER) { + eraseButton->oMenuButtonActionPhase = ERASE_PHASE_MAIN; + sMainMenuButtons[MENU_BUTTON_ERASE_MIN + sSelectedFileIndex]->oMenuButtonState = + MENU_BUTTON_STATE_ZOOM_OUT; + } + } +} +#undef ACTION_TIMER +#undef MAIN_RETURN_TIMER + +#ifdef VERSION_EU + #define SOUND_BUTTON_Y 388 +#else + #define SOUND_BUTTON_Y 0 +#endif + +/** + * Render buttons for the sound mode menu. + */ +void render_sound_mode_menu_buttons(struct Object *soundModeButton) { + // Stereo option button + sMainMenuButtons[MENU_BUTTON_STEREO] = spawn_object_rel_with_rot( + soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, 533, SOUND_BUTTON_Y, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_STEREO]->oMenuButtonScale = 0.11111111f; + // Mono option button + sMainMenuButtons[MENU_BUTTON_MONO] = spawn_object_rel_with_rot( + soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, 0, SOUND_BUTTON_Y, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_MONO]->oMenuButtonScale = 0.11111111f; + // Headset option button + sMainMenuButtons[MENU_BUTTON_HEADSET] = spawn_object_rel_with_rot( + soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, -533, SOUND_BUTTON_Y, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_HEADSET]->oMenuButtonScale = 0.11111111f; + +#ifdef VERSION_EU + // English option button + sMainMenuButtons[MENU_BUTTON_LANGUAGE_ENGLISH] = spawn_object_rel_with_rot( + soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, 533, -111, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_LANGUAGE_ENGLISH]->oMenuButtonScale = 0.11111111f; + // French option button + sMainMenuButtons[MENU_BUTTON_LANGUAGE_FRENCH] = spawn_object_rel_with_rot( + soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, 0, -111, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_LANGUAGE_FRENCH]->oMenuButtonScale = 0.11111111f; + // German option button + sMainMenuButtons[MENU_BUTTON_LANGUAGE_GERMAN] = spawn_object_rel_with_rot( + soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, -533, -111, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_LANGUAGE_GERMAN]->oMenuButtonScale = 0.11111111f; + + // Return button + sMainMenuButtons[MENU_BUTTON_LANGUAGE_RETURN] = spawn_object_rel_with_rot( + soundModeButton, MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, bhvMenuButton, 0, -533, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_LANGUAGE_RETURN]->oMenuButtonScale = 0.11111111f; +#else + // Zoom in current selection + sMainMenuButtons[MENU_BUTTON_OPTION_MIN + sSoundMode]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN; +#endif +} +#undef SOUND_BUTTON_Y + +/** + * In the sound mode menu, checks if a button was clicked to change sound mode & button state. + */ +void check_sound_mode_menu_clicked_buttons(struct Object *soundModeButton) { + if (soundModeButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { + s32 buttonID; + // Configure sound mode menu button group + for (buttonID = MENU_BUTTON_OPTION_MIN; buttonID < MENU_BUTTON_OPTION_MAX; buttonID++) { + s16 buttonX = sMainMenuButtons[buttonID]->oPosX; + s16 buttonY = sMainMenuButtons[buttonID]->oPosY; + + if (check_clicked_button(buttonX, buttonY, 22.0f) == TRUE) { + // If sound mode button clicked, select it and define sound mode + // The check will always be true because of the group configured above (In JP & US) + if (buttonID == MENU_BUTTON_STEREO || buttonID == MENU_BUTTON_MONO + || buttonID == MENU_BUTTON_HEADSET) { + if (soundModeButton->oMenuButtonActionPhase == SOUND_MODE_PHASE_MAIN) { + play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); + sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; +#ifndef VERSION_EU + // Sound menu buttons don't return to Main Menu in EU + // because they don't have a case in bhv_menu_button_manager_loop + sSelectedButtonID = buttonID; +#endif + sSoundMode = buttonID - MENU_BUTTON_OPTION_MIN; + save_file_set_sound_mode(sSoundMode); + } + } +#ifdef VERSION_EU + // If language mode button clicked, select it and change language + if (buttonID == MENU_BUTTON_LANGUAGE_ENGLISH || buttonID == MENU_BUTTON_LANGUAGE_FRENCH + || buttonID == MENU_BUTTON_LANGUAGE_GERMAN) { + if (soundModeButton->oMenuButtonActionPhase == SOUND_MODE_PHASE_MAIN) { + play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); + sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; + sLanguageMode = buttonID - MENU_BUTTON_LANGUAGE_MIN; + eu_set_language(sLanguageMode); + } + } + // If neither of the buttons above are pressed, return to main menu + if (buttonID == MENU_BUTTON_LANGUAGE_RETURN) { + play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); + sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; + sSelectedButtonID = buttonID; + } +#endif + sCurrentMenuLevel = MENU_LAYER_SUBMENU; + + break; + } + } + } +} + +/** + * Loads a save file selected after it goes into a full screen state + * retuning sSelectedFileNum to a save value defined in fileNum. + */ +void load_main_menu_save_file(struct Object *fileButton, s32 fileNum) { + if (fileButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { + sSelectedFileNum = fileNum; + } +} + +/** + * Returns from the previous menu back to the main menu using + * the return button (or sound mode) as source button. + */ +void return_to_main_menu(s16 prevMenuButtonID, struct Object *sourceButton) { + s32 buttonID; + // If the source button is in default state and the previous menu in full screen, + // play zoom out sound and shrink previous menu + if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT + && sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { + play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs); + sMainMenuButtons[prevMenuButtonID]->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING; + sCurrentMenuLevel = MENU_LAYER_MAIN; + } + // If the previous button is in default state, return back to the main menu + if (sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT) { + sSelectedButtonID = MENU_BUTTON_NONE; + // Hide buttons of corresponding button menu groups + if (prevMenuButtonID == MENU_BUTTON_SCORE) { + for (buttonID = MENU_BUTTON_SCORE_MIN; buttonID < MENU_BUTTON_SCORE_MAX; buttonID++) { + mark_obj_for_deletion(sMainMenuButtons[buttonID]); + } + } + if (prevMenuButtonID == MENU_BUTTON_COPY) { + for (buttonID = MENU_BUTTON_COPY_MIN; buttonID < MENU_BUTTON_COPY_MAX; buttonID++) { + mark_obj_for_deletion(sMainMenuButtons[buttonID]); + } + } + if (prevMenuButtonID == MENU_BUTTON_ERASE) { + for (buttonID = MENU_BUTTON_ERASE_MIN; buttonID < MENU_BUTTON_ERASE_MAX; buttonID++) { + mark_obj_for_deletion(sMainMenuButtons[buttonID]); + } + } + if (prevMenuButtonID == MENU_BUTTON_SOUND_MODE) { + for (buttonID = MENU_BUTTON_OPTION_MIN; buttonID < MENU_BUTTON_OPTION_MAX; buttonID++) { + mark_obj_for_deletion(sMainMenuButtons[buttonID]); + } + } + } +} + +/** + * Loads score menu from the previous menu using "CHECK SCORE" as source button. + */ +void load_score_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceButton) { + s32 buttonID; + // If the source button is in default state and the previous menu in full screen, + // play zoom out sound and shrink previous menu + if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT + && sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { + play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs); + sMainMenuButtons[prevMenuButtonID]->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING; + sCurrentMenuLevel = MENU_LAYER_MAIN; + } + // If the previous button is in default state + if (sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT) { + // Hide buttons of corresponding button menu groups + if (prevMenuButtonID == MENU_BUTTON_SCORE) //! Not possible, this is checking if the score menu + //! was opened from the score menu! + { + for (buttonID = MENU_BUTTON_SCORE_MIN; buttonID < MENU_BUTTON_SCORE_MAX; buttonID++) { + mark_obj_for_deletion(sMainMenuButtons[buttonID]); + } + } + if (prevMenuButtonID == MENU_BUTTON_COPY) { + for (buttonID = MENU_BUTTON_COPY_MIN; buttonID < MENU_BUTTON_COPY_MAX; buttonID++) { + mark_obj_for_deletion(sMainMenuButtons[buttonID]); + } + } + if (prevMenuButtonID == MENU_BUTTON_ERASE) { + for (buttonID = MENU_BUTTON_ERASE_MIN; buttonID < MENU_BUTTON_ERASE_MAX; buttonID++) { + mark_obj_for_deletion(sMainMenuButtons[buttonID]); + } + } + // Play zoom in sound, select score menu and render it's buttons + sSelectedButtonID = MENU_BUTTON_SCORE; + play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); + sMainMenuButtons[MENU_BUTTON_SCORE]->oMenuButtonState = MENU_BUTTON_STATE_GROWING; + render_score_menu_buttons(sMainMenuButtons[MENU_BUTTON_SCORE]); + } +} + +/** + * Loads copy menu from the previous menu using "COPY FILE" as source button. + */ +void load_copy_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceButton) { + s32 buttonID; + // If the source button is in default state and the previous menu in full screen, + // play zoom out sound and shrink previous menu + if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT + && sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { + play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs); + sMainMenuButtons[prevMenuButtonID]->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING; + sCurrentMenuLevel = MENU_LAYER_MAIN; + } + // If the previous button is in default state + if (sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT) { + // Hide buttons of corresponding button menu groups + if (prevMenuButtonID == MENU_BUTTON_SCORE) { + for (buttonID = MENU_BUTTON_SCORE_MIN; buttonID < MENU_BUTTON_SCORE_MAX; buttonID++) { + mark_obj_for_deletion(sMainMenuButtons[buttonID]); + } + } + if (prevMenuButtonID == MENU_BUTTON_COPY) //! Not possible, this is checking if the copy menu + //! was opened from the copy menu! + { + for (buttonID = MENU_BUTTON_COPY_MIN; buttonID < MENU_BUTTON_COPY_MAX; buttonID++) { + mark_obj_for_deletion(sMainMenuButtons[buttonID]); + } + } + if (prevMenuButtonID == MENU_BUTTON_ERASE) { + for (buttonID = MENU_BUTTON_ERASE_MIN; buttonID < MENU_BUTTON_ERASE_MAX; buttonID++) { + mark_obj_for_deletion(sMainMenuButtons[buttonID]); + } + } + // Play zoom in sound, select copy menu and render it's buttons + sSelectedButtonID = MENU_BUTTON_COPY; + play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); + sMainMenuButtons[MENU_BUTTON_COPY]->oMenuButtonState = MENU_BUTTON_STATE_GROWING; + render_copy_menu_buttons(sMainMenuButtons[MENU_BUTTON_COPY]); + } +} + +/** + * Loads erase menu from the previous menu using "ERASE FILE" as source button. + */ +void load_erase_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceButton) { + s32 buttonID; + // If the source button is in default state and the previous menu in full screen, + // play zoom out sound and shrink previous menu + if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT + && sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { + play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs); + sMainMenuButtons[prevMenuButtonID]->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING; + sCurrentMenuLevel = MENU_LAYER_MAIN; + } + // If the previous button is in default state + if (sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT) { + // Hide buttons of corresponding button menu groups + if (prevMenuButtonID == MENU_BUTTON_SCORE) { + for (buttonID = MENU_BUTTON_SCORE_MIN; buttonID < MENU_BUTTON_SCORE_MAX; buttonID++) { + mark_obj_for_deletion(sMainMenuButtons[buttonID]); + } + } + if (prevMenuButtonID == MENU_BUTTON_COPY) { + for (buttonID = MENU_BUTTON_COPY_MIN; buttonID < MENU_BUTTON_COPY_MAX; buttonID++) { + mark_obj_for_deletion(sMainMenuButtons[buttonID]); + } + } + if (prevMenuButtonID == MENU_BUTTON_ERASE) //! Not possible, this is checking if the erase menu + //! was opened from the erase menu! + { + for (buttonID = MENU_BUTTON_ERASE_MIN; buttonID < MENU_BUTTON_ERASE_MAX; buttonID++) { + mark_obj_for_deletion(sMainMenuButtons[buttonID]); + } + } + // Play zoom in sound, select erase menu and render it's buttons + sSelectedButtonID = MENU_BUTTON_ERASE; + play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); + sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonState = MENU_BUTTON_STATE_GROWING; + render_erase_menu_buttons(sMainMenuButtons[MENU_BUTTON_ERASE]); + } +} + + +/** + * Menu Buttons Menu Manager Initial Action + * Creates models of the buttons in the menu. For the Mario buttons it + * checks if a save file exists to render an specific button model for it. + * Unlike buttons on submenus, these are never hidden or recreated. + */ +void bhv_menu_button_manager_init(void) { + // File A + if (save_file_exists(SAVE_FILE_A) == TRUE) { + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_A] = + spawn_object_rel_with_rot(gCurrentObject, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, + bhvMenuButton, -6400, 2800, 0, 0, 0, 0); + } else { + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_A] = + spawn_object_rel_with_rot(gCurrentObject, MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE, + bhvMenuButton, -6400, 2800, 0, 0, 0, 0); + } + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_A]->oMenuButtonScale = 1.0f; + // File B + if (save_file_exists(SAVE_FILE_B) == TRUE) { + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_B] = + spawn_object_rel_with_rot(gCurrentObject, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, + bhvMenuButton, 1500, 2800, 0, 0, 0, 0); + } else { + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_B] = + spawn_object_rel_with_rot(gCurrentObject, MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE, + bhvMenuButton, 1500, 2800, 0, 0, 0, 0); + } + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_B]->oMenuButtonScale = 1.0f; + // File C + if (save_file_exists(SAVE_FILE_C) == TRUE) { + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_C] = + spawn_object_rel_with_rot(gCurrentObject, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, + bhvMenuButton, -6400, 0, 0, 0, 0, 0); + } else { + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_C] = spawn_object_rel_with_rot( + gCurrentObject, MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE, bhvMenuButton, -6400, 0, 0, 0, 0, 0); + } + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_C]->oMenuButtonScale = 1.0f; + // File D + if (save_file_exists(SAVE_FILE_D) == TRUE) { + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_D] = spawn_object_rel_with_rot( + gCurrentObject, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, bhvMenuButton, 1500, 0, 0, 0, 0, 0); + } else { + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_D] = spawn_object_rel_with_rot( + gCurrentObject, MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE, bhvMenuButton, 1500, 0, 0, 0, 0, 0); + } + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_D]->oMenuButtonScale = 1.0f; + // Score menu button + sMainMenuButtons[MENU_BUTTON_SCORE] = spawn_object_rel_with_rot( + gCurrentObject, MODEL_MAIN_MENU_GREEN_SCORE_BUTTON, bhvMenuButton, -6400, -3500, 0, 0, 0, 0); + sMainMenuButtons[MENU_BUTTON_SCORE]->oMenuButtonScale = 1.0f; + // Copy menu button + sMainMenuButtons[MENU_BUTTON_COPY] = spawn_object_rel_with_rot( + gCurrentObject, MODEL_MAIN_MENU_BLUE_COPY_BUTTON, bhvMenuButton, -2134, -3500, 0, 0, 0, 0); + sMainMenuButtons[MENU_BUTTON_COPY]->oMenuButtonScale = 1.0f; + // Erase menu button + sMainMenuButtons[MENU_BUTTON_ERASE] = spawn_object_rel_with_rot( + gCurrentObject, MODEL_MAIN_MENU_RED_ERASE_BUTTON, bhvMenuButton, 2134, -3500, 0, 0, 0, 0); + sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonScale = 1.0f; + // Sound mode menu button (Option Mode in EU) + sMainMenuButtons[MENU_BUTTON_SOUND_MODE] = spawn_object_rel_with_rot( + gCurrentObject, MODEL_MAIN_MENU_PURPLE_SOUND_BUTTON, bhvMenuButton, 6400, -3500, 0, 0, 0, 0); + sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oMenuButtonScale = 1.0f; + + sTextBaseAlpha = 0; +} + +#if defined(VERSION_JP) || defined(VERSION_SH) + #define SAVE_FILE_SOUND SOUND_MENU_STAR_SOUND +#else + #define SAVE_FILE_SOUND SOUND_MENU_STAR_SOUND_OKEY_DOKEY +#endif + +/** + * In the main menu, check if a button was clicked to play it's button growing state. + * Also play a sound and/or render buttons depending of the button ID selected. + */ +void check_main_menu_clicked_buttons(void) { +#ifdef VERSION_EU + if (sMainMenuTimer >= 5) { +#endif + // Sound mode menu is handled separately because the button ID for it + // is not grouped with the IDs of the other submenus. + if (check_clicked_button(sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oPosX, + sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oPosY, 200.0f) == TRUE) { + sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oMenuButtonState = MENU_BUTTON_STATE_GROWING; + sSelectedButtonID = MENU_BUTTON_SOUND_MODE; + } else { + // Main Menu buttons + s8 buttonID; + // Configure Main Menu button group + for (buttonID = MENU_BUTTON_MAIN_MIN; buttonID < MENU_BUTTON_MAIN_MAX; buttonID++) { + s16 buttonX = sMainMenuButtons[buttonID]->oPosX; + s16 buttonY = sMainMenuButtons[buttonID]->oPosY; + + if (check_clicked_button(buttonX, buttonY, 200.0f) == TRUE) { + // If menu button clicked, select it + sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_GROWING; + sSelectedButtonID = buttonID; + break; + } + } + } +#ifdef VERSION_EU + // Open Options Menu if sOpenLangSettings is TRUE (It's TRUE when there's no saves) + if (sOpenLangSettings == TRUE) { + sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oMenuButtonState = MENU_BUTTON_STATE_GROWING; + sSelectedButtonID = MENU_BUTTON_SOUND_MODE; + sOpenLangSettings = FALSE; + } +#endif + + // Play sound of the save file clicked + switch (sSelectedButtonID) { + case MENU_BUTTON_PLAY_FILE_A: + play_sound(SAVE_FILE_SOUND, gDefaultSoundArgs); + break; + case MENU_BUTTON_PLAY_FILE_B: + play_sound(SAVE_FILE_SOUND, gDefaultSoundArgs); + break; + case MENU_BUTTON_PLAY_FILE_C: + play_sound(SAVE_FILE_SOUND, gDefaultSoundArgs); + break; + case MENU_BUTTON_PLAY_FILE_D: + play_sound(SAVE_FILE_SOUND, gDefaultSoundArgs); + break; + // Play sound of the button clicked and render buttons of that menu. + case MENU_BUTTON_SCORE: + play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); + render_score_menu_buttons(sMainMenuButtons[MENU_BUTTON_SCORE]); + break; + case MENU_BUTTON_COPY: + play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); + render_copy_menu_buttons(sMainMenuButtons[MENU_BUTTON_COPY]); + break; + case MENU_BUTTON_ERASE: + play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); + render_erase_menu_buttons(sMainMenuButtons[MENU_BUTTON_ERASE]); + break; + case MENU_BUTTON_SOUND_MODE: + play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); + render_sound_mode_menu_buttons(sMainMenuButtons[MENU_BUTTON_SOUND_MODE]); + break; + } +#ifdef VERSION_EU + } +#endif +} +#undef SAVE_FILE_SOUND + +/** + * Menu Buttons Menu Manager Loop Action + * Calls a menu function depending of the button chosen. + * sSelectedButtonID is MENU_BUTTON_NONE when the file select + * is loaded, and that checks what buttonID is clicked in the main menu. + */ +void bhv_menu_button_manager_loop(void) { + switch (sSelectedButtonID) { + case MENU_BUTTON_NONE: + check_main_menu_clicked_buttons(); + break; + case MENU_BUTTON_PLAY_FILE_A: + load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_A], 1); + break; + case MENU_BUTTON_PLAY_FILE_B: + load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_B], 2); + break; + case MENU_BUTTON_PLAY_FILE_C: + load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_C], 3); + break; + case MENU_BUTTON_PLAY_FILE_D: + load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_D], 4); + break; + case MENU_BUTTON_SCORE: + check_score_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_SCORE]); + break; + case MENU_BUTTON_COPY: + check_copy_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_COPY]); + break; + case MENU_BUTTON_ERASE: + check_erase_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_ERASE]); + break; + + case MENU_BUTTON_SCORE_FILE_A: + exit_score_file_to_score_menu(sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A], MENU_BUTTON_SCORE); + break; + case MENU_BUTTON_SCORE_FILE_B: + exit_score_file_to_score_menu(sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B], MENU_BUTTON_SCORE); + break; + case MENU_BUTTON_SCORE_FILE_C: + exit_score_file_to_score_menu(sMainMenuButtons[MENU_BUTTON_SCORE_FILE_C], MENU_BUTTON_SCORE); + break; + case MENU_BUTTON_SCORE_FILE_D: + exit_score_file_to_score_menu(sMainMenuButtons[MENU_BUTTON_SCORE_FILE_D], MENU_BUTTON_SCORE); + break; + case MENU_BUTTON_SCORE_RETURN: + return_to_main_menu(MENU_BUTTON_SCORE, sMainMenuButtons[MENU_BUTTON_SCORE_RETURN]); + break; + case MENU_BUTTON_SCORE_COPY_FILE: + load_copy_menu_from_submenu(MENU_BUTTON_SCORE, + sMainMenuButtons[MENU_BUTTON_SCORE_COPY_FILE]); + break; + case MENU_BUTTON_SCORE_ERASE_FILE: + load_erase_menu_from_submenu(MENU_BUTTON_SCORE, + sMainMenuButtons[MENU_BUTTON_SCORE_ERASE_FILE]); + break; + + case MENU_BUTTON_COPY_FILE_A: + break; + case MENU_BUTTON_COPY_FILE_B: + break; + case MENU_BUTTON_COPY_FILE_C: + break; + case MENU_BUTTON_COPY_FILE_D: + break; + case MENU_BUTTON_COPY_RETURN: + return_to_main_menu(MENU_BUTTON_COPY, sMainMenuButtons[MENU_BUTTON_COPY_RETURN]); + break; + case MENU_BUTTON_COPY_CHECK_SCORE: + load_score_menu_from_submenu(MENU_BUTTON_COPY, + sMainMenuButtons[MENU_BUTTON_COPY_CHECK_SCORE]); + break; + case MENU_BUTTON_COPY_ERASE_FILE: + load_erase_menu_from_submenu(MENU_BUTTON_COPY, + sMainMenuButtons[MENU_BUTTON_COPY_ERASE_FILE]); + break; + + case MENU_BUTTON_ERASE_FILE_A: + break; + case MENU_BUTTON_ERASE_FILE_B: + break; + case MENU_BUTTON_ERASE_FILE_C: + break; + case MENU_BUTTON_ERASE_FILE_D: + break; + case MENU_BUTTON_ERASE_RETURN: + return_to_main_menu(MENU_BUTTON_ERASE, sMainMenuButtons[MENU_BUTTON_ERASE_RETURN]); + break; + case MENU_BUTTON_ERASE_CHECK_SCORE: + load_score_menu_from_submenu(MENU_BUTTON_ERASE, + sMainMenuButtons[MENU_BUTTON_ERASE_CHECK_SCORE]); + break; + case MENU_BUTTON_ERASE_COPY_FILE: + load_copy_menu_from_submenu(MENU_BUTTON_ERASE, + sMainMenuButtons[MENU_BUTTON_ERASE_COPY_FILE]); + break; + + case MENU_BUTTON_SOUND_MODE: + check_sound_mode_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_SOUND_MODE]); + break; + + // STEREO, MONO and HEADSET buttons are undefined so they can be selected without + // exiting the Options menu, as a result they added a return button +#ifdef VERSION_EU + case MENU_BUTTON_LANGUAGE_RETURN: + return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_LANGUAGE_RETURN]); + break; +#else + case MENU_BUTTON_STEREO: + return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_STEREO]); + break; + case MENU_BUTTON_MONO: + return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_MONO]); + break; + case MENU_BUTTON_HEADSET: + return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_HEADSET]); + break; +#endif + } + + sClickPos[0] = -10000; + sClickPos[1] = -10000; +} + +/** + * Cursor function that handles button inputs. + * If the cursor is clicked, sClickPos uses the same value as sCursorPos. + */ +void handle_cursor_button_input(void) { + // If scoring a file, pressing A just changes the coin score mode. + if (sSelectedButtonID == MENU_BUTTON_SCORE_FILE_A || sSelectedButtonID == MENU_BUTTON_SCORE_FILE_B + || sSelectedButtonID == MENU_BUTTON_SCORE_FILE_C + || sSelectedButtonID == MENU_BUTTON_SCORE_FILE_D) { + if (gPlayer3Controller->buttonPressed +#ifdef VERSION_EU + & (B_BUTTON | START_BUTTON | Z_TRIG)) { +#else + & (B_BUTTON | START_BUTTON)) { +#endif + sClickPos[0] = sCursorPos[0]; + sClickPos[1] = sCursorPos[1]; + sCursorClickingTimer = 1; + } else if (gPlayer3Controller->buttonPressed & A_BUTTON) { + sScoreFileCoinScoreMode = 1 - sScoreFileCoinScoreMode; + play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); + } + } else { // If cursor is clicked + if (gPlayer3Controller->buttonPressed +#ifdef VERSION_EU + & (A_BUTTON | B_BUTTON | START_BUTTON | Z_TRIG)) { +#else + & (A_BUTTON | B_BUTTON | START_BUTTON)) { +#endif + sClickPos[0] = sCursorPos[0]; + sClickPos[1] = sCursorPos[1]; + sCursorClickingTimer = 1; + } + } +} + +/** + * Cursor function that handles analog stick input and button presses with a function near the end. + */ +void handle_controller_cursor_input(void) { + s16 rawStickX = gPlayer3Controller->rawStickX; + s16 rawStickY = gPlayer3Controller->rawStickY; + + // Handle deadzone + if (rawStickY > -2 && rawStickY < 2) { + rawStickY = 0; + } + if (rawStickX > -2 && rawStickX < 2) { + rawStickX = 0; + } + + // Move cursor + sCursorPos[0] += rawStickX / 8; + sCursorPos[1] += rawStickY / 8; + + // Stop cursor from going offscreen + if (sCursorPos[0] > 132.0f) { + sCursorPos[0] = 132.0f; + } + if (sCursorPos[0] < -132.0f) { + sCursorPos[0] = -132.0f; + } + + if (sCursorPos[1] > 90.0f) { + sCursorPos[1] = 90.0f; + } + if (sCursorPos[1] < -90.0f) { + sCursorPos[1] = -90.0f; + } + + if (sCursorClickingTimer == 0) { + handle_cursor_button_input(); + } +} + +/** + * Prints the cursor (Mario Hand, different to the one in the Mario screen) + * and loads it's controller inputs in handle_controller_cursor_input + * to be usable on the file select. + */ +void print_menu_cursor(void) { + handle_controller_cursor_input(); + create_dl_translation_matrix(MENU_MTX_PUSH, sCursorPos[0] + 160.0f - 5.0, sCursorPos[1] + 120.0f - 25.0, 0.0f); + // Get the right graphic to use for the cursor. + if (sCursorClickingTimer == 0) + // Idle + gSPDisplayList(gDisplayListHead++, dl_menu_idle_hand); + if (sCursorClickingTimer != 0) + // Grabbing + gSPDisplayList(gDisplayListHead++, dl_menu_grabbing_hand); + gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); + if (sCursorClickingTimer != 0) { + sCursorClickingTimer++; // This is a very strange way to implement a timer? It counts up and + // then resets to 0 instead of just counting down to 0. + if (sCursorClickingTimer == 5) { + sCursorClickingTimer = 0; + } + } +} + +/** + * Prints a hud string depending of the hud table list defined with text fade properties. + */ +void print_hud_lut_string_fade(s8 hudLUT, s16 x, s16 y, const unsigned char *text) { + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha - sTextFadeAlpha); + print_hud_lut_string(hudLUT, x, y, text); + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); +} + +/** + * Prints a generic white string with text fade properties. + */ +void print_generic_string_fade(s16 x, s16 y, const unsigned char *text) { + gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha - sTextFadeAlpha); + print_generic_string(x, y, text); + gSPDisplayList(gDisplayListHead++, dl_ia_text_end); +} + +/** + * Updates text fade at the top of a menu. + */ +s32 update_text_fade_out(void) { + if (sFadeOutText == TRUE) { + sTextFadeAlpha += 50; + if (sTextFadeAlpha == 250) { + sFadeOutText = FALSE; + return TRUE; + } + } else { + if (sTextFadeAlpha > 0) { + sTextFadeAlpha -= 50; + } + } + return FALSE; +} + +/** + * Prints the amount of stars of a save file. + * If a save doesn't exist, print "NEW" instead. + */ +void print_save_file_star_count(s8 fileIndex, s16 x, s16 y) { + u8 starCountText[4]; + s8 offset = 0; + s16 starCount; + + if (save_file_exists(fileIndex) == TRUE) { + starCount = save_file_get_total_star_count(fileIndex, 0, 24); + // Print star icon + print_hud_lut_string(HUD_LUT_GLOBAL, x, y, starIcon); + // If star count is less than 100, print x icon and move + // the star count text one digit to the right. + if (starCount < 100) { + print_hud_lut_string(HUD_LUT_GLOBAL, x + 16, y, xIcon); + offset = 16; + } + // Print star count + int_to_str(starCount, starCountText); + print_hud_lut_string(HUD_LUT_GLOBAL, x + offset + 16, y, starCountText); + } else { + // Print "new" text + print_hud_lut_string(HUD_LUT_GLOBAL, x, y, LANGUAGE_ARRAY(textNew)); + } +} + +#if defined(VERSION_JP) || defined(VERSION_SH) + #define SELECT_FILE_X 96 + #define SCORE_X 50 + #define COPY_X 115 + #define ERASE_X 180 + #define SOUNDMODE_X1 235 + #define SAVEFILE_X1 92 + #define SAVEFILE_X2 209 + #define MARIOTEXT_X1 92 + #define MARIOTEXT_X2 207 +#elif VERSION_US + #define SELECT_FILE_X 93 + #define SCORE_X 52 + #define COPY_X 117 + #define ERASE_X 177 + #define SOUNDMODE_X1 sSoundTextX + #define SAVEFILE_X1 92 + #define SAVEFILE_X2 209 + #define MARIOTEXT_X1 92 + #define MARIOTEXT_X2 207 +#elif VERSION_EU + #define SELECT_FILE_X 93 + #define SCORE_X 52 + #define COPY_X 117 + #define ERASE_X 177 + #define SOUNDMODE_X1 sSoundTextX + #define SAVEFILE_X1 97 + #define SAVEFILE_X2 204 + #define MARIOTEXT_X1 97 + #define MARIOTEXT_X2 204 +#endif + +/** + * Prints main menu strings that shows on the yellow background menu screen. + * + * In EU this function acts like "print_save_file_strings" because + * print_main_lang_strings is first called to render the strings for the 4 buttons. + * Same rule applies for score, copy and erase strings. + */ +void print_main_menu_strings(void) { + // Print "SELECT FILE" text + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); +#ifndef VERSION_EU + print_hud_lut_string(HUD_LUT_DIFF, SELECT_FILE_X, 35, textSelectFile); +#endif + // Print file star counts + print_save_file_star_count(SAVE_FILE_A, SAVEFILE_X1, 78); + print_save_file_star_count(SAVE_FILE_B, SAVEFILE_X2, 78); + print_save_file_star_count(SAVE_FILE_C, SAVEFILE_X1, 118); + print_save_file_star_count(SAVE_FILE_D, SAVEFILE_X2, 118); + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); +#ifndef VERSION_EU + // Print menu names + gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + print_generic_string(SCORE_X, 39, textScore); + print_generic_string(COPY_X, 39, textCopy); + print_generic_string(ERASE_X, 39, textErase); +#if !defined(VERSION_JP) && !defined(VERSION_SH) + sSoundTextX = get_str_x_pos_from_center(254, textSoundModes[sSoundMode], 10.0f); +#endif + print_generic_string(SOUNDMODE_X1, 39, textSoundModes[sSoundMode]); + gSPDisplayList(gDisplayListHead++, dl_ia_text_end); +#endif + // Print file names + gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + print_menu_generic_string(MARIOTEXT_X1, 65, textMarioA); + print_menu_generic_string(MARIOTEXT_X2, 65, textMarioB); + print_menu_generic_string(MARIOTEXT_X1, 105, textMarioC); + print_menu_generic_string(MARIOTEXT_X2, 105, textMarioD); + gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_end); +} + +#ifdef VERSION_EU +/** + * Prints the first part main menu strings that shows on the yellow background menu screen. + * Has the strings for the 4 buttons below the save buttons that get changed depending of the language. + * Calls print_main_menu_strings to print the remaining strings. + */ +void print_main_lang_strings(void) { + s16 centeredX; + + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + centeredX = get_str_x_pos_from_center_scale(160, textSelectFile[sLanguageMode], 12.0f); + sCenteredX = centeredX; + print_hud_lut_string(HUD_LUT_GLOBAL, centeredX, 35, textSelectFile[sLanguageMode]); + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); + + gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + centeredX = get_str_x_pos_from_center(76, textScore[sLanguageMode], 10.0f); + sCenteredX = centeredX; + print_generic_string(centeredX, 39, textScore[sLanguageMode]); + centeredX = get_str_x_pos_from_center(131, textCopy[sLanguageMode], 10.0f); + sCenteredX = centeredX; + print_generic_string(centeredX, 39, textCopy[sLanguageMode]); + centeredX = get_str_x_pos_from_center(189, textErase[sLanguageMode], 10.0f); + sCenteredX = centeredX; + print_generic_string(centeredX, 39, textErase[sLanguageMode]); + centeredX = get_str_x_pos_from_center(245, textOption[sLanguageMode], 10.0f); + sCenteredX = centeredX; + print_generic_string(centeredX, 39, textOption[sLanguageMode]); + gSPDisplayList(gDisplayListHead++, dl_ia_text_end); + + print_main_menu_strings(); +} +#endif + +#ifdef VERSION_EU +#define CHECK_FILE_X checkFileX +#define NOSAVE_DATA_X1 noSaveDataX +#elif VERSION_JP +#define CHECK_FILE_X 90 +#define NOSAVE_DATA_X1 90 +#else +#define CHECK_FILE_X 95 +#define NOSAVE_DATA_X1 99 +#endif + +/** + * Defines IDs for the top message of the score menu and displays it if the ID is called in messageID. + */ +void score_menu_display_message(s8 messageID) { +#ifdef VERSION_EU + s16 checkFileX, noSaveDataX; +#endif + + switch (messageID) { + case SCORE_MSG_CHECK_FILE: +#ifdef VERSION_EU + checkFileX = get_str_x_pos_from_center_scale(160, LANGUAGE_ARRAY(textCheckFile), 12.0f); +#endif + print_hud_lut_string_fade(HUD_LUT_DIFF, CHECK_FILE_X, 35, LANGUAGE_ARRAY(textCheckFile)); + break; + case SCORE_MSG_NOSAVE_DATA: +#ifdef VERSION_EU + noSaveDataX = get_str_x_pos_from_center(160, LANGUAGE_ARRAY(textNoSavedDataExists), 10.0f); +#endif + print_generic_string_fade(NOSAVE_DATA_X1, 190, LANGUAGE_ARRAY(textNoSavedDataExists)); + break; + } +} + +#if defined(VERSION_JP) || defined(VERSION_SH) + #define RETURN_X 45 + #define COPYFILE_X1 128 + #define ERASEFILE_X1 228 +#elif VERSION_EU + #define RETURN_X centeredX + #define COPYFILE_X1 centeredX + #define ERASEFILE_X1 centeredX +#else + #define RETURN_X 44 + #define COPYFILE_X1 135 + #define ERASEFILE_X1 231 +#endif + +#ifdef VERSION_EU + #define FADEOUT_TIMER 35 +#else + #define FADEOUT_TIMER 20 +#endif + +/** + * Prints score menu strings that shows on the green background menu screen. + */ +void print_score_menu_strings(void) { +#ifdef VERSION_EU + s16 centeredX; +#endif + + // Update and print the message at the top of the menu. + if (sMainMenuTimer == FADEOUT_TIMER) { + sFadeOutText = TRUE; + } + if (update_text_fade_out() == TRUE) { + if (sStatusMessageID == SCORE_MSG_CHECK_FILE) { + sStatusMessageID = SCORE_MSG_NOSAVE_DATA; + } else { + sStatusMessageID = SCORE_MSG_CHECK_FILE; + } + } + // Print messageID called above + score_menu_display_message(sStatusMessageID); + +#ifndef VERSION_EU + // Print file star counts + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + print_save_file_star_count(SAVE_FILE_A, 90, 76); + print_save_file_star_count(SAVE_FILE_B, 211, 76); + print_save_file_star_count(SAVE_FILE_C, 90, 119); + print_save_file_star_count(SAVE_FILE_D, 211, 119); + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); +#endif + + // Print menu names + gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center(69, textReturn[sLanguageMode], 10.0f); +#endif + print_generic_string(RETURN_X, 35, LANGUAGE_ARRAY(textReturn)); +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center(159, textCopyFileButton[sLanguageMode], 10.0f); +#endif + print_generic_string(COPYFILE_X1, 35, LANGUAGE_ARRAY(textCopyFileButton)); +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center(249, textEraseFileButton[sLanguageMode], 10.0f); +#endif + print_generic_string(ERASEFILE_X1, 35, LANGUAGE_ARRAY(textEraseFileButton)); + gSPDisplayList(gDisplayListHead++, dl_ia_text_end); + +#ifdef VERSION_EU + print_main_menu_strings(); +#else + // Print file names + gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + print_menu_generic_string(89, 62, textMarioA); + print_menu_generic_string(211, 62, textMarioB); + print_menu_generic_string(89, 105, textMarioC); + print_menu_generic_string(211, 105, textMarioD); + gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_end); +#endif +} + +#if defined(VERSION_JP) || defined(VERSION_SH) + #define NOFILE_COPY_X 90 + #define COPY_FILE_X 90 + #define COPYIT_WHERE_X 90 + #define NOSAVE_DATA_X2 90 + #define COPYCOMPLETE_X 90 + #define SAVE_EXISTS_X1 90 +#elif VERSION_EU + #define NOFILE_COPY_X centeredX + #define COPY_FILE_X centeredX + #define COPYIT_WHERE_X centeredX + #define NOSAVE_DATA_X2 centeredX + #define COPYCOMPLETE_X centeredX + #define SAVE_EXISTS_X1 centeredX +#else + #define NOFILE_COPY_X 119 + #define COPY_FILE_X 104 + #define COPYIT_WHERE_X 109 + #define NOSAVE_DATA_X2 101 + #define COPYCOMPLETE_X 110 + #define SAVE_EXISTS_X1 110 +#endif + +/** + * Defines IDs for the top message of the copy menu and displays it if the ID is called in messageID. + */ +void copy_menu_display_message(s8 messageID) { +#ifdef VERSION_EU + s16 centeredX; +#endif + + switch (messageID) { + case COPY_MSG_MAIN_TEXT: + if (sAllFilesExist == TRUE) { +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center(160, textNoFileToCopyFrom[sLanguageMode], 10.0f); +#endif + print_generic_string_fade(NOFILE_COPY_X, 190, LANGUAGE_ARRAY(textNoFileToCopyFrom)); + } else { +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center_scale(160, textCopyFile[sLanguageMode], 12.0f); +#endif + print_hud_lut_string_fade(HUD_LUT_DIFF, COPY_FILE_X, 35, LANGUAGE_ARRAY(textCopyFile)); + } + break; + case COPY_MSG_COPY_WHERE: +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center(160, textCopyItToWhere[sLanguageMode], 10.0f); +#endif + print_generic_string_fade(COPYIT_WHERE_X, 190, LANGUAGE_ARRAY(textCopyItToWhere)); + break; + case COPY_MSG_NOSAVE_EXISTS: +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center(160, textNoSavedDataExists[sLanguageMode], 10.0f); + print_generic_string_fade(NOSAVE_DATA_X2, 190, textNoSavedDataExists[sLanguageMode]); +#else + print_generic_string_fade(NOSAVE_DATA_X2, 190, textNoSavedDataExistsCopy); +#endif + break; + case COPY_MSG_COPY_COMPLETE: +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center(160, textCopyCompleted[sLanguageMode], 10.0f); +#endif + print_generic_string_fade(COPYCOMPLETE_X, 190, LANGUAGE_ARRAY(textCopyCompleted)); + break; + case COPY_MSG_SAVE_EXISTS: +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center(160, textSavedDataExists[sLanguageMode], 10.0f); +#endif + print_generic_string_fade(SAVE_EXISTS_X1, 190, LANGUAGE_ARRAY(textSavedDataExists)); + break; + } +} + +/** + * Updates messageIDs of the copy menu depending of the copy phase value defined. + */ +void copy_menu_update_message(void) { + switch (sMainMenuButtons[MENU_BUTTON_COPY]->oMenuButtonActionPhase) { + case COPY_PHASE_MAIN: + if (sMainMenuTimer == FADEOUT_TIMER) { + sFadeOutText = TRUE; + } + if (update_text_fade_out() == TRUE) { + if (sStatusMessageID == COPY_MSG_MAIN_TEXT) { + sStatusMessageID = COPY_MSG_NOSAVE_EXISTS; + } else { + sStatusMessageID = COPY_MSG_MAIN_TEXT; + } + } + break; + case COPY_PHASE_COPY_WHERE: + if (sMainMenuTimer == FADEOUT_TIMER + && sStatusMessageID == COPY_MSG_SAVE_EXISTS) { + sFadeOutText = TRUE; + } + if (update_text_fade_out() == TRUE) { + if (sStatusMessageID != COPY_MSG_COPY_WHERE) { + sStatusMessageID = COPY_MSG_COPY_WHERE; + } else { + sStatusMessageID = COPY_MSG_SAVE_EXISTS; + } + } + break; + case COPY_PHASE_COPY_COMPLETE: + if (sMainMenuTimer == FADEOUT_TIMER) { + sFadeOutText = TRUE; + } + if (update_text_fade_out() == TRUE) { + if (sStatusMessageID != COPY_MSG_COPY_COMPLETE) { + sStatusMessageID = COPY_MSG_COPY_COMPLETE; + } else { + sStatusMessageID = COPY_MSG_MAIN_TEXT; + } + } + break; + } +} + +#if defined(VERSION_JP) || defined(VERSION_SH) + #define VIEWSCORE_X1 133 + #define ERASEFILE_X2 220 +#elif VERSION_EU + #define VIEWSCORE_X1 centeredX + #define ERASEFILE_X2 centeredX +#else + #define VIEWSCORE_X1 128 + #define ERASEFILE_X2 230 +#endif + +/** + * Prints copy menu strings that shows on the blue background menu screen. + */ +void print_copy_menu_strings(void) { +#ifdef VERSION_EU + s16 centeredX; +#endif + + // Update and print the message at the top of the menu. + copy_menu_update_message(); + // Print messageID called inside a copy_menu_update_message case + copy_menu_display_message(sStatusMessageID); +#ifndef VERSION_EU + // Print file star counts + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + print_save_file_star_count(SAVE_FILE_A, 90, 76); + print_save_file_star_count(SAVE_FILE_B, 211, 76); + print_save_file_star_count(SAVE_FILE_C, 90, 119); + print_save_file_star_count(SAVE_FILE_D, 211, 119); + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); +#endif + // Print menu names + gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center(69, textReturn[sLanguageMode], 10.0f); +#endif + print_generic_string(RETURN_X, 35, LANGUAGE_ARRAY(textReturn)); +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center(159, textViewScore[sLanguageMode], 10.0f); +#endif + print_generic_string(VIEWSCORE_X1, 35, LANGUAGE_ARRAY(textViewScore)); +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center(249, textEraseFileButton[sLanguageMode], 10.0f); +#endif + print_generic_string(ERASEFILE_X2, 35, LANGUAGE_ARRAY(textEraseFileButton)); + gSPDisplayList(gDisplayListHead++, dl_ia_text_end); +#ifdef VERSION_EU + print_main_menu_strings(); +#else + // Print file names + gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + print_menu_generic_string(89, 62, textMarioA); + print_menu_generic_string(211, 62, textMarioB); + print_menu_generic_string(89, 105, textMarioC); + print_menu_generic_string(211, 105, textMarioD); + gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_end); +#endif +} + +#if defined(VERSION_JP) || defined(VERSION_SH) + #define CURSOR_X 160.0f + #define MENU_ERASE_YES_MIN_X 0x91 + #define MENU_ERASE_YES_MAX_X 0xA4 +#else + #define CURSOR_X (x + 0x46) + #define MENU_ERASE_YES_MIN_X 0x8C + #define MENU_ERASE_YES_MAX_X 0xA9 +#endif + +#define MENU_ERASE_YES_NO_MIN_Y 0xBF +#define MENU_ERASE_YES_NO_MAX_Y 0xD2 +#define MENU_ERASE_NO_MIN_X 0xBD +#define MENU_ERASE_NO_MAX_X 0xDA + +/** + * Prints the "YES NO" prompt and checks if one of the prompts are hovered to do it's functions. + */ +void print_erase_menu_prompt(s16 x, s16 y) { + s16 colorFade = gGlobalTimer << 12; + + s16 cursorX = sCursorPos[0] + CURSOR_X; + s16 cursorY = sCursorPos[1] + 120.0f; + + if (cursorX < MENU_ERASE_YES_MAX_X && cursorX >= MENU_ERASE_YES_MIN_X && + cursorY < MENU_ERASE_YES_NO_MAX_Y && cursorY >= MENU_ERASE_YES_NO_MIN_Y) { + // Fade "YES" string color but keep "NO" gray + sYesNoColor[0] = sins(colorFade) * 50.0f + 205.0f; + sYesNoColor[1] = 150; + sEraseYesNoHoverState = MENU_ERASE_HOVER_YES; + } else if (cursorX < MENU_ERASE_NO_MAX_X && cursorX >= MENU_ERASE_NO_MIN_X + && cursorY < MENU_ERASE_YES_NO_MAX_Y && cursorY >= MENU_ERASE_YES_NO_MIN_Y) { + // Fade "NO" string color but keep "YES" gray + sYesNoColor[0] = 150; + sYesNoColor[1] = sins(colorFade) * 50.0f + 205.0f; + sEraseYesNoHoverState = MENU_ERASE_HOVER_NO; + } else { + // Don't fade both strings and keep them gray + sYesNoColor[0] = 150; + sYesNoColor[1] = 150; + sEraseYesNoHoverState = MENU_ERASE_HOVER_NONE; + } + // If the cursor is clicked... + if (sCursorClickingTimer == 2) { + // ..and is hovering "YES", delete file + if (sEraseYesNoHoverState == MENU_ERASE_HOVER_YES) { + play_sound(SOUND_MARIO_WAAAOOOW, gDefaultSoundArgs); + sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonActionPhase = ERASE_PHASE_MARIO_ERASED; + sFadeOutText = TRUE; + sMainMenuTimer = 0; + save_file_erase(sSelectedFileIndex); + sMainMenuButtons[MENU_BUTTON_ERASE_MIN + sSelectedFileIndex]->header.gfx.sharedChild = + gLoadedGraphNodes[MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE]; + sMainMenuButtons[sSelectedFileIndex]->header.gfx.sharedChild = + gLoadedGraphNodes[MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE]; + sEraseYesNoHoverState = MENU_ERASE_HOVER_NONE; + // ..and is hovering "NO", return back to main phase + } else if (sEraseYesNoHoverState == MENU_ERASE_HOVER_NO) { + play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); + sMainMenuButtons[MENU_BUTTON_ERASE_MIN + sSelectedFileIndex]->oMenuButtonState = + MENU_BUTTON_STATE_ZOOM_OUT; + sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonActionPhase = ERASE_PHASE_MAIN; + sFadeOutText = TRUE; + sMainMenuTimer = 0; + sEraseYesNoHoverState = MENU_ERASE_HOVER_NONE; + } + } + + // Print "YES NO" strings + gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); + gDPSetEnvColor(gDisplayListHead++, sYesNoColor[0], sYesNoColor[0], sYesNoColor[0], sTextBaseAlpha); + print_generic_string(x + 56, y, LANGUAGE_ARRAY(textYes)); + gDPSetEnvColor(gDisplayListHead++, sYesNoColor[1], sYesNoColor[1], sYesNoColor[1], sTextBaseAlpha); + print_generic_string(x + 98, y, LANGUAGE_ARRAY(textNo)); + gSPDisplayList(gDisplayListHead++, dl_ia_text_end); +} + +// MARIO_ERASED_VAR is the value there the letter "A" is, it works like this: +// US and EU --- JP +// M a r i o A --- マ リ オ A +// 0 1 2 3 4 5 6 --- 0 1 2 3 +#if defined(VERSION_JP) || defined(VERSION_SH) + #define ERASE_FILE_X 96 + #define NOSAVE_DATA_X3 90 + #define MARIO_ERASED_VAR 3 + #define MARIO_ERASED_X 90 + #define SAVE_EXISTS_X2 90 +#elif VERSION_EU + #define ERASE_FILE_X centeredX + #define NOSAVE_DATA_X3 centeredX + #define MARIO_ERASED_VAR 6 + #define MARIO_ERASED_X centeredX + #define SAVE_EXISTS_X2 centeredX +#else + #define ERASE_FILE_X 98 + #define NOSAVE_DATA_X3 100 + #define MARIO_ERASED_VAR 6 + #define MARIO_ERASED_X 100 + #define SAVE_EXISTS_X2 100 +#endif + +/** + * Defines IDs for the top message of the erase menu and displays it if the ID is called in messageID. + */ +void erase_menu_display_message(s8 messageID) { +#ifdef VERSION_EU + s16 centeredX; +#endif + +#ifndef VERSION_EU + unsigned char textEraseFile[] = { TEXT_ERASE_FILE }; + unsigned char textSure[] = { TEXT_SURE }; + unsigned char textNoSavedDataExists[] = { TEXT_NO_SAVED_DATA_EXISTS }; + unsigned char textMarioAJustErased[] = { TEXT_FILE_MARIO_A_JUST_ERASED }; + unsigned char textSavedDataExists[] = { TEXT_SAVED_DATA_EXISTS }; +#endif + + switch (messageID) { + case ERASE_MSG_MAIN_TEXT: +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center_scale(160, textEraseFile[sLanguageMode], 12.0f); +#endif + print_hud_lut_string_fade(HUD_LUT_DIFF, ERASE_FILE_X, 35, LANGUAGE_ARRAY(textEraseFile)); + break; + case ERASE_MSG_PROMPT: + print_generic_string_fade(90, 190, LANGUAGE_ARRAY(textSure)); + print_erase_menu_prompt(90, 190); // YES NO, has functions for it too + break; + case ERASE_MSG_NOSAVE_EXISTS: +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center(160, textNoSavedDataExists[sLanguageMode], 10.0f); +#endif + print_generic_string_fade(NOSAVE_DATA_X3, 190, LANGUAGE_ARRAY(textNoSavedDataExists)); + break; + case ERASE_MSG_MARIO_ERASED: + LANGUAGE_ARRAY(textMarioAJustErased)[MARIO_ERASED_VAR] = sSelectedFileIndex + 10; +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center(160, textMarioAJustErased[sLanguageMode], 10.0f); +#endif + print_generic_string_fade(MARIO_ERASED_X, 190, LANGUAGE_ARRAY(textMarioAJustErased)); + break; + case ERASE_MSG_SAVE_EXISTS: // unused +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center(160, textSavedDataExists[sLanguageMode], 10.0f); +#endif + print_generic_string_fade(SAVE_EXISTS_X2, 190, LANGUAGE_ARRAY(textSavedDataExists)); + break; + } +} + +/** + * Updates messageIDs of the erase menu depending of the erase phase value defined. + */ +void erase_menu_update_message(void) { + switch (sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonActionPhase) { + case ERASE_PHASE_MAIN: + if (sMainMenuTimer == FADEOUT_TIMER + && sStatusMessageID == ERASE_MSG_NOSAVE_EXISTS) { + sFadeOutText = TRUE; + } + if (update_text_fade_out() == TRUE) { + if (sStatusMessageID == ERASE_MSG_MAIN_TEXT) { + sStatusMessageID = ERASE_MSG_NOSAVE_EXISTS; + } else { + sStatusMessageID = ERASE_MSG_MAIN_TEXT; + } + } + break; + case ERASE_PHASE_PROMPT: + if (update_text_fade_out() == TRUE) { + if (sStatusMessageID != ERASE_MSG_PROMPT) { + sStatusMessageID = ERASE_MSG_PROMPT; + } + sCursorPos[0] = 43.0f; + sCursorPos[1] = 80.0f; + } + break; + case ERASE_PHASE_MARIO_ERASED: + if (sMainMenuTimer == FADEOUT_TIMER) { + sFadeOutText = TRUE; + } + if (update_text_fade_out() == TRUE) { + if (sStatusMessageID != ERASE_MSG_MARIO_ERASED) { + sStatusMessageID = ERASE_MSG_MARIO_ERASED; + } else { + sStatusMessageID = ERASE_MSG_MAIN_TEXT; + } + } + break; + } +} + +#if defined(VERSION_JP) || defined(VERSION_SH) +#define VIEWSCORE_X2 133 +#define COPYFILE_X2 223 +#else +#define VIEWSCORE_X2 127 +#define COPYFILE_X2 233 +#endif + +/** + * Prints erase menu strings that shows on the red background menu screen. + */ +void print_erase_menu_strings(void) { +#ifdef VERSION_EU + s16 centeredX; +#endif + + // Update and print the message at the top of the menu. + erase_menu_update_message(); + + // Print messageID called inside a erase_menu_update_message case + erase_menu_display_message(sStatusMessageID); + +#ifndef VERSION_EU + // Print file star counts + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + print_save_file_star_count(SAVE_FILE_A, 90, 76); + print_save_file_star_count(SAVE_FILE_B, 211, 76); + print_save_file_star_count(SAVE_FILE_C, 90, 119); + print_save_file_star_count(SAVE_FILE_D, 211, 119); + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); +#endif + + // Print menu names + gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + +#ifdef VERSION_EU + centeredX = get_str_x_pos_from_center(69, textReturn[sLanguageMode], 10.0f); + print_generic_string(centeredX, 35, textReturn[sLanguageMode]); + centeredX = get_str_x_pos_from_center(159, textViewScore[sLanguageMode], 10.0f); + print_generic_string(centeredX, 35, textViewScore[sLanguageMode]); + centeredX = get_str_x_pos_from_center(249, textCopyFileButton[sLanguageMode], 10.0f); + print_generic_string(centeredX, 35, textCopyFileButton[sLanguageMode]); +#else + print_generic_string(RETURN_X, 35, textReturn); + print_generic_string(VIEWSCORE_X2, 35, textViewScore); + print_generic_string(COPYFILE_X2, 35, textCopyFileButton); +#endif + gSPDisplayList(gDisplayListHead++, dl_ia_text_end); + +#ifdef VERSION_EU + print_main_menu_strings(); +#else + // Print file names + gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + print_menu_generic_string(89, 62, textMarioA); + print_menu_generic_string(211, 62, textMarioB); + print_menu_generic_string(89, 105, textMarioC); + print_menu_generic_string(211, 105, textMarioD); + gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_end); +#endif +} + +#if defined(VERSION_JP) || defined(VERSION_SH) + #define SOUND_HUD_X 96 +#elif VERSION_US + #define SOUND_HUD_X 88 +#endif + +/** + * Prints sound mode menu strings that shows on the purple background menu screen. + * + * In EU, this function acts like "print_option_mode_menu_strings" because of languages. + */ +void print_sound_mode_menu_strings(void) { + s32 mode; + +#ifdef VERSION_US + s16 textX; +#elif VERSION_EU + s32 textX; +#endif + +#ifndef VERSION_EU + unsigned char textSoundSelect[] = { TEXT_SOUND_SELECT }; +#endif + + // Print "SOUND SELECT" text + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + +#ifdef VERSION_EU + print_hud_lut_string(HUD_LUT_DIFF, 47, 32, textSoundSelect[sLanguageMode]); + print_hud_lut_string(HUD_LUT_DIFF, 47, 101, textLanguageSelect[sLanguageMode]); +#else + print_hud_lut_string(HUD_LUT_DIFF, SOUND_HUD_X, 35, textSoundSelect); +#endif + + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); + + gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); + +#ifdef VERSION_EU // In EU their X position get increased each string + // Print sound mode names + for (mode = 0, textX = 90; mode < 3; textX += 70, mode++) { + if (mode == sSoundMode) { + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + } else { + gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, sTextBaseAlpha); + } + print_generic_string( + get_str_x_pos_from_center(textX, textSoundModes[sLanguageMode * 3 + mode], 10.0f), + 141, textSoundModes[sLanguageMode * 3 + mode]); + } + + // In EU, print language mode names + for (mode = 0, textX = 90; mode < 3; textX += 70, mode++) { + if (mode == sLanguageMode) { + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + } else { + gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, sTextBaseAlpha); + } + print_generic_string( + get_str_x_pos_from_center(textX, textLanguage[mode], 10.0f), + 72, textLanguage[mode]); + } +#else + // Print sound mode names + for (mode = 0; mode < 3; mode++) { + if (mode == sSoundMode) { + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + } else { + gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, sTextBaseAlpha); + } + #ifdef VERSION_US + // Mode names are centered correctly on US + textX = get_str_x_pos_from_center(mode * 74 + 87, textSoundModes[mode], 10.0f); + print_generic_string(textX, 87, textSoundModes[mode]); + #elif VERSION_JP + print_generic_string(mode * 74 + 67, 87, textSoundModes[mode]); + #endif + } +#endif + +#ifdef VERSION_EU + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + print_generic_string(182, 29, textReturn[sLanguageMode]); +#endif + + gSPDisplayList(gDisplayListHead++, dl_ia_text_end); +} + + +unsigned char textStarX[] = { TEXT_STAR_X }; + +/** + * Prints castle secret stars collected in a score menu save file. + */ +void print_score_file_castle_secret_stars(s8 fileIndex, s16 x, s16 y) { + unsigned char secretStarsText[20]; + // Print "[star] x" + print_menu_generic_string(x, y, textStarX); + // Print number of castle secret stars + int_to_str(save_file_get_total_star_count(fileIndex, 15, 24), secretStarsText); +#ifdef VERSION_EU + print_menu_generic_string(x + 20, y, secretStarsText); +#else + print_menu_generic_string(x + 16, y, secretStarsText); +#endif +} + +#if defined(VERSION_JP) || defined(VERSION_SH) + #define HISCORE_COIN_ICON_X 0 + #define HISCORE_COIN_TEXT_X 16 + #define HISCORE_COIN_NAMES_X 45 +#else + #define HISCORE_COIN_ICON_X 18 + #define HISCORE_COIN_TEXT_X 34 + #define HISCORE_COIN_NAMES_X 60 +#endif + +/** + * Prints course coins collected in a score menu save file. + */ +void print_score_file_course_coin_score(s8 fileIndex, s16 courseIndex, s16 x, s16 y) { + unsigned char coinScoreText[20]; + u8 stars = save_file_get_star_flags(fileIndex, courseIndex); + unsigned char textCoinX[] = { TEXT_COIN_X }; + unsigned char textStar[] = { TEXT_STAR }; +#if defined(VERSION_JP) || defined(VERSION_SH) + #define LENGTH 5 +#else + #define LENGTH 8 +#endif + unsigned char fileNames[][LENGTH] = { + { TEXT_4DASHES }, // huh? + { TEXT_SCORE_MARIO_A }, { TEXT_SCORE_MARIO_B }, { TEXT_SCORE_MARIO_C }, { TEXT_SCORE_MARIO_D }, + }; +#undef LENGTH + // MYSCORE + if (sScoreFileCoinScoreMode == 0) { + // Print "[coin] x" + print_menu_generic_string(x + 25, y, textCoinX); + // Print coin score + int_to_str(save_file_get_course_coin_score(fileIndex, courseIndex), coinScoreText); + print_menu_generic_string(x + 41, y, coinScoreText); + // If collected, print 100 coin star + if (stars & (1 << 6)) { + print_menu_generic_string(x + 70, y, textStar); + } + } + // HISCORE + else { + // Print "[coin] x" + print_menu_generic_string(x + HISCORE_COIN_ICON_X, y, textCoinX); + // Print coin highscore + int_to_str((u16) save_file_get_max_coin_score(courseIndex) & 0xFFFF, coinScoreText); + print_menu_generic_string(x + HISCORE_COIN_TEXT_X, y, coinScoreText); + // Print coin highscore file + print_menu_generic_string(x + HISCORE_COIN_NAMES_X, y, + fileNames[(save_file_get_max_coin_score(courseIndex) >> 16) & 0xFFFF]); + } +} + +/** + * Prints stars collected in a score menu save file. + */ +void print_score_file_star_score(s8 fileIndex, s16 courseIndex, s16 x, s16 y) { + s16 i = 0; + unsigned char starScoreText[19]; + u8 stars = save_file_get_star_flags(fileIndex, courseIndex); + s8 starCount = save_file_get_course_star_count(fileIndex, courseIndex); + // Don't count 100 coin star + if (stars & (1 << 6)) { + starCount--; + } + // Add 1 star character for every star collected + for (i = 0; i < starCount; i++) { + starScoreText[i] = DIALOG_CHAR_STAR_FILLED; + } + // Terminating byte + starScoreText[i] = DIALOG_CHAR_TERMINATOR; + print_menu_generic_string(x, y, starScoreText); +} + +#if defined(VERSION_JP) || defined(VERSION_SH) + #define MARIO_X 28 + #define FILE_LETTER_X 86 + #define LEVEL_NAME_X 23 + #define SECRET_STARS_X 152 + #define MYSCORE_X 237 + #define HISCORE_X 237 +#else + #define MARIO_X 25 + #define FILE_LETTER_X 95 + #define LEVEL_NAME_X 29 + #define SECRET_STARS_X 171 + #define MYSCORE_X 238 + #define HISCORE_X 231 +#endif + +#ifdef VERSION_EU +#include "game/segment7.h" +#endif + +/** + * Prints save file score strings that shows when a save file is chosen inside the score menu. + */ + void print_save_file_scores(s8 fileIndex) { +#ifndef VERSION_EU + unsigned char textMario[] = { TEXT_MARIO }; +#endif +#ifndef VERSION_US + unsigned char textFileLetter[] = { TEXT_ZERO }; +#endif +#if defined(VERSION_JP) || defined(VERSION_SH) + void **levelNameTable = segmented_to_virtual(seg2_course_name_table); +#endif +#ifndef VERSION_EU + unsigned char textHiScore[] = { TEXT_HI_SCORE }; + unsigned char textMyScore[] = { TEXT_MY_SCORE }; + #ifdef VERSION_US + unsigned char textFileLetter[] = { TEXT_ZERO }; + void **levelNameTable = segmented_to_virtual(seg2_course_name_table); + #endif +#else + void **levelNameTable; + switch (sLanguageMode) { + case LANGUAGE_ENGLISH: + levelNameTable = segmented_to_virtual(eu_course_strings_en_table); + break; + case LANGUAGE_FRENCH: + levelNameTable = segmented_to_virtual(eu_course_strings_fr_table); + break; + case LANGUAGE_GERMAN: + levelNameTable = segmented_to_virtual(eu_course_strings_de_table); + break; + } +#endif + + textFileLetter[0] = fileIndex + ASCII_TO_DIALOG('A'); // get letter of file selected + + // Print file name at top + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + print_hud_lut_string(HUD_LUT_DIFF, MARIO_X, 15, textMario); + print_hud_lut_string(HUD_LUT_GLOBAL, FILE_LETTER_X, 15, textFileLetter); + + // Print save file star count at top + print_save_file_star_count(fileIndex, 124, 15); + gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); + // Print course scores + gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_begin); + gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); + +//! Huge print list, for loops exist for a reason! +// PADCHAR is used to difference an x position value between +// JP and US when the course number is only one digit. +#if defined(VERSION_JP) || defined(VERSION_SH) + #define PADCHAR 0 + #define PRINT_COURSE_SCORES(courseIndex, pad) \ + print_menu_generic_string(23 + (pad * 3), 23 + 12 * courseIndex, segmented_to_virtual(levelNameTable[courseIndex - 1])); \ + print_score_file_star_score(fileIndex, courseIndex - 1, 152, 23 + 12 * courseIndex); \ + print_score_file_course_coin_score(fileIndex, courseIndex - 1, 213, 23 + 12 * courseIndex); +#else + #define PADCHAR 1 + #define PRINT_COURSE_SCORES(courseIndex, pad) \ + print_menu_generic_string(23 + (pad * 3), 23 + 12 * courseIndex, segmented_to_virtual(levelNameTable[courseIndex - 1])); \ + print_score_file_star_score(fileIndex, courseIndex - 1, 171, 23 + 12 * courseIndex); \ + print_score_file_course_coin_score(fileIndex, courseIndex - 1, 213, 23 + 12 * courseIndex); +#endif + // Course values are indexed, from Bob-omb Battlefield to Rainbow Ride + PRINT_COURSE_SCORES(COURSE_BOB, PADCHAR) // BOB + PRINT_COURSE_SCORES(COURSE_WF, PADCHAR) // WF + PRINT_COURSE_SCORES(COURSE_JRB, PADCHAR) // JRB + PRINT_COURSE_SCORES(COURSE_CCM, PADCHAR) // CCM + PRINT_COURSE_SCORES(COURSE_BBH, PADCHAR) // BBH + PRINT_COURSE_SCORES(COURSE_HMC, PADCHAR) // HMC + PRINT_COURSE_SCORES(COURSE_LLL, PADCHAR) // LLL + PRINT_COURSE_SCORES(COURSE_SSL, PADCHAR) // SSL + PRINT_COURSE_SCORES(COURSE_DDD, PADCHAR) // DDD + PRINT_COURSE_SCORES(COURSE_SL, 0) // SL + PRINT_COURSE_SCORES(COURSE_WDW, 0) // WDW + PRINT_COURSE_SCORES(COURSE_TTM, 0) // TTM + PRINT_COURSE_SCORES(COURSE_THI, 0) // THI + PRINT_COURSE_SCORES(COURSE_TTC, 0) // TTC + PRINT_COURSE_SCORES(COURSE_RR, 0) // RR +#undef PRINT_COURSE_SCORES +#undef PADCHAR + + // Print level name + print_menu_generic_string(LEVEL_NAME_X, 215, segmented_to_virtual(levelNameTable[25])); + // Print castle secret stars + print_score_file_castle_secret_stars(fileIndex, SECRET_STARS_X, 215); + + // Print current coin score mode + if (sScoreFileCoinScoreMode == 0) { +#ifdef VERSION_EU + print_menu_generic_string(get_str_x_pos_from_center(257, textMyScore[sLanguageMode], 10.0f), + 24, textMyScore[sLanguageMode]); +#else + print_menu_generic_string(MYSCORE_X, 24, textMyScore); +#endif + } else { +#ifdef VERSION_EU + print_menu_generic_string(get_str_x_pos_from_center(257, textHiScore[sLanguageMode], 10.0f), + 24,textHiScore[sLanguageMode]); +#else + print_menu_generic_string(HISCORE_X, 24, textHiScore); +#endif + } + gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_end); +} + +/** + * Prints file select strings depending on the menu selected. + * Also checks if all saves exists and defines text and main menu timers. + */ +static void print_file_select_strings(void) { + UNUSED s32 unused1; + UNUSED s32 unused2; + + create_dl_ortho_matrix(); + switch (sSelectedButtonID) { + case MENU_BUTTON_NONE: +#ifdef VERSION_EU + // Ultimately calls print_main_menu_strings, but prints main language strings first. + print_main_lang_strings(); +#else + print_main_menu_strings(); +#endif + break; + case MENU_BUTTON_SCORE: + print_score_menu_strings(); + sScoreFileCoinScoreMode = 0; + break; + case MENU_BUTTON_COPY: + print_copy_menu_strings(); + break; + case MENU_BUTTON_ERASE: + print_erase_menu_strings(); + break; + case MENU_BUTTON_SCORE_FILE_A: + print_save_file_scores(SAVE_FILE_A); + break; + case MENU_BUTTON_SCORE_FILE_B: + print_save_file_scores(SAVE_FILE_B); + break; + case MENU_BUTTON_SCORE_FILE_C: + print_save_file_scores(SAVE_FILE_C); + break; + case MENU_BUTTON_SCORE_FILE_D: + print_save_file_scores(SAVE_FILE_D); + break; + case MENU_BUTTON_SOUND_MODE: + print_sound_mode_menu_strings(); + break; + } + // If all 4 save file exists, define true to sAllFilesExist to prevent more copies in copy menu + if (save_file_exists(SAVE_FILE_A) == TRUE && save_file_exists(SAVE_FILE_B) == TRUE && + save_file_exists(SAVE_FILE_C) == TRUE && save_file_exists(SAVE_FILE_D) == TRUE) { + sAllFilesExist = TRUE; + } else { + sAllFilesExist = FALSE; + } + // Timers for menu alpha text and the main menu itself + if (sTextBaseAlpha < 250) { + sTextBaseAlpha += 10; + } + if (sMainMenuTimer < 1000) { + sMainMenuTimer += 1; + } +} + +/** + * Geo function that prints file select strings and the cursor. + */ +Gfx *geo_file_select_strings_and_menu_cursor(s32 callContext, UNUSED struct GraphNode *node, UNUSED Mat4 mtx) { + if (callContext == GEO_CONTEXT_RENDER) { + print_file_select_strings(); + print_menu_cursor(); + } + return NULL; +} + +/** + * Initiates file select values after Mario Screen. + * Relocates cursor position of the last save if the game goes back to the Mario Screen + * either completing a course choosing "SAVE & QUIT" or having a game over. + */ +s32 lvl_init_menu_values_and_cursor_pos(UNUSED s32 arg, UNUSED s32 unused) { +#ifdef VERSION_EU + s8 fileNum; +#endif + sSelectedButtonID = MENU_BUTTON_NONE; + sCurrentMenuLevel = MENU_LAYER_MAIN; + sTextBaseAlpha = 0; + // Place the cursor over the save file that was being played. + // gCurrSaveFileNum is 1 by default when the game boots, as such + // the cursor will point on Mario A save file. + switch (gCurrSaveFileNum) { + case 1: // File A + sCursorPos[0] = -94.0f; + sCursorPos[1] = 46.0f; + break; + case 2: // File B + sCursorPos[0] = 24.0f; + sCursorPos[1] = 46.0f; + break; + case 3: // File C + sCursorPos[0] = -94.0f; + sCursorPos[1] = 5.0f; + break; + case 4: // File D + sCursorPos[0] = 24.0f; + sCursorPos[1] = 5.0f; + break; + } + sClickPos[0] = -10000; + sClickPos[1] = -10000; + sCursorClickingTimer = 0; + sSelectedFileNum = 0; + sSelectedFileIndex = MENU_BUTTON_NONE; + sFadeOutText = FALSE; + sStatusMessageID = 0; + sTextFadeAlpha = 0; + sMainMenuTimer = 0; + sEraseYesNoHoverState = MENU_ERASE_HOVER_NONE; + sSoundMode = save_file_get_sound_mode(); +#ifdef VERSION_EU + sLanguageMode = eu_get_language(); + + for (fileNum = 0; fileNum < 4; fileNum++) { + if (save_file_exists(fileNum) == TRUE) { + sOpenLangSettings = FALSE; + break; + } else { + sOpenLangSettings = TRUE; + } + } +#endif + //! no return value +#ifdef AVOID_UB + return 0; +#endif +} + +/** + * Updates file select menu button objects so they can be interacted. + * When a save file is selected, it returns fileNum value + * defined in load_main_menu_save_file. + */ +s32 lvl_update_obj_and_load_file_selected(UNUSED s32 arg, UNUSED s32 unused) { + area_update_objects(); + return sSelectedFileNum; +} diff --git a/src/menu/file_select.cpp b/src/menu/file_select.cpp deleted file mode 100644 index 07204063..00000000 --- a/src/menu/file_select.cpp +++ /dev/null @@ -1,2787 +0,0 @@ -#include "file_select.hpp" - -#include -#include - -#include "audio/external.h" -#include "behavior_data.h" -#include "common/service_locator.hpp" -#include "dialog_ids.h" -#include "engine/behavior_script.h" -#include "engine/graph_node.h" -#include "engine/math_util.h" -#include "game/area.h" -#include "game/game_init.h" -#include "game/ingame_menu.h" -#include "game/object_helpers.h" -#include "game/object_list_processor.h" -#include "game/print.h" -#include "game/save_file.h" -#include "game/segment2.h" -#include "game/segment7.h" -#include "game/spawn_object.h" -#include "menu_button.hpp" -#include "sm64.h" -#include "text_strings.h" - -#include "eu_translation.h" - -#ifdef VERSION_EU -#undef LANGUAGE_FUNCTION -#define LANGUAGE_FUNCTION sLanguageMode -#endif - -/** - * @file file_select.cpp - * This file implements how the file select and it's menus render and function. - * That includes button IDs rendered as object models, strings, hand cursor, - * special menu messages and phases, button states and button clicked checks. - */ - -#ifdef VERSION_US -// The current sound mode is automatically centered on US due to -// the large length difference between options. -// sSoundTextY unused (EU supports its existence). -static s16 sSoundTextX; -static s16 sSoundTextY; -#endif - -//! @Bug (UB Array Access) For PAL, more buttons were added than the array was extended. -//! This causes no currently known issues on console (as the other variables are not changed -//! while this is used) but can cause issues with other compilers. -#ifdef VERSION_EU -#ifdef AVOID_UB -#define NUM_BUTTONS 36 -#else -#define NUM_BUTTONS 34 -#endif -#else -#define NUM_BUTTONS 32 -#endif - -// Amount of main menu buttons defined in the code called by spawn_object_rel_with_rot. -// See file_select.h for the names in MenuButtonTypes. -static struct Object *sMainMenuButtons[NUM_BUTTONS]; - -#ifdef VERSION_EU -// The current sound mode is automatically centered on US due to -// the large length difference between options. -// sSoundTextY is unused -static s16 sSoundTextX; -static s16 sSoundTextY; -#endif - -// Used to defined yes/no fade colors after a file is selected in the erase menu. -// sYesNoColor[0]: YES | sYesNoColor[1]: NO -static u8 sYesNoColor[2]; - -// Unused variable that is written to define centered X value for some strings. -#ifdef VERSION_EU -static s16 sCenteredX; -#endif - -// The button that is selected when it is clicked. -static s8 sSelectedButtonID = MENU_BUTTON_NONE; - -// Whether we are on the main menu or one of the submenus. -static s8 sCurrentMenuLevel = MENU_LAYER_MAIN; - -// Used for text opacifying. If it is below 250, it is constantly incremented. -static u8 sTextBaseAlpha = 0; - -// 2D position of the cursor on the screen. -// sCursorPos[0]: X | sCursorPos[1]: Y -static f32 sCursorPos[] = { 0, 0 }; - -// Determines which graphic to use for the cursor. -static s16 sCursorClickingTimer = 0; - -// Equal to sCursorPos if the cursor gets clicked, {-10000, -10000} otherwise. -static s16 sClickPos[] = { -10000, -10000 }; - -// Used for determining which file has been selected during copying and erasing. -static s8 sSelectedFileIndex = -1; - -// Whether to fade out text or not. -static s8 sFadeOutText = FALSE; - -// The message currently being displayed at the top of a menu. -static s8 sStatusMessageID = 0; - -// Used for text fading. The alpha value of text is calculated as -// sTextBaseAlpha - sTextFadeAlpha. -static u8 sTextFadeAlpha = 0; - -// File select timer that keeps counting until it reaches 1000. -// Used to prevent buttons from being clickable as soon as a menu loads. -// Gets reset when you click an empty save, existing saves in copy and erase menus -// and when you click yes/no in the erase confirmation prompt. -static s16 sMainMenuTimer = 0; - -// Sound mode menu buttonID, has different values compared to gSoundMode in audio. -// 0: gSoundMode = 0 (Stereo) | 1: gSoundMode = 3 (Mono) | 2: gSoundMode = 1 (Headset) -static s8 sSoundMode = 0; - -// Active language for PAL arrays, values defined similar to sSoundMode -// 0: English | 1: French | 2: German -#ifdef VERSION_EU -static s8 sLanguageMode = LANGUAGE_ENGLISH; -#endif - -// Tracks which button will be pressed in the erase confirmation prompt (yes/no). -static s8 sEraseYesNoHoverState = MENU_ERASE_HOVER_NONE; - -// Used for the copy menu, defines if the game as all 4 save slots with data. -// if TRUE, it doesn't allow copying more files. -static s8 sAllFilesExist = FALSE; - -// Defines the value of the save slot selected in the menu. -// Mario A: 1 | Mario B: 2 | Mario C: 3 | Mario D: 4 -static s8 sSelectedFileNum = 0; - -// Which coin score mode to use when scoring files. 0 for local -// coin high score, 1 for high score across all files. -static s8 sScoreFileCoinScoreMode = 0; - -// In PAL, if no save file exists, open the language menu so the user can find it. -#ifdef VERSION_EU -static s8 sOpenLangSettings = FALSE; -#endif - -#ifndef VERSION_EU -static unsigned char textReturn[] = { TEXT_RETURN }; -#else -static unsigned char textReturn[][8] = { { TEXT_RETURN }, { TEXT_RETURN_FR }, { TEXT_RETURN_DE } }; -#endif - -#ifndef VERSION_EU -static unsigned char textViewScore[] = { TEXT_CHECK_SCORE }; -#else -static unsigned char textViewScore[][12] = { { TEXT_CHECK_SCORE }, - { TEXT_CHECK_SCORE_FR }, - { TEXT_CHECK_SCORE_DE } }; -#endif - -#ifndef VERSION_EU -static unsigned char textCopyFileButton[] = { TEXT_COPY_FILE_BUTTON }; -#else -static unsigned char textCopyFileButton[][15] = { { TEXT_COPY_FILE }, - { TEXT_COPY_FILE_FR }, - { TEXT_COPY_FILE_DE } }; -#endif - -#ifndef VERSION_EU -static unsigned char textEraseFileButton[] = { TEXT_ERASE_FILE_BUTTON }; -#else -static unsigned char textEraseFileButton[][16] = { { TEXT_ERASE_FILE }, - { TEXT_ERASE_FILE_FR }, - { TEXT_ERASE_FILE_DE } }; -#endif - -#ifndef VERSION_EU -static unsigned char textSoundModes[][8] = { { TEXT_STEREO }, { TEXT_MONO }, { TEXT_HEADSET } }; -#endif - -static unsigned char textMarioA[] = { TEXT_FILE_MARIO_A }; -static unsigned char textMarioB[] = { TEXT_FILE_MARIO_B }; -static unsigned char textMarioC[] = { TEXT_FILE_MARIO_C }; -static unsigned char textMarioD[] = { TEXT_FILE_MARIO_D }; - -#ifndef VERSION_EU -static unsigned char textNew[] = { TEXT_NEW }; -static unsigned char starIcon[] = { GLYPH_STAR, (unsigned char) GLYPH_SPACE }; -static unsigned char xIcon[] = { GLYPH_MULTIPLY, (unsigned char) GLYPH_SPACE }; -#endif - -#ifndef VERSION_EU -static unsigned char textSelectFile[] = { TEXT_SELECT_FILE }; -#else -static unsigned char textSelectFile[][17] = { { TEXT_SELECT_FILE }, - { TEXT_SELECT_FILE_FR }, - { TEXT_SELECT_FILE_DE } }; -#endif - -#ifndef VERSION_EU -static unsigned char textScore[] = { TEXT_SCORE }; -#else -static unsigned char textScore[][9] = { { TEXT_SCORE }, { TEXT_SCORE_FR }, { TEXT_SCORE_DE } }; -#endif - -#ifndef VERSION_EU -static unsigned char textCopy[] = { TEXT_COPY }; -#else -static unsigned char textCopy[][9] = { { TEXT_COPY }, { TEXT_COPY_FR }, { TEXT_COPY_DE } }; -#endif - -#ifndef VERSION_EU -static unsigned char textErase[] = { TEXT_ERASE }; -#else -static unsigned char textErase[][8] = { { TEXT_ERASE }, { TEXT_ERASE_FR }, { TEXT_ERASE_DE } }; -#endif - -#ifdef VERSION_EU -static unsigned char textOption[][9] = { { TEXT_OPTION }, { TEXT_OPTION_FR }, { TEXT_OPTION_DE } }; -#endif - -#ifndef VERSION_EU -static unsigned char textCheckFile[] = { TEXT_CHECK_FILE }; -#else -static unsigned char textCheckFile[][18] = { { TEXT_CHECK_FILE }, - { TEXT_CHECK_FILE_FR }, - { TEXT_CHECK_FILE_DE } }; -#endif - -#ifndef VERSION_EU -static unsigned char textNoSavedDataExists[] = { TEXT_NO_SAVED_DATA_EXISTS }; -#else -static unsigned char textNoSavedDataExists[][30] = { { TEXT_NO_SAVED_DATA_EXISTS }, - { TEXT_NO_SAVED_DATA_EXISTS_FR }, - { TEXT_NO_SAVED_DATA_EXISTS_DE } }; -#endif - -#ifndef VERSION_EU -static unsigned char textCopyFile[] = { TEXT_COPY_FILE }; -#else -static unsigned char textCopyFile[][16] = { { TEXT_COPY_FILE_BUTTON }, - { TEXT_COPY_FILE_BUTTON_FR }, - { TEXT_COPY_FILE_BUTTON_DE } }; -#endif - -#ifndef VERSION_EU -static unsigned char textCopyItToWhere[] = { TEXT_COPY_IT_TO_WHERE }; -#else -static unsigned char textCopyItToWhere[][18] = { { TEXT_COPY_IT_TO_WHERE }, - { TEXT_COPY_IT_TO_WHERE_FR }, - { TEXT_COPY_IT_TO_WHERE_DE } }; -#endif - -#ifndef VERSION_EU -static unsigned char textNoSavedDataExistsCopy[] = { TEXT_NO_SAVED_DATA_EXISTS }; -#endif - -#ifndef VERSION_EU -static unsigned char textCopyCompleted[] = { TEXT_COPYING_COMPLETED }; -#else -static unsigned char textCopyCompleted[][18] = { { TEXT_COPYING_COMPLETED }, - { TEXT_COPYING_COMPLETED_FR }, - { TEXT_COPYING_COMPLETED_DE } }; -#endif - -#ifndef VERSION_EU -static unsigned char textSavedDataExists[] = { TEXT_SAVED_DATA_EXISTS }; -#else -static unsigned char textSavedDataExists[][20] = { { TEXT_SAVED_DATA_EXISTS }, - { TEXT_SAVED_DATA_EXISTS_FR }, - { TEXT_SAVED_DATA_EXISTS_DE } }; -#endif - -#ifndef VERSION_EU -static unsigned char textNoFileToCopyFrom[] = { TEXT_NO_FILE_TO_COPY_FROM }; -#else -static unsigned char textNoFileToCopyFrom[][21] = { { TEXT_NO_FILE_TO_COPY_FROM }, - { TEXT_NO_FILE_TO_COPY_FROM_FR }, - { TEXT_NO_FILE_TO_COPY_FROM_DE } }; -#endif - -#ifndef VERSION_EU -static unsigned char textYes[] = { TEXT_YES }; -#else -static unsigned char textYes[][4] = { { TEXT_YES }, { TEXT_YES_FR }, { TEXT_YES_DE } }; -#endif - -#ifndef VERSION_EU -static unsigned char textNo[] = { TEXT_NO }; -#else -static unsigned char textNo[][5] = { { TEXT_NO }, { TEXT_NO_FR }, { TEXT_NO_DE } }; -#endif - -#ifdef VERSION_EU -// In EU, Erase File and Sound Select strings are outside it's print string function -static unsigned char textEraseFile[][17] = { { TEXT_ERASE_FILE_BUTTON }, - { TEXT_ERASE_FILE_BUTTON_FR }, - { TEXT_ERASE_FILE_BUTTON_DE } }; -static unsigned char textSure[][8] = { { TEXT_SURE }, { TEXT_SURE_FR }, { TEXT_SURE_DE } }; -static unsigned char textMarioAJustErased[][20] = { { TEXT_FILE_MARIO_A_JUST_ERASED }, - { TEXT_FILE_MARIO_A_JUST_ERASED_FR }, - { TEXT_FILE_MARIO_A_JUST_ERASED_DE } }; - -static unsigned char textSoundSelect[][13] = { { TEXT_SOUND_SELECT }, - { TEXT_SOUND_SELECT_FR }, - { TEXT_SOUND_SELECT_DE } }; - -static unsigned char textLanguageSelect[][17] = { { TEXT_LANGUAGE_SELECT }, - { TEXT_LANGUAGE_SELECT_FR }, - { TEXT_LANGUAGE_SELECT_DE } }; - -static unsigned char textSoundModes[][10] = { - { TEXT_STEREO }, { TEXT_MONO }, { TEXT_HEADSET }, { TEXT_STEREO_FR }, { TEXT_MONO_FR }, - { TEXT_HEADSET_FR }, { TEXT_STEREO_DE }, { TEXT_MONO_DE }, { TEXT_HEADSET_DE } -}; - -static unsigned char textLanguage[][9] = { { TEXT_ENGLISH }, { TEXT_FRENCH }, { TEXT_GERMAN } }; - -static unsigned char textMario[] = { TEXT_MARIO }; -static unsigned char textHiScore[][15] = { { TEXT_HI_SCORE }, - { TEXT_HI_SCORE_FR }, - { TEXT_HI_SCORE_DE } }; -static unsigned char textMyScore[][10] = { { TEXT_MY_SCORE }, - { TEXT_MY_SCORE_FR }, - { TEXT_MY_SCORE_DE } }; - -static unsigned char textNew[][5] = { { TEXT_NEW }, { TEXT_NEW_FR }, { TEXT_NEW_DE } }; -static unsigned char starIcon[] = { GLYPH_STAR, GLYPH_SPACE }; -static unsigned char xIcon[] = { GLYPH_MULTIPLY, GLYPH_SPACE }; -#endif - -/** - * Yellow Background Menu Initial Action - * Rotates the background at 180 grades and it's scale. - * Although the scale is properly applied in the loop function. - */ -void beh_yellow_background_menu_init(void) { - gCurrentObject->oFaceAngleYaw = 0x8000; - gCurrentObject->oMenuButtonScale = 9.0f; -} - -/** - * Yellow Background Menu Loop Action - * Properly scales the background in the main menu. - */ -void beh_yellow_background_menu_loop(void) { - cur_obj_scale(9.0f); -} - -/** - * Check if a button was clicked. - * depth = 200.0 for main menu, 22.0 for submenus. - */ -s32 check_clicked_button(s16 x, s16 y, f32 depth) { - f32 a = 52.4213; - f32 newX = ((f32) x * 160.0) / (a * depth); - f32 newY = ((f32) y * 120.0) / (a * 3 / 4 * depth); - s16 maxX = newX + 25.0f; - s16 minX = newX - 25.0f; - s16 maxY = newY + 21.0f; - s16 minY = newY - 21.0f; - - if (sClickPos[0] < maxX && minX < sClickPos[0] && sClickPos[1] < maxY && minY < sClickPos[1]) { - return TRUE; - } - return FALSE; -} - -/** - * Grow from main menu, used by selecting files and menus. - */ -static void bhv_menu_button_growing_from_main_menu(struct Object *button) { - auto buttonWrapper = MenuButton(button); - buttonWrapper.grow_from_main_menu(); -} - -/** - * Shrink back to main menu, used to return back while inside menus. - */ -static void bhv_menu_button_shrinking_to_main_menu(struct Object *button) { - auto buttonWrapper = MenuButton(button); - buttonWrapper.shrink_to_main_menu(); -} - -/** - * Grow from submenu, used by selecting a file in the score menu. - */ -static void bhv_menu_button_growing_from_submenu(struct Object *button) { - auto buttonWrapper = MenuButton(button); - buttonWrapper.grow_from_submenu(); -} - -/** - * Shrink back to submenu, used to return back while inside a score save menu. - */ -static void bhv_menu_button_shrinking_to_submenu(struct Object *button) { - auto buttonWrapper = MenuButton(button); - buttonWrapper.shrink_to_submenu(); -} - -/** - * A small increase and decrease in size. - * Used by failed copy/erase/score operations and sound mode select. - */ -static void bhv_menu_button_zoom_in_out(struct Object *button) { - if (sCurrentMenuLevel == MENU_LAYER_MAIN) { - if (button->oMenuButtonTimer < 4) { - button->oParentRelativePosZ -= 20.0f; - } - if (button->oMenuButtonTimer >= 4) { - button->oParentRelativePosZ += 20.0f; - } - } else { - if (button->oMenuButtonTimer < 4) { - button->oParentRelativePosZ += 20.0f; - } - if (button->oMenuButtonTimer >= 4) { - button->oParentRelativePosZ -= 20.0f; - } - } - button->oMenuButtonTimer++; - if (button->oMenuButtonTimer == 8) { - button->oMenuButtonState = MENU_BUTTON_STATE_DEFAULT; - button->oMenuButtonTimer = 0; - } -} - -/** - * A small temporary increase in size. - * Used while selecting a target copy/erase file or yes/no erase confirmation prompt. - */ -static void bhv_menu_button_zoom_in(struct Object *button) { - button->oMenuButtonScale += 0.0022; - button->oMenuButtonTimer++; - if (button->oMenuButtonTimer == 10) { - button->oMenuButtonState = MENU_BUTTON_STATE_DEFAULT; - button->oMenuButtonTimer = 0; - } -} - -/** - * A small temporary decrease in size. - * Used after selecting a target copy/erase file or - * yes/no erase confirmation prompt to undo the zoom in. - */ -static void bhv_menu_button_zoom_out(struct Object *button) { - button->oMenuButtonScale -= 0.0022; - button->oMenuButtonTimer++; - if (button->oMenuButtonTimer == 10) { - button->oMenuButtonState = MENU_BUTTON_STATE_DEFAULT; - button->oMenuButtonTimer = 0; - } -} - -/** - * Menu Buttons Menu Initial Action - * Aligns menu buttons so they can stay in their original - * positions when you choose a button. - */ -void bhv_menu_button_init(void) { - gCurrentObject->oMenuButtonOrigPosX = gCurrentObject->oParentRelativePosX; - gCurrentObject->oMenuButtonOrigPosY = gCurrentObject->oParentRelativePosY; -} - -/** - * Menu Buttons Menu Loop Action - * Handles the functions of the button states and - * object scale for each button. - */ -void bhv_menu_button_loop(void) { - switch (gCurrentObject->oMenuButtonState) { - case MENU_BUTTON_STATE_DEFAULT: // Button state - gCurrentObject->oMenuButtonOrigPosZ = gCurrentObject->oPosZ; - break; - case MENU_BUTTON_STATE_GROWING: // Switching from button to menu state - if (sCurrentMenuLevel == MENU_LAYER_MAIN) { - bhv_menu_button_growing_from_main_menu(gCurrentObject); - } - if (sCurrentMenuLevel == MENU_LAYER_SUBMENU) { - bhv_menu_button_growing_from_submenu(gCurrentObject); // Only used for score files - } - sTextBaseAlpha = 0; - sCursorClickingTimer = 4; - break; - case MENU_BUTTON_STATE_FULLSCREEN: // Menu state - break; - case MENU_BUTTON_STATE_SHRINKING: // Switching from menu to button state - if (sCurrentMenuLevel == MENU_LAYER_MAIN) { - bhv_menu_button_shrinking_to_main_menu(gCurrentObject); - } - if (sCurrentMenuLevel == MENU_LAYER_SUBMENU) { - bhv_menu_button_shrinking_to_submenu(gCurrentObject); // Only used for score files - } - sTextBaseAlpha = 0; - sCursorClickingTimer = 4; - break; - case MENU_BUTTON_STATE_ZOOM_IN_OUT: - bhv_menu_button_zoom_in_out(gCurrentObject); - sCursorClickingTimer = 4; - break; - case MENU_BUTTON_STATE_ZOOM_IN: - bhv_menu_button_zoom_in(gCurrentObject); - sCursorClickingTimer = 4; - break; - case MENU_BUTTON_STATE_ZOOM_OUT: - bhv_menu_button_zoom_out(gCurrentObject); - sCursorClickingTimer = 4; - break; - } - cur_obj_scale(gCurrentObject->oMenuButtonScale); -} - -/** - * Handles how to exit the score file menu using button states. - */ -void exit_score_file_to_score_menu(struct Object *scoreFileButton, s8 scoreButtonID) { - // Begin exit - if (scoreFileButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN && sCursorClickingTimer == 2) { - play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs); - scoreFileButton->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING; - } - // End exit - if (scoreFileButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT) { - sSelectedButtonID = scoreButtonID; - if (sCurrentMenuLevel == MENU_LAYER_SUBMENU) { - sCurrentMenuLevel = MENU_LAYER_MAIN; - } - } -} - -/** - * Render buttons for the score menu. - * Also check if the save file exists to render a different Mario button. - */ -void render_score_menu_buttons(struct Object *scoreButton) { - // File A - if (save_file_exists(SAVE_FILE_A) == TRUE) { - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A] = spawn_object_rel_with_rot( - scoreButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, 711, 311, -100, 0, -0x8000, 0); - } else { - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A] = spawn_object_rel_with_rot( - scoreButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, 311, -100, 0, -0x8000, 0); - } - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A]->oMenuButtonScale = 0.11111111f; - // File B - if (save_file_exists(SAVE_FILE_B) == TRUE) { - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B] = spawn_object_rel_with_rot( - scoreButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, -166, 311, -100, 0, -0x8000, 0); - } else { - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B] = spawn_object_rel_with_rot( - scoreButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, -166, 311, -100, 0, -0x8000, 0); - } - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B]->oMenuButtonScale = 0.11111111f; - // File C - if (save_file_exists(SAVE_FILE_C) == TRUE) { - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_C] = spawn_object_rel_with_rot( - scoreButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, 711, 0, -100, 0, -0x8000, 0); - } else { - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_C] = spawn_object_rel_with_rot( - scoreButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, 0, -100, 0, -0x8000, 0); - } - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_C]->oMenuButtonScale = 0.11111111f; - // File D - if (save_file_exists(SAVE_FILE_D) == TRUE) { - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_D] = spawn_object_rel_with_rot( - scoreButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, -166, 0, -100, 0, -0x8000, 0); - } else { - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_D] = spawn_object_rel_with_rot( - scoreButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, -166, 0, -100, 0, -0x8000, 0); - } - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_D]->oMenuButtonScale = 0.11111111f; - // Return to main menu button - sMainMenuButtons[MENU_BUTTON_SCORE_RETURN] = spawn_object_rel_with_rot( - scoreButton, MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, bhvMenuButton, 711, -388, -100, 0, -0x8000, 0); - sMainMenuButtons[MENU_BUTTON_SCORE_RETURN]->oMenuButtonScale = 0.11111111f; - // Switch to copy menu button - sMainMenuButtons[MENU_BUTTON_SCORE_COPY_FILE] = spawn_object_rel_with_rot( - scoreButton, MODEL_MAIN_MENU_BLUE_COPY_BUTTON, bhvMenuButton, 0, -388, -100, 0, -0x8000, 0); - sMainMenuButtons[MENU_BUTTON_SCORE_COPY_FILE]->oMenuButtonScale = 0.11111111f; - // Switch to erase menu button - sMainMenuButtons[MENU_BUTTON_SCORE_ERASE_FILE] = spawn_object_rel_with_rot( - scoreButton, MODEL_MAIN_MENU_RED_ERASE_BUTTON, bhvMenuButton, -711, -388, -100, 0, -0x8000, 0); - sMainMenuButtons[MENU_BUTTON_SCORE_ERASE_FILE]->oMenuButtonScale = 0.11111111f; -} - -#ifdef VERSION_EU -#define SCORE_TIMER 46 -#else -#define SCORE_TIMER 31 -#endif -/** - * In the score menu, checks if a button was clicked to play a sound, button state and other functions. - */ -void check_score_menu_clicked_buttons(struct Object *scoreButton) { - if (scoreButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { - s32 buttonID; - // Configure score menu button group - for (buttonID = MENU_BUTTON_SCORE_MIN; buttonID < MENU_BUTTON_SCORE_MAX; buttonID++) { - s16 buttonX = sMainMenuButtons[buttonID]->oPosX; - s16 buttonY = sMainMenuButtons[buttonID]->oPosY; - - if (check_clicked_button(buttonX, buttonY, 22.0f) == TRUE && sMainMenuTimer >= SCORE_TIMER) { - // If menu button clicked, select it - if (buttonID == MENU_BUTTON_SCORE_RETURN || buttonID == MENU_BUTTON_SCORE_COPY_FILE - || buttonID == MENU_BUTTON_SCORE_ERASE_FILE) { - play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); - sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; - sSelectedButtonID = buttonID; - } else { // Check if a save file is clicked - if (sMainMenuTimer >= SCORE_TIMER) { - // If clicked in a existing save file, select it too see it's score - if (save_file_exists(buttonID - MENU_BUTTON_SCORE_MIN) == TRUE) { - play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); - sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_GROWING; - sSelectedButtonID = buttonID; - } else { - // If clicked in a non-existing save file, play buzz sound - play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs); - sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; - if (sMainMenuTimer >= SCORE_TIMER) { - sFadeOutText = TRUE; - sMainMenuTimer = 0; - } - } - } - } - sCurrentMenuLevel = MENU_LAYER_SUBMENU; - break; - } - } - } -} -#undef SCORE_TIMER - -/** - * Render buttons for the copy menu. - * Also check if the save file exists to render a different Mario button. - */ -void render_copy_menu_buttons(struct Object *copyButton) { - // File A - if (save_file_exists(SAVE_FILE_A) == TRUE) { - sMainMenuButtons[MENU_BUTTON_COPY_FILE_A] = spawn_object_rel_with_rot( - copyButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, 711, 311, -100, 0, -0x8000, 0); - } else { - sMainMenuButtons[MENU_BUTTON_COPY_FILE_A] = spawn_object_rel_with_rot( - copyButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, 311, -100, 0, -0x8000, 0); - } - sMainMenuButtons[MENU_BUTTON_COPY_FILE_A]->oMenuButtonScale = 0.11111111f; - // File B - if (save_file_exists(SAVE_FILE_B) == TRUE) { - sMainMenuButtons[MENU_BUTTON_COPY_FILE_B] = spawn_object_rel_with_rot( - copyButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, -166, 311, -100, 0, -0x8000, 0); - } else { - sMainMenuButtons[MENU_BUTTON_COPY_FILE_B] = spawn_object_rel_with_rot( - copyButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, -166, 311, -100, 0, -0x8000, 0); - } - sMainMenuButtons[MENU_BUTTON_COPY_FILE_B]->oMenuButtonScale = 0.11111111f; - // File C - if (save_file_exists(SAVE_FILE_C) == TRUE) { - sMainMenuButtons[MENU_BUTTON_COPY_FILE_C] = spawn_object_rel_with_rot( - copyButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, 711, 0, -100, 0, -0x8000, 0); - } else { - sMainMenuButtons[MENU_BUTTON_COPY_FILE_C] = spawn_object_rel_with_rot( - copyButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, 0, -100, 0, -0x8000, 0); - } - sMainMenuButtons[MENU_BUTTON_COPY_FILE_C]->oMenuButtonScale = 0.11111111f; - // File D - if (save_file_exists(SAVE_FILE_D) == TRUE) { - sMainMenuButtons[MENU_BUTTON_COPY_FILE_D] = spawn_object_rel_with_rot( - copyButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, -166, 0, -100, 0, -0x8000, 0); - } else { - sMainMenuButtons[MENU_BUTTON_COPY_FILE_D] = spawn_object_rel_with_rot( - copyButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, -166, 0, -100, 0, -0x8000, 0); - } - sMainMenuButtons[MENU_BUTTON_COPY_FILE_D]->oMenuButtonScale = 0.11111111f; - // Return to main menu button - sMainMenuButtons[MENU_BUTTON_COPY_RETURN] = spawn_object_rel_with_rot( - copyButton, MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, bhvMenuButton, 711, -388, -100, 0, -0x8000, 0); - sMainMenuButtons[MENU_BUTTON_COPY_RETURN]->oMenuButtonScale = 0.11111111f; - // Switch to scire menu button - sMainMenuButtons[MENU_BUTTON_COPY_CHECK_SCORE] = spawn_object_rel_with_rot( - copyButton, MODEL_MAIN_MENU_GREEN_SCORE_BUTTON, bhvMenuButton, 0, -388, -100, 0, -0x8000, 0); - sMainMenuButtons[MENU_BUTTON_COPY_CHECK_SCORE]->oMenuButtonScale = 0.11111111f; - // Switch to erase menu button - sMainMenuButtons[MENU_BUTTON_COPY_ERASE_FILE] = spawn_object_rel_with_rot( - copyButton, MODEL_MAIN_MENU_RED_ERASE_BUTTON, bhvMenuButton, -711, -388, -100, 0, -0x8000, 0); - sMainMenuButtons[MENU_BUTTON_COPY_ERASE_FILE]->oMenuButtonScale = 0.11111111f; -} - -#ifdef VERSION_EU -#define BUZZ_TIMER 36 -#else -#define BUZZ_TIMER 21 -#endif - -/** - * Copy Menu phase actions that handles what to do when a file button is clicked. - */ -void copy_action_file_button(struct Object *copyButton, s32 copyFileButtonID) { - switch (copyButton->oMenuButtonActionPhase) { - case COPY_PHASE_MAIN: // Copy Menu Main Phase - if (sAllFilesExist == TRUE) { // Don't enable copy if all save files exists - return; - } - if (save_file_exists(copyFileButtonID - MENU_BUTTON_COPY_MIN) == TRUE) { - // If clicked in a existing save file, ask where it wants to copy - play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); - sMainMenuButtons[copyFileButtonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN; - sSelectedFileIndex = copyFileButtonID - MENU_BUTTON_COPY_MIN; - copyButton->oMenuButtonActionPhase = COPY_PHASE_COPY_WHERE; - sFadeOutText = TRUE; - sMainMenuTimer = 0; - } else { - // If clicked in a non-existing save file, play buzz sound - play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs); - sMainMenuButtons[copyFileButtonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; - if (sMainMenuTimer >= BUZZ_TIMER) { - sFadeOutText = TRUE; - sMainMenuTimer = 0; - } - } - break; - case COPY_PHASE_COPY_WHERE: // Copy Menu "COPY IT TO WHERE?" Phase (after a file is selected) - sMainMenuButtons[copyFileButtonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; - if (save_file_exists(copyFileButtonID - MENU_BUTTON_COPY_MIN) == FALSE) { - // If clicked in a non-existing save file, copy the file - play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs); - copyButton->oMenuButtonActionPhase = COPY_PHASE_COPY_COMPLETE; - sFadeOutText = TRUE; - sMainMenuTimer = 0; - save_file_copy(sSelectedFileIndex, copyFileButtonID - MENU_BUTTON_COPY_MIN); - sMainMenuButtons[copyFileButtonID]->header.gfx.sharedChild = - gLoadedGraphNodes[MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE]; - sMainMenuButtons[copyFileButtonID - MENU_BUTTON_COPY_MIN]->header.gfx.sharedChild = - gLoadedGraphNodes[MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE]; - } else { - // If clicked in a existing save file, play buzz sound - if (MENU_BUTTON_COPY_FILE_A + sSelectedFileIndex == copyFileButtonID) { - play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs); - sMainMenuButtons[MENU_BUTTON_COPY_FILE_A + sSelectedFileIndex]->oMenuButtonState = - MENU_BUTTON_STATE_ZOOM_OUT; - copyButton->oMenuButtonActionPhase = COPY_PHASE_MAIN; - sFadeOutText = TRUE; - return; - } - if (sMainMenuTimer >= BUZZ_TIMER) { - sFadeOutText = TRUE; - sMainMenuTimer = 0; - } - } - break; - } -} - -#ifdef VERSION_EU -#define ACTION_TIMER 41 -#define MAIN_RETURN_TIMER 36 -#else -#define ACTION_TIMER 31 -#define MAIN_RETURN_TIMER 31 -#endif - -/** - * In the copy menu, checks if a button was clicked to play a sound, button state and other functions. - */ -void check_copy_menu_clicked_buttons(struct Object *copyButton) { - if (copyButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { - s32 buttonID; - // Configure copy menu button group - for (buttonID = MENU_BUTTON_COPY_MIN; buttonID < MENU_BUTTON_COPY_MAX; buttonID++) { - s16 buttonX = sMainMenuButtons[buttonID]->oPosX; - s16 buttonY = sMainMenuButtons[buttonID]->oPosY; - - if (check_clicked_button(buttonX, buttonY, 22.0f) == TRUE) { - // If menu button clicked, select it - if (buttonID == MENU_BUTTON_COPY_RETURN || buttonID == MENU_BUTTON_COPY_CHECK_SCORE - || buttonID == MENU_BUTTON_COPY_ERASE_FILE) { - if (copyButton->oMenuButtonActionPhase == COPY_PHASE_MAIN) { - play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); - sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; - sSelectedButtonID = buttonID; - } - } else { - // Check if a file button is clicked to play a copy action - if (sMainMenuButtons[buttonID]->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT - && sMainMenuTimer >= ACTION_TIMER) { - copy_action_file_button(copyButton, buttonID); - } - } - sCurrentMenuLevel = MENU_LAYER_SUBMENU; - break; - } - } - - // After copy is complete, return to main copy phase - if (copyButton->oMenuButtonActionPhase == COPY_PHASE_COPY_COMPLETE - && sMainMenuTimer >= MAIN_RETURN_TIMER) { - copyButton->oMenuButtonActionPhase = COPY_PHASE_MAIN; - sMainMenuButtons[MENU_BUTTON_COPY_MIN + sSelectedFileIndex]->oMenuButtonState = - MENU_BUTTON_STATE_ZOOM_OUT; - } - } -} - -/** - * Render buttons for the erase menu. - * Also check if the save file exists to render a different Mario button. - */ -void render_erase_menu_buttons(struct Object *eraseButton) { - // File A - if (save_file_exists(SAVE_FILE_A) == TRUE) { - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_A] = spawn_object_rel_with_rot( - eraseButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, 711, 311, -100, 0, -0x8000, 0); - } else { - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_A] = spawn_object_rel_with_rot( - eraseButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, 311, -100, 0, -0x8000, 0); - } - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_A]->oMenuButtonScale = 0.11111111f; - // File B - if (save_file_exists(SAVE_FILE_B) == TRUE) { - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_B] = spawn_object_rel_with_rot( - eraseButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, -166, 311, -100, 0, -0x8000, 0); - } else { - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_B] = spawn_object_rel_with_rot( - eraseButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, -166, 311, -100, 0, -0x8000, 0); - } - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_B]->oMenuButtonScale = 0.11111111f; - // File C - if (save_file_exists(SAVE_FILE_C) == TRUE) { - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_C] = spawn_object_rel_with_rot( - eraseButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, 711, 0, -100, 0, -0x8000, 0); - } else { - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_C] = spawn_object_rel_with_rot( - eraseButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, 0, -100, 0, -0x8000, 0); - } - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_C]->oMenuButtonScale = 0.11111111f; - // File D - if (save_file_exists(SAVE_FILE_D) == TRUE) { - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_D] = spawn_object_rel_with_rot( - eraseButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, -166, 0, -100, 0, -0x8000, 0); - } else { - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_D] = spawn_object_rel_with_rot( - eraseButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, -166, 0, -100, 0, -0x8000, 0); - } - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_D]->oMenuButtonScale = 0.11111111f; - // Return to main menu button - sMainMenuButtons[MENU_BUTTON_ERASE_RETURN] = spawn_object_rel_with_rot( - eraseButton, MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, bhvMenuButton, 711, -388, -100, 0, -0x8000, 0); - sMainMenuButtons[MENU_BUTTON_ERASE_RETURN]->oMenuButtonScale = 0.11111111f; - // Switch to score menu button - sMainMenuButtons[MENU_BUTTON_ERASE_CHECK_SCORE] = spawn_object_rel_with_rot( - eraseButton, MODEL_MAIN_MENU_GREEN_SCORE_BUTTON, bhvMenuButton, 0, -388, -100, 0, -0x8000, 0); - sMainMenuButtons[MENU_BUTTON_ERASE_CHECK_SCORE]->oMenuButtonScale = 0.11111111f; - // Switch to copy menu button - sMainMenuButtons[MENU_BUTTON_ERASE_COPY_FILE] = spawn_object_rel_with_rot( - eraseButton, MODEL_MAIN_MENU_BLUE_COPY_BUTTON, bhvMenuButton, -711, -388, -100, 0, -0x8000, 0); - sMainMenuButtons[MENU_BUTTON_ERASE_COPY_FILE]->oMenuButtonScale = 0.11111111f; -} - -/** - * Erase Menu phase actions that handles what to do when a file button is clicked. - */ -void erase_action_file_button(struct Object *eraseButton, s32 eraseFileButtonID) { - switch (eraseButton->oMenuButtonActionPhase) { - case ERASE_PHASE_MAIN: // Erase Menu Main Phase - if (save_file_exists(eraseFileButtonID - MENU_BUTTON_ERASE_MIN) == TRUE) { - // If clicked in a existing save file, ask if it wants to delete it - play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); - sMainMenuButtons[eraseFileButtonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN; - sSelectedFileIndex = eraseFileButtonID - MENU_BUTTON_ERASE_MIN; - eraseButton->oMenuButtonActionPhase = ERASE_PHASE_PROMPT; - sFadeOutText = TRUE; - sMainMenuTimer = 0; - } else { - // If clicked in a non-existing save file, play buzz sound - play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs); - sMainMenuButtons[eraseFileButtonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; - - if (sMainMenuTimer >= BUZZ_TIMER) { - sFadeOutText = TRUE; - sMainMenuTimer = 0; - } - } - break; - case ERASE_PHASE_PROMPT: // Erase Menu "SURE? YES NO" Phase (after a file is selected) - if (MENU_BUTTON_ERASE_MIN + sSelectedFileIndex == eraseFileButtonID) { - // If clicked in a existing save file, play click sound and zoom out button - // Note: The prompt functions are actually called when the ERASE_MSG_PROMPT - // message is displayed with print_erase_menu_prompt - play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); - sMainMenuButtons[MENU_BUTTON_ERASE_MIN + sSelectedFileIndex]->oMenuButtonState = - MENU_BUTTON_STATE_ZOOM_OUT; - eraseButton->oMenuButtonActionPhase = ERASE_PHASE_MAIN; - sFadeOutText = TRUE; - } - break; - } -} -#undef BUZZ_TIMER - -/** - * In the erase menu, checks if a button was clicked to play a sound, button state and other functions. - */ -void check_erase_menu_clicked_buttons(struct Object *eraseButton) { - if (eraseButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { - s32 buttonID; - // Configure erase menu button group - for (buttonID = MENU_BUTTON_ERASE_MIN; buttonID < MENU_BUTTON_ERASE_MAX; buttonID++) { - s16 buttonX = sMainMenuButtons[buttonID]->oPosX; - s16 buttonY = sMainMenuButtons[buttonID]->oPosY; - - if (check_clicked_button(buttonX, buttonY, 22.0f) == TRUE) { - // If menu button clicked, select it - if (buttonID == MENU_BUTTON_ERASE_RETURN || buttonID == MENU_BUTTON_ERASE_CHECK_SCORE - || buttonID == MENU_BUTTON_ERASE_COPY_FILE) { - if (eraseButton->oMenuButtonActionPhase == ERASE_PHASE_MAIN) { - play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); - sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; - sSelectedButtonID = buttonID; - } - } else { - // Check if a file button is clicked to play an erase action - if (sMainMenuTimer >= ACTION_TIMER) { - erase_action_file_button(eraseButton, buttonID); - } - } - sCurrentMenuLevel = MENU_LAYER_SUBMENU; - break; - } - } - // After erase is complete, return to main erase phase - if (eraseButton->oMenuButtonActionPhase == ERASE_PHASE_MARIO_ERASED - && sMainMenuTimer >= MAIN_RETURN_TIMER) { - eraseButton->oMenuButtonActionPhase = ERASE_PHASE_MAIN; - sMainMenuButtons[MENU_BUTTON_ERASE_MIN + sSelectedFileIndex]->oMenuButtonState = - MENU_BUTTON_STATE_ZOOM_OUT; - } - } -} -#undef ACTION_TIMER -#undef MAIN_RETURN_TIMER - -#ifdef VERSION_EU -#define SOUND_BUTTON_Y 388 -#else -#define SOUND_BUTTON_Y 0 -#endif - -/** - * Render buttons for the sound mode menu. - */ -void render_sound_mode_menu_buttons(struct Object *soundModeButton) { - // Stereo option button - sMainMenuButtons[MENU_BUTTON_STEREO] = - spawn_object_rel_with_rot(soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, 533, - SOUND_BUTTON_Y, -100, 0, -0x8000, 0); - sMainMenuButtons[MENU_BUTTON_STEREO]->oMenuButtonScale = 0.11111111f; - // Mono option button - sMainMenuButtons[MENU_BUTTON_MONO] = - spawn_object_rel_with_rot(soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, 0, - SOUND_BUTTON_Y, -100, 0, -0x8000, 0); - sMainMenuButtons[MENU_BUTTON_MONO]->oMenuButtonScale = 0.11111111f; - // Headset option button - sMainMenuButtons[MENU_BUTTON_HEADSET] = - spawn_object_rel_with_rot(soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, -533, - SOUND_BUTTON_Y, -100, 0, -0x8000, 0); - sMainMenuButtons[MENU_BUTTON_HEADSET]->oMenuButtonScale = 0.11111111f; - -#ifdef VERSION_EU - // English option button - sMainMenuButtons[MENU_BUTTON_LANGUAGE_ENGLISH] = spawn_object_rel_with_rot( - soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, 533, -111, -100, 0, -0x8000, 0); - sMainMenuButtons[MENU_BUTTON_LANGUAGE_ENGLISH]->oMenuButtonScale = 0.11111111f; - // French option button - sMainMenuButtons[MENU_BUTTON_LANGUAGE_FRENCH] = spawn_object_rel_with_rot( - soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, 0, -111, -100, 0, -0x8000, 0); - sMainMenuButtons[MENU_BUTTON_LANGUAGE_FRENCH]->oMenuButtonScale = 0.11111111f; - // German option button - sMainMenuButtons[MENU_BUTTON_LANGUAGE_GERMAN] = spawn_object_rel_with_rot( - soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, -533, -111, -100, 0, -0x8000, 0); - sMainMenuButtons[MENU_BUTTON_LANGUAGE_GERMAN]->oMenuButtonScale = 0.11111111f; - - // Return button - sMainMenuButtons[MENU_BUTTON_LANGUAGE_RETURN] = spawn_object_rel_with_rot( - soundModeButton, MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, bhvMenuButton, 0, -533, -100, 0, -0x8000, 0); - sMainMenuButtons[MENU_BUTTON_LANGUAGE_RETURN]->oMenuButtonScale = 0.11111111f; -#else - // Zoom in current selection - sMainMenuButtons[MENU_BUTTON_OPTION_MIN + sSoundMode]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN; -#endif -} -#undef SOUND_BUTTON_Y - -/** - * In the sound mode menu, checks if a button was clicked to change sound mode & button state. - */ -void check_sound_mode_menu_clicked_buttons(struct Object *soundModeButton) { - if (soundModeButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { - s32 buttonID; - // Configure sound mode menu button group - for (buttonID = MENU_BUTTON_OPTION_MIN; buttonID < MENU_BUTTON_OPTION_MAX; buttonID++) { - s16 buttonX = sMainMenuButtons[buttonID]->oPosX; - s16 buttonY = sMainMenuButtons[buttonID]->oPosY; - - if (check_clicked_button(buttonX, buttonY, 22.0f) == TRUE) { - // If sound mode button clicked, select it and define sound mode - // The check will always be true because of the group configured above (In JP & US) - if (buttonID == MENU_BUTTON_STEREO || buttonID == MENU_BUTTON_MONO - || buttonID == MENU_BUTTON_HEADSET) { - if (soundModeButton->oMenuButtonActionPhase == SOUND_MODE_PHASE_MAIN) { - play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); - sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; -#ifndef VERSION_EU - // Sound menu buttons don't return to Main Menu in EU - // because they don't have a case in bhv_menu_button_manager_loop - sSelectedButtonID = buttonID; -#endif - sSoundMode = buttonID - MENU_BUTTON_OPTION_MIN; - save_file_set_sound_mode(sSoundMode); - } - } -#ifdef VERSION_EU - // If language mode button clicked, select it and change language - if (buttonID == MENU_BUTTON_LANGUAGE_ENGLISH || buttonID == MENU_BUTTON_LANGUAGE_FRENCH - || buttonID == MENU_BUTTON_LANGUAGE_GERMAN) { - if (soundModeButton->oMenuButtonActionPhase == SOUND_MODE_PHASE_MAIN) { - play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); - sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; - sLanguageMode = buttonID - MENU_BUTTON_LANGUAGE_MIN; - eu_set_language(sLanguageMode); - } - } - // If neither of the buttons above are pressed, return to main menu - if (buttonID == MENU_BUTTON_LANGUAGE_RETURN) { - play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); - sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; - sSelectedButtonID = buttonID; - } -#endif - sCurrentMenuLevel = MENU_LAYER_SUBMENU; - - break; - } - } - } -} - -/** - * Loads a save file selected after it goes into a full screen state - * retuning sSelectedFileNum to a save value defined in fileNum. - */ -void load_main_menu_save_file(struct Object *fileButton, s32 fileNum) { - if (fileButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { - sSelectedFileNum = fileNum; - } -} - -/** - * Returns from the previous menu back to the main menu using - * the return button (or sound mode) as source button. - */ -void return_to_main_menu(s16 prevMenuButtonID, struct Object *sourceButton) { - s32 buttonID; - // If the source button is in default state and the previous menu in full screen, - // play zoom out sound and shrink previous menu - if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT - && sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { - play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs); - sMainMenuButtons[prevMenuButtonID]->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING; - sCurrentMenuLevel = MENU_LAYER_MAIN; - } - // If the previous button is in default state, return back to the main menu - if (sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT) { - sSelectedButtonID = MENU_BUTTON_NONE; - // Hide buttons of corresponding button menu groups - if (prevMenuButtonID == MENU_BUTTON_SCORE) { - for (buttonID = MENU_BUTTON_SCORE_MIN; buttonID < MENU_BUTTON_SCORE_MAX; buttonID++) { - mark_obj_for_deletion(sMainMenuButtons[buttonID]); - } - } - if (prevMenuButtonID == MENU_BUTTON_COPY) { - for (buttonID = MENU_BUTTON_COPY_MIN; buttonID < MENU_BUTTON_COPY_MAX; buttonID++) { - mark_obj_for_deletion(sMainMenuButtons[buttonID]); - } - } - if (prevMenuButtonID == MENU_BUTTON_ERASE) { - for (buttonID = MENU_BUTTON_ERASE_MIN; buttonID < MENU_BUTTON_ERASE_MAX; buttonID++) { - mark_obj_for_deletion(sMainMenuButtons[buttonID]); - } - } - if (prevMenuButtonID == MENU_BUTTON_SOUND_MODE) { - for (buttonID = MENU_BUTTON_OPTION_MIN; buttonID < MENU_BUTTON_OPTION_MAX; buttonID++) { - mark_obj_for_deletion(sMainMenuButtons[buttonID]); - } - } - } -} - -/** - * Loads score menu from the previous menu using "CHECK SCORE" as source button. - */ -void load_score_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceButton) { - s32 buttonID; - // If the source button is in default state and the previous menu in full screen, - // play zoom out sound and shrink previous menu - if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT - && sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { - play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs); - sMainMenuButtons[prevMenuButtonID]->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING; - sCurrentMenuLevel = MENU_LAYER_MAIN; - } - // If the previous button is in default state - if (sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT) { - // Hide buttons of corresponding button menu groups - if (prevMenuButtonID == MENU_BUTTON_SCORE) //! Not possible, this is checking if the score menu - //! was opened from the score menu! - { - for (buttonID = MENU_BUTTON_SCORE_MIN; buttonID < MENU_BUTTON_SCORE_MAX; buttonID++) { - mark_obj_for_deletion(sMainMenuButtons[buttonID]); - } - } - if (prevMenuButtonID == MENU_BUTTON_COPY) { - for (buttonID = MENU_BUTTON_COPY_MIN; buttonID < MENU_BUTTON_COPY_MAX; buttonID++) { - mark_obj_for_deletion(sMainMenuButtons[buttonID]); - } - } - if (prevMenuButtonID == MENU_BUTTON_ERASE) { - for (buttonID = MENU_BUTTON_ERASE_MIN; buttonID < MENU_BUTTON_ERASE_MAX; buttonID++) { - mark_obj_for_deletion(sMainMenuButtons[buttonID]); - } - } - // Play zoom in sound, select score menu and render it's buttons - sSelectedButtonID = MENU_BUTTON_SCORE; - play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); - sMainMenuButtons[MENU_BUTTON_SCORE]->oMenuButtonState = MENU_BUTTON_STATE_GROWING; - render_score_menu_buttons(sMainMenuButtons[MENU_BUTTON_SCORE]); - } -} - -/** - * Loads copy menu from the previous menu using "COPY FILE" as source button. - */ -void load_copy_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceButton) { - s32 buttonID; - // If the source button is in default state and the previous menu in full screen, - // play zoom out sound and shrink previous menu - if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT - && sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { - play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs); - sMainMenuButtons[prevMenuButtonID]->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING; - sCurrentMenuLevel = MENU_LAYER_MAIN; - } - // If the previous button is in default state - if (sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT) { - // Hide buttons of corresponding button menu groups - if (prevMenuButtonID == MENU_BUTTON_SCORE) { - for (buttonID = MENU_BUTTON_SCORE_MIN; buttonID < MENU_BUTTON_SCORE_MAX; buttonID++) { - mark_obj_for_deletion(sMainMenuButtons[buttonID]); - } - } - if (prevMenuButtonID == MENU_BUTTON_COPY) //! Not possible, this is checking if the copy menu - //! was opened from the copy menu! - { - for (buttonID = MENU_BUTTON_COPY_MIN; buttonID < MENU_BUTTON_COPY_MAX; buttonID++) { - mark_obj_for_deletion(sMainMenuButtons[buttonID]); - } - } - if (prevMenuButtonID == MENU_BUTTON_ERASE) { - for (buttonID = MENU_BUTTON_ERASE_MIN; buttonID < MENU_BUTTON_ERASE_MAX; buttonID++) { - mark_obj_for_deletion(sMainMenuButtons[buttonID]); - } - } - // Play zoom in sound, select copy menu and render it's buttons - sSelectedButtonID = MENU_BUTTON_COPY; - play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); - sMainMenuButtons[MENU_BUTTON_COPY]->oMenuButtonState = MENU_BUTTON_STATE_GROWING; - render_copy_menu_buttons(sMainMenuButtons[MENU_BUTTON_COPY]); - } -} - -/** - * Loads erase menu from the previous menu using "ERASE FILE" as source button. - */ -void load_erase_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceButton) { - s32 buttonID; - // If the source button is in default state and the previous menu in full screen, - // play zoom out sound and shrink previous menu - if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT - && sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { - play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs); - sMainMenuButtons[prevMenuButtonID]->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING; - sCurrentMenuLevel = MENU_LAYER_MAIN; - } - // If the previous button is in default state - if (sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT) { - // Hide buttons of corresponding button menu groups - if (prevMenuButtonID == MENU_BUTTON_SCORE) { - for (buttonID = MENU_BUTTON_SCORE_MIN; buttonID < MENU_BUTTON_SCORE_MAX; buttonID++) { - mark_obj_for_deletion(sMainMenuButtons[buttonID]); - } - } - if (prevMenuButtonID == MENU_BUTTON_COPY) { - for (buttonID = MENU_BUTTON_COPY_MIN; buttonID < MENU_BUTTON_COPY_MAX; buttonID++) { - mark_obj_for_deletion(sMainMenuButtons[buttonID]); - } - } - if (prevMenuButtonID == MENU_BUTTON_ERASE) //! Not possible, this is checking if the erase menu - //! was opened from the erase menu! - { - for (buttonID = MENU_BUTTON_ERASE_MIN; buttonID < MENU_BUTTON_ERASE_MAX; buttonID++) { - mark_obj_for_deletion(sMainMenuButtons[buttonID]); - } - } - // Play zoom in sound, select erase menu and render it's buttons - sSelectedButtonID = MENU_BUTTON_ERASE; - play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); - sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonState = MENU_BUTTON_STATE_GROWING; - render_erase_menu_buttons(sMainMenuButtons[MENU_BUTTON_ERASE]); - } -} - -/** - * Menu Buttons Menu Manager Initial Action - * Creates models of the buttons in the menu. For the Mario buttons it - * checks if a save file exists to render an specific button model for it. - * Unlike buttons on submenus, these are never hidden or recreated. - */ -void bhv_menu_button_manager_init(void) { - // File A - if (save_file_exists(SAVE_FILE_A) == TRUE) { - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_A] = spawn_object_rel_with_rot( - gCurrentObject, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, bhvMenuButton, -6400, 2800, 0, 0, 0, 0); - } else { - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_A] = spawn_object_rel_with_rot( - gCurrentObject, MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE, bhvMenuButton, -6400, 2800, 0, 0, 0, 0); - } - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_A]->oMenuButtonScale = 1.0f; - // File B - if (save_file_exists(SAVE_FILE_B) == TRUE) { - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_B] = spawn_object_rel_with_rot( - gCurrentObject, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, bhvMenuButton, 1500, 2800, 0, 0, 0, 0); - } else { - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_B] = spawn_object_rel_with_rot( - gCurrentObject, MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE, bhvMenuButton, 1500, 2800, 0, 0, 0, 0); - } - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_B]->oMenuButtonScale = 1.0f; - // File C - if (save_file_exists(SAVE_FILE_C) == TRUE) { - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_C] = spawn_object_rel_with_rot( - gCurrentObject, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, bhvMenuButton, -6400, 0, 0, 0, 0, 0); - } else { - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_C] = spawn_object_rel_with_rot( - gCurrentObject, MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE, bhvMenuButton, -6400, 0, 0, 0, 0, 0); - } - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_C]->oMenuButtonScale = 1.0f; - // File D - if (save_file_exists(SAVE_FILE_D) == TRUE) { - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_D] = spawn_object_rel_with_rot( - gCurrentObject, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, bhvMenuButton, 1500, 0, 0, 0, 0, 0); - } else { - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_D] = spawn_object_rel_with_rot( - gCurrentObject, MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE, bhvMenuButton, 1500, 0, 0, 0, 0, 0); - } - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_D]->oMenuButtonScale = 1.0f; - // Score menu button - sMainMenuButtons[MENU_BUTTON_SCORE] = spawn_object_rel_with_rot( - gCurrentObject, MODEL_MAIN_MENU_GREEN_SCORE_BUTTON, bhvMenuButton, -6400, -3500, 0, 0, 0, 0); - sMainMenuButtons[MENU_BUTTON_SCORE]->oMenuButtonScale = 1.0f; - // Copy menu button - sMainMenuButtons[MENU_BUTTON_COPY] = spawn_object_rel_with_rot( - gCurrentObject, MODEL_MAIN_MENU_BLUE_COPY_BUTTON, bhvMenuButton, -2134, -3500, 0, 0, 0, 0); - sMainMenuButtons[MENU_BUTTON_COPY]->oMenuButtonScale = 1.0f; - // Erase menu button - sMainMenuButtons[MENU_BUTTON_ERASE] = spawn_object_rel_with_rot( - gCurrentObject, MODEL_MAIN_MENU_RED_ERASE_BUTTON, bhvMenuButton, 2134, -3500, 0, 0, 0, 0); - sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonScale = 1.0f; - // Sound mode menu button (Option Mode in EU) - sMainMenuButtons[MENU_BUTTON_SOUND_MODE] = spawn_object_rel_with_rot( - gCurrentObject, MODEL_MAIN_MENU_PURPLE_SOUND_BUTTON, bhvMenuButton, 6400, -3500, 0, 0, 0, 0); - sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oMenuButtonScale = 1.0f; - - sTextBaseAlpha = 0; -} - -#if defined(VERSION_JP) || defined(VERSION_SH) -#define SAVE_FILE_SOUND SOUND_MENU_STAR_SOUND -#else -#define SAVE_FILE_SOUND SOUND_MENU_STAR_SOUND_OKEY_DOKEY -#endif - -/** - * In the main menu, check if a button was clicked to play it's button growing state. - * Also play a sound and/or render buttons depending of the button ID selected. - */ -void check_main_menu_clicked_buttons(void) { -#ifdef VERSION_EU - if (sMainMenuTimer >= 5) { -#endif - // Sound mode menu is handled separately because the button ID for it - // is not grouped with the IDs of the other submenus. - if (check_clicked_button(sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oPosX, - sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oPosY, 200.0f) - == TRUE) { - sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oMenuButtonState = MENU_BUTTON_STATE_GROWING; - sSelectedButtonID = MENU_BUTTON_SOUND_MODE; - } else { - // Main Menu buttons - s8 buttonID; - // Configure Main Menu button group - for (buttonID = MENU_BUTTON_MAIN_MIN; buttonID < MENU_BUTTON_MAIN_MAX; buttonID++) { - s16 buttonX = sMainMenuButtons[buttonID]->oPosX; - s16 buttonY = sMainMenuButtons[buttonID]->oPosY; - - if (check_clicked_button(buttonX, buttonY, 200.0f) == TRUE) { - // If menu button clicked, select it - sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_GROWING; - sSelectedButtonID = buttonID; - break; - } - } - } -#ifdef VERSION_EU - // Open Options Menu if sOpenLangSettings is TRUE (It's TRUE when there's no saves) - if (sOpenLangSettings == TRUE) { - sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oMenuButtonState = MENU_BUTTON_STATE_GROWING; - sSelectedButtonID = MENU_BUTTON_SOUND_MODE; - sOpenLangSettings = FALSE; - } -#endif - - // Play sound of the save file clicked - switch (sSelectedButtonID) { - case MENU_BUTTON_PLAY_FILE_A: - play_sound(SAVE_FILE_SOUND, gDefaultSoundArgs); - break; - case MENU_BUTTON_PLAY_FILE_B: - play_sound(SAVE_FILE_SOUND, gDefaultSoundArgs); - break; - case MENU_BUTTON_PLAY_FILE_C: - play_sound(SAVE_FILE_SOUND, gDefaultSoundArgs); - break; - case MENU_BUTTON_PLAY_FILE_D: - play_sound(SAVE_FILE_SOUND, gDefaultSoundArgs); - break; - // Play sound of the button clicked and render buttons of that menu. - case MENU_BUTTON_SCORE: - play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); - render_score_menu_buttons(sMainMenuButtons[MENU_BUTTON_SCORE]); - break; - case MENU_BUTTON_COPY: - play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); - render_copy_menu_buttons(sMainMenuButtons[MENU_BUTTON_COPY]); - break; - case MENU_BUTTON_ERASE: - play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); - render_erase_menu_buttons(sMainMenuButtons[MENU_BUTTON_ERASE]); - break; - case MENU_BUTTON_SOUND_MODE: - play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs); - render_sound_mode_menu_buttons(sMainMenuButtons[MENU_BUTTON_SOUND_MODE]); - break; - } -#ifdef VERSION_EU - } -#endif -} -#undef SAVE_FILE_SOUND - -/** - * Menu Buttons Menu Manager Loop Action - * Calls a menu function depending of the button chosen. - * sSelectedButtonID is MENU_BUTTON_NONE when the file select - * is loaded, and that checks what buttonID is clicked in the main menu. - */ -void bhv_menu_button_manager_loop(void) { - switch (sSelectedButtonID) { - case MENU_BUTTON_NONE: - check_main_menu_clicked_buttons(); - break; - case MENU_BUTTON_PLAY_FILE_A: - load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_A], 1); - break; - case MENU_BUTTON_PLAY_FILE_B: - load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_B], 2); - break; - case MENU_BUTTON_PLAY_FILE_C: - load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_C], 3); - break; - case MENU_BUTTON_PLAY_FILE_D: - load_main_menu_save_file(sMainMenuButtons[MENU_BUTTON_PLAY_FILE_D], 4); - break; - case MENU_BUTTON_SCORE: - check_score_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_SCORE]); - break; - case MENU_BUTTON_COPY: - check_copy_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_COPY]); - break; - case MENU_BUTTON_ERASE: - check_erase_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_ERASE]); - break; - - case MENU_BUTTON_SCORE_FILE_A: - exit_score_file_to_score_menu(sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A], MENU_BUTTON_SCORE); - break; - case MENU_BUTTON_SCORE_FILE_B: - exit_score_file_to_score_menu(sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B], MENU_BUTTON_SCORE); - break; - case MENU_BUTTON_SCORE_FILE_C: - exit_score_file_to_score_menu(sMainMenuButtons[MENU_BUTTON_SCORE_FILE_C], MENU_BUTTON_SCORE); - break; - case MENU_BUTTON_SCORE_FILE_D: - exit_score_file_to_score_menu(sMainMenuButtons[MENU_BUTTON_SCORE_FILE_D], MENU_BUTTON_SCORE); - break; - case MENU_BUTTON_SCORE_RETURN: - return_to_main_menu(MENU_BUTTON_SCORE, sMainMenuButtons[MENU_BUTTON_SCORE_RETURN]); - break; - case MENU_BUTTON_SCORE_COPY_FILE: - load_copy_menu_from_submenu(MENU_BUTTON_SCORE, sMainMenuButtons[MENU_BUTTON_SCORE_COPY_FILE]); - break; - case MENU_BUTTON_SCORE_ERASE_FILE: - load_erase_menu_from_submenu(MENU_BUTTON_SCORE, sMainMenuButtons[MENU_BUTTON_SCORE_ERASE_FILE]); - break; - - case MENU_BUTTON_COPY_FILE_A: - break; - case MENU_BUTTON_COPY_FILE_B: - break; - case MENU_BUTTON_COPY_FILE_C: - break; - case MENU_BUTTON_COPY_FILE_D: - break; - case MENU_BUTTON_COPY_RETURN: - return_to_main_menu(MENU_BUTTON_COPY, sMainMenuButtons[MENU_BUTTON_COPY_RETURN]); - break; - case MENU_BUTTON_COPY_CHECK_SCORE: - load_score_menu_from_submenu(MENU_BUTTON_COPY, sMainMenuButtons[MENU_BUTTON_COPY_CHECK_SCORE]); - break; - case MENU_BUTTON_COPY_ERASE_FILE: - load_erase_menu_from_submenu(MENU_BUTTON_COPY, sMainMenuButtons[MENU_BUTTON_COPY_ERASE_FILE]); - break; - - case MENU_BUTTON_ERASE_FILE_A: - break; - case MENU_BUTTON_ERASE_FILE_B: - break; - case MENU_BUTTON_ERASE_FILE_C: - break; - case MENU_BUTTON_ERASE_FILE_D: - break; - case MENU_BUTTON_ERASE_RETURN: - return_to_main_menu(MENU_BUTTON_ERASE, sMainMenuButtons[MENU_BUTTON_ERASE_RETURN]); - break; - case MENU_BUTTON_ERASE_CHECK_SCORE: - load_score_menu_from_submenu(MENU_BUTTON_ERASE, sMainMenuButtons[MENU_BUTTON_ERASE_CHECK_SCORE]); - break; - case MENU_BUTTON_ERASE_COPY_FILE: - load_copy_menu_from_submenu(MENU_BUTTON_ERASE, sMainMenuButtons[MENU_BUTTON_ERASE_COPY_FILE]); - break; - - case MENU_BUTTON_SOUND_MODE: - check_sound_mode_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_SOUND_MODE]); - break; - - // STEREO, MONO and HEADSET buttons are undefined so they can be selected without - // exiting the Options menu, as a result they added a return button -#ifdef VERSION_EU - case MENU_BUTTON_LANGUAGE_RETURN: - return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_LANGUAGE_RETURN]); - break; -#else - case MENU_BUTTON_STEREO: - return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_STEREO]); - break; - case MENU_BUTTON_MONO: - return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_MONO]); - break; - case MENU_BUTTON_HEADSET: - return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_HEADSET]); - break; -#endif - } - - sClickPos[0] = -10000; - sClickPos[1] = -10000; -} - -/** - * Cursor function that handles button inputs. - * If the cursor is clicked, sClickPos uses the same value as sCursorPos. - */ -void handle_cursor_button_input(void) { - // If scoring a file, pressing A just changes the coin score mode. - if (sSelectedButtonID == MENU_BUTTON_SCORE_FILE_A || sSelectedButtonID == MENU_BUTTON_SCORE_FILE_B - || sSelectedButtonID == MENU_BUTTON_SCORE_FILE_C - || sSelectedButtonID == MENU_BUTTON_SCORE_FILE_D) { - if (gPlayer3Controller->buttonPressed -#ifdef VERSION_EU - & (B_BUTTON | START_BUTTON | Z_TRIG)) { -#else - & (B_BUTTON | START_BUTTON)) { -#endif - sClickPos[0] = sCursorPos[0]; - sClickPos[1] = sCursorPos[1]; - sCursorClickingTimer = 1; - } else if (gPlayer3Controller->buttonPressed & A_BUTTON) { - sScoreFileCoinScoreMode = 1 - sScoreFileCoinScoreMode; - play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); - } - } else { // If cursor is clicked - if (gPlayer3Controller->buttonPressed -#ifdef VERSION_EU - & (A_BUTTON | B_BUTTON | START_BUTTON | Z_TRIG)) { -#else - & (A_BUTTON | B_BUTTON | START_BUTTON)) { -#endif - sClickPos[0] = sCursorPos[0]; - sClickPos[1] = sCursorPos[1]; - sCursorClickingTimer = 1; - } - } -} - -/** - * Cursor function that handles analog stick input and button presses with a function near the end. - */ -void handle_controller_cursor_input(void) { - s16 rawStickX = gPlayer3Controller->rawStickX; - s16 rawStickY = gPlayer3Controller->rawStickY; - - // Handle deadzone - if (rawStickY > -2 && rawStickY < 2) { - rawStickY = 0; - } - if (rawStickX > -2 && rawStickX < 2) { - rawStickX = 0; - } - - // Move cursor - sCursorPos[0] += rawStickX / 8; - sCursorPos[1] += rawStickY / 8; - - // Stop cursor from going offscreen - if (sCursorPos[0] > 132.0f) { - sCursorPos[0] = 132.0f; - } - if (sCursorPos[0] < -132.0f) { - sCursorPos[0] = -132.0f; - } - - if (sCursorPos[1] > 90.0f) { - sCursorPos[1] = 90.0f; - } - if (sCursorPos[1] < -90.0f) { - sCursorPos[1] = -90.0f; - } - - if (sCursorClickingTimer == 0) { - handle_cursor_button_input(); - } -} - -/** - * Prints the cursor (Mario Hand, different to the one in the Mario screen) - * and loads it's controller inputs in handle_controller_cursor_input - * to be usable on the file select. - */ -void print_menu_cursor(void) { - handle_controller_cursor_input(); - create_dl_translation_matrix(MENU_MTX_PUSH, sCursorPos[0] + 160.0f - 5.0, - sCursorPos[1] + 120.0f - 25.0, 0.0f); - // Get the right graphic to use for the cursor. - if (sCursorClickingTimer == 0) - // Idle - gSPDisplayList(gDisplayListHead++, dl_menu_idle_hand); - if (sCursorClickingTimer != 0) - // Grabbing - gSPDisplayList(gDisplayListHead++, dl_menu_grabbing_hand); - gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); - if (sCursorClickingTimer != 0) { - sCursorClickingTimer++; // This is a very strange way to implement a timer? It counts up and - // then resets to 0 instead of just counting down to 0. - if (sCursorClickingTimer == 5) { - sCursorClickingTimer = 0; - } - } -} - -/** - * Prints a hud string depending of the hud table list defined with text fade properties. - */ -void print_hud_lut_string_fade(s8 hudLUT, s16 x, s16 y, const unsigned char *text) { - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha - sTextFadeAlpha); - print_hud_lut_string(hudLUT, x, y, text); - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); -} - -/** - * Prints a generic white string with text fade properties. - */ -void print_generic_string_fade(s16 x, s16 y, const unsigned char *text) { - gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha - sTextFadeAlpha); - print_generic_string(x, y, text); - gSPDisplayList(gDisplayListHead++, dl_ia_text_end); -} - -/** - * Updates text fade at the top of a menu. - */ -s32 update_text_fade_out(void) { - if (sFadeOutText == TRUE) { - sTextFadeAlpha += 50; - if (sTextFadeAlpha == 250) { - sFadeOutText = FALSE; - return TRUE; - } - } else { - if (sTextFadeAlpha > 0) { - sTextFadeAlpha -= 50; - } - } - return FALSE; -} - -/** - * Prints the amount of stars of a save file. - * If a save doesn't exist, print "NEW" instead. - */ -void print_save_file_star_count(s8 fileIndex, s16 x, s16 y) { - auto &text_renderer = ServiceLocator::get_text_renderer(); - - if (save_file_exists(fileIndex) == TRUE) { - s8 offset = 0; - s16 starCount = save_file_get_total_star_count(fileIndex, 0, 24); - // Print star icon - text_renderer.render()->glyphs_at(starIcon, x, y); - // If star count is less than 100, print x icon and move - // the star count text one digit to the right. - if (starCount < 100) { - text_renderer.render()->glyphs_at(xIcon, x + 16, y); - offset = 16; - } - - // Print star count - u8 starCountText[4]; - int_to_str(starCount, starCountText); - text_renderer.render()->glyphs_at(starCountText, x + offset + 16, y); - } else { - // Print "new" text - text_renderer.render()->glyphs_at(LANGUAGE_ARRAY(textNew), x, y); - } -} - -#if defined(VERSION_JP) || defined(VERSION_SH) -#define SELECT_FILE_X 96 -#define SCORE_X 50 -#define COPY_X 115 -#define ERASE_X 180 -#define SOUNDMODE_X1 235 -#define SAVEFILE_X1 92 -#define SAVEFILE_X2 209 -#define MARIOTEXT_X1 92 -#define MARIOTEXT_X2 207 -#elif VERSION_US -#define SELECT_FILE_X 93 -#define SCORE_X 52 -#define COPY_X 117 -#define ERASE_X 177 -#define SOUNDMODE_X1 sSoundTextX -#define SAVEFILE_X1 92 -#define SAVEFILE_X2 209 -#define MARIOTEXT_X1 92 -#define MARIOTEXT_X2 207 -#elif VERSION_EU -#define SELECT_FILE_X 93 -#define SCORE_X 52 -#define COPY_X 117 -#define ERASE_X 177 -#define SOUNDMODE_X1 sSoundTextX -#define SAVEFILE_X1 97 -#define SAVEFILE_X2 204 -#define MARIOTEXT_X1 97 -#define MARIOTEXT_X2 204 -#endif - -/** - * Prints main menu strings that shows on the yellow background menu screen. - * - * In EU this function acts like "print_save_file_strings" because - * print_main_lang_strings is first called to render the strings for the 4 buttons. - * Same rule applies for score, copy and erase strings. - */ -void print_main_menu_strings(void) { - // Print "SELECT FILE" text - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); -#ifndef VERSION_EU - - auto &text_renderer = ServiceLocator::get_text_renderer(); - text_renderer.render() - ->with_glyph_set(LutSource::DIFF) - ->glyphs_at(textSelectFile, SELECT_FILE_X, 35); - -#endif - // Print file star counts - print_save_file_star_count(SAVE_FILE_A, SAVEFILE_X1, 78); - print_save_file_star_count(SAVE_FILE_B, SAVEFILE_X2, 78); - print_save_file_star_count(SAVE_FILE_C, SAVEFILE_X1, 118); - print_save_file_star_count(SAVE_FILE_D, SAVEFILE_X2, 118); - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); -#ifndef VERSION_EU - // Print menu names - gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - print_generic_string(SCORE_X, 39, textScore); - print_generic_string(COPY_X, 39, textCopy); - print_generic_string(ERASE_X, 39, textErase); -#if !defined(VERSION_JP) && !defined(VERSION_SH) - sSoundTextX = get_str_x_pos_from_center(254, textSoundModes[sSoundMode], 10.0f); -#endif - print_generic_string(SOUNDMODE_X1, 39, textSoundModes[sSoundMode]); - gSPDisplayList(gDisplayListHead++, dl_ia_text_end); -#endif - // Print file names - gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - print_menu_generic_string(MARIOTEXT_X1, 65, textMarioA); - print_menu_generic_string(MARIOTEXT_X2, 65, textMarioB); - print_menu_generic_string(MARIOTEXT_X1, 105, textMarioC); - print_menu_generic_string(MARIOTEXT_X2, 105, textMarioD); - gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_end); -} - -#ifdef VERSION_EU -/** - * Prints the first part main menu strings that shows on the yellow background menu screen. - * Has the strings for the 4 buttons below the save buttons that get changed depending of the language. - * Calls print_main_menu_strings to print the remaining strings. - */ -void print_main_lang_strings(void) { - s16 centeredX; - - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - centeredX = get_str_x_pos_from_center_scale(160, textSelectFile[sLanguageMode], 12.0f); - sCenteredX = centeredX; - print_hud_lut_string(HUD_LUT_GLOBAL, centeredX, 35, textSelectFile[sLanguageMode]); - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); - - gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - centeredX = get_str_x_pos_from_center(76, textScore[sLanguageMode], 10.0f); - sCenteredX = centeredX; - print_generic_string(centeredX, 39, textScore[sLanguageMode]); - centeredX = get_str_x_pos_from_center(131, textCopy[sLanguageMode], 10.0f); - sCenteredX = centeredX; - print_generic_string(centeredX, 39, textCopy[sLanguageMode]); - centeredX = get_str_x_pos_from_center(189, textErase[sLanguageMode], 10.0f); - sCenteredX = centeredX; - print_generic_string(centeredX, 39, textErase[sLanguageMode]); - centeredX = get_str_x_pos_from_center(245, textOption[sLanguageMode], 10.0f); - sCenteredX = centeredX; - print_generic_string(centeredX, 39, textOption[sLanguageMode]); - gSPDisplayList(gDisplayListHead++, dl_ia_text_end); - - print_main_menu_strings(); -} -#endif - -#ifdef VERSION_EU -#define CHECK_FILE_X checkFileX -#define NOSAVE_DATA_X1 noSaveDataX -#elif VERSION_JP -#define CHECK_FILE_X 90 -#define NOSAVE_DATA_X1 90 -#else -#define CHECK_FILE_X 95 -#define NOSAVE_DATA_X1 99 -#endif - -/** - * Defines IDs for the top message of the score menu and displays it if the ID is called in messageID. - */ -void score_menu_display_message(s8 messageID) { -#ifdef VERSION_EU - s16 checkFileX, noSaveDataX; -#endif - - switch (messageID) { - case SCORE_MSG_CHECK_FILE: -#ifdef VERSION_EU - checkFileX = get_str_x_pos_from_center_scale(160, LANGUAGE_ARRAY(textCheckFile), 12.0f); -#endif - print_hud_lut_string_fade(HUD_LUT_DIFF, CHECK_FILE_X, 35, LANGUAGE_ARRAY(textCheckFile)); - break; - case SCORE_MSG_NOSAVE_DATA: -#ifdef VERSION_EU - noSaveDataX = get_str_x_pos_from_center(160, LANGUAGE_ARRAY(textNoSavedDataExists), 10.0f); -#endif - print_generic_string_fade(NOSAVE_DATA_X1, 190, LANGUAGE_ARRAY(textNoSavedDataExists)); - break; - } -} - -#if defined(VERSION_JP) || defined(VERSION_SH) -#define RETURN_X 45 -#define COPYFILE_X1 128 -#define ERASEFILE_X1 228 -#elif VERSION_EU -#define RETURN_X centeredX -#define COPYFILE_X1 centeredX -#define ERASEFILE_X1 centeredX -#else -#define RETURN_X 44 -#define COPYFILE_X1 135 -#define ERASEFILE_X1 231 -#endif - -#ifdef VERSION_EU -#define FADEOUT_TIMER 35 -#else -#define FADEOUT_TIMER 20 -#endif - -/** - * Prints score menu strings that shows on the green background menu screen. - */ -void print_score_menu_strings(void) { -#ifdef VERSION_EU - s16 centeredX; -#endif - - // Update and print the message at the top of the menu. - if (sMainMenuTimer == FADEOUT_TIMER) { - sFadeOutText = TRUE; - } - if (update_text_fade_out() == TRUE) { - if (sStatusMessageID == SCORE_MSG_CHECK_FILE) { - sStatusMessageID = SCORE_MSG_NOSAVE_DATA; - } else { - sStatusMessageID = SCORE_MSG_CHECK_FILE; - } - } - // Print messageID called above - score_menu_display_message(sStatusMessageID); - -#ifndef VERSION_EU - // Print file star counts - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - print_save_file_star_count(SAVE_FILE_A, 90, 76); - print_save_file_star_count(SAVE_FILE_B, 211, 76); - print_save_file_star_count(SAVE_FILE_C, 90, 119); - print_save_file_star_count(SAVE_FILE_D, 211, 119); - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); -#endif - - // Print menu names - gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center(69, textReturn[sLanguageMode], 10.0f); -#endif - print_generic_string(RETURN_X, 35, LANGUAGE_ARRAY(textReturn)); -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center(159, textCopyFileButton[sLanguageMode], 10.0f); -#endif - print_generic_string(COPYFILE_X1, 35, LANGUAGE_ARRAY(textCopyFileButton)); -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center(249, textEraseFileButton[sLanguageMode], 10.0f); -#endif - print_generic_string(ERASEFILE_X1, 35, LANGUAGE_ARRAY(textEraseFileButton)); - gSPDisplayList(gDisplayListHead++, dl_ia_text_end); - -#ifdef VERSION_EU - print_main_menu_strings(); -#else - // Print file names - gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - print_menu_generic_string(89, 62, textMarioA); - print_menu_generic_string(211, 62, textMarioB); - print_menu_generic_string(89, 105, textMarioC); - print_menu_generic_string(211, 105, textMarioD); - gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_end); -#endif -} - -#if defined(VERSION_JP) || defined(VERSION_SH) -#define NOFILE_COPY_X 90 -#define COPY_FILE_X 90 -#define COPYIT_WHERE_X 90 -#define NOSAVE_DATA_X2 90 -#define COPYCOMPLETE_X 90 -#define SAVE_EXISTS_X1 90 -#elif VERSION_EU -#define NOFILE_COPY_X centeredX -#define COPY_FILE_X centeredX -#define COPYIT_WHERE_X centeredX -#define NOSAVE_DATA_X2 centeredX -#define COPYCOMPLETE_X centeredX -#define SAVE_EXISTS_X1 centeredX -#else -#define NOFILE_COPY_X 119 -#define COPY_FILE_X 104 -#define COPYIT_WHERE_X 109 -#define NOSAVE_DATA_X2 101 -#define COPYCOMPLETE_X 110 -#define SAVE_EXISTS_X1 110 -#endif - -/** - * Defines IDs for the top message of the copy menu and displays it if the ID is called in messageID. - */ -void copy_menu_display_message(s8 messageID) { -#ifdef VERSION_EU - s16 centeredX; -#endif - - switch (messageID) { - case COPY_MSG_MAIN_TEXT: - if (sAllFilesExist == TRUE) { -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center(160, textNoFileToCopyFrom[sLanguageMode], 10.0f); -#endif - print_generic_string_fade(NOFILE_COPY_X, 190, LANGUAGE_ARRAY(textNoFileToCopyFrom)); - } else { -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center_scale(160, textCopyFile[sLanguageMode], 12.0f); -#endif - print_hud_lut_string_fade(HUD_LUT_DIFF, COPY_FILE_X, 35, LANGUAGE_ARRAY(textCopyFile)); - } - break; - case COPY_MSG_COPY_WHERE: -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center(160, textCopyItToWhere[sLanguageMode], 10.0f); -#endif - print_generic_string_fade(COPYIT_WHERE_X, 190, LANGUAGE_ARRAY(textCopyItToWhere)); - break; - case COPY_MSG_NOSAVE_EXISTS: -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center(160, textNoSavedDataExists[sLanguageMode], 10.0f); - print_generic_string_fade(NOSAVE_DATA_X2, 190, textNoSavedDataExists[sLanguageMode]); -#else - print_generic_string_fade(NOSAVE_DATA_X2, 190, textNoSavedDataExistsCopy); -#endif - break; - case COPY_MSG_COPY_COMPLETE: -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center(160, textCopyCompleted[sLanguageMode], 10.0f); -#endif - print_generic_string_fade(COPYCOMPLETE_X, 190, LANGUAGE_ARRAY(textCopyCompleted)); - break; - case COPY_MSG_SAVE_EXISTS: -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center(160, textSavedDataExists[sLanguageMode], 10.0f); -#endif - print_generic_string_fade(SAVE_EXISTS_X1, 190, LANGUAGE_ARRAY(textSavedDataExists)); - break; - } -} - -/** - * Updates messageIDs of the copy menu depending of the copy phase value defined. - */ -void copy_menu_update_message(void) { - switch (sMainMenuButtons[MENU_BUTTON_COPY]->oMenuButtonActionPhase) { - case COPY_PHASE_MAIN: - if (sMainMenuTimer == FADEOUT_TIMER) { - sFadeOutText = TRUE; - } - if (update_text_fade_out() == TRUE) { - if (sStatusMessageID == COPY_MSG_MAIN_TEXT) { - sStatusMessageID = COPY_MSG_NOSAVE_EXISTS; - } else { - sStatusMessageID = COPY_MSG_MAIN_TEXT; - } - } - break; - case COPY_PHASE_COPY_WHERE: - if (sMainMenuTimer == FADEOUT_TIMER && sStatusMessageID == COPY_MSG_SAVE_EXISTS) { - sFadeOutText = TRUE; - } - if (update_text_fade_out() == TRUE) { - if (sStatusMessageID != COPY_MSG_COPY_WHERE) { - sStatusMessageID = COPY_MSG_COPY_WHERE; - } else { - sStatusMessageID = COPY_MSG_SAVE_EXISTS; - } - } - break; - case COPY_PHASE_COPY_COMPLETE: - if (sMainMenuTimer == FADEOUT_TIMER) { - sFadeOutText = TRUE; - } - if (update_text_fade_out() == TRUE) { - if (sStatusMessageID != COPY_MSG_COPY_COMPLETE) { - sStatusMessageID = COPY_MSG_COPY_COMPLETE; - } else { - sStatusMessageID = COPY_MSG_MAIN_TEXT; - } - } - break; - } -} - -#if defined(VERSION_JP) || defined(VERSION_SH) -#define VIEWSCORE_X1 133 -#define ERASEFILE_X2 220 -#elif VERSION_EU -#define VIEWSCORE_X1 centeredX -#define ERASEFILE_X2 centeredX -#else -#define VIEWSCORE_X1 128 -#define ERASEFILE_X2 230 -#endif - -/** - * Prints copy menu strings that shows on the blue background menu screen. - */ -void print_copy_menu_strings(void) { -#ifdef VERSION_EU - s16 centeredX; -#endif - - // Update and print the message at the top of the menu. - copy_menu_update_message(); - // Print messageID called inside a copy_menu_update_message case - copy_menu_display_message(sStatusMessageID); -#ifndef VERSION_EU - // Print file star counts - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - print_save_file_star_count(SAVE_FILE_A, 90, 76); - print_save_file_star_count(SAVE_FILE_B, 211, 76); - print_save_file_star_count(SAVE_FILE_C, 90, 119); - print_save_file_star_count(SAVE_FILE_D, 211, 119); - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); -#endif - // Print menu names - gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center(69, textReturn[sLanguageMode], 10.0f); -#endif - print_generic_string(RETURN_X, 35, LANGUAGE_ARRAY(textReturn)); -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center(159, textViewScore[sLanguageMode], 10.0f); -#endif - print_generic_string(VIEWSCORE_X1, 35, LANGUAGE_ARRAY(textViewScore)); -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center(249, textEraseFileButton[sLanguageMode], 10.0f); -#endif - print_generic_string(ERASEFILE_X2, 35, LANGUAGE_ARRAY(textEraseFileButton)); - gSPDisplayList(gDisplayListHead++, dl_ia_text_end); -#ifdef VERSION_EU - print_main_menu_strings(); -#else - // Print file names - gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - print_menu_generic_string(89, 62, textMarioA); - print_menu_generic_string(211, 62, textMarioB); - print_menu_generic_string(89, 105, textMarioC); - print_menu_generic_string(211, 105, textMarioD); - gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_end); -#endif -} - -#if defined(VERSION_JP) || defined(VERSION_SH) -#define CURSOR_X 160.0f -#define MENU_ERASE_YES_MIN_X 0x91 -#define MENU_ERASE_YES_MAX_X 0xA4 -#else -#define CURSOR_X (x + 0x46) -#define MENU_ERASE_YES_MIN_X 0x8C -#define MENU_ERASE_YES_MAX_X 0xA9 -#endif - -#define MENU_ERASE_YES_NO_MIN_Y 0xBF -#define MENU_ERASE_YES_NO_MAX_Y 0xD2 -#define MENU_ERASE_NO_MIN_X 0xBD -#define MENU_ERASE_NO_MAX_X 0xDA - -/** - * Prints the "YES NO" prompt and checks if one of the prompts are hovered to do it's functions. - */ -void print_erase_menu_prompt(s16 x, s16 y) { - s16 colorFade = gGlobalTimer << 12; - - s16 cursorX = sCursorPos[0] + CURSOR_X; - s16 cursorY = sCursorPos[1] + 120.0f; - - if (cursorX < MENU_ERASE_YES_MAX_X && cursorX >= MENU_ERASE_YES_MIN_X - && cursorY < MENU_ERASE_YES_NO_MAX_Y && cursorY >= MENU_ERASE_YES_NO_MIN_Y) { - // Fade "YES" string color but keep "NO" gray - sYesNoColor[0] = sins(colorFade) * 50.0f + 205.0f; - sYesNoColor[1] = 150; - sEraseYesNoHoverState = MENU_ERASE_HOVER_YES; - } else if (cursorX < MENU_ERASE_NO_MAX_X && cursorX >= MENU_ERASE_NO_MIN_X - && cursorY < MENU_ERASE_YES_NO_MAX_Y && cursorY >= MENU_ERASE_YES_NO_MIN_Y) { - // Fade "NO" string color but keep "YES" gray - sYesNoColor[0] = 150; - sYesNoColor[1] = sins(colorFade) * 50.0f + 205.0f; - sEraseYesNoHoverState = MENU_ERASE_HOVER_NO; - } else { - // Don't fade both strings and keep them gray - sYesNoColor[0] = 150; - sYesNoColor[1] = 150; - sEraseYesNoHoverState = MENU_ERASE_HOVER_NONE; - } - // If the cursor is clicked... - if (sCursorClickingTimer == 2) { - // ..and is hovering "YES", delete file - if (sEraseYesNoHoverState == MENU_ERASE_HOVER_YES) { - play_sound(SOUND_MARIO_WAAAOOOW, gDefaultSoundArgs); - sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonActionPhase = ERASE_PHASE_MARIO_ERASED; - sFadeOutText = TRUE; - sMainMenuTimer = 0; - save_file_erase(sSelectedFileIndex); - sMainMenuButtons[MENU_BUTTON_ERASE_MIN + sSelectedFileIndex]->header.gfx.sharedChild = - gLoadedGraphNodes[MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE]; - sMainMenuButtons[sSelectedFileIndex]->header.gfx.sharedChild = - gLoadedGraphNodes[MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE]; - sEraseYesNoHoverState = MENU_ERASE_HOVER_NONE; - // ..and is hovering "NO", return back to main phase - } else if (sEraseYesNoHoverState == MENU_ERASE_HOVER_NO) { - play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs); - sMainMenuButtons[MENU_BUTTON_ERASE_MIN + sSelectedFileIndex]->oMenuButtonState = - MENU_BUTTON_STATE_ZOOM_OUT; - sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonActionPhase = ERASE_PHASE_MAIN; - sFadeOutText = TRUE; - sMainMenuTimer = 0; - sEraseYesNoHoverState = MENU_ERASE_HOVER_NONE; - } - } - - // Print "YES NO" strings - gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); - gDPSetEnvColor(gDisplayListHead++, sYesNoColor[0], sYesNoColor[0], sYesNoColor[0], sTextBaseAlpha); - print_generic_string(x + 56, y, LANGUAGE_ARRAY(textYes)); - gDPSetEnvColor(gDisplayListHead++, sYesNoColor[1], sYesNoColor[1], sYesNoColor[1], sTextBaseAlpha); - print_generic_string(x + 98, y, LANGUAGE_ARRAY(textNo)); - gSPDisplayList(gDisplayListHead++, dl_ia_text_end); -} - -// MARIO_ERASED_VAR is the value there the letter "A" is, it works like this: -// US and EU --- JP -// M a r i o A --- マ リ オ A -// 0 1 2 3 4 5 6 --- 0 1 2 3 -#if defined(VERSION_JP) || defined(VERSION_SH) -#define ERASE_FILE_X 96 -#define NOSAVE_DATA_X3 90 -#define MARIO_ERASED_VAR 3 -#define MARIO_ERASED_X 90 -#define SAVE_EXISTS_X2 90 -#elif VERSION_EU -#define ERASE_FILE_X centeredX -#define NOSAVE_DATA_X3 centeredX -#define MARIO_ERASED_VAR 6 -#define MARIO_ERASED_X centeredX -#define SAVE_EXISTS_X2 centeredX -#else -#define ERASE_FILE_X 98 -#define NOSAVE_DATA_X3 100 -#define MARIO_ERASED_VAR 6 -#define MARIO_ERASED_X 100 -#define SAVE_EXISTS_X2 100 -#endif - -/** - * Defines IDs for the top message of the erase menu and displays it if the ID is called in messageID. - */ -void erase_menu_display_message(s8 messageID) { -#ifdef VERSION_EU - s16 centeredX; -#endif - -#ifndef VERSION_EU - unsigned char textEraseFile[] = { TEXT_ERASE_FILE }; - unsigned char textSure[] = { TEXT_SURE }; - unsigned char textNoSavedDataExists[] = { TEXT_NO_SAVED_DATA_EXISTS }; - unsigned char textMarioAJustErased[] = { TEXT_FILE_MARIO_A_JUST_ERASED }; - unsigned char textSavedDataExists[] = { TEXT_SAVED_DATA_EXISTS }; -#endif - - switch (messageID) { - case ERASE_MSG_MAIN_TEXT: -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center_scale(160, textEraseFile[sLanguageMode], 12.0f); -#endif - print_hud_lut_string_fade(HUD_LUT_DIFF, ERASE_FILE_X, 35, LANGUAGE_ARRAY(textEraseFile)); - break; - case ERASE_MSG_PROMPT: - print_generic_string_fade(90, 190, LANGUAGE_ARRAY(textSure)); - print_erase_menu_prompt(90, 190); // YES NO, has functions for it too - break; - case ERASE_MSG_NOSAVE_EXISTS: -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center(160, textNoSavedDataExists[sLanguageMode], 10.0f); -#endif - print_generic_string_fade(NOSAVE_DATA_X3, 190, LANGUAGE_ARRAY(textNoSavedDataExists)); - break; - case ERASE_MSG_MARIO_ERASED: - LANGUAGE_ARRAY(textMarioAJustErased)[MARIO_ERASED_VAR] = sSelectedFileIndex + 10; -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center(160, textMarioAJustErased[sLanguageMode], 10.0f); -#endif - print_generic_string_fade(MARIO_ERASED_X, 190, LANGUAGE_ARRAY(textMarioAJustErased)); - break; - case ERASE_MSG_SAVE_EXISTS: // unused -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center(160, textSavedDataExists[sLanguageMode], 10.0f); -#endif - print_generic_string_fade(SAVE_EXISTS_X2, 190, LANGUAGE_ARRAY(textSavedDataExists)); - break; - } -} - -/** - * Updates messageIDs of the erase menu depending of the erase phase value defined. - */ -void erase_menu_update_message(void) { - switch (sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonActionPhase) { - case ERASE_PHASE_MAIN: - if (sMainMenuTimer == FADEOUT_TIMER && sStatusMessageID == ERASE_MSG_NOSAVE_EXISTS) { - sFadeOutText = TRUE; - } - if (update_text_fade_out() == TRUE) { - if (sStatusMessageID == ERASE_MSG_MAIN_TEXT) { - sStatusMessageID = ERASE_MSG_NOSAVE_EXISTS; - } else { - sStatusMessageID = ERASE_MSG_MAIN_TEXT; - } - } - break; - case ERASE_PHASE_PROMPT: - if (update_text_fade_out() == TRUE) { - if (sStatusMessageID != ERASE_MSG_PROMPT) { - sStatusMessageID = ERASE_MSG_PROMPT; - } - sCursorPos[0] = 43.0f; - sCursorPos[1] = 80.0f; - } - break; - case ERASE_PHASE_MARIO_ERASED: - if (sMainMenuTimer == FADEOUT_TIMER) { - sFadeOutText = TRUE; - } - if (update_text_fade_out() == TRUE) { - if (sStatusMessageID != ERASE_MSG_MARIO_ERASED) { - sStatusMessageID = ERASE_MSG_MARIO_ERASED; - } else { - sStatusMessageID = ERASE_MSG_MAIN_TEXT; - } - } - break; - } -} - -#if defined(VERSION_JP) || defined(VERSION_SH) -#define VIEWSCORE_X2 133 -#define COPYFILE_X2 223 -#else -#define VIEWSCORE_X2 127 -#define COPYFILE_X2 233 -#endif - -/** - * Prints erase menu strings that shows on the red background menu screen. - */ -void print_erase_menu_strings(void) { -#ifdef VERSION_EU - s16 centeredX; -#endif - - // Update and print the message at the top of the menu. - erase_menu_update_message(); - - // Print messageID called inside a erase_menu_update_message case - erase_menu_display_message(sStatusMessageID); - -#ifndef VERSION_EU - // Print file star counts - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - print_save_file_star_count(SAVE_FILE_A, 90, 76); - print_save_file_star_count(SAVE_FILE_B, 211, 76); - print_save_file_star_count(SAVE_FILE_C, 90, 119); - print_save_file_star_count(SAVE_FILE_D, 211, 119); - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); -#endif - - // Print menu names - gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - -#ifdef VERSION_EU - centeredX = get_str_x_pos_from_center(69, textReturn[sLanguageMode], 10.0f); - print_generic_string(centeredX, 35, textReturn[sLanguageMode]); - centeredX = get_str_x_pos_from_center(159, textViewScore[sLanguageMode], 10.0f); - print_generic_string(centeredX, 35, textViewScore[sLanguageMode]); - centeredX = get_str_x_pos_from_center(249, textCopyFileButton[sLanguageMode], 10.0f); - print_generic_string(centeredX, 35, textCopyFileButton[sLanguageMode]); -#else - print_generic_string(RETURN_X, 35, textReturn); - print_generic_string(VIEWSCORE_X2, 35, textViewScore); - print_generic_string(COPYFILE_X2, 35, textCopyFileButton); -#endif - gSPDisplayList(gDisplayListHead++, dl_ia_text_end); - -#ifdef VERSION_EU - print_main_menu_strings(); -#else - // Print file names - gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - print_menu_generic_string(89, 62, textMarioA); - print_menu_generic_string(211, 62, textMarioB); - print_menu_generic_string(89, 105, textMarioC); - print_menu_generic_string(211, 105, textMarioD); - gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_end); -#endif -} - -#if defined(VERSION_JP) || defined(VERSION_SH) -#define SOUND_HUD_X 96 -#elif VERSION_US -#define SOUND_HUD_X 88 -#endif - -/** - * Prints sound mode menu strings that shows on the purple background menu screen. - * - * In EU, this function acts like "print_option_mode_menu_strings" because of languages. - */ -void print_sound_mode_menu_strings(void) { - s32 mode; - -#ifdef VERSION_US - s16 textX; -#elif VERSION_EU - s32 textX; -#endif - -#ifndef VERSION_EU - unsigned char textSoundSelect[] = { TEXT_SOUND_SELECT }; -#endif - - // Print "SOUND SELECT" text - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - - auto &text_renderer = ServiceLocator::get_text_renderer(); -#ifdef VERSION_EU - text_renderer.render_text(textSoundSelect[sLanguageMode], 47, 32, LutSource::DIFF); - text_renderer.render_text(textLanguageSelect[sLanguageMode], 47, 101, LutSource::DIFF); -#else - text_renderer.render() - ->with_glyph_set(LutSource::DIFF) - ->glyphs_at(textSoundSelect, SOUND_HUD_X, 35); -#endif - - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); - - gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); - -#ifdef VERSION_EU // In EU their X position get increased each string - // Print sound mode names - for (mode = 0, textX = 90; mode < 3; textX += 70, mode++) { - if (mode == sSoundMode) { - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - } else { - gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, sTextBaseAlpha); - } - print_generic_string( - get_str_x_pos_from_center(textX, textSoundModes[sLanguageMode * 3 + mode], 10.0f), 141, - textSoundModes[sLanguageMode * 3 + mode]); - } - - // In EU, print language mode names - for (mode = 0, textX = 90; mode < 3; textX += 70, mode++) { - if (mode == sLanguageMode) { - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - } else { - gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, sTextBaseAlpha); - } - print_generic_string(get_str_x_pos_from_center(textX, textLanguage[mode], 10.0f), 72, - textLanguage[mode]); - } -#else - // Print sound mode names - for (mode = 0; mode < 3; mode++) { - if (mode == sSoundMode) { - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - } else { - gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, sTextBaseAlpha); - } -#ifdef VERSION_US - // Mode names are centered correctly on US - textX = get_str_x_pos_from_center(mode * 74 + 87, textSoundModes[mode], 10.0f); - print_generic_string(textX, 87, textSoundModes[mode]); -#elif VERSION_JP - print_generic_string(mode * 74 + 67, 87, textSoundModes[mode]); -#endif - } -#endif - -#ifdef VERSION_EU - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - print_generic_string(182, 29, textReturn[sLanguageMode]); -#endif - - gSPDisplayList(gDisplayListHead++, dl_ia_text_end); -} - -unsigned char textStarX[] = { TEXT_STAR_X }; - -/** - * Prints castle secret stars collected in a score menu save file. - */ -void print_score_file_castle_secret_stars(s8 fileIndex, s16 x, s16 y) { - unsigned char secretStarsText[20]; - // Print "[star] x" - print_menu_generic_string(x, y, textStarX); - // Print number of castle secret stars - int_to_str(save_file_get_total_star_count(fileIndex, 15, 24), secretStarsText); -#ifdef VERSION_EU - print_menu_generic_string(x + 20, y, secretStarsText); -#else - print_menu_generic_string(x + 16, y, secretStarsText); -#endif -} - -#if defined(VERSION_JP) || defined(VERSION_SH) -#define HISCORE_COIN_ICON_X 0 -#define HISCORE_COIN_TEXT_X 16 -#define HISCORE_COIN_NAMES_X 45 -#else -#define HISCORE_COIN_ICON_X 18 -#define HISCORE_COIN_TEXT_X 34 -#define HISCORE_COIN_NAMES_X 60 -#endif - -/** - * Prints course coins collected in a score menu save file. - */ -void print_score_file_course_coin_score(s8 fileIndex, s16 courseIndex, s16 x, s16 y) { - unsigned char coinScoreText[20]; - u8 stars = save_file_get_star_flags(fileIndex, courseIndex); - unsigned char textCoinX[] = { TEXT_COIN_X }; - unsigned char textStar[] = { TEXT_STAR }; -#if defined(VERSION_JP) || defined(VERSION_SH) -#define LENGTH 5 -#else -#define LENGTH 8 -#endif - unsigned char fileNames[][LENGTH] = { - { TEXT_4DASHES }, // huh? - { TEXT_SCORE_MARIO_A }, { TEXT_SCORE_MARIO_B }, { TEXT_SCORE_MARIO_C }, { TEXT_SCORE_MARIO_D }, - }; -#undef LENGTH - // MYSCORE - if (sScoreFileCoinScoreMode == 0) { - // Print "[coin] x" - print_menu_generic_string(x + 25, y, textCoinX); - // Print coin score - int_to_str(save_file_get_course_coin_score(fileIndex, courseIndex), coinScoreText); - print_menu_generic_string(x + 41, y, coinScoreText); - // If collected, print 100 coin star - if (stars & (1 << 6)) { - print_menu_generic_string(x + 70, y, textStar); - } - } - // HISCORE - else { - // Print "[coin] x" - print_menu_generic_string(x + HISCORE_COIN_ICON_X, y, textCoinX); - // Print coin highscore - int_to_str((u16) save_file_get_max_coin_score(courseIndex) & 0xFFFF, coinScoreText); - print_menu_generic_string(x + HISCORE_COIN_TEXT_X, y, coinScoreText); - // Print coin highscore file - print_menu_generic_string(x + HISCORE_COIN_NAMES_X, y, - fileNames[(save_file_get_max_coin_score(courseIndex) >> 16) & 0xFFFF]); - } -} - -/** - * Prints stars collected in a score menu save file. - */ -void print_score_file_star_score(s8 fileIndex, s16 courseIndex, s16 x, s16 y) { - s16 i = 0; - unsigned char starScoreText[19]; - u8 stars = save_file_get_star_flags(fileIndex, courseIndex); - s8 starCount = save_file_get_course_star_count(fileIndex, courseIndex); - // Don't count 100 coin star - if (stars & (1 << 6)) { - starCount--; - } - // Add 1 star character for every star collected - for (i = 0; i < starCount; i++) { - starScoreText[i] = DIALOG_CHAR_STAR_FILLED; - } - // Terminating byte - starScoreText[i] = DIALOG_CHAR_TERMINATOR; - print_menu_generic_string(x, y, starScoreText); -} - -#if defined(VERSION_JP) || defined(VERSION_SH) -#define MARIO_X 28 -#define FILE_LETTER_X 86 -#define LEVEL_NAME_X 23 -#define SECRET_STARS_X 152 -#define MYSCORE_X 237 -#define HISCORE_X 237 -#else -#define MARIO_X 25 -#define FILE_LETTER_X 95 -#define LEVEL_NAME_X 29 -#define SECRET_STARS_X 171 -#define MYSCORE_X 238 -#define HISCORE_X 231 -#endif - -#ifdef VERSION_EU -#include "game/segment7.h" -#endif - -/** - * Prints save file score strings that shows when a save file is chosen inside the score menu. - */ -void print_save_file_scores(s8 fileIndex) { -#ifndef VERSION_EU - unsigned char textMario[] = { TEXT_MARIO }; -#endif -#ifndef VERSION_US - unsigned char textFileLetter[] = { TEXT_ZERO }; -#endif -#if defined(VERSION_JP) || defined(VERSION_SH) - void **levelNameTable = segmented_to_virtual(seg2_course_name_table); -#endif -#ifndef VERSION_EU - unsigned char textHiScore[] = { TEXT_HI_SCORE }; - unsigned char textMyScore[] = { TEXT_MY_SCORE }; -#ifdef VERSION_US - unsigned char textFileLetter[] = { TEXT_ZERO }; - void **levelNameTable = (void **) segmented_to_virtual(seg2_course_name_table); -#endif -#else - void **levelNameTable; - switch (sLanguageMode) { - case LANGUAGE_ENGLISH: - levelNameTable = segmented_to_virtual(eu_course_strings_en_table); - break; - case LANGUAGE_FRENCH: - levelNameTable = segmented_to_virtual(eu_course_strings_fr_table); - break; - case LANGUAGE_GERMAN: - levelNameTable = segmented_to_virtual(eu_course_strings_de_table); - break; - } -#endif - - textFileLetter[0] = fileIndex + ASCII_TO_DIALOG('A'); // get letter of file selected - - // Print file name at top - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - print_hud_lut_string(HUD_LUT_DIFF, MARIO_X, 15, textMario); - print_hud_lut_string(HUD_LUT_GLOBAL, FILE_LETTER_X, 15, textFileLetter); - - // Print save file star count at top - print_save_file_star_count(fileIndex, 124, 15); - gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end); - // Print course scores - gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_begin); - gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); - -//! Huge print list, for loops exist for a reason! -// PADCHAR is used to difference an x position value between -// JP and US when the course number is only one digit. -#if defined(VERSION_JP) || defined(VERSION_SH) -#define PADCHAR 0 -#define PRINT_COURSE_SCORES(courseIndex, pad) \ - print_menu_generic_string(23 + (pad * 3), 23 + 12 * courseIndex, \ - segmented_to_virtual(levelNameTable[courseIndex - 1])); \ - print_score_file_star_score(fileIndex, courseIndex - 1, 152, 23 + 12 * courseIndex); \ - print_score_file_course_coin_score(fileIndex, courseIndex - 1, 213, 23 + 12 * courseIndex); -#else -#define PADCHAR 1 -#define PRINT_COURSE_SCORES(courseIndex, pad) \ - print_menu_generic_string(23 + (pad * 3), 23 + 12 * courseIndex, \ - (const u8 *) segmented_to_virtual(levelNameTable[courseIndex - 1])); \ - print_score_file_star_score(fileIndex, courseIndex - 1, 171, 23 + 12 * courseIndex); \ - print_score_file_course_coin_score(fileIndex, courseIndex - 1, 213, 23 + 12 * courseIndex); -#endif - // Course values are indexed, from Bob-omb Battlefield to Rainbow Ride - PRINT_COURSE_SCORES(COURSE_BOB, PADCHAR) // BOB - PRINT_COURSE_SCORES(COURSE_WF, PADCHAR) // WF - PRINT_COURSE_SCORES(COURSE_JRB, PADCHAR) // JRB - PRINT_COURSE_SCORES(COURSE_CCM, PADCHAR) // CCM - PRINT_COURSE_SCORES(COURSE_BBH, PADCHAR) // BBH - PRINT_COURSE_SCORES(COURSE_HMC, PADCHAR) // HMC - PRINT_COURSE_SCORES(COURSE_LLL, PADCHAR) // LLL - PRINT_COURSE_SCORES(COURSE_SSL, PADCHAR) // SSL - PRINT_COURSE_SCORES(COURSE_DDD, PADCHAR) // DDD - PRINT_COURSE_SCORES(COURSE_SL, 0) // SL - PRINT_COURSE_SCORES(COURSE_WDW, 0) // WDW - PRINT_COURSE_SCORES(COURSE_TTM, 0) // TTM - PRINT_COURSE_SCORES(COURSE_THI, 0) // THI - PRINT_COURSE_SCORES(COURSE_TTC, 0) // TTC - PRINT_COURSE_SCORES(COURSE_RR, 0) // RR -#undef PRINT_COURSE_SCORES -#undef PADCHAR - - // Print level name - print_menu_generic_string(LEVEL_NAME_X, 215, (const u8 *) segmented_to_virtual(levelNameTable[25])); - // Print castle secret stars - print_score_file_castle_secret_stars(fileIndex, SECRET_STARS_X, 215); - - // Print current coin score mode - if (sScoreFileCoinScoreMode == 0) { -#ifdef VERSION_EU - print_menu_generic_string(get_str_x_pos_from_center(257, textMyScore[sLanguageMode], 10.0f), 24, - textMyScore[sLanguageMode]); -#else - print_menu_generic_string(MYSCORE_X, 24, textMyScore); -#endif - } else { -#ifdef VERSION_EU - print_menu_generic_string(get_str_x_pos_from_center(257, textHiScore[sLanguageMode], 10.0f), 24, - textHiScore[sLanguageMode]); -#else - print_menu_generic_string(HISCORE_X, 24, textHiScore); -#endif - } - gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_end); -} - -/** - * Prints file select strings depending on the menu selected. - * Also checks if all saves exists and defines text and main menu timers. - */ -static void print_file_select_strings(void) { - UNUSED s32 unused1; - UNUSED s32 unused2; - - create_dl_ortho_matrix(); - switch (sSelectedButtonID) { - case MENU_BUTTON_NONE: -#ifdef VERSION_EU - // Ultimately calls print_main_menu_strings, but prints main language strings first. - print_main_lang_strings(); -#else - print_main_menu_strings(); -#endif - break; - case MENU_BUTTON_SCORE: - print_score_menu_strings(); - sScoreFileCoinScoreMode = 0; - break; - case MENU_BUTTON_COPY: - print_copy_menu_strings(); - break; - case MENU_BUTTON_ERASE: - print_erase_menu_strings(); - break; - case MENU_BUTTON_SCORE_FILE_A: - print_save_file_scores(SAVE_FILE_A); - break; - case MENU_BUTTON_SCORE_FILE_B: - print_save_file_scores(SAVE_FILE_B); - break; - case MENU_BUTTON_SCORE_FILE_C: - print_save_file_scores(SAVE_FILE_C); - break; - case MENU_BUTTON_SCORE_FILE_D: - print_save_file_scores(SAVE_FILE_D); - break; - case MENU_BUTTON_SOUND_MODE: - print_sound_mode_menu_strings(); - break; - } - // If all 4 save file exists, define true to sAllFilesExist to prevent more copies in copy menu - if (save_file_exists(SAVE_FILE_A) == TRUE && save_file_exists(SAVE_FILE_B) == TRUE - && save_file_exists(SAVE_FILE_C) == TRUE && save_file_exists(SAVE_FILE_D) == TRUE) { - sAllFilesExist = TRUE; - } else { - sAllFilesExist = FALSE; - } - // Timers for menu alpha text and the main menu itself - if (sTextBaseAlpha < 250) { - sTextBaseAlpha += 10; - } - if (sMainMenuTimer < 1000) { - sMainMenuTimer += 1; - } -} - -/** - * Geo function that prints file select strings and the cursor. - */ -Gfx *geo_file_select_strings_and_menu_cursor(s32 callContext, UNUSED struct GraphNode *node, - UNUSED Mat4 mtx) { - if (callContext == GEO_CONTEXT_RENDER) { - print_file_select_strings(); - print_menu_cursor(); - } - return NULL; -} - -/** - * Initiates file select values after Mario Screen. - * Relocates cursor position of the last save if the game goes back to the Mario Screen - * either completing a course choosing "SAVE & QUIT" or having a game over. - */ -s32 lvl_init_menu_values_and_cursor_pos(UNUSED s32 arg, UNUSED s32 unused) { -#ifdef VERSION_EU - s8 fileNum; -#endif - sSelectedButtonID = MENU_BUTTON_NONE; - sCurrentMenuLevel = MENU_LAYER_MAIN; - sTextBaseAlpha = 0; - // Place the cursor over the save file that was being played. - // gCurrSaveFileNum is 1 by default when the game boots, as such - // the cursor will point on Mario A save file. - switch (gCurrSaveFileNum) { - case 1: // File A - sCursorPos[0] = -94.0f; - sCursorPos[1] = 46.0f; - break; - case 2: // File B - sCursorPos[0] = 24.0f; - sCursorPos[1] = 46.0f; - break; - case 3: // File C - sCursorPos[0] = -94.0f; - sCursorPos[1] = 5.0f; - break; - case 4: // File D - sCursorPos[0] = 24.0f; - sCursorPos[1] = 5.0f; - break; - } - sClickPos[0] = -10000; - sClickPos[1] = -10000; - sCursorClickingTimer = 0; - sSelectedFileNum = 0; - sSelectedFileIndex = MENU_BUTTON_NONE; - sFadeOutText = FALSE; - sStatusMessageID = 0; - sTextFadeAlpha = 0; - sMainMenuTimer = 0; - sEraseYesNoHoverState = MENU_ERASE_HOVER_NONE; - sSoundMode = save_file_get_sound_mode(); -#ifdef VERSION_EU - sLanguageMode = eu_get_language(); - - for (fileNum = 0; fileNum < 4; fileNum++) { - if (save_file_exists(fileNum) == TRUE) { - sOpenLangSettings = FALSE; - break; - } else { - sOpenLangSettings = TRUE; - } - } -#endif - //! no return value -#ifdef AVOID_UB - return 0; -#endif -} - -/** - * Updates file select menu button objects so they can be interacted. - * When a save file is selected, it returns fileNum value - * defined in load_main_menu_save_file. - */ -s32 lvl_update_obj_and_load_file_selected(UNUSED s32 arg, UNUSED s32 unused) { - area_update_objects(); - return sSelectedFileNum; -} \ No newline at end of file diff --git a/src/menu/file_select.hpp b/src/menu/file_select.h similarity index 100% rename from src/menu/file_select.hpp rename to src/menu/file_select.h diff --git a/src/menu/intro_geo.c b/src/menu/intro_geo.c index dca37209..1d3be071 100644 --- a/src/menu/intro_geo.c +++ b/src/menu/intro_geo.c @@ -9,6 +9,8 @@ #include "types.h" #include "prevent_bss_reordering.h" +#include "gfx_dimensions.h" + // frame counts for the zoom in, hold, and zoom out of title model #define INTRO_STEPS_ZOOM_IN 20 #define INTRO_STEPS_HOLD_1 75 @@ -81,14 +83,14 @@ Gfx *geo_title_screen(s32 sp50, struct GraphNode *sp54, UNUSED void *context) { graphNode = sp54; displayList = NULL; displayListIter = NULL; - scaleTable1 = (f32*) segmented_to_virtual(intro_seg7_table_0700C790); - scaleTable2 = (f32*) segmented_to_virtual(intro_seg7_table_0700C880); + scaleTable1 = segmented_to_virtual(intro_seg7_table_0700C790); + scaleTable2 = segmented_to_virtual(intro_seg7_table_0700C880); if (sp50 != 1) { gTitleZoomCounter = 0; } else if (sp50 == 1) { graphNode->flags = (graphNode->flags & 0xFF) | 0x100; - scaleMat = (Mtx*) alloc_display_list(sizeof(*scaleMat)); - displayList = (Gfx*) alloc_display_list(4 * sizeof(*displayList)); + scaleMat = alloc_display_list(sizeof(*scaleMat)); + displayList = alloc_display_list(4 * sizeof(*displayList)); displayListIter = displayList; if (gTitleZoomCounter >= 0 && gTitleZoomCounter < INTRO_STEPS_ZOOM_IN) { scaleX = scaleTable1[gTitleZoomCounter * 3]; @@ -110,7 +112,7 @@ Gfx *geo_title_screen(s32 sp50, struct GraphNode *sp54, UNUSED void *context) { } guScale(scaleMat, scaleX, scaleY, scaleZ); gSPMatrix(displayListIter++, scaleMat, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH); - gSPDisplayList(displayListIter++, &intro_seg7_dl_0700B3A0); + gSPDisplayList(displayListIter++, &titletest_test_mesh); gSPPopMatrix(displayListIter++, G_MTX_MODELVIEW); gSPEndDisplayList(displayListIter); gTitleZoomCounter++; @@ -125,7 +127,7 @@ Gfx *geo_fade_transition(s32 sp40, struct GraphNode *sp44, UNUSED void *context) if (sp40 != 1) { gTitleFadeCounter = 0; // D_801B985C } else if (sp40 == 1) { - displayList = (Gfx*) alloc_display_list(5 * sizeof(*displayList)); + displayList = alloc_display_list(5 * sizeof(*displayList)); displayListIter = displayList; gSPDisplayList(displayListIter++, dl_proj_mtx_fullscreen); gDPSetEnvColor(displayListIter++, 255, 255, 255, gTitleFadeCounter); @@ -140,7 +142,7 @@ Gfx *geo_fade_transition(s32 sp40, struct GraphNode *sp44, UNUSED void *context) if (0) { } } - gSPDisplayList(displayListIter++, &intro_seg7_dl_0700C6A0); + //gSPDisplayList(displayListIter++, &intro_seg7_dl_0700C6A0); gSPEndDisplayList(displayListIter); if (gTitleZoomCounter >= 0x13) { gTitleFadeCounter += 0x1a; @@ -158,11 +160,15 @@ Gfx *intro_backdrop_one_image(s32 index, s8 *backgroundTable) { Gfx *displayListIter; // sp54 const u8 *const *vIntroBgTable; // sp50 s32 i; // sp4c - mtx = (Mtx*) alloc_display_list(sizeof(*mtx)); - displayList = (Gfx*) alloc_display_list(36 * sizeof(*displayList)); + f32 aspect = GFX_DIMENSIONS_ASPECT_RATIO; + int num_tiles_h = (((aspect*SCREEN_HEIGHT)+79)/80); + float x_ofs = (SCREEN_WIDTH/2)-(aspect*SCREEN_HEIGHT/2); + + mtx = alloc_display_list(sizeof(*mtx)); + displayList = alloc_display_list(36 * sizeof(*displayList)); displayListIter = displayList; - vIntroBgTable = (const u8* const*) segmented_to_virtual(introBackgroundTextureType[backgroundTable[index]]); - guTranslate(mtx, introBackgroundOffsetX[index], introBackgroundOffsetY[index], 0.0f); + vIntroBgTable = segmented_to_virtual(introBackgroundTextureType[backgroundTable[0]]); + guTranslate(mtx, ((index%num_tiles_h)*80)+x_ofs, (index/num_tiles_h)*80, 0.0f); gSPMatrix(displayListIter++, mtx, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH); gSPDisplayList(displayListIter++, &title_screen_bg_dl_0A000118); for (i = 0; i < 4; ++i) { @@ -187,13 +193,16 @@ Gfx *geo_intro_backdrop(s32 sp48, struct GraphNode *sp4c, UNUSED void *context) backgroundTable = introBackgroundTables[index]; displayList = NULL; displayListIter = NULL; + f32 aspect = GFX_DIMENSIONS_ASPECT_RATIO; + int num_tiles_h = (((aspect*SCREEN_HEIGHT)+79)/80); + if (sp48 == 1) { - displayList = (Gfx*) alloc_display_list(16 * sizeof(*displayList)); + displayList = alloc_display_list(((num_tiles_h*3)+4) * sizeof(*displayList)); displayListIter = displayList; graphNode->node.flags = (graphNode->node.flags & 0xFF) | 0x100; gSPDisplayList(displayListIter++, &dl_proj_mtx_fullscreen); gSPDisplayList(displayListIter++, &title_screen_bg_dl_0A000100); - for (i = 0; i < 12; ++i) { + for (i = 0; i < num_tiles_h*3; ++i) { gSPDisplayList(displayListIter++, intro_backdrop_one_image(i, backgroundTable)); } gSPDisplayList(displayListIter++, &title_screen_bg_dl_0A000190); @@ -211,6 +220,9 @@ Gfx *geo_game_over_tile(s32 sp40, struct GraphNode *sp44, UNUSED void *context) graphNode = sp44; displayList = NULL; displayListIter = NULL; + f32 aspect = GFX_DIMENSIONS_ASPECT_RATIO; + int num_tiles_h = (((aspect*SCREEN_HEIGHT)+79)/80); + if (sp40 != 1) { gGameOverFrameCounter = 0; gGameOverTableIndex = -2; @@ -218,7 +230,7 @@ Gfx *geo_game_over_tile(s32 sp40, struct GraphNode *sp44, UNUSED void *context) gameOverBackgroundTable[i] = INTRO_BACKGROUND_GAME_OVER; } } else { - displayList = (Gfx*) alloc_display_list(16 * sizeof(*displayList)); + displayList = alloc_display_list(((num_tiles_h*3)+4) * sizeof(*displayList)); displayListIter = displayList; if (gGameOverTableIndex == -2) { if (gGameOverFrameCounter == 180) { @@ -239,7 +251,7 @@ Gfx *geo_game_over_tile(s32 sp40, struct GraphNode *sp44, UNUSED void *context) graphNode->flags = (graphNode->flags & 0xFF) | 0x100; gSPDisplayList(displayListIter++, &dl_proj_mtx_fullscreen); gSPDisplayList(displayListIter++, &title_screen_bg_dl_0A000100); - for (j = 0; j < (s32) sizeof(gameOverBackgroundTable); ++j) { + for (j = 0; j < (s32) num_tiles_h*3; ++j) { gSPDisplayList(displayListIter++, intro_backdrop_one_image(j, gameOverBackgroundTable)); } gSPDisplayList(displayListIter++, &title_screen_bg_dl_0A000190); diff --git a/src/menu/level_select_menu.c b/src/menu/level_select_menu.c index c1a6ec60..b48478d3 100644 --- a/src/menu/level_select_menu.c +++ b/src/menu/level_select_menu.c @@ -69,6 +69,29 @@ int run_press_start_demo_timer(s32 timer) { return timer; } +extern int gDemoInputListID_2; +extern int gPressedStart; + +int start_demo(int timer) +{ + gCurrDemoInput = NULL; + gPressedStart = 0; + // start the mario demo animation for the demo list. + //func_80278AD4(&gDemo, gDemoInputListID_2); + + // if the next demo sequence ID is the count limit, reset it back to + // the first sequence. + + if((++gDemoInputListID_2) == gDemo.animDmaTable->count) + gDemoInputListID_2 = 0; + + gCurrDemoInput = ((struct DemoInput *) gDemo.targetAnim) + 1; // add 1 (+4) to the pointer to skip the demoID. + timer = (s8)((struct DemoInput *) gDemo.targetAnim)->timer; // TODO: see if making timer s8 matches + gCurrSaveFileNum = 1; + gCurrActNum = 6; + return timer; +} + // input loop for the level select menu. updates the selected stage // count if an input was received. signals the stage to be started // or the level select to be exited if start or the quit combo is @@ -134,28 +157,22 @@ s16 level_select_input_loop(void) { return 0; } + int intro_default(void) { s32 sp1C = 0; #ifndef VERSION_JP if (D_U_801A7C34 == 1) { - if (gGlobalTimer < 0x81) { - play_sound(SOUND_MARIO_HELLO, gDefaultSoundArgs); - } else { - play_sound(SOUND_MARIO_PRESS_START_TO_PLAY, gDefaultSoundArgs); - } + play_sound(SOUND_MARIO_HELLO, gDefaultSoundArgs); D_U_801A7C34 = 0; } #endif print_intro_text(); if (gPlayer1Controller->buttonPressed & START_BUTTON) { -#ifdef VERSION_JP - play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs); - sp1C = 100 + gDebugLevelSelect; -#else play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs); sp1C = 100 + gDebugLevelSelect; +#ifndef VERSION_JP D_U_801A7C34 = 1; #endif } diff --git a/src/menu/menu_button.cpp b/src/menu/menu_button.cpp deleted file mode 100644 index 152570a2..00000000 --- a/src/menu/menu_button.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include "menu_button.hpp" - -#include "object_fields.h" - -/** - * Public - */ -void MenuButton::grow_from_main_menu() { - if (change_size_in_main_menu(true)) { - set_state(MENU_BUTTON_STATE_FULLSCREEN); - } -} - -void MenuButton::shrink_to_main_menu() { - if (change_size_in_main_menu(false)) { - set_state(MENU_BUTTON_STATE_DEFAULT); - } -} - -void MenuButton::grow_from_submenu() { - if (change_size_in_submenu(true)) { - set_state(MENU_BUTTON_STATE_FULLSCREEN); - } -} - -void MenuButton::shrink_to_submenu() { - if (change_size_in_submenu(false)) { - set_state(MENU_BUTTON_STATE_DEFAULT); - } -} - - -/** - * Private - */ -void MenuButton::set_timer(s32 timer) { impl->oMenuButtonTimer = timer; } -s32 MenuButton::get_timer() const { return impl->oMenuButtonTimer; } - -void MenuButton::set_state(MainMenuButtonStates state) { - impl->oMenuButtonState = state; -} - -MainMenuButtonStates MenuButton::get_state() const { - return (MainMenuButtonStates) impl->oMenuButtonState; -} - -bool MenuButton::change_size_in_main_menu(bool grow) { - const auto timer = get_timer(); - const auto growthSign = grow ? 1 : -1; - - if (timer < 16) { impl->oFaceAngleYaw += growthSign * 0x800; } - if (timer < 8) { impl->oFaceAnglePitch += growthSign * 0x800; } - if (timer >= 8 && timer < 16) { impl->oFaceAnglePitch -= growthSign * 0x800; } - - impl->oParentRelativePosX -= growthSign * impl->oMenuButtonOrigPosX / 16.0; - impl->oParentRelativePosY -= growthSign * impl->oMenuButtonOrigPosY / 16.0; - - if ((grow && impl->oPosZ < impl->oMenuButtonOrigPosZ + 17800) - || (!grow && impl->oPosZ > impl->oMenuButtonOrigPosZ)) { - impl->oParentRelativePosZ += growthSign * 1112.5; - } - - set_timer(timer + 1); - if (get_timer() == 16) { - impl->oParentRelativePosX = grow ? 0 : impl->oMenuButtonOrigPosX; - impl->oParentRelativePosY = grow ? 0 : impl->oMenuButtonOrigPosY; - - set_timer(0); - - return true; - } - - return false; -} - -bool MenuButton::change_size_in_submenu(bool grow) { - const auto timer = get_timer(); - const auto growthSign = grow ? 1 : -1; - - if (timer < 16) { impl->oFaceAngleYaw += growthSign * 0x800; } - if (timer < 8) { impl->oFaceAnglePitch += growthSign * 0x800; } - if (timer >= 8 && timer < 16) { impl->oFaceAnglePitch -= growthSign * 0x800; } - - impl->oParentRelativePosX -= growthSign * impl->oMenuButtonOrigPosX / 16.0; - impl->oParentRelativePosY -= growthSign * impl->oMenuButtonOrigPosY / 16.0; - - if (grow || (!grow && impl->oPosZ > impl->oMenuButtonOrigPosZ)) { - impl->oParentRelativePosZ -= growthSign * 116.25; - } - - set_timer(timer + 1); - if (get_timer() == 16) { - impl->oParentRelativePosX = grow ? 0 : impl->oMenuButtonOrigPosX; - impl->oParentRelativePosY = grow ? 0 : impl->oMenuButtonOrigPosY; - set_timer(0); - - return true; - } - - return false; -} diff --git a/src/menu/menu_button.hpp b/src/menu/menu_button.hpp deleted file mode 100644 index 708ef6a3..00000000 --- a/src/menu/menu_button.hpp +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once -#include "file_select.hpp" - -#include - -/** - * Class representing the tile buttons on the main menu. This wraps around the - * Object struct from the original game. - */ -class MenuButton { -public: - explicit MenuButton(struct Object* impl) : impl(impl) {} - - void grow_from_main_menu(); - void shrink_to_main_menu(); - - void grow_from_submenu(); - void shrink_to_submenu(); - -private: - struct Object *impl; - - void set_state(MainMenuButtonStates state); - MainMenuButtonStates get_state() const; - - void set_timer(s32 timer); - s32 get_timer() const; - - /** Returns true once complete. */ - bool change_size_in_main_menu(bool grow); - bool change_size_in_submenu(bool grow); -}; diff --git a/src/menu/star_select.c b/src/menu/star_select.c index a6c44377..08b988e6 100644 --- a/src/menu/star_select.c +++ b/src/menu/star_select.c @@ -269,9 +269,9 @@ void print_act_selector_strings(void) { u8 *currLevelName; u8 **actNameTbl; #else - u8 **levelNameTbl = (u8**) segmented_to_virtual(seg2_course_name_table); - u8 *currLevelName = (u8*) segmented_to_virtual(levelNameTbl[gCurrCourseNum - 1]); - u8 **actNameTbl = (u8**) segmented_to_virtual(seg2_act_name_table); + u8 **levelNameTbl = segmented_to_virtual(seg2_course_name_table); + u8 *currLevelName = segmented_to_virtual(levelNameTbl[gCurrCourseNum - 1]); + u8 **actNameTbl = segmented_to_virtual(seg2_act_name_table); #endif u8 *selectedActName; #ifndef VERSION_EU @@ -342,7 +342,7 @@ void print_act_selector_strings(void) { gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, 255); // Print the name of the selected act. if (sVisibleStars != 0) { - selectedActName = (u8*) segmented_to_virtual(actNameTbl[(gCurrCourseNum - 1) * 6 + sSelectedActIndex]); + selectedActName = segmented_to_virtual(actNameTbl[(gCurrCourseNum - 1) * 6 + sSelectedActIndex]); #ifdef VERSION_EU print_menu_generic_string(get_str_x_pos_from_center(ACT_NAME_X, selectedActName, 8.0f), 81, selectedActName); @@ -394,10 +394,8 @@ s32 lvl_init_act_selector_values_and_stars(UNUSED s32 arg, UNUSED s32 unused) { sInitSelectedActNum = 0; sVisibleStars = 0; sActSelectorMenuTimer = 0; -#ifdef NO_SEGMENTED_MEMORY sSelectedActIndex = 0; sSelectableStarIndex = 0; -#endif sObtainedStars = save_file_get_course_star_count(gCurrSaveFileNum - 1, gCurrCourseNum - 1); // Don't count 100 coin star diff --git a/src/pc/gfx/LICENSE.txt b/src/pc/README-n64-fast32-engine.md similarity index 75% rename from src/pc/gfx/LICENSE.txt rename to src/pc/README-n64-fast32-engine.md index 5a1a079e..4aa387d4 100644 --- a/src/pc/gfx/LICENSE.txt +++ b/src/pc/README-n64-fast32-engine.md @@ -1,4 +1,12 @@ -Copyright (c) 2020 Emill, MaikelChan +# About n64-fast32-engine + +sm64pc supports OpenGL through [n64-fast32-engine](https://github.com/Emill/n64-fast3d-engine/), by [Emill](https://github.com/Emill/). + +We recommend that you visit the repo if you wish for a better understanding on how this port was possible. + +n64-fast32-engine is licensed under +``` +Copyright (c) 2020, Emill Redistribution and use in source forms, with or without modification, are permitted provided that the following conditions are met: @@ -17,3 +25,4 @@ 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. +``` diff --git a/src/pc/audio/audio_alsa.c b/src/pc/audio/audio_alsa.c deleted file mode 100644 index 9199b2f0..00000000 --- a/src/pc/audio/audio_alsa.c +++ /dev/null @@ -1,168 +0,0 @@ -#if defined(__linux__) && !defined(TARGET_WEB) -/* - Simple sound playback using ALSA API and libasound. - Dependencies: libasound, alsa - Build-Dependencies: liasound-dev - Compile: gcc -lasound -o play sound_playback.c - Usage: ./play < - Examples: - ./play 44100 2 5 < /dev/urandom - ./play 22050 1 8 < /path/to/file.wav - - Copyright (C) 2009 Alessandro Ghedini - -------------------------------------------------------------- - "THE BEER-WARE LICENSE" (Revision 42): - Alessandro Ghedini wrote this file. As long as you retain this - notice you can do whatever you want with this stuff. If we - meet some day, and you think this stuff is worth it, you can - buy me a beer in return. - -------------------------------------------------------------- -*/ - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include "audio_api.h" - -#define PCM_DEVICE "default" -static snd_pcm_t *pcm_handle; -static unsigned long int alsa_buffer_size; - -static unsigned long get_time(void) { - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - return (unsigned long)ts.tv_sec * 1000000 + ts.tv_nsec / 1000; -} - -static bool audio_alsa_init(void) { - int pcm; - unsigned int tmp; - unsigned int rate, channels; - snd_pcm_hw_params_t *params; - snd_pcm_uframes_t frames; - - rate = 32000; - channels = 2; - - /* Open the PCM device in playback mode */ - if ((pcm = snd_pcm_open(&pcm_handle, PCM_DEVICE, - SND_PCM_STREAM_PLAYBACK, 0)) < 0) { - printf("ERROR: Can't open \"%s\" PCM device. %s\n", - PCM_DEVICE, snd_strerror(pcm)); - return false; - } - - /* Allocate parameters object and fill it with default values*/ - snd_pcm_hw_params_alloca(¶ms); - - snd_pcm_hw_params_any(pcm_handle, params); - - /* Set parameters */ - if ((pcm = snd_pcm_hw_params_set_access(pcm_handle, params, - SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) - printf("ERROR: Can't set interleaved mode. %s\n", snd_strerror(pcm)); - - if ((pcm = snd_pcm_hw_params_set_format(pcm_handle, params, - SND_PCM_FORMAT_S16_LE)) < 0) - printf("ERROR: Can't set format. %s\n", snd_strerror(pcm)); - - if ((pcm = snd_pcm_hw_params_set_channels(pcm_handle, params, channels)) < 0) - printf("ERROR: Can't set channels number. %s\n", snd_strerror(pcm)); - - if ((pcm = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0)) < 0) - printf("ERROR: Can't set rate. %s\n", snd_strerror(pcm)); - - alsa_buffer_size = 1600 + 528 + 544; // five audio buffers from the game - if ((pcm = snd_pcm_hw_params_set_buffer_size_near(pcm_handle, params, &alsa_buffer_size)) < 0) - printf("ERROR: Can't set buffer size. %s\n", snd_strerror(pcm)); - - /* Write parameters */ - if ((pcm = snd_pcm_hw_params(pcm_handle, params)) < 0) - printf("ERROR: Can't set harware parameters. %s\n", snd_strerror(pcm)); - - /* Resume information */ - printf("PCM name: '%s'\n", snd_pcm_name(pcm_handle)); - - printf("PCM state: %s\n", snd_pcm_state_name(snd_pcm_state(pcm_handle))); - - snd_pcm_hw_params_get_channels(params, &tmp); - printf("channels: %i ", tmp); - - if (tmp == 1) - printf("(mono)\n"); - else if (tmp == 2) - printf("(stereo)\n"); - - snd_pcm_hw_params_get_rate(params, &tmp, 0); - printf("rate: %d bps\n", tmp); - - snd_pcm_hw_params_get_buffer_size(params, &alsa_buffer_size); - printf("buffer size: %lu\n", alsa_buffer_size); - - /* Allocate buffer to hold single period */ - snd_pcm_hw_params_get_period_size(params, &frames, 0); - printf("frames: %lu\n", frames); - - snd_pcm_hw_params_get_period_time(params, &tmp, NULL); - printf("time: %d\n", tmp); - - return true; -} - -static int audio_alsa_buffered(void) { - if (!pcm_handle) { - return 0; - } - snd_pcm_sframes_t ret = snd_pcm_avail(pcm_handle); - if (ret < 0) { - return 0; - } - ret = alsa_buffer_size - ret; - return ret < 0 ? 0 : ret; -} - -static int audio_alsa_get_desired_buffered(void) { - return 1100; -} - -static void audio_alsa_play(const uint8_t* buff, size_t len) { - if (!pcm_handle) { - audio_alsa_init(); - } - //unsigned long t1 = get_time(); - int frames = len / 4; - int pcm; - if ((pcm = snd_pcm_writei(pcm_handle, buff, frames)) == -EPIPE) { - printf("XRUN.\n"); - snd_pcm_prepare(pcm_handle); - // Add some silence to avoid another XRUN - char buf[1100 * 4 + len]; - memset(buf, 0, 1100 * 4); - memcpy(buf + 1100 * 4, buff, len); - if ((pcm = snd_pcm_writei(pcm_handle, buf, 1100 + frames)) < 0) { - printf("Failed again %d\n", pcm); - } - } else if (pcm < 0) { - printf("ERROR. Can't write to PCM device. %s\n", snd_strerror(pcm)); - return; - } - //fprintf(stderr, "%u ", get_time() - t1); -} - -struct AudioAPI audio_alsa = { - audio_alsa_init, - audio_alsa_buffered, - audio_alsa_get_desired_buffered, - audio_alsa_play -}; - -#endif diff --git a/src/pc/audio/audio_alsa.h b/src/pc/audio/audio_alsa.h deleted file mode 100644 index ba404ff2..00000000 --- a/src/pc/audio/audio_alsa.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef AUDIO_ALSA_H -#define AUDIO_ALSA_H - -#ifdef __linux__ -extern struct AudioAPI audio_alsa; -#define HAVE_ALSA 1 -#else -#define HAVE_ALSA 0 -#endif - -#endif diff --git a/src/pc/audio/audio_api.h b/src/pc/audio/audio_api.h index 26794dd6..b40130e0 100644 --- a/src/pc/audio/audio_api.h +++ b/src/pc/audio/audio_api.h @@ -10,6 +10,7 @@ struct AudioAPI { int (*buffered)(void); int (*get_desired_buffered)(void); void (*play)(const uint8_t *buf, size_t len); + void (*shutdown)(void); }; #endif diff --git a/src/pc/audio/audio_null.c b/src/pc/audio/audio_null.c index 88b7a42b..4d0dd923 100644 --- a/src/pc/audio/audio_null.c +++ b/src/pc/audio/audio_null.c @@ -1,4 +1,3 @@ -#include "macros.h" #include "audio_api.h" static bool audio_null_init(void) { @@ -13,12 +12,16 @@ static int audio_null_get_desired_buffered(void) { return 0; } -static void audio_null_play(UNUSED const uint8_t *buf, UNUSED size_t len) { +static void audio_null_play(const uint8_t *buf, size_t len) { +} + +static void audio_null_shutdown(void) { } struct AudioAPI audio_null = { audio_null_init, audio_null_buffered, audio_null_get_desired_buffered, - audio_null_play -}; + audio_null_play, + audio_null_shutdown +}; \ No newline at end of file diff --git a/src/pc/audio/audio_pulse.c b/src/pc/audio/audio_pulse.c deleted file mode 100644 index 06fcf87a..00000000 --- a/src/pc/audio/audio_pulse.c +++ /dev/null @@ -1,204 +0,0 @@ -#ifdef __linux__ - -#include -#include -#include - -#include "macros.h" -#include "audio_api.h" - -static struct { - pa_mainloop *mainloop; - pa_context *context; - pa_stream *stream; - pa_buffer_attr attr; - bool write_complete; -} pas; - -static void pas_context_state_cb(pa_context *c, void *userdata) { - switch (pa_context_get_state(c)) { - case PA_CONTEXT_READY: - case PA_CONTEXT_TERMINATED: - case PA_CONTEXT_FAILED: - *((bool *)userdata) = true; - break; - default: - break; - } -} - -static void pas_stream_state_cb(pa_stream *s, void *userdata) { - switch (pa_stream_get_state(s)) { - case PA_STREAM_READY: - case PA_STREAM_FAILED: - case PA_STREAM_TERMINATED: - *((bool *)userdata) = true; - break; - default: - break; - } -} - -static void pas_stream_write_cb(UNUSED pa_stream *s, UNUSED size_t length, UNUSED void *userdata) { - //size_t ws = pa_stream_writable_size(pas.stream); - //printf("write cb: %d %d\n", (int)length, (int)ws); -} - -static bool audio_pulse_init(void) { - // Create mainloop - pas.mainloop = pa_mainloop_new(); - if (pas.mainloop == NULL) { - return false; - } - - // Create context and connect - pas.context = pa_context_new(pa_mainloop_get_api(pas.mainloop), "Super Mario 64"); - if (pas.context == NULL) { - goto fail; - } - - bool done = false; - pa_context_set_state_callback(pas.context, pas_context_state_cb, &done); - - if (pa_context_connect(pas.context, NULL, 0, NULL) < 0) { - goto fail; - } - - while (!done) { - pa_mainloop_iterate(pas.mainloop, true, NULL); - } - pa_context_set_state_callback(pas.context, NULL, NULL); - if (pa_context_get_state(pas.context) != PA_CONTEXT_READY) { - goto fail; - } - - // Create stream - pa_sample_spec ss; - ss.format = PA_SAMPLE_S16LE; - ss.rate = 32000; - ss.channels = 2; - - pa_buffer_attr attr; - attr.maxlength = (1600 + 544 + 528 + 1600) * 4; - attr.tlength = (528*2 + 544) * 4; - attr.prebuf = 1500 * 4; - attr.minreq = 161 * 4; - attr.fragsize = (uint32_t)-1; - - pas.stream = pa_stream_new(pas.context, "mario", &ss, NULL); - if (pas.stream == NULL) { - goto fail; - } - - done = false; - pa_stream_set_state_callback(pas.stream, pas_stream_state_cb, &done); - pa_stream_set_write_callback(pas.stream, pas_stream_write_cb, NULL); - if (pa_stream_connect_playback(pas.stream, NULL, &attr, PA_STREAM_ADJUST_LATENCY, NULL, NULL) < 0) { - goto fail; - } - - while (!done) { - pa_mainloop_iterate(pas.mainloop, true, NULL); - } - pa_stream_set_state_callback(pas.stream, NULL, NULL); - if (pa_stream_get_state(pas.stream) != PA_STREAM_READY) { - goto fail; - } - - const pa_buffer_attr *applied_attr = pa_stream_get_buffer_attr(pas.stream); - printf("maxlength: %u\ntlength: %u\nprebuf: %u\nminreq: %u\nfragsize: %u\n", - applied_attr->maxlength, applied_attr->tlength, applied_attr->prebuf, applied_attr->minreq, applied_attr->fragsize); - pas.attr = *applied_attr; - - return true; - -fail: - if (pas.stream != NULL) { - pa_stream_unref(pas.stream); - pas.stream = NULL; - } - if (pas.context != NULL) { - pa_context_disconnect(pas.context); - pa_context_unref(pas.context); - pas.context = NULL; - } - if (pas.mainloop != NULL) { - pa_mainloop_free(pas.mainloop); - pas.mainloop = NULL; - } - return false; -} - -static void pas_update_complete(UNUSED pa_stream *stream, UNUSED int success, void *userdata) { - *(bool *)userdata = true; -} - -static void pas_update(void) { - bool done = false; - pa_stream_update_timing_info(pas.stream, pas_update_complete, &done); - while (!done) { - pa_mainloop_iterate(pas.mainloop, true, NULL); - } -} - -static void pas_write_complete(UNUSED void *p) { - pas.write_complete = true; -} - -static int audio_pulse_buffered(void) { - if (pas.stream == NULL) { - return 0; - } - pas_update(); - const pa_timing_info *info = pa_stream_get_timing_info(pas.stream); - if (info == NULL) { - printf("pa_stream_get_timing_info failed, state is %d\n", pa_stream_get_state(pas.stream)); - } - /*int diff = info->write_index - info->read_index + (int)(info->sink_usec * 0.128); - pa_usec_t usec; - pa_stream_get_time(pas.stream, &usec); - int32_t t = info->timestamp.tv_sec * 1000000 + info->timestamp.tv_usec - (usec - info->transport_usec); - static int t0; - if (t0 == 0) t0 = t;*/ - - /*int r = pa_mainloop_iterate(pas.mainloop, false, NULL); - size_t ws = pa_stream_writable_size(pas.stream); - printf("Writable: %d (%d) %d %d %d %d %llu %d\n", (int)ws, r, (int)(info->write_index - info->read_index), diff, (int)info->sink_usec, (int)info->transport_usec, (unsigned long long)usec, t - t0);*/ - //return (pas.attr.tlength - ws) / 4; - return (info->write_index - info->read_index) / 4; -} - -static int audio_pulse_get_desired_buffered(void) { - return 1100; -} - -static void audio_pulse_play(const uint8_t *buf, size_t len) { - if (pas.stream == NULL) { - if (!audio_pulse_init()) { - return; - } - } - //size_t ws = pa_stream_writable_size(pas.stream); - size_t ws = pas.attr.maxlength - audio_pulse_buffered() * 4; - if (ws < len) { - //printf("Warning: can't write everything: %d vs %d\n", (int)len, (int)ws); - len = ws; - } - if (pa_stream_write(pas.stream, buf, len, pas_write_complete, 0LL, PA_SEEK_RELATIVE) < 0) { - printf("pa_stream_write failed\n"); - return; - } - while (!pas.write_complete) { - pa_mainloop_iterate(pas.mainloop, true, NULL); - } - pas.write_complete = false; -} - -struct AudioAPI audio_pulse = { - audio_pulse_init, - audio_pulse_buffered, - audio_pulse_get_desired_buffered, - audio_pulse_play -}; - -#endif diff --git a/src/pc/audio/audio_pulse.h b/src/pc/audio/audio_pulse.h deleted file mode 100644 index 8be9ea59..00000000 --- a/src/pc/audio/audio_pulse.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef AUDIO_PULSE_H -#define AUDIO_PULSE_H - -#ifdef __linux__ -extern struct AudioAPI audio_pulse; -#define HAVE_PULSE_AUDIO 1 -#else -#define HAVE_PULSE_AUDIO 0 -#endif - -#endif diff --git a/src/pc/audio/audio_sdl.c b/src/pc/audio/audio_sdl.c index 3f020f9d..0701b037 100644 --- a/src/pc/audio/audio_sdl.c +++ b/src/pc/audio/audio_sdl.c @@ -1,10 +1,6 @@ -#if !defined(_WIN32) && !defined(_WIN64) +#ifdef AAPI_SDL2 -#ifdef __MINGW32__ -#include "SDL.h" -#else -#include "SDL2/SDL.h" -#endif +#include #include "audio_api.h" @@ -46,11 +42,23 @@ static void audio_sdl_play(const uint8_t *buf, size_t len) { } } +static void audio_sdl_shutdown(void) +{ + if (SDL_WasInit(SDL_INIT_AUDIO)) { + if (dev != 0) { + SDL_CloseAudioDevice(dev); + dev = 0; + } + SDL_QuitSubSystem(SDL_INIT_AUDIO); + } +} + struct AudioAPI audio_sdl = { audio_sdl_init, audio_sdl_buffered, audio_sdl_get_desired_buffered, - audio_sdl_play + audio_sdl_play, + audio_sdl_shutdown }; #endif diff --git a/src/pc/audio/audio_sdl.h b/src/pc/audio/audio_sdl.h index e553239f..8b4a4e46 100644 --- a/src/pc/audio/audio_sdl.h +++ b/src/pc/audio/audio_sdl.h @@ -1,6 +1,8 @@ #ifndef AUDIO_SDL_H #define AUDIO_SDL_H +#include "audio_api.h" + extern struct AudioAPI audio_sdl; #endif diff --git a/src/pc/audio/audio_wasapi.cpp b/src/pc/audio/audio_wasapi.cpp deleted file mode 100644 index 2783fd00..00000000 --- a/src/pc/audio/audio_wasapi.cpp +++ /dev/null @@ -1,210 +0,0 @@ -#if defined(_WIN32) || defined(_WIN64) - -#include -#include - -#include -#include -#include -#include -#include - -#include "audio_api.h" - -// These constants are currently missing from the MinGW headers. -#ifndef AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM -# define AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM 0x80000000 -#endif -#ifndef AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY -# define AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY 0x08000000 -#endif - -using namespace Microsoft::WRL; - -const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator); -const IID IID_IMMDeviceEnumerator = __uuidof(IMMDeviceEnumerator); -const IID IID_IAudioClient = __uuidof(IAudioClient); -const IID IID_IAudioRenderClient = __uuidof(IAudioRenderClient); - -static ComPtr immdev_enumerator; - -static struct WasapiState { - ComPtr device; - ComPtr client; - ComPtr rclient; - UINT32 buffer_frame_count; - bool initialized; - bool started; -} wasapi; - -static class NotificationClient : public IMMNotificationClient { - LONG refcount; -public: - NotificationClient() : refcount(1) { - } - - virtual HRESULT STDMETHODCALLTYPE OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState) { - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE OnDeviceAdded(LPCWSTR pwstrDeviceId) { - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE OnDeviceRemoved(LPCWSTR pwstrDeviceId) { - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR pwstrDefaultDeviceId) { - if (flow == eRender && role == eConsole) { - // This callback runs on a separate thread, - // but it's not important how fast this write takes effect. - wasapi.initialized = false; - } - return S_OK; - } - - virtual HRESULT STDMETHODCALLTYPE OnPropertyValueChanged(LPCWSTR pwstrDeviceId, const PROPERTYKEY key) { - return S_OK; - } - - virtual ULONG STDMETHODCALLTYPE AddRef() { - return InterlockedIncrement(&refcount); - } - - virtual ULONG STDMETHODCALLTYPE Release() { - ULONG rc = InterlockedDecrement(&refcount); - if (rc == 0) { - delete this; - } - return rc; - } - - virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, VOID **ppvInterface) { - if (riid == __uuidof(IUnknown)) { - AddRef(); - *ppvInterface = (IUnknown *)this; - } else if (riid == __uuidof(IMMNotificationClient)) { - AddRef(); - *ppvInterface = (IMMNotificationClient *)this; - } else { - *ppvInterface = nullptr; - return E_NOINTERFACE; - } - return S_OK; - } -} notification_client; - -static void ThrowIfFailed(HRESULT res) { - if (FAILED(res)) { - throw res; - } -} - -bool audio_wasapi_init(void) { - try { - ThrowIfFailed(CoCreateInstance(CLSID_MMDeviceEnumerator, nullptr, CLSCTX_ALL, IID_PPV_ARGS(&immdev_enumerator))); - } catch (HRESULT res) { - return false; - } - - ThrowIfFailed(immdev_enumerator->RegisterEndpointNotificationCallback(new NotificationClient())); - - return true; -} - -static bool audio_wasapi_setup_stream(void) { - wasapi = WasapiState(); - - try { - ThrowIfFailed(immdev_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, &wasapi.device)); - ThrowIfFailed(wasapi.device->Activate(IID_IAudioClient, CLSCTX_ALL, nullptr, IID_PPV_ARGS_Helper(&wasapi.client))); - - WAVEFORMATEX desired; - desired.wFormatTag = WAVE_FORMAT_PCM; - desired.nChannels = 2; - desired.nSamplesPerSec = 32000; - desired.nAvgBytesPerSec = 32000 * 2 * 2; - desired.nBlockAlign = 4; - desired.wBitsPerSample = 16; - desired.cbSize = 0; - - ThrowIfFailed(wasapi.client->Initialize(AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM | AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY, 2000000, 0, &desired, nullptr)); - - ThrowIfFailed(wasapi.client->GetBufferSize(&wasapi.buffer_frame_count)); - ThrowIfFailed(wasapi.client->GetService(IID_PPV_ARGS(&wasapi.rclient))); - - wasapi.started = false; - wasapi.initialized = true; - } catch (HRESULT res) { - wasapi = WasapiState(); - return false; - } - - return true; -} - -static int audio_wasapi_buffered(void) { - if (!wasapi.initialized) { - if (!audio_wasapi_setup_stream()) { - return 0; - } - } - try { - UINT32 padding; - ThrowIfFailed(wasapi.client->GetCurrentPadding(&padding)); - return padding; - } catch (HRESULT res) { - wasapi = WasapiState(); - return 0; - } -} - -static int audio_wasapi_get_desired_buffered(void) { - return 1100; -} - -//#include -static void audio_wasapi_play(const uint8_t *buf, size_t len) { - if (!wasapi.initialized) { - if (!audio_wasapi_setup_stream()) { - return; - } - } - try { - UINT32 frames = len / 4; - - UINT32 padding; - ThrowIfFailed(wasapi.client->GetCurrentPadding(&padding)); - //printf("%u %u\n", frames, padding); - - UINT32 available = wasapi.buffer_frame_count - padding; - if (available < frames) { - frames = available; - } - if (available == 0) { - return; - } - - BYTE *data; - ThrowIfFailed(wasapi.rclient->GetBuffer(frames, &data)); - memcpy(data, buf, frames * 4); - ThrowIfFailed(wasapi.rclient->ReleaseBuffer(frames, 0)); - - if (!wasapi.started && padding + frames > 1500) { - wasapi.started = true; - ThrowIfFailed(wasapi.client->Start()); - } - } catch (HRESULT res) { - wasapi = WasapiState(); - } -} - -struct AudioAPI audio_wasapi = { - audio_wasapi_init, - audio_wasapi_buffered, - audio_wasapi_get_desired_buffered, - audio_wasapi_play -}; - -#endif diff --git a/src/pc/audio/audio_wasapi.h b/src/pc/audio/audio_wasapi.h deleted file mode 100644 index b0aab111..00000000 --- a/src/pc/audio/audio_wasapi.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef AUDIO_WASAPI_H -#define AUDIO_WASAPI_H - -#if defined(_WIN32) || defined(_WIN64) -#include "audio_api.h" -extern struct AudioAPI audio_wasapi; -#define HAVE_WASAPI 1 -#else -#define HAVE_WASAPI 0 -#endif - -#endif diff --git a/src/pc/cheats.c b/src/pc/cheats.c new file mode 100644 index 00000000..adcc4efe --- /dev/null +++ b/src/pc/cheats.c @@ -0,0 +1,3 @@ +#include "cheats.h" + +struct CheatList Cheats; diff --git a/src/pc/cheats.h b/src/pc/cheats.h new file mode 100644 index 00000000..eaf71ab4 --- /dev/null +++ b/src/pc/cheats.h @@ -0,0 +1,20 @@ +#ifndef _CHEATS_H +#define _CHEATS_H + +#include + +struct CheatList { + bool EnableCheats; + bool MoonJump; + bool GodMode; + bool InfiniteLives; + bool SuperSpeed; + bool Responsive; + bool ExitAnywhere; + bool HugeMario; + bool TinyMario; +}; + +extern struct CheatList Cheats; + +#endif // _CHEATS_H diff --git a/src/pc/cliopts.c b/src/pc/cliopts.c new file mode 100644 index 00000000..b9e9ee77 --- /dev/null +++ b/src/pc/cliopts.c @@ -0,0 +1,69 @@ +#include "cliopts.h" +#include "configfile.h" +#include "cheats.h" +#include "pc_main.h" +#include "platform.h" + +#include +#include +#define __NO_MINGW_LFS //Mysterious error in MinGW.org stdio.h +#include +#include + +struct PCCLIOptions gCLIOpts; + +static void print_help(void) { + printf("Super Mario 64 PC Port\n"); + printf("%-20s\tEnables the cheat menu.\n", "--cheats"); + printf("%-20s\tSaves the configuration file as CONFIGNAME.\n", "--configfile CONFIGNAME"); + printf("%-20s\tSets additional data directory name (only 'res' is used by default).\n", "--gamedir DIRNAME"); + printf("%-20s\tOverrides the default save/config path ('!' expands to executable path).\n", "--savepath SAVEPATH"); + printf("%-20s\tStarts the game in full screen mode.\n", "--fullscreen"); + printf("%-20s\tSkips the Peach and Castle intro when starting a new game.\n", "--skip-intro"); + printf("%-20s\tStarts the game in windowed mode.\n", "--windowed"); +} + +static inline int arg_string(const char *name, const char *value, char *target) { + const unsigned int arglen = strlen(value); + if (arglen >= SYS_MAX_PATH) { + fprintf(stderr, "Supplied value for `%s` is too long.\n", name); + return 0; + } + strncpy(target, value, arglen); + target[arglen] = '\0'; + return 1; +} + +void parse_cli_opts(int argc, char* argv[]) { + // Initialize options with false values. + memset(&gCLIOpts, 0, sizeof(gCLIOpts)); + + for (int i = 1; i < argc; i++) { + if (strcmp(argv[i], "--skip-intro") == 0) // Skip Peach Intro + gCLIOpts.SkipIntro = 1; + + else if (strcmp(argv[i], "--fullscreen") == 0) // Open game in fullscreen + gCLIOpts.FullScreen = 1; + + else if (strcmp(argv[i], "--windowed") == 0) // Open game in windowed mode + gCLIOpts.FullScreen = 2; + + else if (strcmp(argv[i], "--cheats") == 0) // Enable cheats menu + Cheats.EnableCheats = true; + + else if (strcmp(argv[i], "--configfile") == 0 && (i + 1) < argc) + arg_string("--configfile", argv[++i], gCLIOpts.ConfigFile); + + else if (strcmp(argv[i], "--gamedir") == 0 && (i + 1) < argc) + arg_string("--gamedir", argv[++i], gCLIOpts.GameDir); + + else if (strcmp(argv[i], "--savepath") == 0 && (i + 1) < argc) + arg_string("--savepath", argv[++i], gCLIOpts.SavePath); + + // Print help + else if (strcmp(argv[i], "--help") == 0) { + print_help(); + game_exit(); + } + } +} diff --git a/src/pc/cliopts.h b/src/pc/cliopts.h new file mode 100644 index 00000000..f9a45e18 --- /dev/null +++ b/src/pc/cliopts.h @@ -0,0 +1,18 @@ +#ifndef _CLIOPTS_H +#define _CLIOPTS_H + +#include "platform.h" + +struct PCCLIOptions { + unsigned int SkipIntro; + unsigned int FullScreen; + char ConfigFile[SYS_MAX_PATH]; + char SavePath[SYS_MAX_PATH]; + char GameDir[SYS_MAX_PATH]; +}; + +extern struct PCCLIOptions gCLIOpts; + +void parse_cli_opts(int argc, char* argv[]); + +#endif // _CLIOPTS_H diff --git a/src/pc/configfile.c b/src/pc/configfile.c index a38ba71c..7411d4f8 100644 --- a/src/pc/configfile.c +++ b/src/pc/configfile.c @@ -6,7 +6,13 @@ #include #include +#include "platform.h" #include "configfile.h" +#include "cliopts.h" +#include "gfx/gfx_screen_config.h" +#include "gfx/gfx_window_manager_api.h" +#include "controller/controller_api.h" +#include "fs/fs.h" #define ARRAY_LEN(arr) (sizeof(arr) / sizeof(arr[0])) @@ -14,6 +20,7 @@ enum ConfigOptionType { CONFIG_TYPE_BOOL, CONFIG_TYPE_UINT, CONFIG_TYPE_FLOAT, + CONFIG_TYPE_BIND, }; struct ConfigOption { @@ -29,51 +36,124 @@ struct ConfigOption { /* *Config options and default values */ -bool configFullscreen = false; -// Keyboard mappings (scancode values) -unsigned int configKeyA = 0x26; -unsigned int configKeyB = 0x33; -unsigned int configKeyStart = 0x39; -unsigned int configKeyR = 0x36; -unsigned int configKeyZ = 0x25; -unsigned int configKeyCUp = 0x148; -unsigned int configKeyCDown = 0x150; -unsigned int configKeyCLeft = 0x14B; -unsigned int configKeyCRight = 0x14D; -unsigned int configKeyStickUp = 0x11; -unsigned int configKeyStickDown = 0x1F; -unsigned int configKeyStickLeft = 0x1E; -unsigned int configKeyStickRight = 0x20; +// Video/audio stuff +ConfigWindow configWindow = { + .x = WAPI_WIN_CENTERPOS, + .y = WAPI_WIN_CENTERPOS, + .w = DESIRED_SCREEN_WIDTH, + .h = DESIRED_SCREEN_HEIGHT, + .vsync = 1, + .reset = false, + .fullscreen = false, + .exiting_fullscreen = false, + .settings_changed = false, +}; +unsigned int configFiltering = 1; // 0=force nearest, 1=linear, (TODO) 2=three-point +unsigned int configMasterVolume = MAX_VOLUME; // 0 - MAX_VOLUME +unsigned int configMusicVolume = MAX_VOLUME; +unsigned int configSfxVolume = MAX_VOLUME; +unsigned int configEnvVolume = MAX_VOLUME; + +// Keyboard mappings (VK_ values, by default keyboard/gamepad/mouse) +unsigned int configKeyA[MAX_BINDS] = { 0x0026, 0x1000, 0x1103 }; +unsigned int configKeyB[MAX_BINDS] = { 0x0033, 0x1002, 0x1101 }; +unsigned int configKeyStart[MAX_BINDS] = { 0x0039, 0x1006, VK_INVALID }; +unsigned int configKeyL[MAX_BINDS] = { 0x002A, 0x1009, 0x1104 }; +unsigned int configKeyR[MAX_BINDS] = { 0x0036, 0x100A, 0x101B }; +unsigned int configKeyZ[MAX_BINDS] = { 0x0025, 0x1007, 0x101A }; +unsigned int configKeyCUp[MAX_BINDS] = { 0x0148, VK_INVALID, VK_INVALID }; +unsigned int configKeyCDown[MAX_BINDS] = { 0x0150, VK_INVALID, VK_INVALID }; +unsigned int configKeyCLeft[MAX_BINDS] = { 0x014B, VK_INVALID, VK_INVALID }; +unsigned int configKeyCRight[MAX_BINDS] = { 0x014D, VK_INVALID, VK_INVALID }; +unsigned int configKeyStickUp[MAX_BINDS] = { 0x0011, VK_INVALID, VK_INVALID }; +unsigned int configKeyStickDown[MAX_BINDS] = { 0x001F, VK_INVALID, VK_INVALID }; +unsigned int configKeyStickLeft[MAX_BINDS] = { 0x001E, VK_INVALID, VK_INVALID }; +unsigned int configKeyStickRight[MAX_BINDS] = { 0x0020, VK_INVALID, VK_INVALID }; +unsigned int configStickDeadzone = 16; // 16*DEADZONE_STEP=4960 (the original default deadzone) +unsigned int configRumbleStrength = 50; +#ifdef EXTERNAL_DATA +bool configPrecacheRes = true; +#endif +#ifdef BETTERCAMERA +// BetterCamera settings +unsigned int configCameraXSens = 50; +unsigned int configCameraYSens = 50; +unsigned int configCameraAggr = 0; +unsigned int configCameraPan = 0; +unsigned int configCameraDegrade = 10; // 0 - 100% +bool configCameraInvertX = true; +bool configCameraInvertY = false; +bool configEnableCamera = false; +bool configCameraAnalog = true; +bool configCameraMouse = false; +#endif +bool configSkipIntro = 0; +bool configHUD = true; +#ifdef DISCORDRPC +bool configDiscordRPC = true; +#endif static const struct ConfigOption options[] = { - {.name = "fullscreen", .type = CONFIG_TYPE_BOOL, .boolValue = &configFullscreen}, - {.name = "key_a", .type = CONFIG_TYPE_UINT, .uintValue = &configKeyA}, - {.name = "key_b", .type = CONFIG_TYPE_UINT, .uintValue = &configKeyB}, - {.name = "key_start", .type = CONFIG_TYPE_UINT, .uintValue = &configKeyStart}, - {.name = "key_r", .type = CONFIG_TYPE_UINT, .uintValue = &configKeyR}, - {.name = "key_z", .type = CONFIG_TYPE_UINT, .uintValue = &configKeyZ}, - {.name = "key_cup", .type = CONFIG_TYPE_UINT, .uintValue = &configKeyCUp}, - {.name = "key_cdown", .type = CONFIG_TYPE_UINT, .uintValue = &configKeyCDown}, - {.name = "key_cleft", .type = CONFIG_TYPE_UINT, .uintValue = &configKeyCLeft}, - {.name = "key_cright", .type = CONFIG_TYPE_UINT, .uintValue = &configKeyCRight}, - {.name = "key_stickup", .type = CONFIG_TYPE_UINT, .uintValue = &configKeyStickUp}, - {.name = "key_stickdown", .type = CONFIG_TYPE_UINT, .uintValue = &configKeyStickDown}, - {.name = "key_stickleft", .type = CONFIG_TYPE_UINT, .uintValue = &configKeyStickLeft}, - {.name = "key_stickright", .type = CONFIG_TYPE_UINT, .uintValue = &configKeyStickRight}, + {.name = "fullscreen", .type = CONFIG_TYPE_BOOL, .boolValue = &configWindow.fullscreen}, + {.name = "window_x", .type = CONFIG_TYPE_UINT, .uintValue = &configWindow.x}, + {.name = "window_y", .type = CONFIG_TYPE_UINT, .uintValue = &configWindow.y}, + {.name = "window_w", .type = CONFIG_TYPE_UINT, .uintValue = &configWindow.w}, + {.name = "window_h", .type = CONFIG_TYPE_UINT, .uintValue = &configWindow.h}, + {.name = "vsync", .type = CONFIG_TYPE_BOOL, .boolValue = &configWindow.vsync}, + {.name = "texture_filtering", .type = CONFIG_TYPE_UINT, .uintValue = &configFiltering}, + {.name = "master_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configMasterVolume}, + {.name = "music_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configMusicVolume}, + {.name = "sfx_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configSfxVolume}, + {.name = "env_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configEnvVolume}, + {.name = "key_a", .type = CONFIG_TYPE_BIND, .uintValue = configKeyA}, + {.name = "key_b", .type = CONFIG_TYPE_BIND, .uintValue = configKeyB}, + {.name = "key_start", .type = CONFIG_TYPE_BIND, .uintValue = configKeyStart}, + {.name = "key_l", .type = CONFIG_TYPE_BIND, .uintValue = configKeyL}, + {.name = "key_r", .type = CONFIG_TYPE_BIND, .uintValue = configKeyR}, + {.name = "key_z", .type = CONFIG_TYPE_BIND, .uintValue = configKeyZ}, + {.name = "key_cup", .type = CONFIG_TYPE_BIND, .uintValue = configKeyCUp}, + {.name = "key_cdown", .type = CONFIG_TYPE_BIND, .uintValue = configKeyCDown}, + {.name = "key_cleft", .type = CONFIG_TYPE_BIND, .uintValue = configKeyCLeft}, + {.name = "key_cright", .type = CONFIG_TYPE_BIND, .uintValue = configKeyCRight}, + {.name = "key_stickup", .type = CONFIG_TYPE_BIND, .uintValue = configKeyStickUp}, + {.name = "key_stickdown", .type = CONFIG_TYPE_BIND, .uintValue = configKeyStickDown}, + {.name = "key_stickleft", .type = CONFIG_TYPE_BIND, .uintValue = configKeyStickLeft}, + {.name = "key_stickright", .type = CONFIG_TYPE_BIND, .uintValue = configKeyStickRight}, + {.name = "stick_deadzone", .type = CONFIG_TYPE_UINT, .uintValue = &configStickDeadzone}, + {.name = "rumble_strength", .type = CONFIG_TYPE_UINT, .uintValue = &configRumbleStrength}, + #ifdef EXTERNAL_DATA + {.name = "precache", .type = CONFIG_TYPE_BOOL, .boolValue = &configPrecacheRes}, + #endif + #ifdef BETTERCAMERA + {.name = "bettercam_enable", .type = CONFIG_TYPE_BOOL, .boolValue = &configEnableCamera}, + {.name = "bettercam_analog", .type = CONFIG_TYPE_BOOL, .boolValue = &configCameraAnalog}, + {.name = "bettercam_mouse_look", .type = CONFIG_TYPE_BOOL, .boolValue = &configCameraMouse}, + {.name = "bettercam_invertx", .type = CONFIG_TYPE_BOOL, .boolValue = &configCameraInvertX}, + {.name = "bettercam_inverty", .type = CONFIG_TYPE_BOOL, .boolValue = &configCameraInvertY}, + {.name = "bettercam_xsens", .type = CONFIG_TYPE_UINT, .uintValue = &configCameraXSens}, + {.name = "bettercam_ysens", .type = CONFIG_TYPE_UINT, .uintValue = &configCameraYSens}, + {.name = "bettercam_aggression", .type = CONFIG_TYPE_UINT, .uintValue = &configCameraAggr}, + {.name = "bettercam_pan_level", .type = CONFIG_TYPE_UINT, .uintValue = &configCameraPan}, + {.name = "bettercam_degrade", .type = CONFIG_TYPE_UINT, .uintValue = &configCameraDegrade}, + #endif + {.name = "skip_intro", .type = CONFIG_TYPE_BOOL, .boolValue = &configSkipIntro}, + #ifdef DISCORDRPC + {.name = "discordrpc_enable", .type = CONFIG_TYPE_BOOL, .boolValue = &configDiscordRPC}, + #endif }; // Reads an entire line from a file (excluding the newline character) and returns an allocated string // Returns NULL if no lines could be read from the file -static char *read_file_line(FILE *file) { +static char *read_file_line(fs_file_t *file) { char *buffer; size_t bufferSize = 8; size_t offset = 0; // offset in buffer to write - buffer = (char*) malloc(bufferSize); + buffer = malloc(bufferSize); while (1) { // Read a line from the file - if (fgets(buffer + offset, bufferSize - offset, file) == NULL) { + if (fs_readline(file, buffer + offset, bufferSize - offset) == NULL) { free(buffer); return NULL; // Nothing could be read. } @@ -86,12 +166,12 @@ static char *read_file_line(FILE *file) { break; } - if (feof(file)) // EOF was reached + if (fs_eof(file)) // EOF was reached break; // If no newline or EOF was reached, then the whole line wasn't read. bufferSize *= 2; // Increase buffer size - buffer = (char*) realloc(buffer, bufferSize); + buffer = realloc(buffer, bufferSize); assert(buffer != NULL); } @@ -138,14 +218,19 @@ static unsigned int tokenize_string(char *str, int maxTokens, char **tokens) { return count; } +// Gets the config file path and caches it +const char *configfile_name(void) { + return (gCLIOpts.ConfigFile[0]) ? gCLIOpts.ConfigFile : CONFIGFILE_DEFAULT; +} + // Loads the config file specified by 'filename' void configfile_load(const char *filename) { - FILE *file; + fs_file_t *file; char *line; printf("Loading configuration from '%s'\n", filename); - file = fopen(filename, "r"); + file = fs_open(filename); if (file == NULL) { // Create a new config file and save defaults printf("Config file '%s' not found. Creating it.\n", filename); @@ -156,14 +241,18 @@ void configfile_load(const char *filename) { // Go through each line in the file while ((line = read_file_line(file)) != NULL) { char *p = line; - char *tokens[2]; + char *tokens[1 + MAX_BINDS]; int numTokens; while (isspace(*p)) p++; - numTokens = tokenize_string(p, 2, tokens); + + if (!*p || *p == '#') // comment or empty line + continue; + + numTokens = tokenize_string(p, sizeof(tokens) / sizeof(tokens[0]), tokens); if (numTokens != 0) { - if (numTokens == 2) { + if (numTokens >= 2) { const struct ConfigOption *option = NULL; for (unsigned int i = 0; i < ARRAY_LEN(options); i++) { @@ -179,19 +268,25 @@ void configfile_load(const char *filename) { case CONFIG_TYPE_BOOL: if (strcmp(tokens[1], "true") == 0) *option->boolValue = true; - else if (strcmp(tokens[1], "false") == 0) + else *option->boolValue = false; break; case CONFIG_TYPE_UINT: sscanf(tokens[1], "%u", option->uintValue); break; + case CONFIG_TYPE_BIND: + for (int i = 0; i < MAX_BINDS && i < numTokens - 1; ++i) + sscanf(tokens[i + 1], "%x", option->uintValue + i); + break; case CONFIG_TYPE_FLOAT: sscanf(tokens[1], "%f", option->floatValue); break; default: assert(0); // bad type } - printf("option: '%s', value: '%s'\n", tokens[0], tokens[1]); + printf("option: '%s', value:", tokens[0]); + for (int i = 1; i < numTokens; ++i) printf(" '%s'", tokens[i]); + printf("\n"); } } else puts("error: expected value"); @@ -199,7 +294,7 @@ void configfile_load(const char *filename) { free(line); } - fclose(file); + fs_close(file); } // Writes the config file to 'filename' @@ -208,7 +303,7 @@ void configfile_save(const char *filename) { printf("Saving configuration to '%s'\n", filename); - file = fopen(filename, "w"); + file = fopen(fs_get_write_path(filename), "w"); if (file == NULL) { // error return; @@ -227,6 +322,12 @@ void configfile_save(const char *filename) { case CONFIG_TYPE_FLOAT: fprintf(file, "%s %f\n", option->name, *option->floatValue); break; + case CONFIG_TYPE_BIND: + fprintf(file, "%s ", option->name); + for (int i = 0; i < MAX_BINDS; ++i) + fprintf(file, "%04x ", option->uintValue[i]); + fprintf(file, "\n"); + break; default: assert(0); // unknown type } diff --git a/src/pc/configfile.h b/src/pc/configfile.h index ae9070b7..b92ae7be 100644 --- a/src/pc/configfile.h +++ b/src/pc/configfile.h @@ -1,22 +1,67 @@ #ifndef CONFIGFILE_H #define CONFIGFILE_H -extern bool configFullscreen; -extern unsigned int configKeyA; -extern unsigned int configKeyB; -extern unsigned int configKeyStart; -extern unsigned int configKeyR; -extern unsigned int configKeyZ; -extern unsigned int configKeyCUp; -extern unsigned int configKeyCDown; -extern unsigned int configKeyCLeft; -extern unsigned int configKeyCRight; -extern unsigned int configKeyStickUp; -extern unsigned int configKeyStickDown; -extern unsigned int configKeyStickLeft; -extern unsigned int configKeyStickRight; +#include + +#define CONFIGFILE_DEFAULT "sm64config.txt" + +#define MAX_BINDS 3 +#define MAX_VOLUME 127 + +typedef struct { + unsigned int x, y, w, h; + bool vsync; + bool reset; + bool fullscreen; + bool exiting_fullscreen; + bool settings_changed; +} ConfigWindow; + +extern ConfigWindow configWindow; +extern unsigned int configFiltering; +extern unsigned int configMasterVolume; +extern unsigned int configMusicVolume; +extern unsigned int configSfxVolume; +extern unsigned int configEnvVolume; +extern unsigned int configKeyA[]; +extern unsigned int configKeyB[]; +extern unsigned int configKeyStart[]; +extern unsigned int configKeyL[]; +extern unsigned int configKeyR[]; +extern unsigned int configKeyZ[]; +extern unsigned int configKeyCUp[]; +extern unsigned int configKeyCDown[]; +extern unsigned int configKeyCLeft[]; +extern unsigned int configKeyCRight[]; +extern unsigned int configKeyStickUp[]; +extern unsigned int configKeyStickDown[]; +extern unsigned int configKeyStickLeft[]; +extern unsigned int configKeyStickRight[]; +extern unsigned int configStickDeadzone; +extern unsigned int configRumbleStrength; +#ifdef EXTERNAL_DATA +extern bool configPrecacheRes; +#endif +#ifdef BETTERCAMERA +extern unsigned int configCameraXSens; +extern unsigned int configCameraYSens; +extern unsigned int configCameraAggr; +extern unsigned int configCameraPan; +extern unsigned int configCameraDegrade; +extern bool configCameraInvertX; +extern bool configCameraInvertY; +extern bool configEnableCamera; +extern bool configCameraMouse; +extern bool configCameraAnalog; +#endif +extern bool configHUD; +extern bool configSkipIntro; +#ifdef DISCORDRPC +extern bool configDiscordRPC; +#endif void configfile_load(const char *filename); void configfile_save(const char *filename); +const char *configfile_name(void); #endif diff --git a/src/pc/controller/controller_api.h b/src/pc/controller/controller_api.h index dd318a8a..c835ee3c 100644 --- a/src/pc/controller/controller_api.h +++ b/src/pc/controller/controller_api.h @@ -1,11 +1,44 @@ #ifndef CONTROLLER_API #define CONTROLLER_API +#define DEADZONE_STEP 310 // original deadzone is 4960 +#define VK_INVALID 0xFFFF +#define VK_SIZE 0x1000 + +// virtual buttons for left and right analog triggers +#define VK_LTRIGGER 0x101A +#define VK_RTRIGGER 0x101B + +// fake buttons for binding the stick directions +#define STICK_UP 0x80000 +#define STICK_DOWN 0x40000 +#define STICK_LEFT 0x10000 +#define STICK_RIGHT 0x20000 +#define STICK_XMASK 0x30000 +#define STICK_YMASK 0xc0000 + #include struct ControllerAPI { - void (*init)(void); - void (*read)(OSContPad *pad); + const u32 vkbase; // base number in the virtual keyspace (e.g. keyboard is 0x0000-0x1000) + void (*init)(void); // call once, also calls reconfig() + void (*read)(OSContPad *pad); // read controller and update N64 pad values + u32 (*rawkey)(void); // returns last pressed virtual key or VK_INVALID if none + void (*rumble_play)(float str, float time); // (optional) rumble with intensity `str` (0 - 1) for `time` seconds + void (*rumble_stop)(void); // (optional) stop any ongoing haptic feedback + void (*reconfig)(void); // (optional) call when bindings have changed + void (*shutdown)(void); // (optional) call in osContReset }; +// used for binding keys +u32 controller_get_raw_key(void); +void controller_reconfigure(void); + +// rumbles all controllers with rumble support +void controller_rumble_play(float str, float time); +void controller_rumble_stop(void); + +// calls the shutdown() function of all controller subsystems +void controller_shutdown(void); + #endif diff --git a/src/pc/controller/controller_entry_point.c b/src/pc/controller/controller_entry_point.c index f86cf0d1..c2e5207a 100644 --- a/src/pc/controller/controller_entry_point.c +++ b/src/pc/controller/controller_entry_point.c @@ -1,31 +1,19 @@ -#include "macros.h" - #include "lib/src/libultra_internal.h" #include "lib/src/osContInternal.h" +#include "macros.h" + +#include "../configfile.h" #include "controller_recorded_tas.h" #include "controller_keyboard.h" - -#if defined(_WIN32) || defined(_WIN64) -#include "controller_xinput.h" -#else #include "controller_sdl.h" -#endif -#ifdef __linux__ -#include "controller_wup.h" -#endif +// Analog camera movement by Pathétique (github.com/vrmiguel), y0shin and Mors +// Contribute or communicate bugs at github.com/vrmiguel/sm64-analog-camera static struct ControllerAPI *controller_implementations[] = { &controller_recorded_tas, -#if defined(_WIN32) || defined(_WIN64) - &controller_xinput, -#else &controller_sdl, -#endif -#ifdef __linux__ - &controller_wup, -#endif &controller_keyboard, }; @@ -37,6 +25,22 @@ s32 osContInit(UNUSED OSMesgQueue *mq, u8 *controllerBits, UNUSED OSContStatus * return 0; } +s32 osMotorStart(UNUSED void *pfs) { + // Since rumble stops by osMotorStop, its duration is not nessecary. + // Set it to 5 seconds and hope osMotorStop() is called in time. + controller_rumble_play(configRumbleStrength / 100.0f, 5.0f); + return 0; +} + +s32 osMotorStop(UNUSED void *pfs) { + controller_rumble_stop(); + return 0; +} + +u32 osMotorInit(UNUSED OSMesgQueue *mq, UNUSED void *pfs, UNUSED s32 port) { + return 0; // rumble is initialized in the specific backend's init function +} + s32 osContStartReadData(UNUSED OSMesgQueue *mesg) { return 0; } @@ -45,9 +49,47 @@ void osContGetReadData(OSContPad *pad) { pad->button = 0; pad->stick_x = 0; pad->stick_y = 0; + pad->ext_stick_x = 0; + pad->ext_stick_y = 0; pad->errnum = 0; for (size_t i = 0; i < sizeof(controller_implementations) / sizeof(struct ControllerAPI *); i++) { controller_implementations[i]->read(pad); } } + +u32 controller_get_raw_key(void) { + for (size_t i = 0; i < sizeof(controller_implementations) / sizeof(struct ControllerAPI *); i++) { + u32 vk = controller_implementations[i]->rawkey(); + if (vk != VK_INVALID) return vk + controller_implementations[i]->vkbase; + } + return VK_INVALID; +} + +void controller_shutdown(void) { + for (size_t i = 0; i < sizeof(controller_implementations) / sizeof(struct ControllerAPI *); i++) { + if (controller_implementations[i]->shutdown) + controller_implementations[i]->shutdown(); + } +} + +void controller_reconfigure(void) { + for (size_t i = 0; i < sizeof(controller_implementations) / sizeof(struct ControllerAPI *); i++) { + if (controller_implementations[i]->reconfig) + controller_implementations[i]->reconfig(); + } +} + +void controller_rumble_play(float str, float time) { + for (size_t i = 0; i < sizeof(controller_implementations) / sizeof(struct ControllerAPI *); i++) { + if (controller_implementations[i]->rumble_play) + controller_implementations[i]->rumble_play(str, time); + } +} + +void controller_rumble_stop(void) { + for (size_t i = 0; i < sizeof(controller_implementations) / sizeof(struct ControllerAPI *); i++) { + if (controller_implementations[i]->rumble_stop) + controller_implementations[i]->rumble_stop(); + } +} diff --git a/src/pc/controller/controller_keyboard.c b/src/pc/controller/controller_keyboard.c index 6ba16634..da597328 100644 --- a/src/pc/controller/controller_keyboard.c +++ b/src/pc/controller/controller_keyboard.c @@ -1,5 +1,3 @@ -#include "controller_keyboard.h" - #include #include @@ -10,14 +8,19 @@ #endif #include "../configfile.h" +#include "controller_keyboard.h" static int keyboard_buttons_down; -static int keyboard_mapping[13][2]; +#define MAX_KEYBINDS 64 +static int keyboard_mapping[MAX_KEYBINDS][2]; +static int num_keybinds = 0; + +static u32 keyboard_lastkey = VK_INVALID; static int keyboard_map_scancode(int scancode) { int ret = 0; - for (size_t i = 0; i < sizeof(keyboard_mapping) / sizeof(keyboard_mapping[0]); i++) { + for (int i = 0; i < num_keybinds; i++) { if (keyboard_mapping[i][0] == scancode) { ret |= keyboard_mapping[i][1]; } @@ -28,12 +31,15 @@ static int keyboard_map_scancode(int scancode) { bool keyboard_on_key_down(int scancode) { int mapped = keyboard_map_scancode(scancode); keyboard_buttons_down |= mapped; + keyboard_lastkey = scancode; return mapped != 0; } bool keyboard_on_key_up(int scancode) { int mapped = keyboard_map_scancode(scancode); keyboard_buttons_down &= ~mapped; + if (keyboard_lastkey == (u32) scancode) + keyboard_lastkey = VK_INVALID; return mapped != 0; } @@ -41,27 +47,38 @@ void keyboard_on_all_keys_up(void) { keyboard_buttons_down = 0; } -static void set_keyboard_mapping(int index, int mask, int scancode) { - keyboard_mapping[index][0] = scancode; - keyboard_mapping[index][1] = mask; +static void keyboard_add_binds(int mask, unsigned int *scancode) { + for (int i = 0; i < MAX_BINDS && num_keybinds < MAX_KEYBINDS; ++i) { + if (scancode[i] < VK_BASE_KEYBOARD + VK_SIZE) { + keyboard_mapping[num_keybinds][0] = scancode[i]; + keyboard_mapping[num_keybinds][1] = mask; + num_keybinds++; + } + } +} + +static void keyboard_bindkeys(void) { + bzero(keyboard_mapping, sizeof(keyboard_mapping)); + num_keybinds = 0; + + keyboard_add_binds(STICK_UP, configKeyStickUp); + keyboard_add_binds(STICK_LEFT, configKeyStickLeft); + keyboard_add_binds(STICK_DOWN, configKeyStickDown); + keyboard_add_binds(STICK_RIGHT, configKeyStickRight); + keyboard_add_binds(A_BUTTON, configKeyA); + keyboard_add_binds(B_BUTTON, configKeyB); + keyboard_add_binds(Z_TRIG, configKeyZ); + keyboard_add_binds(U_CBUTTONS, configKeyCUp); + keyboard_add_binds(L_CBUTTONS, configKeyCLeft); + keyboard_add_binds(D_CBUTTONS, configKeyCDown); + keyboard_add_binds(R_CBUTTONS, configKeyCRight); + keyboard_add_binds(L_TRIG, configKeyL); + keyboard_add_binds(R_TRIG, configKeyR); + keyboard_add_binds(START_BUTTON, configKeyStart); } static void keyboard_init(void) { - int i = 0; - - set_keyboard_mapping(i++, 0x80000, configKeyStickUp); - set_keyboard_mapping(i++, 0x10000, configKeyStickLeft); - set_keyboard_mapping(i++, 0x40000, configKeyStickDown); - set_keyboard_mapping(i++, 0x20000, configKeyStickRight); - set_keyboard_mapping(i++, A_BUTTON, configKeyA); - set_keyboard_mapping(i++, B_BUTTON, configKeyB); - set_keyboard_mapping(i++, Z_TRIG, configKeyZ); - set_keyboard_mapping(i++, U_CBUTTONS, configKeyCUp); - set_keyboard_mapping(i++, L_CBUTTONS, configKeyCLeft); - set_keyboard_mapping(i++, D_CBUTTONS, configKeyCDown); - set_keyboard_mapping(i++, R_CBUTTONS, configKeyCRight); - set_keyboard_mapping(i++, R_TRIG, configKeyR); - set_keyboard_mapping(i++, START_BUTTON, configKeyStart); + keyboard_bindkeys(); #ifdef TARGET_WEB controller_emscripten_keyboard_init(); @@ -70,21 +87,34 @@ static void keyboard_init(void) { static void keyboard_read(OSContPad *pad) { pad->button |= keyboard_buttons_down; - if ((keyboard_buttons_down & 0x30000) == 0x10000) { + const u32 xstick = keyboard_buttons_down & STICK_XMASK; + const u32 ystick = keyboard_buttons_down & STICK_YMASK; + if (xstick == STICK_LEFT) pad->stick_x = -128; - } - if ((keyboard_buttons_down & 0x30000) == 0x20000) { + else if (xstick == STICK_RIGHT) pad->stick_x = 127; - } - if ((keyboard_buttons_down & 0xc0000) == 0x40000) { + if (ystick == STICK_DOWN) pad->stick_y = -128; - } - if ((keyboard_buttons_down & 0xc0000) == 0x80000) { + else if (ystick == STICK_UP) pad->stick_y = 127; - } +} + +static u32 keyboard_rawkey(void) { + const u32 ret = keyboard_lastkey; + keyboard_lastkey = VK_INVALID; + return ret; +} + +static void keyboard_shutdown(void) { } struct ControllerAPI controller_keyboard = { + VK_BASE_KEYBOARD, keyboard_init, - keyboard_read + keyboard_read, + keyboard_rawkey, + NULL, + NULL, + keyboard_bindkeys, + keyboard_shutdown }; diff --git a/src/pc/controller/controller_keyboard.h b/src/pc/controller/controller_keyboard.h index e2c08586..028d2e85 100644 --- a/src/pc/controller/controller_keyboard.h +++ b/src/pc/controller/controller_keyboard.h @@ -4,6 +4,8 @@ #include #include "controller_api.h" +# define VK_BASE_KEYBOARD 0x0000 + #ifdef __cplusplus extern "C" { #endif diff --git a/src/pc/controller/controller_mouse.h b/src/pc/controller/controller_mouse.h new file mode 100644 index 00000000..8ef01196 --- /dev/null +++ b/src/pc/controller/controller_mouse.h @@ -0,0 +1,13 @@ +#ifndef CONTROLLER_MOUSE_H +#define CONTROLLER_MOUSE_H + +#include "controller_api.h" + +extern int mouse_x; +extern int mouse_y; + +#define VK_BASE_MOUSE 0x2000 + +extern struct ControllerAPI controller_mouse; + +#endif diff --git a/src/pc/controller/controller_recorded_tas.c b/src/pc/controller/controller_recorded_tas.c index 4f5c1bb0..73b507dc 100644 --- a/src/pc/controller/controller_recorded_tas.c +++ b/src/pc/controller/controller_recorded_tas.c @@ -23,7 +23,24 @@ static void tas_read(OSContPad *pad) { } } +static void tas_shutdown(void) { + if (fp != NULL) { + fclose(fp); + fp = NULL; + } +} + +static u32 tas_rawkey(void) { + return VK_INVALID; +} + struct ControllerAPI controller_recorded_tas = { + VK_INVALID, tas_init, - tas_read + tas_read, + tas_rawkey, + NULL, // no rumble_play + NULL, // no rumble_stop + NULL, // no rebinding + tas_shutdown }; diff --git a/src/pc/controller/controller_sdl.c b/src/pc/controller/controller_sdl.c index c3ab2422..a71a82eb 100644 --- a/src/pc/controller/controller_sdl.c +++ b/src/pc/controller/controller_sdl.c @@ -1,4 +1,4 @@ -#if !defined(_WIN32) && !defined(_WIN64) +#ifdef CAPI_SDL2 #include #include @@ -7,40 +7,182 @@ #include +// Analog camera movement by Pathétique (github.com/vrmiguel), y0shin and Mors +// Contribute or communicate bugs at github.com/vrmiguel/sm64-analog-camera + #include #include "controller_api.h" +#include "controller_sdl.h" +#include "../configfile.h" +#include "../platform.h" +#include "../fs/fs.h" -#define DEADZONE 4960 +#include "game/level_update.h" + +// mouse buttons are also in the controller namespace (why), just offset 0x100 +#define VK_OFS_SDL_MOUSE 0x0100 +#define VK_BASE_SDL_MOUSE (VK_BASE_SDL_GAMEPAD + VK_OFS_SDL_MOUSE) +#define MAX_JOYBINDS 32 +#define MAX_MOUSEBUTTONS 8 // arbitrary +#define MAX_JOYBUTTONS 32 // arbitrary; includes virtual keys for triggers +#define AXIS_THRESHOLD (30 * 256) + +int mouse_x; +int mouse_y; + +#ifdef BETTERCAMERA +extern u8 newcam_mouse; +#endif static bool init_ok; +static bool haptics_enabled; static SDL_GameController *sdl_cntrl; +static SDL_Haptic *sdl_haptic; + +static u32 num_joy_binds = 0; +static u32 num_mouse_binds = 0; +static u32 joy_binds[MAX_JOYBINDS][2]; +static u32 mouse_binds[MAX_JOYBINDS][2]; + +static bool joy_buttons[MAX_JOYBUTTONS] = { false }; +static u32 mouse_buttons = 0; +static u32 last_mouse = VK_INVALID; +static u32 last_joybutton = VK_INVALID; + +static inline void controller_add_binds(const u32 mask, const u32 *btns) { + for (u32 i = 0; i < MAX_BINDS; ++i) { + if (btns[i] >= VK_BASE_SDL_GAMEPAD && btns[i] <= VK_BASE_SDL_GAMEPAD + VK_SIZE) { + if (btns[i] >= VK_BASE_SDL_MOUSE && num_joy_binds < MAX_JOYBINDS) { + mouse_binds[num_mouse_binds][0] = btns[i] - VK_BASE_SDL_MOUSE; + mouse_binds[num_mouse_binds][1] = mask; + ++num_mouse_binds; + } else if (num_mouse_binds < MAX_JOYBINDS) { + joy_binds[num_joy_binds][0] = btns[i] - VK_BASE_SDL_GAMEPAD; + joy_binds[num_joy_binds][1] = mask; + ++num_joy_binds; + } + } + } +} + +static void controller_sdl_bind(void) { + bzero(joy_binds, sizeof(joy_binds)); + bzero(mouse_binds, sizeof(mouse_binds)); + num_joy_binds = 0; + num_mouse_binds = 0; + + controller_add_binds(A_BUTTON, configKeyA); + controller_add_binds(B_BUTTON, configKeyB); + controller_add_binds(Z_TRIG, configKeyZ); + controller_add_binds(STICK_UP, configKeyStickUp); + controller_add_binds(STICK_LEFT, configKeyStickLeft); + controller_add_binds(STICK_DOWN, configKeyStickDown); + controller_add_binds(STICK_RIGHT, configKeyStickRight); + controller_add_binds(U_CBUTTONS, configKeyCUp); + controller_add_binds(L_CBUTTONS, configKeyCLeft); + controller_add_binds(D_CBUTTONS, configKeyCDown); + controller_add_binds(R_CBUTTONS, configKeyCRight); + controller_add_binds(L_TRIG, configKeyL); + controller_add_binds(R_TRIG, configKeyR); + controller_add_binds(START_BUTTON, configKeyStart); +} static void controller_sdl_init(void) { - if (SDL_Init(SDL_INIT_GAMECONTROLLER) != 0) { + if (SDL_Init(SDL_INIT_GAMECONTROLLER | SDL_INIT_EVENTS) != 0) { fprintf(stderr, "SDL init error: %s\n", SDL_GetError()); return; } + haptics_enabled = (SDL_InitSubSystem(SDL_INIT_HAPTIC) == 0); + + // try loading an external gamecontroller mapping file + uint64_t gcsize = 0; + void *gcdata = fs_load_file("gamecontrollerdb.txt", &gcsize); + if (gcdata && gcsize) { + SDL_RWops *rw = SDL_RWFromConstMem(gcdata, gcsize); + if (rw) { + int nummaps = SDL_GameControllerAddMappingsFromRW(rw, SDL_TRUE); + if (nummaps >= 0) + printf("loaded %d controller mappings from 'gamecontrollerdb.txt'\n", nummaps); + } + free(gcdata); + } + +#ifdef BETTERCAMERA + if (newcam_mouse == 1) + SDL_SetRelativeMouseMode(SDL_TRUE); + SDL_GetRelativeMouseState(&mouse_x, &mouse_y); +#endif + + controller_sdl_bind(); + init_ok = true; } +static SDL_Haptic *controller_sdl_init_haptics(const int joy) { + if (!haptics_enabled) return NULL; + + SDL_Haptic *hap = SDL_HapticOpen(joy); + if (!hap) return NULL; + + if (SDL_HapticRumbleSupported(hap) != SDL_TRUE) { + SDL_HapticClose(hap); + return NULL; + } + + if (SDL_HapticRumbleInit(hap) != 0) { + SDL_HapticClose(hap); + return NULL; + } + + printf("controller %s has haptics support, rumble enabled\n", SDL_JoystickNameForIndex(joy)); + return hap; +} + +static inline void update_button(const int i, const bool new) { + const bool pressed = !joy_buttons[i] && new; + joy_buttons[i] = new; + if (pressed) last_joybutton = i; +} + static void controller_sdl_read(OSContPad *pad) { if (!init_ok) { return; } +#ifdef BETTERCAMERA + if (newcam_mouse == 1 && sCurrPlayMode != 2) + SDL_SetRelativeMouseMode(SDL_TRUE); + else + SDL_SetRelativeMouseMode(SDL_FALSE); + + u32 mouse = SDL_GetRelativeMouseState(&mouse_x, &mouse_y); + + for (u32 i = 0; i < num_mouse_binds; ++i) + if (mouse & SDL_BUTTON(mouse_binds[i][0])) + pad->button |= mouse_binds[i][1]; + + // remember buttons that changed from 0 to 1 + last_mouse = (mouse_buttons ^ mouse) & mouse; + mouse_buttons = mouse; +#endif + SDL_GameControllerUpdate(); if (sdl_cntrl != NULL && !SDL_GameControllerGetAttached(sdl_cntrl)) { + SDL_HapticClose(sdl_haptic); SDL_GameControllerClose(sdl_cntrl); sdl_cntrl = NULL; + sdl_haptic = NULL; } + if (sdl_cntrl == NULL) { for (int i = 0; i < SDL_NumJoysticks(); i++) { if (SDL_IsGameController(i)) { sdl_cntrl = SDL_GameControllerOpen(i); if (sdl_cntrl != NULL) { + sdl_haptic = controller_sdl_init_haptics(i); break; } } @@ -50,12 +192,6 @@ static void controller_sdl_read(OSContPad *pad) { } } - if (SDL_GameControllerGetButton(sdl_cntrl, SDL_CONTROLLER_BUTTON_START)) pad->button |= START_BUTTON; - if (SDL_GameControllerGetButton(sdl_cntrl, SDL_CONTROLLER_BUTTON_LEFTSHOULDER)) pad->button |= Z_TRIG; - if (SDL_GameControllerGetButton(sdl_cntrl, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER)) pad->button |= R_TRIG; - if (SDL_GameControllerGetButton(sdl_cntrl, SDL_CONTROLLER_BUTTON_A)) pad->button |= A_BUTTON; - if (SDL_GameControllerGetButton(sdl_cntrl, SDL_CONTROLLER_BUTTON_X)) pad->button |= B_BUTTON; - int16_t leftx = SDL_GameControllerGetAxis(sdl_cntrl, SDL_CONTROLLER_AXIS_LEFTX); int16_t lefty = SDL_GameControllerGetAxis(sdl_cntrl, SDL_CONTROLLER_AXIS_LEFTY); int16_t rightx = SDL_GameControllerGetAxis(sdl_cntrl, SDL_CONTROLLER_AXIS_RIGHTX); @@ -78,25 +214,111 @@ static void controller_sdl_read(OSContPad *pad) { } #endif + for (u32 i = 0; i < SDL_CONTROLLER_BUTTON_MAX; ++i) { + const bool new = SDL_GameControllerGetButton(sdl_cntrl, i); + update_button(i, new); + } + + update_button(VK_LTRIGGER - VK_BASE_SDL_GAMEPAD, ltrig > AXIS_THRESHOLD); + update_button(VK_RTRIGGER - VK_BASE_SDL_GAMEPAD, rtrig > AXIS_THRESHOLD); + + u32 buttons_down = 0; + for (u32 i = 0; i < num_joy_binds; ++i) + if (joy_buttons[joy_binds[i][0]]) + buttons_down |= joy_binds[i][1]; + + pad->button |= buttons_down; + + const u32 xstick = buttons_down & STICK_XMASK; + const u32 ystick = buttons_down & STICK_YMASK; + if (xstick == STICK_LEFT) + pad->stick_x = -128; + else if (xstick == STICK_RIGHT) + pad->stick_x = 127; + if (ystick == STICK_DOWN) + pad->stick_y = -128; + else if (ystick == STICK_UP) + pad->stick_y = 127; + if (rightx < -0x4000) pad->button |= L_CBUTTONS; if (rightx > 0x4000) pad->button |= R_CBUTTONS; if (righty < -0x4000) pad->button |= U_CBUTTONS; if (righty > 0x4000) pad->button |= D_CBUTTONS; - if (ltrig > 30 * 256) pad->button |= Z_TRIG; - if (rtrig > 30 * 256) pad->button |= R_TRIG; - uint32_t magnitude_sq = (uint32_t)(leftx * leftx) + (uint32_t)(lefty * lefty); - if (magnitude_sq > (uint32_t)(DEADZONE * DEADZONE)) { + uint32_t stickDeadzoneActual = configStickDeadzone * DEADZONE_STEP; + if (magnitude_sq > (uint32_t)(stickDeadzoneActual * stickDeadzoneActual)) { pad->stick_x = leftx / 0x100; int stick_y = -lefty / 0x100; pad->stick_y = stick_y == 128 ? 127 : stick_y; } + + magnitude_sq = (uint32_t)(rightx * rightx) + (uint32_t)(righty * righty); + stickDeadzoneActual = configStickDeadzone * DEADZONE_STEP; + if (magnitude_sq > (uint32_t)(stickDeadzoneActual * stickDeadzoneActual)) { + pad->ext_stick_x = rightx / 0x100; + int stick_y = -righty / 0x100; + pad->ext_stick_y = stick_y == 128 ? 127 : stick_y; + } +} + +static void controller_sdl_rumble_play(f32 strength, f32 length) { + if (sdl_haptic) + SDL_HapticRumblePlay(sdl_haptic, strength, (u32)(length * 1000.0f)); +} + +static void controller_sdl_rumble_stop(void) { + if (sdl_haptic) + SDL_HapticRumbleStop(sdl_haptic); +} + +static u32 controller_sdl_rawkey(void) { + if (last_joybutton != VK_INVALID) { + const u32 ret = last_joybutton; + last_joybutton = VK_INVALID; + return ret; + } + + for (int i = 0; i < MAX_MOUSEBUTTONS; ++i) { + if (last_mouse & SDL_BUTTON(i)) { + const u32 ret = VK_OFS_SDL_MOUSE + i; + last_mouse = 0; + return ret; + } + } + return VK_INVALID; +} + +static void controller_sdl_shutdown(void) { + if (SDL_WasInit(SDL_INIT_GAMECONTROLLER)) { + if (sdl_cntrl) { + SDL_GameControllerClose(sdl_cntrl); + sdl_cntrl = NULL; + } + SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER); + } + + if (SDL_WasInit(SDL_INIT_HAPTIC)) { + if (sdl_haptic) { + SDL_HapticClose(sdl_haptic); + sdl_haptic = NULL; + } + SDL_QuitSubSystem(SDL_INIT_HAPTIC); + } + + haptics_enabled = false; + init_ok = false; } struct ControllerAPI controller_sdl = { + VK_BASE_SDL_GAMEPAD, controller_sdl_init, - controller_sdl_read + controller_sdl_read, + controller_sdl_rawkey, + controller_sdl_rumble_play, + controller_sdl_rumble_stop, + controller_sdl_bind, + controller_sdl_shutdown }; -#endif +#endif // CAPI_SDL2 diff --git a/src/pc/controller/controller_sdl.h b/src/pc/controller/controller_sdl.h index 02aec8d9..bbe8a62c 100644 --- a/src/pc/controller/controller_sdl.h +++ b/src/pc/controller/controller_sdl.h @@ -3,6 +3,8 @@ #include "controller_api.h" +#define VK_BASE_SDL_GAMEPAD 0x1000 + extern struct ControllerAPI controller_sdl; #endif diff --git a/src/pc/controller/controller_wup.c b/src/pc/controller/controller_wup.c deleted file mode 100644 index 0a675ffd..00000000 --- a/src/pc/controller/controller_wup.c +++ /dev/null @@ -1,51 +0,0 @@ -#ifdef __linux__ - -#include -#include - -#include - -#include "controller_api.h" - -void *wup_start(void *a); -bool wup_get_controller_input(uint16_t *buttons, uint8_t axis[6]); - -static int8_t saturate(int v) { - v = v * 3 / 2; - return v < -128 ? -128 : v > 127 ? 127 : v; -} - -static void controller_wup_init(void) { - pthread_t pid; - pthread_create(&pid, NULL, wup_start, NULL); -} - -static void controller_wup_read(OSContPad *pad) { - uint16_t buttons; - uint8_t axis[6]; - if (wup_get_controller_input(&buttons, axis)) { - if (buttons & 0x0001) pad->button |= START_BUTTON; - if (buttons & 0x0008) pad->button |= Z_TRIG; - if (buttons & 0x0004) pad->button |= R_TRIG; - if (buttons & 0x0100) pad->button |= A_BUTTON; - if (buttons & 0x0200) pad->button |= B_BUTTON; - if (buttons & 0x1000) pad->button |= L_TRIG; - if (axis[2] < 0x40) pad->button |= L_CBUTTONS; - if (axis[2] > 0xC0) pad->button |= R_CBUTTONS; - if (axis[3] < 0x40) pad->button |= D_CBUTTONS; - if (axis[3] > 0xC0) pad->button |= U_CBUTTONS; - int8_t stick_x = saturate(axis[0] - 128 - 0); - int8_t stick_y = saturate(axis[1] - 128 - 0); - if (stick_x != 0 || stick_y != 0) { - pad->stick_x = stick_x; - pad->stick_y = stick_y; - } - } -} - -struct ControllerAPI controller_wup = { - controller_wup_init, - controller_wup_read -}; - -#endif diff --git a/src/pc/controller/controller_wup.h b/src/pc/controller/controller_wup.h deleted file mode 100644 index 3c5674c8..00000000 --- a/src/pc/controller/controller_wup.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef CONTROLLER_WUP_H -#define CONTROLLER_WUP_H - -#ifdef __linux__ - -#include "controller_api.h" - -extern struct ControllerAPI controller_wup; - -#endif - -#endif diff --git a/src/pc/controller/controller_xinput.c b/src/pc/controller/controller_xinput.c deleted file mode 100644 index bb44bc1b..00000000 --- a/src/pc/controller/controller_xinput.c +++ /dev/null @@ -1,49 +0,0 @@ -#if defined(_WIN32) || defined(_WIN64) - -#include -#include - -#include - -#include "controller_api.h" - -#define DEADZONE 4960 - -static void xinput_init(void) { -} - -static void xinput_read(OSContPad *pad) { - for (int i = 0; i < XUSER_MAX_COUNT; i++) { - XINPUT_STATE state; - memset(&state, 0, sizeof(XINPUT_STATE)); - if (XInputGetState(i, &state) == ERROR_SUCCESS) { - XINPUT_GAMEPAD *gp = &state.Gamepad; - if (gp->wButtons & XINPUT_GAMEPAD_START) pad->button |= START_BUTTON; - if (gp->wButtons & XINPUT_GAMEPAD_LEFT_SHOULDER) pad->button |= Z_TRIG; - if (gp->bLeftTrigger > XINPUT_GAMEPAD_TRIGGER_THRESHOLD) pad->button |= Z_TRIG; - if (gp->wButtons & XINPUT_GAMEPAD_RIGHT_SHOULDER) pad->button |= R_TRIG; - if (gp->bRightTrigger > XINPUT_GAMEPAD_TRIGGER_THRESHOLD) pad->button |= R_TRIG; - if (gp->wButtons & XINPUT_GAMEPAD_A) pad->button |= A_BUTTON; - if (gp->wButtons & XINPUT_GAMEPAD_X) pad->button |= B_BUTTON; - if (gp->wButtons & XINPUT_GAMEPAD_DPAD_LEFT) pad->button |= L_TRIG; - if (gp->sThumbRX < -0x4000) pad->button |= L_CBUTTONS; - if (gp->sThumbRX > 0x4000) pad->button |= R_CBUTTONS; - if (gp->sThumbRY < -0x4000) pad->button |= D_CBUTTONS; - if (gp->sThumbRY > 0x4000) pad->button |= U_CBUTTONS; - - uint32_t magnitude_sq = (uint32_t)(gp->sThumbLX * gp->sThumbLX) + (uint32_t)(gp->sThumbLY * gp->sThumbLY); - if (magnitude_sq > (uint32_t)(DEADZONE * DEADZONE)) { - pad->stick_x = gp->sThumbLX / 0x100; - pad->stick_y = gp->sThumbLY / 0x100; - } - break; - } - } -} - -struct ControllerAPI controller_xinput = { - xinput_init, - xinput_read -}; - -#endif diff --git a/src/pc/controller/controller_xinput.h b/src/pc/controller/controller_xinput.h deleted file mode 100644 index be1e68ca..00000000 --- a/src/pc/controller/controller_xinput.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef CONTROLLER_XINPUT_H -#define CONTROLLER_XINPUT_H - -#if defined(_WIN32) || defined(_WIN64) - -#include "controller_api.h" - -extern struct ControllerAPI controller_xinput; - -#endif - -#endif diff --git a/src/pc/controller/wup.c b/src/pc/controller/wup.c deleted file mode 100644 index 61d156ed..00000000 --- a/src/pc/controller/wup.c +++ /dev/null @@ -1,362 +0,0 @@ -#if !defined(__MINGW32__) && !defined(TARGET_WEB) -// See LICENSE for license - -#define _XOPEN_SOURCE 600 - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -//#include -#include -#include - -#include "macros.h" - -#if (!defined(LIBUSBX_API_VERSION) || LIBUSBX_API_VERSION < 0x01000102) && (!defined(LIBUSB_API_VERSION) || LIBUSB_API_VERSION < 0x01000102) -#error libusb(x) 1.0.16 or higher is required -#endif - -#define EP_IN 0x81 -#define EP_OUT 0x02 - -#define STATE_NORMAL 0x10 -#define STATE_WAVEBIRD 0x20 - -const int BUTTON_OFFSET_VALUES[16] = { - BTN_START, - BTN_TR2, - BTN_TR, - BTN_TL, - -1, - -1, - -1, - -1, - BTN_SOUTH, - BTN_WEST, - BTN_EAST, - BTN_NORTH, - BTN_DPAD_LEFT, - BTN_DPAD_RIGHT, - BTN_DPAD_DOWN, - BTN_DPAD_UP, -}; - -const int AXIS_OFFSET_VALUES[6] = { - ABS_X, - ABS_Y, - ABS_RX, - ABS_RY, - ABS_Z, - ABS_RZ -}; - -struct ports -{ - bool connected; - bool extra_power; - unsigned char type; - uint16_t buttons; - uint8_t axis[6]; -}; - -struct adapter -{ - volatile bool quitting; - struct libusb_device *device; - struct libusb_device_handle *handle; - pthread_t thread; - unsigned char rumble[5]; - struct ports controllers[4]; - struct adapter *next; -}; - -static bool raw_mode; - -static volatile int quitting; - -static struct adapter adapters; - -static const char *uinput_path; - -bool wup_get_controller_input(uint16_t *buttons, uint8_t axis[6]) { - struct adapter *adapter = adapters.next; - if (adapter != NULL) { - *buttons = adapter->controllers[0].buttons; - memcpy(axis, adapter->controllers[0].axis, 6); - return true; - } else { - return false; - } -} - -static unsigned char connected_type(unsigned char status) -{ - unsigned char type = status & (STATE_NORMAL | STATE_WAVEBIRD); - switch (type) - { - case STATE_NORMAL: - case STATE_WAVEBIRD: - return type; - default: - return 0; - } -} - -static void handle_payload(int i, struct ports *port, unsigned char *payload) -{ - unsigned char status = payload[0]; - unsigned char type = connected_type(status); - - if (type != 0 && !port->connected) - { - //uinput_create(i, port, type); - port->type = type; - port->connected = true; - } - else if (type == 0 && port->connected) - { - //uinput_destroy(i, port); - port->connected = false; - } - - if (!port->connected) - return; - - port->extra_power = ((status & 0x04) != 0); - - if (type != port->type) - { - fprintf(stderr, "controller on port %d changed controller type???", i+1); - port->type = type; - } - - uint16_t btns = (uint16_t) payload[1] << 8 | (uint16_t) payload[2]; - port->buttons = btns; - //printf("Btns: %04x\n", btns); - - //printf("Axis:"); - for (int j = 0; j < 6; j++) - { - unsigned char value = payload[j+3]; - port->axis[j] = value; - //printf(" %02x", value); - } - //puts(""); -} - -static int64_t to_ms(struct timespec* t) { - return t->tv_sec * 1000 + t->tv_nsec / 1000000; -} - -static void *adapter_thread(void *data) -{ - struct adapter *a = (struct adapter *)data; - - int bytes_transferred; - unsigned char payload[1] = { 0x13 }; - - int transfer_ret = libusb_interrupt_transfer(a->handle, EP_OUT, payload, sizeof(payload), &bytes_transferred, 0); - - if (transfer_ret != 0) { - fprintf(stderr, "libusb_interrupt_transfer: %s\n", libusb_error_name(transfer_ret)); - return NULL; - } - if (bytes_transferred != sizeof(payload)) { - fprintf(stderr, "libusb_interrupt_transfer %d/%lu bytes transferred.\n", bytes_transferred, sizeof(payload)); - return NULL; - } - - while (!a->quitting) - { - //struct timespec time_before = { 0 }, time_after = { 0 }; - unsigned char payload[37]; - int size = 0; - //clock_gettime(CLOCK_MONOTONIC, &time_before); - int transfer_ret = libusb_interrupt_transfer(a->handle, EP_IN, payload, sizeof(payload), &size, 0); - //clock_gettime(CLOCK_MONOTONIC, &time_after); - //printf("Time taken: %d\n", (int)(to_ms(&time_after) - to_ms(&time_before))); - if (transfer_ret != 0) { - fprintf(stderr, "libusb_interrupt_transfer error %d\n", transfer_ret); - a->quitting = true; - break; - } - if (size != 37 || payload[0] != 0x21) - continue; - - unsigned char *controller = &payload[1]; - - unsigned char rumble[5] = { 0x11, 0, 0, 0, 0 }; - //struct timespec current_time = { 0 }; - //clock_gettime(CLOCK_REALTIME, ¤t_time); - //printf("Time: %d %d\n", (int)current_time.tv_sec, (int)current_time.tv_nsec); - for (int i = 0; i < 4; i++, controller += 9) - { - handle_payload(i, &a->controllers[i], controller); - rumble[i+1] = 0; - /*if (a->controllers[i].extra_power && a->controllers[i].type == STATE_NORMAL) - { - for (int j = 0; j < MAX_FF_EVENTS; j++) - { - struct ff_event *e = &a->controllers[i].ff_events[j]; - if (e->in_use) - { - if (ts_lessthan(&e->start_time, ¤t_time) && ts_greaterthan(&e->end_time, ¤t_time)) - rumble[i+1] = 1; - else - update_ff_start_stop(e, ¤t_time); - } - } - }*/ - } - - if (memcmp(rumble, a->rumble, sizeof(rumble)) != 0) - { - memcpy(a->rumble, rumble, sizeof(rumble)); - transfer_ret = libusb_interrupt_transfer(a->handle, EP_OUT, a->rumble, sizeof(a->rumble), &size, 0); - if (transfer_ret != 0) { - fprintf(stderr, "libusb_interrupt_transfer error %d\n", transfer_ret); - a->quitting = true; - break; - } - } - } - - for (int i = 0; i < 4; i++) - { - /*if (a->controllers[i].connected) - uinput_destroy(i, &a->controllers[i]);*/ - } - - return NULL; -} - -static void add_adapter(struct libusb_device *dev) -{ - struct adapter *a = calloc(1, sizeof(struct adapter)); - if (a == NULL) - { - fprintf(stderr, "FATAL: calloc() failed"); - exit(-1); - } - a->device = dev; - - if (libusb_open(a->device, &a->handle) != 0) - { - fprintf(stderr, "Error opening device 0x%p\n", a->device); - return; - } - - if (libusb_kernel_driver_active(a->handle, 0) == 1) { - fprintf(stderr, "Detaching kernel driver\n"); - if (libusb_detach_kernel_driver(a->handle, 0)) { - fprintf(stderr, "Error detaching handle 0x%p from kernel\n", a->handle); - return; - } - } - - struct adapter *old_head = adapters.next; - adapters.next = a; - a->next = old_head; - - pthread_create(&a->thread, NULL, adapter_thread, a); - - fprintf(stderr, "adapter 0x%p connected\n", a->device); -} - -static void remove_adapter(struct libusb_device *dev) -{ - struct adapter *a = &adapters; - while (a->next != NULL) - { - if (a->next->device == dev) - { - a->next->quitting = true; - pthread_join(a->next->thread, NULL); - fprintf(stderr, "adapter 0x%p disconnected\n", a->next->device); - libusb_close(a->next->handle); - struct adapter *new_next = a->next->next; - free(a->next); - a->next = new_next; - return; - } - - a = a->next; - } -} - -static int LIBUSB_CALL hotplug_callback(struct libusb_context *ctx, struct libusb_device *dev, libusb_hotplug_event event, void *user_data) -{ - (void)ctx; - (void)user_data; - if (event == LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED) - { - add_adapter(dev); - } - else if (event == LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT) - { - remove_adapter(dev); - } - - return 0; -} - -void *wup_start(UNUSED void *a) -{ - libusb_init(NULL); - - struct libusb_device **devices; - - int count = libusb_get_device_list(NULL, &devices); - - for (int i = 0; i < count; i++) - { - struct libusb_device_descriptor desc; - libusb_get_device_descriptor(devices[i], &desc); - if (desc.idVendor == 0x057e && desc.idProduct == 0x0337) - add_adapter(devices[i]); - } - - if (count > 0) - libusb_free_device_list(devices, 1); - - libusb_hotplug_callback_handle callback; - - int hotplug_capability = libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG); - if (hotplug_capability) { - int hotplug_ret = libusb_hotplug_register_callback(NULL, - LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, - LIBUSB_HOTPLUG_NO_FLAGS, 0x057e, 0x0337, - LIBUSB_HOTPLUG_MATCH_ANY, hotplug_callback, NULL, &callback); - - if (hotplug_ret != LIBUSB_SUCCESS) { - fprintf(stderr, "cannot register hotplug callback, hotplugging not enabled\n"); - hotplug_capability = 0; - } - } - - // pump events until shutdown & all helper threads finish cleaning up - while (!quitting) - libusb_handle_events_completed(NULL, (int *)&quitting); - - while (adapters.next) - remove_adapter(adapters.next->device); - - if (hotplug_capability) - libusb_hotplug_deregister_callback(NULL, callback); - - libusb_exit(NULL); - return (void *)0; -} -#endif diff --git a/src/pc/discord/discordrpc.c b/src/pc/discord/discordrpc.c new file mode 100644 index 00000000..034a1e80 --- /dev/null +++ b/src/pc/discord/discordrpc.c @@ -0,0 +1,291 @@ +#include +#include +#include +#include + +#include "macros.h" +#include "PR/ultratypes.h" +#include "game/memory.h" +#include "game/save_file.h" +#include "pc/configfile.h" +#include "discordrpc.h" + +#define DISCORDLIBFILE "libdiscord-rpc" + +// Thanks Microsoft for being non posix compliant +#if defined(_WIN32) +# include +# define DISCORDLIBEXT ".dll" +# define dlopen(lib, flag) LoadLibrary(TEXT(lib)) +# define dlerror() "" +# define dlsym(handle, func) (void *)GetProcAddress(handle, func) +# define dlclose(handle) FreeLibrary(handle) +#elif defined(__APPLE__) +# include +# define DISCORDLIBEXT ".dylib" +#elif defined(__linux__) || defined(__FreeBSD__) // lets make the bold assumption for FreeBSD +# include +# define DISCORDLIBEXT ".so" +#else +# error Unknown System +#endif + +#define DISCORDLIB DISCORDLIBFILE DISCORDLIBEXT +#define DISCORD_APP_ID "709083908708237342" +#define DISCORD_UPDATE_RATE 5 + +extern s16 gCurrCourseNum; +extern s16 gCurrActNum; +extern u8 seg2_course_name_table[]; +extern u8 seg2_act_name_table[]; + +static time_t lastUpdatedTime; + +static DiscordRichPresence discordRichPresence; +static bool initd = false; + +static void* handle; + +void (*Discord_Initialize)(const char *, DiscordEventHandlers *, int, const char *); +void (*Discord_Shutdown)(void); +void (*Discord_ClearPresence)(void); +void (*Discord_UpdatePresence)(DiscordRichPresence *); + +static s16 lastCourseNum = -1; +static s16 lastActNum = -1; + +#ifdef VERSION_EU +#include "eu_translation.h" +extern s32 gInGameLanguage; +#endif + +static char stage[188]; +static char act[188]; + +static char smallImageKey[5]; +static char largeImageKey[5]; + +static const char charset[0xFF+1] = { + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7 + ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', // 15 + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', // 23 + 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', // 31 + 'w', 'x', 'y', 'z', ' ', ' ', ' ', ' ', // 39 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 49 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 55 + ' ', ' ', ' ', ' ', ' ', ' ', '\'', ' ', // 63 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 71 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 79 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 87 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 95 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 103 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ',', // 111 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 119 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 127 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 135 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 143 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 151 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', '-', // 159 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 167 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 175 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 183 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 192 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 199 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 207 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 215 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 223 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 231 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 239 + ' ', ' ', '!', ' ', ' ', ' ', ' ', ' ', // 247 + ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' // 255 +}; + +static void convertstring(const u8 *str, char* output) { + s32 strPos = 0; + bool capitalizeChar = true; + + while (str[strPos] != 0xFF) { + if (str[strPos] < 0xFF) { + output[strPos] = charset[str[strPos]]; + + // if the char is a letter we can capatalize it + if (capitalizeChar && 0x0A <= str[strPos] && str[strPos] <= 0x23) { + output[strPos] -= ('a' - 'A'); + capitalizeChar = false; + } + + } else { + output[strPos] = ' '; + } + + // decide if the next character should be capitalized + switch (output[strPos]) { + case ' ': + if (str[strPos] != 158) + fprintf(stdout, "Unknown Character (%i)\n", str[strPos]); // inform that an unknown char was found + case '-': + capitalizeChar = true; + break; + default: + capitalizeChar = false; + break; + } + + strPos++; + } + + output[strPos] = '\0'; +} + +static void on_ready(UNUSED const DiscordUser* user) { + discord_reset(); +} + +static void init_discord(void) { + DiscordEventHandlers handlers; + memset(&handlers, 0, sizeof(handlers)); + handlers.ready = on_ready; + + Discord_Initialize(DISCORD_APP_ID, &handlers, false, ""); + + initd = true; +} + +static void set_details(void) { + if (lastCourseNum != gCurrCourseNum) { + // If we are in in Course 0 we are in the castle which doesn't have a string + if (gCurrCourseNum) { + void **courseNameTbl; + +#ifndef VERSION_EU + courseNameTbl = segmented_to_virtual(seg2_course_name_table); +#else + switch (gInGameLanguage) { + case LANGUAGE_ENGLISH: + courseNameTbl = segmented_to_virtual(course_name_table_eu_en); + break; + case LANGUAGE_FRENCH: + courseNameTbl = segmented_to_virtual(course_name_table_eu_fr); + break; + case LANGUAGE_GERMAN: + courseNameTbl = segmented_to_virtual(course_name_table_eu_de); + break; + } +#endif + u8 *courseName = segmented_to_virtual(courseNameTbl[gCurrCourseNum - 1]); + + convertstring(&courseName[3], stage); + } else { + strcpy(stage, "Peach's Castle"); + } + + lastCourseNum = gCurrCourseNum; + } +} + +static void set_state(void) { + if (lastActNum != gCurrActNum || lastCourseNum != gCurrCourseNum) { + // when exiting a stage the act doesn't get reset + if (gCurrActNum && gCurrCourseNum) { + // any stage over 19 is a special stage without acts + if (gCurrCourseNum < 19) { + void **actNameTbl; +#ifndef VERSION_EU + actNameTbl = segmented_to_virtual(seg2_act_name_table); +#else + switch (gInGameLanguage) { + case LANGUAGE_ENGLISH: + actNameTbl = segmented_to_virtual(act_name_table_eu_en); + break; + case LANGUAGE_FRENCH: + actNameTbl = segmented_to_virtual(act_name_table_eu_fr); + break; + case LANGUAGE_GERMAN: + actNameTbl = segmented_to_virtual(act_name_table_eu_de); + break; + } +#endif + u8 *actName = actName = segmented_to_virtual(actNameTbl[(gCurrCourseNum - 1) * 6 + gCurrActNum - 1]); + + convertstring(actName, act); + } else { + act[0] = '\0'; + gCurrActNum = 0; + } + } else { + act[0] = '\0'; + } + + lastActNum = gCurrActNum; + } +} + +void set_logo(void) { + if (lastCourseNum) + snprintf(largeImageKey, sizeof(largeImageKey), "%d", lastCourseNum); + else + strcpy(largeImageKey, "0"); + + /* + if (lastActNum) + snprintf(smallImageKey, sizeof(largeImageKey), "%d", lastActNum); + else + smallImageKey[0] = '\0'; + */ + + discordRichPresence.largeImageKey = largeImageKey; + //discordRichPresence.largeImageText = ""; + //discordRichPresence.smallImageKey = smallImageKey; + //discordRichPresence.smallImageText = ""; +} + +void discord_update_rich_presence(void) { + if (!configDiscordRPC || !initd) return; + if (time(NULL) < lastUpdatedTime + DISCORD_UPDATE_RATE) return; + + lastUpdatedTime = time(NULL); + + set_state(); + set_details(); + set_logo(); + Discord_UpdatePresence(&discordRichPresence); +} + +void discord_shutdown(void) { + if (handle) { + Discord_ClearPresence(); + Discord_Shutdown(); + dlclose(handle); + } +} + +void discord_init(void) { + if (configDiscordRPC) { + handle = dlopen(DISCORDLIB, RTLD_LAZY); + if (!handle) { + fprintf(stderr, "Unable to load Discord\n%s\n", dlerror()); + return; + } + + Discord_Initialize = dlsym(handle, "Discord_Initialize"); + Discord_Shutdown = dlsym(handle, "Discord_Shutdown"); + Discord_ClearPresence = dlsym(handle, "Discord_ClearPresence"); + Discord_UpdatePresence = dlsym(handle, "Discord_UpdatePresence"); + + init_discord(); + + discordRichPresence.details = stage; + discordRichPresence.state = act; + + lastUpdatedTime = 0; + } +} + +void discord_reset(void) { + memset( &discordRichPresence, 0, sizeof( discordRichPresence ) ); + + set_state(); + set_details(); + set_logo(); + Discord_UpdatePresence(&discordRichPresence); +} diff --git a/src/pc/discord/discordrpc.h b/src/pc/discord/discordrpc.h new file mode 100644 index 00000000..6d8bc6db --- /dev/null +++ b/src/pc/discord/discordrpc.h @@ -0,0 +1,49 @@ +#ifndef DISCORDRPC_H +#define DISCORDRPC_H + +#include + +typedef struct DiscordRichPresence { + const char* state; /* max 128 bytes */ + const char* details; /* max 128 bytes */ + int64_t startTimestamp; + int64_t endTimestamp; + const char* largeImageKey; /* max 32 bytes */ + const char* largeImageText; /* max 128 bytes */ + const char* smallImageKey; /* max 32 bytes */ + const char* smallImageText; /* max 128 bytes */ + const char* partyId; /* max 128 bytes */ + int partySize; + int partyMax; + const char* matchSecret; /* max 128 bytes */ + const char* joinSecret; /* max 128 bytes */ + const char* spectateSecret; /* max 128 bytes */ + int8_t instance; +} DiscordRichPresence; + +typedef struct DiscordUser { + const char* userId; + const char* username; + const char* discriminator; + const char* avatar; +} DiscordUser; + +typedef struct DiscordEventHandlers { + void (*ready)(const DiscordUser* request); + void (*disconnected)(int errorCode, const char* message); + void (*errored)(int errorCode, const char* message); + void (*joinGame)(const char* joinSecret); + void (*spectateGame)(const char* spectateSecret); + void (*joinRequest)(const DiscordUser* request); +} DiscordEventHandlers; + +#define DISCORD_REPLY_NO 0 +#define DISCORD_REPLY_YES 1 +#define DISCORD_REPLY_IGNORE 2 + +void discord_update_rich_presence(void); +void discord_shutdown(void); +void discord_init(void); +void discord_reset(void); + +#endif // DISCORDRPC_H diff --git a/src/pc/fs/dirtree.c b/src/pc/fs/dirtree.c new file mode 100644 index 00000000..3ebdc5fe --- /dev/null +++ b/src/pc/fs/dirtree.c @@ -0,0 +1,137 @@ +#include +#include +#include +#include + +#include "../platform.h" +#include "fs.h" +#include "dirtree.h" + +static inline uint32_t dirtree_hash(const char *s, size_t len) { + // djb hash + uint32_t hash = 5381; + while (len--) hash = ((hash << 5) + hash) ^ *(s++); + return hash & (FS_NUMBUCKETS - 1); +} + +bool fs_dirtree_init(fs_dirtree_t *tree, const size_t entry_len) { + memset(tree, 0, sizeof(*tree)); + + tree->root = malloc(entry_len); + if (!tree->root) return false; + + tree->root->name = ""; // root + tree->root->is_dir = true; + tree->entry_len = entry_len; + + return true; +} + +void fs_dirtree_free(fs_dirtree_t *tree) { + if (!tree) return; + if (tree->root) free(tree->root); + for (int i = 0; i < FS_NUMBUCKETS; ++i) { + fs_dirtree_entry_t *ent, *next; + for (ent = tree->buckets[i]; ent; ent = next) { + next = ent->next_hash; + free(ent); + } + } +} + +static inline fs_dirtree_entry_t *dirtree_add_ancestors(fs_dirtree_t *tree, char *name) { + fs_dirtree_entry_t *ent = tree->root; + + // look for parent directory + char *last_sep = strrchr(name, '/'); + if (!last_sep) return ent; + *last_sep = 0; + ent = fs_dirtree_find(tree, name); + + if (ent) { + *last_sep = '/'; // put the separator back + return ent; // parent directory already in tree + } + + // add the parent directory + ent = fs_dirtree_add(tree, name, true); + *last_sep = '/'; + + return ent; +} + +fs_dirtree_entry_t *fs_dirtree_add(fs_dirtree_t *tree, char *name, const bool is_dir) { + fs_dirtree_entry_t *ent = fs_dirtree_find(tree, name); + if (ent) return ent; + + // add the parent directory into the tree first + fs_dirtree_entry_t *parent = dirtree_add_ancestors(tree, name); + if (!parent) return NULL; + + // we'll plaster the name at the end of the allocated chunk, after the actual entry + const size_t name_len = strlen(name); + const size_t allocsize = tree->entry_len + name_len + 1; + ent = calloc(1, allocsize); + if (!ent) return NULL; + + ent->name = (const char *)ent + tree->entry_len; + strcpy((char *)ent->name, name); + + const uint32_t hash = dirtree_hash(name, name_len); + ent->next_hash = tree->buckets[hash]; + tree->buckets[hash] = ent; + ent->next_sibling = parent->next_child; + ent->is_dir = is_dir; + parent->next_child = ent; + + return ent; +} + +fs_dirtree_entry_t *fs_dirtree_find(fs_dirtree_t *tree, const char *name) { + if (!name) return NULL; + if (!*name) return tree->root; + + const uint32_t hash = dirtree_hash(name, strlen(name)); + + fs_dirtree_entry_t *ent, *prev = NULL; + for (ent = tree->buckets[hash]; ent; ent = ent->next_hash) { + if (!strcmp(ent->name, name)) { + // if this path is not in front of the hash list, move it to the front + // in case of reccurring searches + if (prev) { + prev->next_hash = ent->next_hash; + ent->next_hash = tree->buckets[hash]; + tree->buckets[hash] = ent; + } + return ent; + } + prev = ent; + } + + return NULL; +} + +static fs_walk_result_t dirtree_walk_impl(fs_dirtree_entry_t *ent, walk_fn_t walkfn, void *user, const bool recur) { + fs_walk_result_t res = FS_WALK_SUCCESS;; + ent = ent->next_child; + while (ent && (res == FS_WALK_SUCCESS)) { + if (ent->is_dir) { + if (recur && ent->next_child) + res = dirtree_walk_impl(ent, walkfn, user, recur); + } else if (!walkfn(user, ent->name)) { + res = FS_WALK_INTERRUPTED; + break; + } + ent = ent->next_sibling; + } + return res; +} + +fs_walk_result_t fs_dirtree_walk(void *pack, const char *base, walk_fn_t walkfn, void *user, const bool recur) { + fs_dirtree_t *tree = (fs_dirtree_t *)pack; + + fs_dirtree_entry_t *ent = fs_dirtree_find(tree, base); + if (!ent) return FS_WALK_NOTFOUND; + + return dirtree_walk_impl(ent, walkfn, user, recur); +} diff --git a/src/pc/fs/dirtree.h b/src/pc/fs/dirtree.h new file mode 100644 index 00000000..6793a3a0 --- /dev/null +++ b/src/pc/fs/dirtree.h @@ -0,0 +1,32 @@ +#ifndef _SM64_DIRTREE_H_ +#define _SM64_DIRTREE_H_ + +#include +#include + +#include "fs.h" + +#define FS_NUMBUCKETS 64 + +typedef struct fs_dirtree_entry_s { + const char *name; + bool is_dir; + struct fs_dirtree_entry_s *next_hash, *next_child, *next_sibling; +} fs_dirtree_entry_t; + +typedef struct { + fs_dirtree_entry_t *root; + fs_dirtree_entry_t *buckets[FS_NUMBUCKETS]; + size_t entry_len; +} fs_dirtree_t; + +bool fs_dirtree_init(fs_dirtree_t *tree, const size_t entry_len); +void fs_dirtree_free(fs_dirtree_t *tree); + +fs_dirtree_entry_t *fs_dirtree_add(fs_dirtree_t *tree, char *name, const bool is_dir); +fs_dirtree_entry_t *fs_dirtree_find(fs_dirtree_t *tree, const char *name); + +// the first arg is void* so this could be used in walk() methods of various packtypes +fs_walk_result_t fs_dirtree_walk(void *tree, const char *base, walk_fn_t walkfn, void *user, const bool recur); + +#endif // _SM64_DIRTREE_H_ diff --git a/src/pc/fs/fs.c b/src/pc/fs/fs.c new file mode 100644 index 00000000..b9e117f7 --- /dev/null +++ b/src/pc/fs/fs.c @@ -0,0 +1,470 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef _WIN32 +#include +#endif + +#include "macros.h" +#include "../platform.h" +#include "fs.h" + +char fs_gamedir[SYS_MAX_PATH] = ""; +char fs_writepath[SYS_MAX_PATH] = ""; + +struct fs_dir_s { + void *pack; + const char *realpath; + fs_packtype_t *packer; + struct fs_dir_s *prev, *next; +}; + +extern fs_packtype_t fs_packtype_dir; +extern fs_packtype_t fs_packtype_zip; + +static fs_packtype_t *fs_packers[] = { + &fs_packtype_dir, + &fs_packtype_zip, +}; + +static fs_dir_t *fs_searchpaths = NULL; + +static inline fs_dir_t *fs_find_dir(const char *realpath) { + for (fs_dir_t *dir = fs_searchpaths; dir; dir = dir->next) + if (!sys_strcasecmp(realpath, dir->realpath)) + return dir; + return NULL; +} + +static int mount_cmp(const void *p1, const void *p2) { + const char *s1 = sys_file_name(*(const char **)p1); + const char *s2 = sys_file_name(*(const char **)p2); + + // check if one or both of these are basepacks + const int plen = strlen(FS_BASEPACK_PREFIX); + const bool is_base1 = !strncmp(s1, FS_BASEPACK_PREFIX, plen); + const bool is_base2 = !strncmp(s2, FS_BASEPACK_PREFIX, plen); + + // if both are basepacks, compare the postfixes only + if (is_base1 && is_base2) return strcmp(s1 + plen, s2 + plen); + // if only one is a basepack, it goes first + if (is_base1) return -1; + if (is_base2) return 1; + // otherwise strcmp order + return strcmp(s1, s2); +} + +static void scan_path_dir(const char *ropath, const char *dir) { + char dirpath[SYS_MAX_PATH]; + snprintf(dirpath, sizeof(dirpath), "%s/%s", ropath, dir); + + if (!fs_sys_dir_exists(dirpath)) return; + + // since filename order in readdir() isn't guaranteed, collect paths and sort them in strcmp() order + // (but with basepacks first) + fs_pathlist_t plist = fs_sys_enumerate(dirpath, false); + if (plist.paths) { + qsort(plist.paths, plist.numpaths, sizeof(char *), mount_cmp); + for (int i = 0; i < plist.numpaths; ++i) + fs_mount(plist.paths[i]); + fs_pathlist_free(&plist); + } + + // mount the directory itself + fs_mount(dirpath); +} + +bool fs_init(const char **rodirs, const char *gamedir, const char *writepath) { + char buf[SYS_MAX_PATH]; + + // expand and remember the write path + strncpy(fs_writepath, fs_convert_path(buf, sizeof(buf), writepath), sizeof(fs_writepath)); + fs_writepath[sizeof(fs_writepath)-1] = 0; + printf("fs: writepath set to `%s`\n", fs_writepath); + + // remember the game directory name + strncpy(fs_gamedir, gamedir, sizeof(fs_gamedir)); + fs_gamedir[sizeof(fs_gamedir)-1] = 0; + printf("fs: gamedir set to `%s`\n", fs_gamedir); + + // first, scan all possible paths and mount all basedirs in them + for (const char **p = rodirs; p && *p; ++p) + scan_path_dir(fs_convert_path(buf, sizeof(buf), *p), FS_BASEDIR); + scan_path_dir(fs_writepath, FS_BASEDIR); + + // then mount all the gamedirs in them, if the game dir isn't the same + if (sys_strcasecmp(FS_BASEDIR, fs_gamedir)) { + for (const char **p = rodirs; p && *p; ++p) + scan_path_dir(fs_convert_path(buf, sizeof(buf), *p), fs_gamedir); + scan_path_dir(fs_writepath, fs_gamedir); + } + + // as a special case, mount writepath itself + fs_mount(fs_writepath); + + return true; +} + +bool fs_mount(const char *realpath) { + if (fs_find_dir(realpath)) + return false; // already mounted + + const char *ext = sys_file_extension(realpath); + void *pack = NULL; + fs_packtype_t *packer = NULL; + bool tried = false; + for (unsigned int i = 0; i < sizeof(fs_packers) / sizeof(fs_packers[0]); ++i) { + if (ext && sys_strcasecmp(ext, fs_packers[i]->extension)) + continue; + tried = true; + pack = fs_packers[i]->mount(realpath); + if (pack) { + packer = fs_packers[i]; + break; + } + } + + if (!pack || !packer) { + if (tried) + fprintf(stderr, "fs: could not mount '%s'\n", realpath); + return false; + } + + fs_dir_t *dir = calloc(1, sizeof(fs_dir_t)); + if (!dir) { + packer->unmount(pack); + return false; + } + + dir->pack = pack; + dir->realpath = sys_strdup(realpath); + dir->packer = packer; + dir->prev = NULL; + dir->next = fs_searchpaths; + if (fs_searchpaths) + fs_searchpaths->prev = dir; + fs_searchpaths = dir; + + printf("fs: mounting '%s'\n", realpath); + + return true; +} + +bool fs_unmount(const char *realpath) { + fs_dir_t *dir = fs_find_dir(realpath); + if (dir) { + dir->packer->unmount(dir->pack); + free((void *)dir->realpath); + if (dir->prev) dir->prev->next = dir->next; + if (dir->next) dir->next->prev = dir->prev; + if (dir == fs_searchpaths) fs_searchpaths = dir->next; + free(dir); + return true; + } + return false; +} + +fs_walk_result_t fs_walk(const char *base, walk_fn_t walkfn, void *user, const bool recur) { + bool found = false; + for (fs_dir_t *dir = fs_searchpaths; dir; dir = dir->next) { + fs_walk_result_t res = dir->packer->walk(dir->pack, base, walkfn, user, recur); + if (res == FS_WALK_INTERRUPTED) + return res; + if (res != FS_WALK_NOTFOUND) + found = true; + } + return found ? FS_WALK_SUCCESS : FS_WALK_NOTFOUND; +} + +bool fs_is_file(const char *fname) { + for (fs_dir_t *dir = fs_searchpaths; dir; dir = dir->next) { + if (dir->packer->is_file(dir->pack, fname)) + return true; + } + return false; +} + +bool fs_is_dir(const char *fname) { + for (fs_dir_t *dir = fs_searchpaths; dir; dir = dir->next) { + if (dir->packer->is_dir(dir->pack, fname)) + return true; + } + return false; +} + +fs_file_t *fs_open(const char *vpath) { + for (fs_dir_t *dir = fs_searchpaths; dir; dir = dir->next) { + fs_file_t *f = dir->packer->open(dir->pack, vpath); + if (f) { + f->parent = dir; + return f; + } + } + return NULL; +} + +void fs_close(fs_file_t *file) { + if (!file) return; + file->parent->packer->close(file->parent->pack, file); +} + +int64_t fs_read(fs_file_t *file, void *buf, const uint64_t size) { + if (!file) return -1; + return file->parent->packer->read(file->parent->pack, file, buf, size); +} + +bool fs_seek(fs_file_t *file, const int64_t ofs) { + if (!file) return -1; + return file->parent->packer->seek(file->parent->pack, file, ofs); +} + +int64_t fs_tell(fs_file_t *file) { + if (!file) return -1; + return file->parent->packer->tell(file->parent->pack, file); +} + +int64_t fs_size(fs_file_t *file) { + if (!file) return -1; + return file->parent->packer->size(file->parent->pack, file); +} + +bool fs_eof(fs_file_t *file) { + if (!file) return true; + return file->parent->packer->eof(file->parent->pack, file); +} + +struct matchdata_s { + const char *prefix; + size_t prefix_len; + char *dst; + size_t dst_len; +}; + +static bool match_walk(void *user, const char *path) { + struct matchdata_s *data = (struct matchdata_s *)user; + if (!strncmp(path, data->prefix, data->prefix_len)) { + // found our lad, copy path to destination and terminate + strncpy(data->dst, path, data->dst_len); + data->dst[data->dst_len - 1] = 0; + return false; + } + return true; +} + +const char *fs_match(char *outname, const size_t outlen, const char *prefix) { + struct matchdata_s data = { + .prefix = prefix, + .prefix_len = strlen(prefix), + .dst = outname, + .dst_len = outlen, + }; + + if (fs_walk("", match_walk, &data, true) == FS_WALK_INTERRUPTED) + return outname; + + return NULL; +} + +static bool enumerate_walk(void *user, const char *path) { + fs_pathlist_t *data = (fs_pathlist_t *)user; + + if (data->listcap == data->numpaths) { + data->listcap *= 2; + char **newpaths = realloc(data->paths, data->listcap * sizeof(char *)); + if (!newpaths) return false; + data->paths = newpaths; + } + + data->paths[data->numpaths++] = sys_strdup(path); + return true; +} + +fs_pathlist_t fs_enumerate(const char *base, const bool recur) { + char **paths = malloc(sizeof(char *) * 32); + fs_pathlist_t pathlist = { paths, 0, 32 }; + + if (!paths) return pathlist; + + if (fs_walk(base, enumerate_walk, &pathlist, recur) == FS_WALK_INTERRUPTED) + fs_pathlist_free(&pathlist); + + return pathlist; +} + +void fs_pathlist_free(fs_pathlist_t *pathlist) { + if (!pathlist || !pathlist->paths) return; + for (int i = 0; i < pathlist->numpaths; ++i) + free(pathlist->paths[i]); + free(pathlist->paths); + pathlist->paths = NULL; + pathlist->numpaths = 0; +} + +const char *fs_readline(fs_file_t *file, char *dst, uint64_t size) { + int64_t rx = 0; + char chr, *p; + + // assume we got buffered input + for (p = dst, size--; size > 0; size--) { + if ((rx = fs_read(file, &chr, 1)) <= 0) + break; + *p++ = chr; + if (chr == '\n') + break; + } + + *p = 0; + if (p == dst || rx <= 0) + return NULL; + + return p; +} + +void *fs_load_file(const char *vpath, uint64_t *outsize) { + fs_file_t *f = fs_open(vpath); + if (!f) return NULL; + + int64_t size = fs_size(f); + if (size <= 0) { + fs_close(f); + return NULL; + } + + void *buf = malloc(size); + if (!buf) { + fs_close(f); + return NULL; + } + + int64_t rx = fs_read(f, buf, size); + fs_close(f); + + if (rx < size) { + free(buf); + return NULL; + } + + if (outsize) *outsize = size; + return buf; +} + +const char *fs_get_write_path(const char *vpath) { + static char path[SYS_MAX_PATH]; + snprintf(path, sizeof(path), "%s/%s", fs_writepath, vpath); + return path; +} + +const char *fs_convert_path(char *buf, const size_t bufsiz, const char *path) { + // ! means "executable directory" + if (path[0] == '!') { + snprintf(buf, bufsiz, "%s%s", sys_exe_path(), path + 1); + } else { + strncpy(buf, path, bufsiz); + buf[bufsiz-1] = 0; + } + + // change all backslashes + for (char *p = buf; *p; ++p) + if (*p == '\\') *p = '/'; + + return buf; +} + +/* these operate on the real file system */ + +bool fs_sys_file_exists(const char *name) { + struct stat st; + return (stat(name, &st) == 0 && S_ISREG(st.st_mode)); +} + +bool fs_sys_dir_exists(const char *name) { + struct stat st; + return (stat(name, &st) == 0 && S_ISDIR(st.st_mode)); +} + +bool fs_sys_walk(const char *base, walk_fn_t walk, void *user, const bool recur) { + char fullpath[SYS_MAX_PATH]; + DIR *dir; + struct dirent *ent; + + if (!(dir = opendir(base))) { + fprintf(stderr, "fs_dir_walk(): could not open `%s`\n", base); + return false; + } + + bool ret = true; + + while ((ent = readdir(dir)) != NULL) { + if (ent->d_name[0] == 0 || ent->d_name[0] == '.') continue; // skip ./.. and hidden files + snprintf(fullpath, sizeof(fullpath), "%s/%s", base, ent->d_name); + if (fs_sys_dir_exists(fullpath)) { + if (recur) { + if (!fs_sys_walk(fullpath, walk, user, recur)) { + ret = false; + break; + } + } + } else { + if (!walk(user, fullpath)) { + ret = false; + break; + } + } + } + + closedir(dir); + return ret; +} + +fs_pathlist_t fs_sys_enumerate(const char *base, const bool recur) { + char **paths = malloc(sizeof(char *) * 32); + fs_pathlist_t pathlist = { paths, 0, 32 }; + + if (!paths) return pathlist; + + if (!fs_sys_walk(base, enumerate_walk, &pathlist, recur)) + fs_pathlist_free(&pathlist); + + return pathlist; +} + +bool fs_sys_mkdir(const char *name) { + #ifdef _WIN32 + return _mkdir(name) == 0; + #else + return mkdir(name, 0777) == 0; + #endif +} + +bool fs_sys_copy_file(const char *oldname, const char *newname) { + uint8_t buf[2048]; + + FILE *fin = fopen(oldname, "rb"); + if (!fin) return false; + + FILE *fout = fopen(newname, "wb"); + if (!fout) { + fclose(fin); + return false; + } + + bool ret = true; + size_t rx; + while ((rx = fread(buf, 1, sizeof(buf), fin)) > 0) { + if (!fwrite(buf, rx, 1, fout)) { + ret = false; + break; + } + } + + fclose(fout); + fclose(fin); + + return ret; +} diff --git a/src/pc/fs/fs.h b/src/pc/fs/fs.h new file mode 100644 index 00000000..25d176df --- /dev/null +++ b/src/pc/fs/fs.h @@ -0,0 +1,138 @@ +#ifndef _SM64_FS_H_ +#define _SM64_FS_H_ + +#include +#include +#include +#include + +#include "../platform.h" + +// FS_BASEDIR is usually defined in the build script +#ifndef FS_BASEDIR +# define FS_BASEDIR "res" +#endif + +#ifndef FS_BASEPACK_PREFIX +# define FS_BASEPACK_PREFIX "base" +#endif + +#define FS_TEXTUREDIR "gfx" +#define FS_SOUNDDIR "sound" + +#define SAVE_FILENAME "sm64_save_file.bin" + +extern char fs_gamedir[]; +extern char fs_writepath[]; + +// receives the full path +// should return `true` if traversal should continue +// first arg is user data +typedef bool (*walk_fn_t)(void *, const char *); + +typedef enum { + FS_WALK_SUCCESS = 0, + FS_WALK_INTERRUPTED = 1, + FS_WALK_NOTFOUND = 2, + FS_WALK_ERROR = 4, +} fs_walk_result_t; + +// opaque searchpath directory type +typedef struct fs_dir_s fs_dir_t; + +// virtual file handle +typedef struct fs_file_s { + void *handle; // opaque packtype-defined data + fs_dir_t *parent; // directory containing this file +} fs_file_t; + +// list of paths; returned by fs_enumerate() +typedef struct { + char **paths; + int numpaths; + int listcap; +} fs_pathlist_t; + +typedef struct { + const char *extension; // file extensions of this pack type + + void *(*mount)(const char *rpath); // open and initialize pack at real path `rpath` + void (*unmount)(void *pack); // free pack + + // walks the specified directory inside this pack, calling walkfn for each file + // returns FS_WALK_SUCCESS if the directory was successfully opened and walk() didn't ever return false + // returns FS_WALK_INTERRUPTED if the traversal started but walk() returned false at some point + // if recur is true, will recurse into subfolders + fs_walk_result_t (*walk)(void *pack, const char *base, walk_fn_t walkfn, void *user, const bool recur); + + bool (*is_file)(void *pack, const char *path); // returns true if `path` exists in this pack and is a file + bool (*is_dir)(void *pack, const char *path); // returns true if `path` exists in this pack and is a directory + + // file I/O functions; paths are virtual + fs_file_t *(*open)(void *pack, const char *path); // opens a virtual file contained in this pack for reading, returns NULL in case of error + int64_t (*read)(void *pack, fs_file_t *file, void *buf, const uint64_t size); // returns -1 in case of error + bool (*seek)(void *pack, fs_file_t *file, const int64_t ofs); // returns true if seek succeeded + int64_t (*tell)(void *pack, fs_file_t *file); // returns -1 in case of error, current virtual file position otherwise + int64_t (*size)(void *pack, fs_file_t *file); // returns -1 in case of error, size of the (uncompressed) file otherwise + bool (*eof)(void *pack, fs_file_t *file); // returns true if there's nothing more to read + void (*close)(void *pack, fs_file_t *file); // closes a virtual file previously opened with ->open() +} fs_packtype_t; + +// takes the supplied NULL-terminated list of read-only directories and mounts all the packs in them, +// then mounts the directories themselves, then mounts all the packs in `gamedir`, then mounts `gamedir` itself, +// then does the same with `userdir` +// initializes the `fs_gamedir` and `fs_userdir` variables +bool fs_init(const char **rodirs, const char *gamedir, const char *userdir); + +// mounts the pack at physical path `realpath` to the root of the filesystem +// packs mounted later take priority over packs mounted earlier +bool fs_mount(const char *realpath); + +// removes the pack at physical path from the virtual filesystem +bool fs_unmount(const char *realpath); + +/* generalized filesystem functions that call matching packtype functions for each pack in the searchpath */ + +// FIXME: this can walk in unorthodox patterns, since it goes through mountpoints linearly +fs_walk_result_t fs_walk(const char *base, walk_fn_t walkfn, void *user, const bool recur); + +// returns a list of files in the `base` directory +fs_pathlist_t fs_enumerate(const char *base, const bool recur); +// call this on a list returned by fs_enumerate() to free it +void fs_pathlist_free(fs_pathlist_t *pathlist); + +bool fs_is_file(const char *fname); +bool fs_is_dir(const char *fname); + +fs_file_t *fs_open(const char *vpath); +void fs_close(fs_file_t *file); +int64_t fs_read(fs_file_t *file, void *buf, const uint64_t size); +const char *fs_readline(fs_file_t *file, char *dst, const uint64_t size); +bool fs_seek(fs_file_t *file, const int64_t ofs); +int64_t fs_tell(fs_file_t *file); +int64_t fs_size(fs_file_t *file); +bool fs_eof(fs_file_t *file); + +void *fs_load_file(const char *vpath, uint64_t *outsize); +const char *fs_readline(fs_file_t *file, char *dst, uint64_t size); + +// tries to find the first file with the filename that starts with `prefix` +// puts full filename into `outname` and returns it or returns NULL if nothing matches +const char *fs_match(char *outname, const size_t outlen, const char *prefix); + +// takes a virtual path and prepends the write path to it +const char *fs_get_write_path(const char *vpath); + +// expands special chars in paths and changes backslashes to forward slashes +const char *fs_convert_path(char *buf, const size_t bufsiz, const char *path); + +/* these operate on the real filesystem and are used by fs_packtype_dir */ + +bool fs_sys_walk(const char *base, walk_fn_t walk, void *user, const bool recur); +fs_pathlist_t fs_sys_enumerate(const char *base, const bool recur); +bool fs_sys_file_exists(const char *name); +bool fs_sys_dir_exists(const char *name); +bool fs_sys_mkdir(const char *name); // creates with 0777 by default +bool fs_sys_copy_file(const char *oldname, const char *newname); + +#endif // _SM64_FS_H_ diff --git a/src/pc/fs/fs_packtype_dir.c b/src/pc/fs/fs_packtype_dir.c new file mode 100644 index 00000000..afd0c97a --- /dev/null +++ b/src/pc/fs/fs_packtype_dir.c @@ -0,0 +1,117 @@ +#include +#include +#include +#include +#include + +#include "macros.h" +#include "../platform.h" +#include "fs.h" + +static void *pack_dir_mount(const char *realpath) { + if (!fs_sys_dir_exists(realpath)) + return NULL; + // the pack is actually just the real folder path + void *pack = (void *)sys_strdup(realpath); + return pack; +} + +static void pack_dir_unmount(void *pack) { + free(pack); +} + +struct walkdata_s { + size_t baselen; + walk_fn_t userwalk; + void *userdata; +}; + +// wrap the actual user walk function to return virtual paths instead of real paths +static bool packdir_walkfn(void *userdata, const char *path) { + struct walkdata_s *walk = (struct walkdata_s *)userdata; + return walk->userwalk(walk->userdata, path + walk->baselen); +} + +static fs_walk_result_t pack_dir_walk(void *pack, const char *base, walk_fn_t walkfn, void *user, const bool recur) { + char path[SYS_MAX_PATH]; + snprintf(path, SYS_MAX_PATH, "%s/%s", (const char *)pack, base); + + if (!fs_sys_dir_exists(path)) + return FS_WALK_NOTFOUND; + + struct walkdata_s walkdata = { strlen((const char *)pack) + 1, walkfn, user }; + return fs_sys_walk(path, packdir_walkfn, &walkdata, recur); +} + +static bool pack_dir_is_file(void *pack, const char *fname) { + char path[SYS_MAX_PATH]; + snprintf(path, sizeof(path), "%s/%s", (const char *)pack, fname); + return fs_sys_dir_exists(path); +} + +static bool pack_dir_is_dir(void *pack, const char *fname) { + char path[SYS_MAX_PATH]; + snprintf(path, sizeof(path), "%s/%s", (const char *)pack, fname); + return fs_sys_file_exists(path); +} + +static fs_file_t *pack_dir_open(void *pack, const char *vpath) { + char path[SYS_MAX_PATH]; + snprintf(path, sizeof(path), "%s/%s", (const char *)pack, vpath); + + FILE *f = fopen(path, "rb"); + if (!f) return NULL; + + fs_file_t *fsfile = malloc(sizeof(fs_file_t)); + if (!fsfile) { fclose(f); return NULL; } + + fsfile->parent = NULL; + fsfile->handle = f; + + return fsfile; +} + +static void pack_dir_close(UNUSED void *pack, fs_file_t *file) { + fclose((FILE *)file->handle); + free(file); +} + +static int64_t pack_dir_read(UNUSED void *pack, fs_file_t *file, void *buf, const uint64_t size) { + return fread(buf, 1, size, (FILE *)file->handle); +} + +static bool pack_dir_seek(UNUSED void *pack, fs_file_t *file, const int64_t ofs) { + return fseek((FILE *)file->handle, ofs, SEEK_SET) == 0; +} + +static int64_t pack_dir_tell(UNUSED void *pack, fs_file_t *file) { + return ftell((FILE *)file->handle); +} + +static int64_t pack_dir_size(UNUSED void *pack, fs_file_t *file) { + int64_t oldofs = ftell((FILE *)file->handle); + fseek((FILE *)file->handle, 0, SEEK_END); + int64_t size = ftell((FILE *)file->handle); + fseek((FILE *)file->handle, oldofs, SEEK_SET); + return size; +} + +static bool pack_dir_eof(UNUSED void *pack, fs_file_t *file) { + return feof((FILE *)file->handle); +} + +fs_packtype_t fs_packtype_dir = { + "", + pack_dir_mount, + pack_dir_unmount, + pack_dir_walk, + pack_dir_is_file, + pack_dir_is_dir, + pack_dir_open, + pack_dir_read, + pack_dir_seek, + pack_dir_tell, + pack_dir_size, + pack_dir_eof, + pack_dir_close, +}; diff --git a/src/pc/fs/fs_packtype_zip.c b/src/pc/fs/fs_packtype_zip.c new file mode 100644 index 00000000..d331cbe1 --- /dev/null +++ b/src/pc/fs/fs_packtype_zip.c @@ -0,0 +1,486 @@ +#include +#include +#include +#include +#include +#include + +#include + +#include "macros.h" +#include "../platform.h" +#include "fs.h" +#include "dirtree.h" + +#define ZIP_BUFSIZE 16384 +#define ZIP_EOCD_BUFSIZE 65578 + +#define ZIP_LFH_SIG 0x04034b50 +#define ZIP_CDH_SIG 0x02014b50 +#define ZIP_EOCD_SIG 0x06054b50 + +typedef struct { + fs_dirtree_t tree; // this should always be first, so this could be used as a dirtree root + const char *realpath; // physical path to the zip file + FILE *zipf; // open zip file handle, if any +} zip_pack_t; + +typedef struct { + fs_dirtree_entry_t tree; // this should always be first, so this could be used as a dirtree entry + uint64_t ofs; // offset to compressed data in zip + uint16_t bits; // general purpose zip flags + uint16_t comptype; // compression method + uint32_t crc; // CRC-32 + uint64_t comp_size; // size of compressed data in zip + uint64_t uncomp_size; // size of decompressed data + uint16_t attr_int; // internal attributes + uint32_t attr_ext; // external attributes + bool ofs_fixed; // if true, `ofs` points to the file data, otherwise to LFH +} zip_entry_t; + +typedef struct { + zip_entry_t *entry; // the dirtree entry of this file + uint32_t comp_pos; // read position in compressed data + uint32_t uncomp_pos; // read position in uncompressed data + uint8_t *buffer; // decompression buffer (if compressed) + z_stream zstream; // tinfl zlib stream + FILE *fstream; // duplicate of zipf of the parent zip file +} zip_file_t; + +static int64_t zip_find_eocd(FILE *f, int64_t *outlen) { + // the EOCD is somewhere in the last 65557 bytes of the file + // get the total file size + fseek(f, 0, SEEK_END); + const int64_t fsize = ftell(f); + if (fsize <= 16) return -1; // probably not a zip + + const int64_t rx = (fsize < ZIP_EOCD_BUFSIZE ? fsize : ZIP_EOCD_BUFSIZE); + uint8_t *buf = malloc(rx); + if (!buf) return -1; + + // read that entire chunk and search for EOCD backwards from the end + fseek(f, fsize - rx, SEEK_SET); + if (fread(buf, rx, 1, f)) { + for (int64_t i = rx - 8; i >= 0; --i) { + if ((buf[i + 0] == 0x50) && (buf[i + 1] == 0x4B) && + (buf[i + 2] == 0x05) && (buf[i + 3] == 0x06)) { + // gotem + free(buf); + if (outlen) *outlen = fsize; + return fsize - rx + i; + } + } + } + + free(buf); + return -1; +} + +static bool zip_parse_eocd(FILE *f, uint64_t *cdir_ofs, uint64_t *data_ofs, uint64_t *count) { + int64_t fsize = 0; + + // EOCD record struct + struct eocd_s { + uint32_t sig; + uint16_t this_disk; + uint16_t cdir_disk; + uint16_t disk_entry_count; + uint16_t total_entry_count; + uint32_t cdir_size; + uint32_t cdir_ofs; + uint16_t comment_len; + // zip comment follows + } __attribute__((__packed__)); + struct eocd_s eocd; + + // find the EOCD and seek to it + int64_t pos = zip_find_eocd(f, &fsize); + if (pos < 0) return false; + fseek(f, pos, SEEK_SET); + + // read it + if (!fread(&eocd, sizeof(eocd), 1, f)) return false; + + // double check the sig + if (LE_TO_HOST32(eocd.sig) != ZIP_EOCD_SIG) return false; + + // disks should all be 0 + if (eocd.this_disk || eocd.cdir_disk) return false; + + // total entry count should be the same as disk entry count + if (eocd.disk_entry_count != eocd.total_entry_count) return false; + + *count = LE_TO_HOST16(eocd.total_entry_count); + *cdir_ofs = LE_TO_HOST32(eocd.cdir_ofs); + eocd.cdir_size = LE_TO_HOST32(eocd.cdir_size); + + // end of central dir can't be before central dir + if ((uint64_t)pos < *cdir_ofs + eocd.cdir_size) return false; + + *data_ofs = (uint64_t)(pos - (*cdir_ofs + eocd.cdir_size)); + *cdir_ofs += *data_ofs; + + // make sure end of comment matches end of file + eocd.comment_len = LE_TO_HOST16(eocd.comment_len); + return ((pos + 22 + eocd.comment_len) == fsize); +} + +static bool zip_fixup_offset(zip_file_t *zipfile) { + // LFH record struct + struct lfh_s { + uint32_t sig; + uint16_t version_required; + uint16_t bits; + uint16_t comptype; + uint16_t mod_time; + uint16_t mod_date; + uint32_t crc; + uint32_t comp_size; + uint32_t uncomp_size; + uint16_t fname_len; + uint16_t extra_len; + // file name, extra field and data follow + } __attribute__((__packed__)); + + struct lfh_s lfh; + + zip_entry_t *ent = zipfile->entry; + + fseek(zipfile->fstream, ent->ofs, SEEK_SET); + if (!fread(&lfh, sizeof(lfh), 1, zipfile->fstream)) return false; + + // we only need these two + lfh.fname_len = LE_TO_HOST16(lfh.fname_len); + lfh.extra_len = LE_TO_HOST16(lfh.extra_len); + + // ofs will now point to actual data + ent->ofs += sizeof(lfh) + lfh.fname_len + lfh.extra_len; + ent->ofs_fixed = true; // only need to do this once + + return true; +} + +static zip_entry_t *zip_load_entry(FILE *f, fs_dirtree_t *tree, const uint64_t data_ofs) { + // CDH record struct + struct cdh_s { + uint32_t sig; + uint16_t version_used; + uint16_t version_required; + uint16_t bits; + uint16_t comptype; + uint16_t mod_time; + uint16_t mod_date; + uint32_t crc; + uint32_t comp_size; + uint32_t uncomp_size; + uint16_t fname_len; + uint16_t extra_len; + uint16_t comment_len; + uint16_t start_disk; + uint16_t attr_int; + uint32_t attr_ext; + uint32_t lfh_ofs; + // file name, extra field and comment follow + } __attribute__((__packed__)); + + struct cdh_s cdh; + zip_entry_t zipent; + + memset(&zipent, 0, sizeof(zipent)); + + if (!fread(&cdh, sizeof(cdh), 1, f)) return NULL; + + // check cdir entry header signature + if (LE_TO_HOST32(cdh.sig) != ZIP_CDH_SIG) return NULL; + + // byteswap and copy some important fields + zipent.bits = LE_TO_HOST16(cdh.bits); + zipent.comptype = LE_TO_HOST16(cdh.comptype); + zipent.crc = LE_TO_HOST32(cdh.crc); + zipent.comp_size = LE_TO_HOST32(cdh.comp_size); + zipent.uncomp_size = LE_TO_HOST32(cdh.uncomp_size); + zipent.ofs = LE_TO_HOST32(cdh.lfh_ofs); + zipent.attr_int = LE_TO_HOST16(cdh.attr_int); + zipent.attr_ext = LE_TO_HOST32(cdh.attr_ext); + cdh.fname_len = LE_TO_HOST16(cdh.fname_len); + cdh.comment_len = LE_TO_HOST16(cdh.comment_len); + cdh.extra_len = LE_TO_HOST16(cdh.extra_len); + + // read the name + char *name = calloc(1, cdh.fname_len + 1); + if (!name) return NULL; + if (!fread(name, cdh.fname_len, 1, f)) { free(name); return NULL; } + + // this is a directory if the name ends in a path separator + bool is_dir = false; + if (name[cdh.fname_len - 1] == '/') { + is_dir = true; + name[cdh.fname_len - 1] = 0; + } + name[cdh.fname_len] = 0; + + // add to directory tree + zip_entry_t *retent = (zip_entry_t *)fs_dirtree_add(tree, name, is_dir); + free(name); + if (!retent) return NULL; + + // copy the data we read into the new entry + zipent.tree = retent->tree; + memcpy(retent, &zipent, sizeof(zipent)); + + // this points to the LFH now; will be fixed up on file open + // while the CDH includes an "extra field length" field, it's usually different + retent->ofs += data_ofs; + + // skip to the next CDH + fseek(f, cdh.extra_len + cdh.comment_len, SEEK_CUR); + + return retent; +} + +static inline bool zip_load_entries(FILE *f, fs_dirtree_t *tree, const uint64_t cdir_ofs, const uint64_t data_ofs, const uint64_t count) { + fseek(f, cdir_ofs, SEEK_SET); + for (uint64_t i = 0; i < count; ++i) { + if (!zip_load_entry(f, tree, data_ofs)) + return false; + } + return true; +} + +static inline bool is_zip(FILE *f) { + uint32_t sig = 0; + if (fread(&sig, sizeof(sig), 1, f)) { + // the first LFH might be at the start of the zip + if (LE_TO_HOST32(sig) == ZIP_LFH_SIG) + return true; + // no signature, might still be a zip because fuck you + // the only way now is to try and find the end of central directory + return zip_find_eocd(f, NULL) >= 0; + } + return false; +} + +static void *pack_zip_mount(const char *realpath) { + uint64_t cdir_ofs, data_ofs, count; + zip_pack_t *pack = NULL; + FILE *f = NULL; + + f = fopen(realpath, "rb"); + if (!f) goto _fail; + + if (!is_zip(f)) goto _fail; + + pack = calloc(1, sizeof(zip_pack_t)); + if (!pack) goto _fail; + + if (!zip_parse_eocd(f, &cdir_ofs, &data_ofs, &count)) + goto _fail; + + if (!fs_dirtree_init(&pack->tree, sizeof(zip_entry_t))) + goto _fail; + + if (!zip_load_entries(f, &pack->tree, cdir_ofs, data_ofs, count)) + goto _fail; + + pack->realpath = sys_strdup(realpath); + pack->zipf = f; + + return pack; + +_fail: + if (f) fclose(f); + if (pack) free(pack); + return NULL; +} + +static void pack_zip_unmount(void *pack) { + zip_pack_t *zip = (zip_pack_t *)pack; + fs_dirtree_free(&zip->tree); + if (zip->realpath) free((void *)zip->realpath); + if (zip->zipf) fclose(zip->zipf); + free(zip); +} + +static bool pack_zip_is_file(void *pack, const char *fname) { + zip_entry_t *ent = (zip_entry_t *)fs_dirtree_find((fs_dirtree_t *)pack, fname); + return ent && !ent->tree.is_dir; +} + +static bool pack_zip_is_dir(void *pack, const char *fname) { + zip_entry_t *ent = (zip_entry_t *)fs_dirtree_find((fs_dirtree_t *)pack, fname); + return ent && ent->tree.is_dir; +} + +static inline void pack_zip_close_zipfile(zip_file_t *zipfile) { + if (zipfile->buffer) { + inflateEnd(&zipfile->zstream); + free(zipfile->buffer); + } + if (zipfile->fstream) fclose(zipfile->fstream); + free(zipfile); +} + +static fs_file_t *pack_zip_open(void *pack, const char *vpath) { + fs_file_t *fsfile = NULL; + zip_file_t *zipfile = NULL; + zip_pack_t *zip = (zip_pack_t *)pack; + zip_entry_t *ent = (zip_entry_t *)fs_dirtree_find((fs_dirtree_t *)zip, vpath); + if (!ent || ent->tree.is_dir) goto _fail; // we're expecting a fucking file here + + zipfile = calloc(1, sizeof(zip_file_t)); + if (!zipfile) goto _fail; + zipfile->entry = ent; + + // obtain an additional file descriptor + // fdopen(dup(fileno())) is not very portable and might not create separate state + zipfile->fstream = fopen(zip->realpath, "rb"); + if (!zipfile->fstream) goto _fail; + + // make ent->ofs point to the actual file data if it doesn't already + if (!ent->ofs_fixed) + if (!zip_fixup_offset(zipfile)) + goto _fail; // this shouldn't generally happen but oh well + + // if there's compression, assume it's zlib + if (ent->comptype != 0) { + zipfile->buffer = malloc(ZIP_BUFSIZE); + if (!zipfile->buffer) + goto _fail; + if (inflateInit2(&zipfile->zstream, -MAX_WBITS) != Z_OK) + goto _fail; + } + + fsfile = malloc(sizeof(fs_file_t)); + if (!fsfile) goto _fail; + fsfile->handle = zipfile; + fsfile->parent = NULL; + + // point to the start of the file data + fseek(zipfile->fstream, ent->ofs, SEEK_SET); + + return fsfile; + +_fail: + if (zipfile) pack_zip_close_zipfile(zipfile); + if (fsfile) free(fsfile); + return NULL; +} + +static void pack_zip_close(UNUSED void *pack, fs_file_t *file) { + if (!file) return; + + zip_file_t *zipfile = (zip_file_t *)file->handle; + if (zipfile) pack_zip_close_zipfile(zipfile); + + free(file); +} + +static int64_t pack_zip_read(UNUSED void *pack, fs_file_t *file, void *buf, const uint64_t size) { + zip_file_t *zipfile = (zip_file_t *)file->handle; + zip_entry_t *ent = zipfile->entry; + + int64_t avail = ent->uncomp_size - zipfile->uncomp_pos; + int64_t max_read = ((int64_t)size > avail) ? avail : (int64_t)size; + int64_t rx = 0; + int err = 0; + + if (max_read == 0) return 0; + + if (ent->comptype == 0) { + // no compression, just read + rx = fread(buf, 1, size, zipfile->fstream); + } else { + zipfile->zstream.next_out = buf; + zipfile->zstream.avail_out = (unsigned int)max_read; + while (rx < max_read) { + const uint32_t before = (uint32_t)zipfile->zstream.total_out; + // check if we ran out of compressed bytes and read more if we did + if (zipfile->zstream.avail_in == 0) { + int32_t comp_rx = ent->comp_size - zipfile->comp_pos; + if (comp_rx > 0) { + if (comp_rx > ZIP_BUFSIZE) comp_rx = ZIP_BUFSIZE; + comp_rx = fread(zipfile->buffer, 1, comp_rx, zipfile->fstream); + if (comp_rx == 0) break; + zipfile->comp_pos += (uint32_t)comp_rx; + zipfile->zstream.next_in = zipfile->buffer; + zipfile->zstream.avail_in = (unsigned int)comp_rx; + } + } + // inflate + err = inflate(&zipfile->zstream, Z_SYNC_FLUSH); + rx += zipfile->zstream.total_out - before; + if (err != Z_OK) break; + } + } + + zipfile->uncomp_pos += rx; + return rx; +} + +static bool pack_zip_seek(UNUSED void *pack, fs_file_t *file, const int64_t ofs) { + zip_file_t *zipfile = (zip_file_t *)file->handle; + zip_entry_t *ent = zipfile->entry; + uint8_t buf[512]; + + if (ofs > (int64_t)ent->uncomp_size) return false; + + if (ent->comptype == 0) { + if (fseek(zipfile->fstream, ofs + ent->ofs, SEEK_SET) == 0) + zipfile->uncomp_pos = ofs; + } else { + // if seeking backwards, gotta redecode the stream from the start until that point + // so we make a copy of the zstream and clear it with a new one + if (ofs < zipfile->uncomp_pos) { + z_stream zstream; + memset(&zstream, 0, sizeof(zstream)); + if (inflateInit2(&zstream, -MAX_WBITS) != Z_OK) + return false; + // reset the underlying file handle back to the start + if (fseek(zipfile->fstream, ent->ofs, SEEK_SET) != 0) + return false; + // free and replace the old one + inflateEnd(&zipfile->zstream); + memcpy(&zipfile->zstream, &zstream, sizeof(zstream)); + zipfile->uncomp_pos = zipfile->comp_pos = 0; + } + // continue decoding the stream until we hit the new offset + while (zipfile->uncomp_pos != ofs) { + uint32_t max_read = (uint32_t)(ofs - zipfile->uncomp_pos); + if (max_read > sizeof(buf)) max_read = sizeof(buf); + if (pack_zip_read(pack, file, buf, max_read) != max_read) + return false; + } + } + + return true; +} + +static int64_t pack_zip_tell(UNUSED void *pack, fs_file_t *file) { + return ((zip_file_t *)file->handle)->uncomp_pos; +} + +static int64_t pack_zip_size(UNUSED void *pack, fs_file_t *file) { + zip_file_t *zipfile = (zip_file_t *)file->handle; + return zipfile->entry->uncomp_size; +} + +static bool pack_zip_eof(UNUSED void *pack, fs_file_t *file) { + zip_file_t *zipfile = (zip_file_t *)file->handle; + return zipfile->uncomp_pos >= zipfile->entry->uncomp_size; +} + +fs_packtype_t fs_packtype_zip = { + "zip", + pack_zip_mount, + pack_zip_unmount, + fs_dirtree_walk, + pack_zip_is_file, + pack_zip_is_dir, + pack_zip_open, + pack_zip_read, + pack_zip_seek, + pack_zip_tell, + pack_zip_size, + pack_zip_eof, + pack_zip_close, +}; diff --git a/src/pc/gfx/README.md b/src/pc/gfx/README.md deleted file mode 100644 index 3f36b1c3..00000000 --- a/src/pc/gfx/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Nintendo 64 Fast3D renderer - -Implementation of a Fast3D renderer for games built originally for the Nintendo 64 platform. - -For rendering OpenGL, Direct3D 11 and Direct3D 12 are supported. - -Supported windowing systems are GLX (used on Linux), DXGI (used on Windows) and SDL (generic). - -# Usage - -See `gfx_pc.h`. You will also need a copy of `PR/gbi.h`, found in libultra. - -First call `gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, const char *game_name, bool start_in_fullscreen)` and supply the desired backends at program start. - -Some callbacks can be set on `wapi`. See `gfx_window_manager_api.h` for more info. - -Each game main loop iteration should look like this: - -```C -gfx_start_frame(); // Handles input events such as keyboard and window events -// perform game logic here -gfx_run(cmds); // submit display list and render a frame -// do more expensive work here, such as play audio -gfx_end_frame(); // this just waits until the frame is shown on the screen (vsync), to provide correct game timing -``` - -When you are ready to start the main loop, call `wapi->main_loop(one_iteration_func)`. - -For the best experience, please change the Vtx and Mtx structures to use floats instead of fixed point arithmetic (`GBI_FLOATS`). - -# License - -See LICENSE.txt. Redistributions are allowed only in source form, not in binary form. diff --git a/src/pc/gfx/gfx_direct3d11.cpp b/src/pc/gfx/gfx_direct3d11.cpp index e5ee4450..d27524b7 100644 --- a/src/pc/gfx/gfx_direct3d11.cpp +++ b/src/pc/gfx/gfx_direct3d11.cpp @@ -1,4 +1,4 @@ -#ifdef ENABLE_DX11 +#ifdef RAPI_D3D11 #include #include @@ -684,9 +684,9 @@ static void gfx_d3d11_start_frame(void) { // No high values, as noise starts to look ugly d3d.per_frame_cb_data.noise_frame = 0; } - float aspect_ratio = (float) d3d.current_width / (float) d3d.current_height; - d3d.per_frame_cb_data.noise_scale_x = 120 * aspect_ratio; // 120 = N64 height resolution (240) / 2 - d3d.per_frame_cb_data.noise_scale_y = 120; + + d3d.per_frame_cb_data.noise_scale_x = (float) d3d.current_width; + d3d.per_frame_cb_data.noise_scale_y = (float) d3d.current_height; D3D11_MAPPED_SUBRESOURCE ms; ZeroMemory(&ms, sizeof(D3D11_MAPPED_SUBRESOURCE)); diff --git a/src/pc/gfx/gfx_direct3d11.h b/src/pc/gfx/gfx_direct3d11.h index 67f6406e..5d795602 100644 --- a/src/pc/gfx/gfx_direct3d11.h +++ b/src/pc/gfx/gfx_direct3d11.h @@ -1,4 +1,4 @@ -#ifdef ENABLE_DX11 +#ifdef RAPI_D3D11 #ifndef GFX_DIRECT3D11_H #define GFX_DIRECT3D11_H diff --git a/src/pc/gfx/gfx_direct3d12.cpp b/src/pc/gfx/gfx_direct3d12.cpp index 91eb47b7..2a31043b 100644 --- a/src/pc/gfx/gfx_direct3d12.cpp +++ b/src/pc/gfx/gfx_direct3d12.cpp @@ -1,4 +1,4 @@ -#ifdef ENABLE_DX12 +#ifdef RAPI_D3D12 #include #include diff --git a/src/pc/gfx/gfx_direct3d12.h b/src/pc/gfx/gfx_direct3d12.h index 9a29be45..559566ff 100644 --- a/src/pc/gfx/gfx_direct3d12.h +++ b/src/pc/gfx/gfx_direct3d12.h @@ -1,4 +1,4 @@ -#ifdef ENABLE_DX12 +#ifdef RAPI_D3D12 #ifndef GFX_DIRECT3D12_H #define GFX_DIRECT3D12_H diff --git a/src/pc/gfx/gfx_direct3d_common.cpp b/src/pc/gfx/gfx_direct3d_common.cpp index 32a7296a..c4d6014e 100644 --- a/src/pc/gfx/gfx_direct3d_common.cpp +++ b/src/pc/gfx/gfx_direct3d_common.cpp @@ -1,4 +1,4 @@ -#if defined(ENABLE_DX11) || defined(ENABLE_DX12) +#if defined(RAPI_D3D11) || defined(RAPI_D3D12) #include diff --git a/src/pc/gfx/gfx_direct3d_common.h b/src/pc/gfx/gfx_direct3d_common.h index 5df83a34..1eb316d7 100644 --- a/src/pc/gfx/gfx_direct3d_common.h +++ b/src/pc/gfx/gfx_direct3d_common.h @@ -1,4 +1,4 @@ -#if defined(ENABLE_DX11) || defined(ENABLE_DX12) +#if defined(RAPI_D3D11) || defined(RAPI_D3D12) #ifndef GFX_DIRECT3D_COMMON_H #define GFX_DIRECT3D_COMMON_H diff --git a/src/pc/gfx/gfx_dxgi.cpp b/src/pc/gfx/gfx_dxgi.cpp index 02cdd811..04674952 100644 --- a/src/pc/gfx/gfx_dxgi.cpp +++ b/src/pc/gfx/gfx_dxgi.cpp @@ -1,4 +1,4 @@ -#if defined(ENABLE_DX11) || defined(ENABLE_DX12) +#ifdef WAPI_DXGI #include #include @@ -20,18 +20,20 @@ #endif #include +#include "../configfile.h" +#include "../pc_main.h" + #include "gfx_window_manager_api.h" #include "gfx_rendering_api.h" #include "gfx_direct3d_common.h" #include "gfx_screen_config.h" #include "gfx_pc.h" +#define WINCLASS_NAME L"N64GAME" + #define DECLARE_GFX_DXGI_FUNCTIONS #include "gfx_dxgi.h" -#define WINCLASS_NAME L"N64GAME" -#define GFX_API_NAME "DirectX" - #ifdef VERSION_EU #define FRAME_INTERVAL_US_NUMERATOR 40000 #define FRAME_INTERVAL_US_DENOMINATOR 1 @@ -46,7 +48,7 @@ static struct { HWND h_wnd; bool showing_error; uint32_t current_width, current_height; - std::string game_name; + std::string window_title; HMODULE dxgi_module; HRESULT (__stdcall *CreateDXGIFactory1)(REFIID riid, void **factory); @@ -68,7 +70,6 @@ static struct { bool sync_interval_means_frames_to_wait; UINT length_in_vsync_frames; - void (*on_fullscreen_changed)(bool is_now_fullscreen); void (*run_one_game_iter)(void); bool (*on_key_down)(int scancode); bool (*on_key_up)(int scancode); @@ -133,7 +134,7 @@ static void run_as_dpi_aware(Fun f) { } } -static void toggle_borderless_window_full_screen(bool enable, bool call_callback) { +static void toggle_borderless_window_full_screen(bool enable) { // Windows 7 + flip mode + waitable object can't go to exclusive fullscreen, // so do borderless instead. If DWM is enabled, this means we get one monitor // sync interval of latency extra. On Win 10 however (maybe Win 8 too), due to @@ -169,6 +170,10 @@ static void toggle_borderless_window_full_screen(bool enable, bool call_callback // Save window position and size if the window is not maximized GetWindowRect(dxgi.h_wnd, &dxgi.last_window_rect); + configWindow.x = dxgi.last_window_rect.left; + configWindow.y = dxgi.last_window_rect.top; + configWindow.w = dxgi.last_window_rect.right - dxgi.last_window_rect.left; + configWindow.h = dxgi.last_window_rect.bottom - dxgi.last_window_rect.top; // Get in which monitor the window is HMONITOR h_monitor = MonitorFromWindow(dxgi.h_wnd, MONITOR_DEFAULTTONEAREST); @@ -187,9 +192,19 @@ static void toggle_borderless_window_full_screen(bool enable, bool call_callback dxgi.is_full_screen = true; } +} - if (dxgi.on_fullscreen_changed != nullptr && call_callback) { - dxgi.on_fullscreen_changed(enable); +static void update_screen_settings(void) { + if (configWindow.fullscreen != dxgi.is_full_screen) + toggle_borderless_window_full_screen(configWindow.fullscreen); + if (!dxgi.is_full_screen) { + const int screen_width = GetSystemMetrics(SM_CXSCREEN); + const int screen_height = GetSystemMetrics(SM_CYSCREEN); + const int xpos = (configWindow.x == WAPI_WIN_CENTERPOS) ? (screen_width - configWindow.w) * 0.5 : configWindow.x; + const int ypos = (configWindow.y == WAPI_WIN_CENTERPOS) ? (screen_height - configWindow.h) * 0.5 : configWindow.y; + RECT wr = { xpos, ypos, xpos + (int)configWindow.w, ypos + (int)configWindow.h }; + AdjustWindowRect(&wr, WS_OVERLAPPEDWINDOW, FALSE); + SetWindowPos(dxgi.h_wnd, NULL, wr.left, wr.top, wr.right - wr.left, wr.bottom - wr.top, SWP_NOACTIVATE | SWP_NOZORDER); } } @@ -201,6 +216,10 @@ static void gfx_dxgi_on_resize(void) { ThrowIfFailed(dxgi.swap_chain->GetDesc1(&desc1)); dxgi.current_width = desc1.Width; dxgi.current_height = desc1.Height; + if (!dxgi.is_full_screen) { + configWindow.w = dxgi.current_width; + configWindow.h = dxgi.current_height; + } } } @@ -223,7 +242,8 @@ static LRESULT CALLBACK gfx_dxgi_wnd_proc(HWND h_wnd, UINT message, WPARAM w_par gfx_dxgi_on_resize(); break; case WM_DESTROY: - exit(0); + game_exit(); + break; case WM_PAINT: if (dxgi.showing_error) { return DefWindowProcW(h_wnd, message, w_param, l_param); @@ -246,7 +266,7 @@ static LRESULT CALLBACK gfx_dxgi_wnd_proc(HWND h_wnd, UINT message, WPARAM w_par break; case WM_SYSKEYDOWN: if ((w_param == VK_RETURN) && ((l_param & 1 << 30) == 0)) { - toggle_borderless_window_full_screen(!dxgi.is_full_screen, true); + toggle_borderless_window_full_screen(!dxgi.is_full_screen); break; } else { return DefWindowProcW(h_wnd, message, w_param, l_param); @@ -254,10 +274,27 @@ static LRESULT CALLBACK gfx_dxgi_wnd_proc(HWND h_wnd, UINT message, WPARAM w_par default: return DefWindowProcW(h_wnd, message, w_param, l_param); } + + if (configWindow.reset) { + dxgi.last_maximized_state = false; + configWindow.reset = false; + configWindow.x = WAPI_WIN_CENTERPOS; + configWindow.y = WAPI_WIN_CENTERPOS; + configWindow.w = DESIRED_SCREEN_WIDTH; + configWindow.h = DESIRED_SCREEN_HEIGHT; + configWindow.fullscreen = false; + configWindow.settings_changed = true; + } + + if (configWindow.settings_changed) { + configWindow.settings_changed = false; + update_screen_settings(); + } + return 0; } -static void gfx_dxgi_init(const char *game_name, bool start_in_fullscreen) { +static void gfx_dxgi_init(const char *window_title) { LARGE_INTEGER qpc_init, qpc_freq; QueryPerformanceCounter(&qpc_init); QueryPerformanceFrequency(&qpc_freq); @@ -266,11 +303,10 @@ static void gfx_dxgi_init(const char *game_name, bool start_in_fullscreen) { // Prepare window title - char title[512]; wchar_t w_title[512]; - int len = sprintf(title, "%s (%s)", game_name, GFX_API_NAME); - mbstowcs(w_title, title, len + 1); - dxgi.game_name = game_name; + int len = strlen(window_title); + mbstowcs(w_title, window_title, len + 1); + dxgi.window_title = window_title; // Create window WNDCLASSEXW wcex; @@ -306,17 +342,7 @@ static void gfx_dxgi_init(const char *game_name, bool start_in_fullscreen) { ShowWindow(dxgi.h_wnd, SW_SHOW); UpdateWindow(dxgi.h_wnd); - if (start_in_fullscreen) { - toggle_borderless_window_full_screen(true, false); - } -} - -static void gfx_dxgi_set_fullscreen_changed_callback(void (*on_fullscreen_changed)(bool is_now_fullscreen)) { - dxgi.on_fullscreen_changed = on_fullscreen_changed; -} - -static void gfx_dxgi_set_fullscreen(bool enable) { - toggle_borderless_window_full_screen(enable, true); + update_screen_settings(); } static void gfx_dxgi_set_keyboard_callbacks(bool (*on_key_down)(int scancode), bool (*on_key_up)(int scancode), void (*on_all_keys_up)(void)) { @@ -528,10 +554,9 @@ void gfx_dxgi_create_factory_and_device(bool debug, int d3d_version, bool (*crea } create_device_fn(adapter.Get(), false); - char title[512]; wchar_t w_title[512]; - int len = sprintf(title, "%s (Direct3D %d)", dxgi.game_name.c_str(), d3d_version); - mbstowcs(w_title, title, len + 1); + int len = dxgi.window_title.length(); + mbstowcs(w_title, dxgi.window_title.c_str(), len + 1); SetWindowTextW(dxgi.h_wnd, w_title); } @@ -580,6 +605,9 @@ HWND gfx_dxgi_get_h_wnd(void) { return dxgi.h_wnd; } +void gfx_dxgi_shutdown(void) { +} + void ThrowIfFailed(HRESULT res) { if (FAILED(res)) { fprintf(stderr, "Error: 0x%08X\n", res); @@ -597,11 +625,9 @@ void ThrowIfFailed(HRESULT res, HWND h_wnd, const char *message) { } } -struct GfxWindowManagerAPI gfx_dxgi_api = { +struct GfxWindowManagerAPI gfx_dxgi = { gfx_dxgi_init, gfx_dxgi_set_keyboard_callbacks, - gfx_dxgi_set_fullscreen_changed_callback, - gfx_dxgi_set_fullscreen, gfx_dxgi_main_loop, gfx_dxgi_get_dimensions, gfx_dxgi_handle_events, @@ -609,6 +635,7 @@ struct GfxWindowManagerAPI gfx_dxgi_api = { gfx_dxgi_swap_buffers_begin, gfx_dxgi_swap_buffers_end, gfx_dxgi_get_time, + gfx_dxgi_shutdown, }; #endif diff --git a/src/pc/gfx/gfx_dxgi.h b/src/pc/gfx/gfx_dxgi.h index d590daa6..6f42474c 100644 --- a/src/pc/gfx/gfx_dxgi.h +++ b/src/pc/gfx/gfx_dxgi.h @@ -11,6 +11,6 @@ void ThrowIfFailed(HRESULT res); void ThrowIfFailed(HRESULT res, HWND h_wnd, const char *message); #endif -extern struct GfxWindowManagerAPI gfx_dxgi_api; +extern struct GfxWindowManagerAPI gfx_dxgi; #endif diff --git a/src/pc/gfx/gfx_glx.c b/src/pc/gfx/gfx_glx.c deleted file mode 100644 index 97fe4a8b..00000000 --- a/src/pc/gfx/gfx_glx.c +++ /dev/null @@ -1,611 +0,0 @@ -#ifdef __linux__ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gfx_window_manager_api.h" -#include "gfx_screen_config.h" - -#define GFX_API_NAME "GLX - OpenGL" - -#ifdef VERSION_EU -#define FRAME_INTERVAL_US_NUMERATOR 40000 -#define FRAME_INTERVAL_US_DENOMINATOR 1 -#else -#define FRAME_INTERVAL_US_NUMERATOR 100000 -#define FRAME_INTERVAL_US_DENOMINATOR 3 -#endif - -const struct { - const char *name; - int scancode; -} keymap_name_to_scancode[] = { - {"ESC", 0x01}, - {"AE01", 0x02 }, - {"AE02", 0x03 }, - {"AE03", 0x04 }, - {"AE04", 0x05 }, - {"AE05", 0x06 }, - {"AE06", 0x07 }, - {"AE07", 0x08 }, - {"AE08", 0x09 }, - {"AE09", 0x0a }, - {"AE10", 0x0b }, - {"AE11", 0x0c }, - {"AE12", 0x0d }, - {"BKSP", 0x0e }, - {"TAB", 0x0f }, - {"AD01", 0x10 }, - {"AD02", 0x11 }, - {"AD03", 0x12 }, - {"AD04", 0x13 }, - {"AD05", 0x14 }, - {"AD06", 0x15 }, - {"AD07", 0x16 }, - {"AD08", 0x17 }, - {"AD09", 0x18 }, - {"AD10", 0x19 }, - {"AD11", 0x1a }, - {"AD12", 0x1b }, - {"RTRN", 0x1c }, - {"LCTL", 0x1d }, - {"AC01", 0x1e }, - {"AC02", 0x1f }, - {"AC03", 0x20 }, - {"AC04", 0x21 }, - {"AC05", 0x22 }, - {"AC06", 0x23 }, - {"AC07", 0x24 }, - {"AC08", 0x25 }, - {"AC09", 0x26 }, - {"AC10", 0x27 }, - {"AC11", 0x28 }, - {"TLDE", 0x29 }, - {"LFSH", 0x2a }, - {"BKSL", 0x2b }, - {"AB01", 0x2c }, - {"AB02", 0x2d }, - {"AB03", 0x2e }, - {"AB04", 0x2f }, - {"AB05", 0x30 }, - {"AB06", 0x31 }, - {"AB07", 0x32 }, - {"AB08", 0x33 }, - {"AB09", 0x34 }, - {"AB10", 0x35 }, - {"RTSH", 0x36 }, - {"KPMU", 0x37 }, - {"LALT", 0x38 }, - {"SPCE", 0x39 }, - {"CAPS", 0x3a }, - {"FK01", 0x3b }, - {"FK02", 0x3c }, - {"FK03", 0x3d }, - {"FK04", 0x3e }, - {"FK05", 0x3f }, - {"FK06", 0x40 }, - {"FK07", 0x41 }, - {"FK08", 0x42 }, - {"FK09", 0x43 }, - {"FK10", 0x44 }, - {"NMLK", 0x45 }, - {"SCLK", 0x46 }, - {"KP7", 0x47 }, - {"KP8", 0x48 }, - {"KP9", 0x49 }, - {"KPSU", 0x4a }, - {"KP4", 0x4b }, - {"KP5", 0x4c }, - {"KP6", 0x4d }, - {"KPAD", 0x4e }, - {"KP1", 0x4f }, - {"KP2", 0x50 }, - {"KP3", 0x51 }, - {"KP0", 0x52 }, - {"KPDL", 0x53 }, - {"LVL3", 0x54 }, // correct? - {"", 0x55 }, // not mapped? - {"LSGT", 0x56 }, - {"FK11", 0x57 }, - {"FK12", 0x58 }, - {"AB11", 0x59 }, - {"KATA", 0 }, - {"HIRA", 0 }, - {"HENK", 0 }, - {"HKTG", 0 }, - {"MUHE", 0 }, - {"JPCM", 0 }, - {"KPEN", 0x11c }, - {"RCTL", 0x11d }, - {"KPDV", 0x135 }, - {"PRSC", 0x54 }, // ? - {"RALT", 0x138 }, - {"LNFD", 0 }, - {"HOME", 0x147 }, - {"UP", 0x148 }, - {"PGUP", 0x149 }, - {"LEFT", 0x14b }, - {"RGHT", 0x14d }, - {"END", 0x14f }, - {"DOWN", 0x150 }, - {"PGDN", 0x151 }, - {"INS", 0x152 }, - {"DELE", 0x153 }, - {"PAUS", 0x21d }, - {"LWIN", 0x15b }, - {"RWIN", 0x15c }, - {"COMP", 0x15d }, -}; - -static struct { - Display *dpy; - Window root; - Window win; - - Atom atom_wm_state; - Atom atom_wm_state_fullscreen; - - bool is_fullscreen; - void (*on_fullscreen_changed)(bool is_now_fullscreen); - - int keymap[256]; - bool (*on_key_down)(int scancode); - bool (*on_key_up)(int scancode); - void (*on_all_keys_up)(void); - - PFNGLXGETSYNCVALUESOMLPROC glXGetSyncValuesOML; - PFNGLXSWAPBUFFERSMSCOMLPROC glXSwapBuffersMscOML; - PFNGLXWAITFORSBCOMLPROC glXWaitForSbcOML; - - PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT; - PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI; - - PFNGLXGETVIDEOSYNCSGIPROC glXGetVideoSyncSGI; - PFNGLXWAITVIDEOSYNCSGIPROC glXWaitVideoSyncSGI; - - bool has_oml_sync_control; - uint64_t ust0; - int64_t last_msc; - uint64_t wanted_ust; // multiplied by FRAME_INTERVAL_US_DENOMINATOR - uint64_t vsync_interval; - uint64_t last_ust; - int64_t target_msc; - bool dropped_frame; - - bool has_sgi_video_sync; - uint64_t last_sync_counter; - int64_t this_msc; - int64_t this_ust; -} glx; - -static int64_t get_time(void) { - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - return (int64_t)ts.tv_sec * 1000000 + ts.tv_nsec / 1000; -} - -static int64_t adjust_sync_counter(uint32_t counter) { - uint32_t hi = glx.last_sync_counter >> 32; - uint32_t lo = (uint32_t)glx.last_sync_counter; - if (lo >= 0x80000000U && counter < 0x80000000U) { - // Wrapped - ++hi; - } - glx.last_sync_counter = ((uint64_t)hi << 32) | counter; - return glx.last_sync_counter; -} - -static int64_t glXWaitVideoSyncSGI_wrapper(void) { - unsigned int counter = 0; - glx.glXWaitVideoSyncSGI(1, 0, &counter); - return adjust_sync_counter(counter); -} - -static int64_t glXGetVideoSyncSGI_wrapper(void) { - unsigned int counter = 0; - glx.glXGetVideoSyncSGI(&counter); - return adjust_sync_counter(counter); -} - -static void init_keymap(void) { - XkbDescPtr desc = XkbGetMap(glx.dpy, 0, XkbUseCoreKbd); - XkbGetNames(glx.dpy, XkbKeyNamesMask, desc); - - for (int i = desc->min_key_code; i <= desc->max_key_code && i < 256; i++) { - char name[XkbKeyNameLength + 1]; - memcpy(name, desc->names->keys[i].name, XkbKeyNameLength); - name[XkbKeyNameLength] = '\0'; - for (size_t j = 0; j < sizeof(keymap_name_to_scancode) / sizeof(keymap_name_to_scancode[0]); j++) { - if (strcmp(keymap_name_to_scancode[j].name, name) == 0) { - glx.keymap[i] = keymap_name_to_scancode[j].scancode; - break; - } - } - } - - XkbFreeNames(desc, XkbKeyNamesMask, True); - XkbFreeKeyboard(desc, 0, True); -} - -static void gfx_glx_hide_mouse(bool hide) { - // Removes distracting mouse cursor during fullscreen play - if (hide) { - Cursor hideCursor; - Pixmap bitmapNoData; - XColor black; - static char noData[] = { 0,0,0,0,0,0,0,0 }; - black.red = black.green = black.blue = 0; - - bitmapNoData = XCreateBitmapFromData(glx.dpy, glx.win, noData, 8, 8); - hideCursor = XCreatePixmapCursor(glx.dpy, bitmapNoData, bitmapNoData, - &black, &black, 0, 0); - XDefineCursor(glx.dpy, glx.win, hideCursor); - XSync(glx.dpy, False); - XFreeCursor(glx.dpy, hideCursor); - XFreePixmap(glx.dpy, bitmapNoData); - } else { - XUndefineCursor(glx.dpy, glx.win); - XSync(glx.dpy, False); - } - -} - -static void gfx_glx_set_fullscreen_state(bool on, bool call_callback) { - if (glx.is_fullscreen == on) { - return; - } - glx.is_fullscreen = on; - - XEvent xev; - xev.xany.type = ClientMessage; - xev.xclient.message_type = glx.atom_wm_state; - xev.xclient.format = 32; - xev.xclient.window = glx.win; - xev.xclient.data.l[0] = on; - xev.xclient.data.l[1] = glx.atom_wm_state_fullscreen; - xev.xclient.data.l[2] = 0; - xev.xclient.data.l[3] = 0; - XSendEvent(glx.dpy, glx.root, 0, SubstructureNotifyMask | SubstructureRedirectMask, &xev); - gfx_glx_hide_mouse(on); - - if (glx.on_fullscreen_changed != NULL && call_callback) { - glx.on_fullscreen_changed(on); - } -} - -static bool gfx_glx_check_extension(const char *extensions, const char *extension) { - size_t len = strlen(extension); - const char *pos = extensions; - while ((pos = strstr(pos, extension)) != NULL) { - if ((pos[len] == ' ' || pos[len] == '\0') && (pos == extensions || pos[-1] == ' ')) { - return true; - } - if (pos[len] == '\0') { - break; - } - pos += len + 1; - } - return false; -} - -static void gfx_glx_init(const char *game_name, bool start_in_fullscreen) { - // On NVIDIA proprietary driver, make the driver queue up to two frames on glXSwapBuffers, - // which means that glXSwapBuffers should be non-blocking, - // if we are sure to wait at least one vsync interval between calls. - setenv("__GL_MaxFramesAllowed", "2", true); - - glx.dpy = XOpenDisplay(NULL); - if (glx.dpy == NULL) { - fprintf(stderr, "Cannot connect to X server\n"); - exit(1); - } - int screen = DefaultScreen(glx.dpy); - glx.root = RootWindow(glx.dpy, screen); - - GLint att[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24, GLX_DOUBLEBUFFER, None }; - XVisualInfo *vi = glXChooseVisual(glx.dpy, 0, att); - if (vi == NULL) { - fprintf(stderr, "No appropriate GLX visual found\n"); - exit(1); - } - Colormap cmap = XCreateColormap(glx.dpy, glx.root, vi->visual, AllocNone); - XSetWindowAttributes swa; - swa.colormap = cmap; - swa.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask | FocusChangeMask; - glx.win = XCreateWindow(glx.dpy, glx.root, 0, 0, DESIRED_SCREEN_WIDTH, DESIRED_SCREEN_HEIGHT, 0, vi->depth, InputOutput, vi->visual, CWColormap | CWEventMask, &swa); - - glx.atom_wm_state = XInternAtom(glx.dpy, "_NET_WM_STATE", False); - glx.atom_wm_state_fullscreen = XInternAtom(glx.dpy, "_NET_WM_STATE_FULLSCREEN", False); - XMapWindow(glx.dpy, glx.win); - - if (start_in_fullscreen) { - gfx_glx_set_fullscreen_state(true, false); - } - - char title[512]; - int len = sprintf(title, "%s (%s)", game_name, GFX_API_NAME); - - XStoreName(glx.dpy, glx.win, title); - GLXContext glc = glXCreateContext(glx.dpy, vi, NULL, GL_TRUE); - glXMakeCurrent(glx.dpy, glx.win, glc); - - init_keymap(); - - const char *extensions = glXQueryExtensionsString(glx.dpy, screen); - - if (gfx_glx_check_extension(extensions, "GLX_OML_sync_control")) { - glx.glXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC)glXGetProcAddressARB((const GLubyte *)"glXGetSyncValuesOML"); - glx.glXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC)glXGetProcAddressARB((const GLubyte *)"glXSwapBuffersMscOML"); - glx.glXWaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC)glXGetProcAddressARB((const GLubyte *)"glXWaitForSbcOML"); - } - if (gfx_glx_check_extension(extensions, "GLX_EXT_swap_control")) { - glx.glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)glXGetProcAddressARB((const GLubyte *)"glXSwapIntervalEXT"); - } - if (gfx_glx_check_extension(extensions, "GLX_SGI_swap_control")) { - glx.glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glXGetProcAddressARB((const GLubyte *)"glXSwapIntervalSGI"); - } - if (gfx_glx_check_extension(extensions, "GLX_SGI_video_sync")) { - glx.glXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC)glXGetProcAddressARB((const GLubyte *)"glXGetVideoSyncSGI"); - glx.glXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC)glXGetProcAddressARB((const GLubyte *)"glXWaitVideoSyncSGI"); - } - - int64_t ust, msc, sbc; - if (glx.glXGetSyncValuesOML != NULL && glx.glXGetSyncValuesOML(glx.dpy, glx.win, &ust, &msc, &sbc)) { - glx.has_oml_sync_control = true; - glx.ust0 = (uint64_t)ust; - } else { - glx.ust0 = get_time(); - if (glx.glXSwapIntervalEXT != NULL) { - glx.glXSwapIntervalEXT(glx.dpy, glx.win, 1); - } else if (glx.glXSwapIntervalSGI != NULL) { - glx.glXSwapIntervalSGI(1); - } - if (glx.glXGetVideoSyncSGI != NULL) { - // Try if it really works - unsigned int count; - if (glx.glXGetVideoSyncSGI(&count) == 0) { - glx.last_sync_counter = count; - glx.has_sgi_video_sync = true; - } - } - } - glx.vsync_interval = 16666; -} - -static void gfx_glx_set_fullscreen_changed_callback(void (*on_fullscreen_changed)(bool is_now_fullscreen)) { - glx.on_fullscreen_changed = on_fullscreen_changed; -} - -static void gfx_glx_set_fullscreen(bool enable) { - gfx_glx_set_fullscreen_state(enable, true); -} - -static void gfx_glx_set_keyboard_callbacks(bool (*on_key_down)(int scancode), bool (*on_key_up)(int scancode), void (*on_all_keys_up)(void)) { - glx.on_key_down = on_key_down; - glx.on_key_up = on_key_up; - glx.on_all_keys_up = on_all_keys_up; -} - -static void gfx_glx_main_loop(void (*run_one_game_iter)(void)) { - while (1) { - run_one_game_iter(); - } -} - -static void gfx_glx_get_dimensions(uint32_t *width, uint32_t *height) { - XWindowAttributes attributes; - XGetWindowAttributes(glx.dpy, glx.win, &attributes); - *width = attributes.width; - *height = attributes.height; -} - -static void gfx_glx_handle_events(void) { - while (XPending(glx.dpy)) { - XEvent xev; - XNextEvent(glx.dpy, &xev); - if (xev.type == FocusOut) { - if (glx.on_all_keys_up != NULL) { - glx.on_all_keys_up(); - } - } - if (xev.type == KeyPress || xev.type == KeyRelease) { - if (xev.xkey.keycode < 256) { - int scancode = glx.keymap[xev.xkey.keycode]; - if (scancode != 0) { - if (xev.type == KeyPress) { - if (scancode == 0x44) { // F10 - gfx_glx_set_fullscreen_state(!glx.is_fullscreen, true); - } - if (glx.on_key_down != NULL) { - glx.on_key_down(scancode); - } - } else { - if (glx.on_key_up != NULL) { - glx.on_key_up(scancode); - } - } - } - } - } - } -} - -static bool gfx_glx_start_frame(void) { - return true; -} - -static void gfx_glx_swap_buffers_begin(void) { - glx.wanted_ust += FRAME_INTERVAL_US_NUMERATOR; // advance 1/30 seconds on JP/US or 1/25 seconds on EU - - if (!glx.has_oml_sync_control && !glx.has_sgi_video_sync) { - glFlush(); - - uint64_t target = glx.wanted_ust / FRAME_INTERVAL_US_DENOMINATOR; - uint64_t now; - while (target > (now = (uint64_t)get_time() - glx.ust0)) { - struct timespec ts = {(target - now) / 1000000, ((target - now) % 1000000) * 1000}; - if (nanosleep(&ts, NULL) == 0) { - break; - } - } - - if (target + 2 * FRAME_INTERVAL_US_NUMERATOR / FRAME_INTERVAL_US_DENOMINATOR < now) { - if (target + 32 * FRAME_INTERVAL_US_NUMERATOR / FRAME_INTERVAL_US_DENOMINATOR >= now) { - printf("Dropping frame\n"); - glx.dropped_frame = true; - return; - } else { - // Reset timer since we are way out of sync - glx.wanted_ust = now * FRAME_INTERVAL_US_DENOMINATOR; - } - } - glXSwapBuffers(glx.dpy, glx.win); - glx.dropped_frame = false; - - return; - } - - double vsyncs_to_wait = (int64_t)(glx.wanted_ust / FRAME_INTERVAL_US_DENOMINATOR - glx.last_ust) / (double)glx.vsync_interval; - if (vsyncs_to_wait <= 0) { - printf("Dropping frame\n"); - // Drop frame - glx.dropped_frame = true; - return; - } - if (floor(vsyncs_to_wait) != vsyncs_to_wait) { - uint64_t left_ust = glx.last_ust + floor(vsyncs_to_wait) * glx.vsync_interval; - uint64_t right_ust = glx.last_ust + ceil(vsyncs_to_wait) * glx.vsync_interval; - uint64_t adjusted_wanted_ust = glx.wanted_ust / FRAME_INTERVAL_US_DENOMINATOR + (glx.last_ust + FRAME_INTERVAL_US_NUMERATOR / FRAME_INTERVAL_US_DENOMINATOR > glx.wanted_ust / FRAME_INTERVAL_US_DENOMINATOR ? 2000 : -2000); - int64_t diff_left = adjusted_wanted_ust - left_ust; - int64_t diff_right = right_ust - adjusted_wanted_ust; - if (diff_left < 0) { - diff_left = -diff_left; - } - if (diff_right < 0) { - diff_right = -diff_right; - } - if (diff_left < diff_right) { - vsyncs_to_wait = floor(vsyncs_to_wait); - } else { - vsyncs_to_wait = ceil(vsyncs_to_wait); - } - if (vsyncs_to_wait <= -4) { - printf("vsyncs_to_wait became -4 or less so dropping frame\n"); - glx.dropped_frame = true; - return; - } else if (vsyncs_to_wait < 1) { - vsyncs_to_wait = 1; - } - } - glx.dropped_frame = false; - //printf("Vsyncs to wait: %d, diff: %d\n", (int)vsyncs_to_wait, (int)(glx.last_ust + (int64_t)vsyncs_to_wait * glx.vsync_interval - glx.wanted_ust / 3)); - if (vsyncs_to_wait > 30) { - // Unreasonable, so change to 2 - vsyncs_to_wait = 2; - } - glx.target_msc = glx.last_msc + vsyncs_to_wait; - - if (glx.has_oml_sync_control) { - glx.glXSwapBuffersMscOML(glx.dpy, glx.win, glx.target_msc, 0, 0); - } else if (glx.has_sgi_video_sync) { - glFlush(); // Try to submit pending work. Don't use glFinish since that busy loops on NVIDIA proprietary driver. - - //uint64_t counter0; - uint64_t counter1, counter2; - - //uint64_t before_wait = get_time(); - - counter1 = glXGetVideoSyncSGI_wrapper(); - //counter0 = counter1; - //int waits = 0; - while (counter1 < (uint64_t)glx.target_msc - 1) { - counter1 = glXWaitVideoSyncSGI_wrapper(); - //++waits; - } - - //uint64_t before = get_time(); - glXSwapBuffers(glx.dpy, glx.win); - - - counter2 = glXGetVideoSyncSGI_wrapper(); - while (counter2 < (uint64_t)glx.target_msc) { - counter2 = glXWaitVideoSyncSGI_wrapper(); - } - uint64_t after = get_time(); - - //printf("%.3f %.3f %.3f\t%.3f\t%u %d %.2f %u %d\n", before_wait * 0.000060, before * 0.000060, after * 0.000060, (after - before) * 0.000060, counter0, counter2 - counter0, vsyncs_to_wait, (unsigned int)glx.target_msc, waits); - glx.this_msc = counter2; - glx.this_ust = after; - } -} - -static void gfx_glx_swap_buffers_end(void) { - if (glx.dropped_frame || (!glx.has_oml_sync_control && !glx.has_sgi_video_sync)) { - return; - } - - int64_t ust, msc, sbc; - if (glx.has_oml_sync_control) { - if (!glx.glXWaitForSbcOML(glx.dpy, glx.win, 0, &ust, &msc, &sbc)) { - // X connection broke or something? - glx.last_ust += (glx.target_msc - glx.last_msc) * glx.vsync_interval; - glx.last_msc = glx.target_msc; - return; - } - } else { - ust = glx.this_ust; - msc = glx.this_msc; - } - uint64_t this_ust = ust - glx.ust0; - uint64_t vsyncs_passed = msc - glx.last_msc; - bool bad_vsync_interval = false; - if (glx.last_ust != 0 && vsyncs_passed != 0) { - uint64_t new_vsync_interval = (this_ust - glx.last_ust) / vsyncs_passed; - if (new_vsync_interval <= 500000) { - // Should be less than 0.5 seconds to be trusted - glx.vsync_interval = new_vsync_interval; - } else { - bad_vsync_interval = true; - } - //printf("glx.vsync_interval: %d\n", (int)glx.vsync_interval); - } - glx.last_ust = this_ust; - glx.last_msc = msc; - if (msc != glx.target_msc) { - printf("Frame too late by %d vsyncs\n", (int)(msc - glx.target_msc)); - } - if (msc - glx.target_msc >= 8 || bad_vsync_interval) { - // Frame arrived way too late, so reset timer from here - printf("Reseting timer\n"); - glx.wanted_ust = this_ust * FRAME_INTERVAL_US_DENOMINATOR; - } -} - -static double gfx_glx_get_time(void) { - return 0.0; -} - -struct GfxWindowManagerAPI gfx_glx = { - gfx_glx_init, - gfx_glx_set_keyboard_callbacks, - gfx_glx_set_fullscreen_changed_callback, - gfx_glx_set_fullscreen, - gfx_glx_main_loop, - gfx_glx_get_dimensions, - gfx_glx_handle_events, - gfx_glx_start_frame, - gfx_glx_swap_buffers_begin, - gfx_glx_swap_buffers_end, - gfx_glx_get_time -}; - -#endif diff --git a/src/pc/gfx/gfx_glx.h b/src/pc/gfx/gfx_glx.h deleted file mode 100644 index 1ca41090..00000000 --- a/src/pc/gfx/gfx_glx.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef GFX_GLX_H -#define GFX_GLX_H - -#include "gfx_window_manager_api.h" - -extern struct GfxWindowManagerAPI gfx_glx; - -#endif diff --git a/src/pc/gfx/gfx_opengl.c b/src/pc/gfx/gfx_opengl.c index 7bc97455..b3d090b0 100644 --- a/src/pc/gfx/gfx_opengl.c +++ b/src/pc/gfx/gfx_opengl.c @@ -1,33 +1,40 @@ -#ifdef ENABLE_OPENGL +#ifdef RAPI_GL #include #include #ifndef _LANGUAGE_C -#define _LANGUAGE_C +# define _LANGUAGE_C #endif #include #ifdef __MINGW32__ -#define FOR_WINDOWS 1 +# define FOR_WINDOWS 1 #else -#define FOR_WINDOWS 0 +# define FOR_WINDOWS 0 +#endif + +#if FOR_WINDOWS || defined(OSX_BUILD) +# define GLEW_STATIC +# include #endif -#if FOR_WINDOWS -#include -#include "SDL.h" -#define GL_GLEXT_PROTOTYPES 1 -#include "SDL_opengl.h" -#else #include + #define GL_GLEXT_PROTOTYPES 1 -#include +#ifdef USE_GLES +# include +#else +# include #endif +#include "../platform.h" +#include "../configfile.h" #include "gfx_cc.h" #include "gfx_rendering_api.h" +#define TEX_CACHE_STEP 512 + struct ShaderProgram { uint32_t shader_id; GLuint opengl_program_id; @@ -35,19 +42,31 @@ struct ShaderProgram { bool used_textures[2]; uint8_t num_floats; GLint attrib_locations[7]; + GLint uniform_locations[5]; uint8_t attrib_sizes[7]; uint8_t num_attribs; bool used_noise; - GLint frame_count_location; - GLint window_height_location; +}; + +struct GLTexture { + GLuint gltex; + GLfloat size[2]; + bool filter; }; static struct ShaderProgram shader_program_pool[64]; static uint8_t shader_program_pool_size; static GLuint opengl_vbo; +static int tex_cache_size = 0; +static int num_textures = 0; +static struct GLTexture *tex_cache = NULL; + +static struct ShaderProgram *opengl_prg = NULL; +static struct GLTexture *opengl_tex[2]; +static int opengl_curtex = 0; + static uint32_t frame_count; -static uint32_t current_height; static bool gfx_opengl_z_is_from_0_to_1(void) { return false; @@ -64,25 +83,36 @@ static void gfx_opengl_vertex_array_set_attribs(struct ShaderProgram *prg) { } } -static void gfx_opengl_set_uniforms(struct ShaderProgram *prg) { - if (prg->used_noise) { - glUniform1i(prg->frame_count_location, frame_count); - glUniform1i(prg->window_height_location, current_height); +static inline void gfx_opengl_set_shader_uniforms(struct ShaderProgram *prg) { + if (prg->used_noise) + glUniform1f(prg->uniform_locations[4], (float)frame_count); +} + +static inline void gfx_opengl_set_texture_uniforms(struct ShaderProgram *prg, const int tile) { + if (prg->used_textures[tile] && opengl_tex[tile]) { + glUniform2f(prg->uniform_locations[tile*2 + 0], opengl_tex[tile]->size[0], opengl_tex[tile]->size[1]); + glUniform1i(prg->uniform_locations[tile*2 + 1], opengl_tex[tile]->filter); } } static void gfx_opengl_unload_shader(struct ShaderProgram *old_prg) { if (old_prg != NULL) { - for (int i = 0; i < old_prg->num_attribs; i++) { + for (int i = 0; i < old_prg->num_attribs; i++) glDisableVertexAttribArray(old_prg->attrib_locations[i]); - } + if (old_prg == opengl_prg) + opengl_prg = NULL; + } else { + opengl_prg = NULL; } } static void gfx_opengl_load_shader(struct ShaderProgram *new_prg) { + opengl_prg = new_prg; glUseProgram(new_prg->opengl_program_id); gfx_opengl_vertex_array_set_attribs(new_prg); - gfx_opengl_set_uniforms(new_prg); + gfx_opengl_set_shader_uniforms(new_prg); + gfx_opengl_set_texture_uniforms(new_prg, 0); + gfx_opengl_set_texture_uniforms(new_prg, 1); } static void append_str(char *buf, size_t *len, const char *str) { @@ -111,7 +141,7 @@ static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_ return with_alpha ? "texVal0" : "texVal0.rgb"; case SHADER_TEXEL0A: return hint_single_element ? "texVal0.a" : - (with_alpha ? "vec4(texVal0.a, texVal0.a, texVal0.a, texVal0.a)" : "vec3(texVal0.a, texVal0.a, texVal0.a)"); + (with_alpha ? "vec4(texelVal0.a, texelVal0.a, texelVal0.a, texelVal0.a)" : "vec3(texelVal0.a, texelVal0.a, texelVal0.a)"); case SHADER_TEXEL1: return with_alpha ? "texVal1" : "texVal1.rgb"; } @@ -165,68 +195,141 @@ static void append_formula(char *buf, size_t *len, uint8_t c[2][4], bool do_sing } static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shader_id) { - struct CCFeatures cc_features; - gfx_cc_get_features(shader_id, &cc_features); + uint8_t c[2][4]; + for (int i = 0; i < 4; i++) { + c[0][i] = (shader_id >> (i * 3)) & 7; + c[1][i] = (shader_id >> (12 + i * 3)) & 7; + } + bool opt_alpha = (shader_id & SHADER_OPT_ALPHA) != 0; + bool opt_fog = (shader_id & SHADER_OPT_FOG) != 0; + bool opt_texture_edge = (shader_id & SHADER_OPT_TEXTURE_EDGE) != 0; +#ifdef USE_GLES + bool opt_noise = false; +#else + bool opt_noise = (shader_id & SHADER_OPT_NOISE) != 0; +#endif + + bool used_textures[2] = { 0, 0 }; + int num_inputs = 0; + for (int i = 0; i < 2; i++) { + for (int j = 0; j < 4; j++) { + if (c[i][j] >= SHADER_INPUT_1 && c[i][j] <= SHADER_INPUT_4) { + if (c[i][j] > num_inputs) { + num_inputs = c[i][j]; + } + } + if (c[i][j] == SHADER_TEXEL0 || c[i][j] == SHADER_TEXEL0A) { + used_textures[0] = true; + } + if (c[i][j] == SHADER_TEXEL1) { + used_textures[1] = true; + } + } + } + bool do_single[2] = { c[0][2] == 0, c[1][2] == 0 }; + bool do_multiply[2] = { c[0][1] == 0 && c[0][3] == 0, c[1][1] == 0 && c[1][3] == 0 }; + bool do_mix[2] = { c[0][1] == c[0][3], c[1][1] == c[1][3] }; + bool color_alpha_same = (shader_id & 0xfff) == ((shader_id >> 12) & 0xfff); char vs_buf[1024]; - char fs_buf[1024]; + char fs_buf[2048]; size_t vs_len = 0; size_t fs_len = 0; size_t num_floats = 4; // Vertex shader - append_line(vs_buf, &vs_len, "#version 110"); +#ifdef USE_GLES + append_line(vs_buf, &vs_len, "#version 100"); +#else + append_line(vs_buf, &vs_len, "#version 120"); +#endif append_line(vs_buf, &vs_len, "attribute vec4 aVtxPos;"); - if (cc_features.used_textures[0] || cc_features.used_textures[1]) { + if (used_textures[0] || used_textures[1]) { append_line(vs_buf, &vs_len, "attribute vec2 aTexCoord;"); append_line(vs_buf, &vs_len, "varying vec2 vTexCoord;"); num_floats += 2; } - if (cc_features.opt_fog) { + if (opt_fog) { append_line(vs_buf, &vs_len, "attribute vec4 aFog;"); append_line(vs_buf, &vs_len, "varying vec4 vFog;"); num_floats += 4; } - for (int i = 0; i < cc_features.num_inputs; i++) { - vs_len += sprintf(vs_buf + vs_len, "attribute vec%d aInput%d;\n", cc_features.opt_alpha ? 4 : 3, i + 1); - vs_len += sprintf(vs_buf + vs_len, "varying vec%d vInput%d;\n", cc_features.opt_alpha ? 4 : 3, i + 1); - num_floats += cc_features.opt_alpha ? 4 : 3; + for (int i = 0; i < num_inputs; i++) { + vs_len += sprintf(vs_buf + vs_len, "attribute vec%d aInput%d;\n", opt_alpha ? 4 : 3, i + 1); + vs_len += sprintf(vs_buf + vs_len, "varying vec%d vInput%d;\n", opt_alpha ? 4 : 3, i + 1); + num_floats += opt_alpha ? 4 : 3; } append_line(vs_buf, &vs_len, "void main() {"); - if (cc_features.used_textures[0] || cc_features.used_textures[1]) { + if (used_textures[0] || used_textures[1]) { append_line(vs_buf, &vs_len, "vTexCoord = aTexCoord;"); } - if (cc_features.opt_fog) { + if (opt_fog) { append_line(vs_buf, &vs_len, "vFog = aFog;"); } - for (int i = 0; i < cc_features.num_inputs; i++) { + for (int i = 0; i < num_inputs; i++) { vs_len += sprintf(vs_buf + vs_len, "vInput%d = aInput%d;\n", i + 1, i + 1); } append_line(vs_buf, &vs_len, "gl_Position = aVtxPos;"); append_line(vs_buf, &vs_len, "}"); // Fragment shader - append_line(fs_buf, &fs_len, "#version 110"); - //append_line(fs_buf, &fs_len, "precision mediump float;"); - if (cc_features.used_textures[0] || cc_features.used_textures[1]) { +#ifdef USE_GLES + append_line(fs_buf, &fs_len, "#version 100"); + append_line(fs_buf, &fs_len, "precision mediump float;"); +#else + append_line(fs_buf, &fs_len, "#version 120"); +#endif + + if (used_textures[0] || used_textures[1]) { append_line(fs_buf, &fs_len, "varying vec2 vTexCoord;"); } - if (cc_features.opt_fog) { + if (opt_fog) { append_line(fs_buf, &fs_len, "varying vec4 vFog;"); } - for (int i = 0; i < cc_features.num_inputs; i++) { - fs_len += sprintf(fs_buf + fs_len, "varying vec%d vInput%d;\n", cc_features.opt_alpha ? 4 : 3, i + 1); + for (int i = 0; i < num_inputs; i++) { + fs_len += sprintf(fs_buf + fs_len, "varying vec%d vInput%d;\n", opt_alpha ? 4 : 3, i + 1); } - if (cc_features.used_textures[0]) { + if (used_textures[0]) { append_line(fs_buf, &fs_len, "uniform sampler2D uTex0;"); + append_line(fs_buf, &fs_len, "uniform vec2 uTex0Size;"); + append_line(fs_buf, &fs_len, "uniform bool uTex0Filter;"); } - if (cc_features.used_textures[1]) { + if (used_textures[1]) { append_line(fs_buf, &fs_len, "uniform sampler2D uTex1;"); + append_line(fs_buf, &fs_len, "uniform vec2 uTex1Size;"); + append_line(fs_buf, &fs_len, "uniform bool uTex1Filter;"); } - if (cc_features.opt_alpha && cc_features.opt_noise) { - append_line(fs_buf, &fs_len, "uniform int frame_count;"); - append_line(fs_buf, &fs_len, "uniform int window_height;"); + // 3 point texture filtering + // Original author: ArthurCarvalho + // Slightly modified GLSL implementation by twinaphex, mupen64plus-libretro project. + + if (used_textures[0] || used_textures[1]) { + if (configFiltering == 2) { + append_line(fs_buf, &fs_len, "#define TEX_OFFSET(off) texture2D(tex, texCoord - (off)/texSize)"); + append_line(fs_buf, &fs_len, "vec4 filter3point(in sampler2D tex, in vec2 texCoord, in vec2 texSize) {"); + append_line(fs_buf, &fs_len, " vec2 offset = fract(texCoord*texSize - vec2(0.5));"); + append_line(fs_buf, &fs_len, " offset -= step(1.0, offset.x + offset.y);"); + append_line(fs_buf, &fs_len, " vec4 c0 = TEX_OFFSET(offset);"); + append_line(fs_buf, &fs_len, " vec4 c1 = TEX_OFFSET(vec2(offset.x - sign(offset.x), offset.y));"); + append_line(fs_buf, &fs_len, " vec4 c2 = TEX_OFFSET(vec2(offset.x, offset.y - sign(offset.y)));"); + append_line(fs_buf, &fs_len, " return c0 + abs(offset.x)*(c1-c0) + abs(offset.y)*(c2-c0);"); + append_line(fs_buf, &fs_len, "}"); + append_line(fs_buf, &fs_len, "vec4 sampleTex(in sampler2D tex, in vec2 uv, in vec2 texSize, in bool dofilter) {"); + append_line(fs_buf, &fs_len, "if (dofilter)"); + append_line(fs_buf, &fs_len, "return filter3point(tex, uv, texSize);"); + append_line(fs_buf, &fs_len, "else"); + append_line(fs_buf, &fs_len, "return texture2D(tex, uv);"); + append_line(fs_buf, &fs_len, "}"); + } else { + append_line(fs_buf, &fs_len, "vec4 sampleTex(in sampler2D tex, in vec2 uv, in vec2 texSize, in bool dofilter) {"); + append_line(fs_buf, &fs_len, "return texture2D(tex, uv);"); + append_line(fs_buf, &fs_len, "}"); + } + } + + if (opt_alpha && opt_noise) { + append_line(fs_buf, &fs_len, "uniform float frame_count;"); append_line(fs_buf, &fs_len, "float random(in vec3 value) {"); append_line(fs_buf, &fs_len, " float random = dot(sin(value), vec3(12.9898, 78.233, 37.719));"); @@ -236,42 +339,41 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shad append_line(fs_buf, &fs_len, "void main() {"); - if (cc_features.used_textures[0]) { - append_line(fs_buf, &fs_len, "vec4 texVal0 = texture2D(uTex0, vTexCoord);"); + if (used_textures[0]) { + append_line(fs_buf, &fs_len, "vec4 texVal0 = sampleTex(uTex0, vTexCoord, uTex0Size, uTex0Filter);"); } - if (cc_features.used_textures[1]) { - append_line(fs_buf, &fs_len, "vec4 texVal1 = texture2D(uTex1, vTexCoord);"); + if (used_textures[1]) { + append_line(fs_buf, &fs_len, "vec4 texVal1 = sampleTex(uTex1, vTexCoord, uTex1Size, uTex1Filter);"); } - append_str(fs_buf, &fs_len, cc_features.opt_alpha ? "vec4 texel = " : "vec3 texel = "); - if (!cc_features.color_alpha_same && cc_features.opt_alpha) { + append_str(fs_buf, &fs_len, opt_alpha ? "vec4 texel = " : "vec3 texel = "); + if (!color_alpha_same && opt_alpha) { append_str(fs_buf, &fs_len, "vec4("); - append_formula(fs_buf, &fs_len, cc_features.c, cc_features.do_single[0], cc_features.do_multiply[0], cc_features.do_mix[0], false, false, true); + append_formula(fs_buf, &fs_len, c, do_single[0], do_multiply[0], do_mix[0], false, false, true); append_str(fs_buf, &fs_len, ", "); - append_formula(fs_buf, &fs_len, cc_features.c, cc_features.do_single[1], cc_features.do_multiply[1], cc_features.do_mix[1], true, true, true); + append_formula(fs_buf, &fs_len, c, do_single[1], do_multiply[1], do_mix[1], true, true, true); append_str(fs_buf, &fs_len, ")"); } else { - append_formula(fs_buf, &fs_len, cc_features.c, cc_features.do_single[0], cc_features.do_multiply[0], cc_features.do_mix[0], cc_features.opt_alpha, false, cc_features.opt_alpha); + append_formula(fs_buf, &fs_len, c, do_single[0], do_multiply[0], do_mix[0], opt_alpha, false, opt_alpha); } append_line(fs_buf, &fs_len, ";"); - if (cc_features.opt_texture_edge && cc_features.opt_alpha) { + if (opt_texture_edge && opt_alpha) { append_line(fs_buf, &fs_len, "if (texel.a > 0.3) texel.a = 1.0; else discard;"); } // TODO discard if alpha is 0? - if (cc_features.opt_fog) { - if (cc_features.opt_alpha) { + if (opt_fog) { + if (opt_alpha) { append_line(fs_buf, &fs_len, "texel = vec4(mix(texel.rgb, vFog.rgb, vFog.a), texel.a);"); } else { append_line(fs_buf, &fs_len, "texel = mix(texel, vFog.rgb, vFog.a);"); } } - if (cc_features.opt_alpha && cc_features.opt_noise) { - append_line(fs_buf, &fs_len, "texel.a *= floor(random(vec3(floor(gl_FragCoord.xy * (240.0 / float(window_height))), float(frame_count))) + 0.5);"); - } + if (opt_alpha && opt_noise) + append_line(fs_buf, &fs_len, "texel.a *= floor(random(floor(vec3(gl_FragCoord.xy, frame_count))) + 0.5);"); - if (cc_features.opt_alpha) { + if (opt_alpha) { append_line(fs_buf, &fs_len, "gl_FragColor = texel;"); } else { append_line(fs_buf, &fs_len, "gl_FragColor = vec4(texel, 1.0);"); @@ -302,7 +404,7 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shad fprintf(stderr, "Vertex shader compilation failed\n"); glGetShaderInfoLog(vertex_shader, max_length, &max_length, &error_log[0]); fprintf(stderr, "%s\n", &error_log[0]); - abort(); + sys_fatal("vertex shader compilation failed (see terminal)"); } GLuint fragment_shader = glCreateShader(GL_FRAGMENT_SHADER); @@ -316,7 +418,7 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shad fprintf(stderr, "Fragment shader compilation failed\n"); glGetShaderInfoLog(fragment_shader, max_length, &max_length, &error_log[0]); fprintf(stderr, "%s\n", &error_log[0]); - abort(); + sys_fatal("fragment shader compilation failed (see terminal)"); } GLuint shader_program = glCreateProgram(); @@ -331,48 +433,51 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shad prg->attrib_sizes[cnt] = 4; ++cnt; - if (cc_features.used_textures[0] || cc_features.used_textures[1]) { + if (used_textures[0] || used_textures[1]) { prg->attrib_locations[cnt] = glGetAttribLocation(shader_program, "aTexCoord"); prg->attrib_sizes[cnt] = 2; ++cnt; } - if (cc_features.opt_fog) { + if (opt_fog) { prg->attrib_locations[cnt] = glGetAttribLocation(shader_program, "aFog"); prg->attrib_sizes[cnt] = 4; ++cnt; } - for (int i = 0; i < cc_features.num_inputs; i++) { + for (int i = 0; i < num_inputs; i++) { char name[16]; sprintf(name, "aInput%d", i + 1); prg->attrib_locations[cnt] = glGetAttribLocation(shader_program, name); - prg->attrib_sizes[cnt] = cc_features.opt_alpha ? 4 : 3; + prg->attrib_sizes[cnt] = opt_alpha ? 4 : 3; ++cnt; } prg->shader_id = shader_id; prg->opengl_program_id = shader_program; - prg->num_inputs = cc_features.num_inputs; - prg->used_textures[0] = cc_features.used_textures[0]; - prg->used_textures[1] = cc_features.used_textures[1]; + prg->num_inputs = num_inputs; + prg->used_textures[0] = used_textures[0]; + prg->used_textures[1] = used_textures[1]; prg->num_floats = num_floats; prg->num_attribs = cnt; gfx_opengl_load_shader(prg); - if (cc_features.used_textures[0]) { + if (used_textures[0]) { GLint sampler_location = glGetUniformLocation(shader_program, "uTex0"); + prg->uniform_locations[0] = glGetUniformLocation(shader_program, "uTex0Size"); + prg->uniform_locations[1] = glGetUniformLocation(shader_program, "uTex0Filter"); glUniform1i(sampler_location, 0); } - if (cc_features.used_textures[1]) { + if (used_textures[1]) { GLint sampler_location = glGetUniformLocation(shader_program, "uTex1"); + prg->uniform_locations[2] = glGetUniformLocation(shader_program, "uTex1Size"); + prg->uniform_locations[3] = glGetUniformLocation(shader_program, "uTex1Filter"); glUniform1i(sampler_location, 1); } - if (cc_features.opt_alpha && cc_features.opt_noise) { - prg->frame_count_location = glGetUniformLocation(shader_program, "frame_count"); - prg->window_height_location = glGetUniformLocation(shader_program, "window_height"); + if (opt_alpha && opt_noise) { + prg->uniform_locations[4] = glGetUniformLocation(shader_program, "frame_count"); prg->used_noise = true; } else { prg->used_noise = false; @@ -397,18 +502,30 @@ static void gfx_opengl_shader_get_info(struct ShaderProgram *prg, uint8_t *num_i } static GLuint gfx_opengl_new_texture(void) { - GLuint ret; - glGenTextures(1, &ret); - return ret; + if (num_textures >= tex_cache_size) { + tex_cache_size += TEX_CACHE_STEP; + tex_cache = realloc(tex_cache, sizeof(struct GLTexture) * tex_cache_size); + if (!tex_cache) sys_fatal("out of memory allocating texture cache"); + // invalidate these because they might be pointing to garbage now + opengl_tex[0] = NULL; + opengl_tex[1] = NULL; + } + glGenTextures(1, &tex_cache[num_textures].gltex); + return num_textures++; } static void gfx_opengl_select_texture(int tile, GLuint texture_id) { - glActiveTexture(GL_TEXTURE0 + tile); - glBindTexture(GL_TEXTURE_2D, texture_id); + opengl_tex[tile] = tex_cache + texture_id; + opengl_curtex = tile; + glActiveTexture(GL_TEXTURE0 + tile); + glBindTexture(GL_TEXTURE_2D, opengl_tex[tile]->gltex); + gfx_opengl_set_texture_uniforms(opengl_prg, tile); } -static void gfx_opengl_upload_texture(const uint8_t *rgba32_buf, int width, int height) { +static void gfx_opengl_upload_texture(uint8_t *rgba32_buf, int width, int height) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, rgba32_buf); + opengl_tex[opengl_curtex]->size[0] = width; + opengl_tex[opengl_curtex]->size[1] = height; } static uint32_t gfx_cm_to_opengl(uint32_t val) { @@ -419,11 +536,17 @@ static uint32_t gfx_cm_to_opengl(uint32_t val) { } static void gfx_opengl_set_sampler_parameters(int tile, bool linear_filter, uint32_t cms, uint32_t cmt) { + const GLenum filter = linear_filter ? GL_LINEAR : GL_NEAREST; glActiveTexture(GL_TEXTURE0 + tile); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, linear_filter ? GL_LINEAR : GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, linear_filter ? GL_LINEAR : GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, gfx_cm_to_opengl(cms)); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, gfx_cm_to_opengl(cmt)); + opengl_curtex = tile; + if (opengl_tex[tile]) { + opengl_tex[tile]->filter = linear_filter; + gfx_opengl_set_texture_uniforms(opengl_prg, tile); + } } static void gfx_opengl_set_depth_test(bool depth_test) { @@ -450,7 +573,6 @@ static void gfx_opengl_set_zmode_decal(bool zmode_decal) { static void gfx_opengl_set_viewport(int x, int y, int width, int height) { glViewport(x, y, width, height); - current_height = height; } static void gfx_opengl_set_scissor(int x, int y, int width, int height) { @@ -471,11 +593,39 @@ static void gfx_opengl_draw_triangles(float buf_vbo[], size_t buf_vbo_len, size_ glDrawArrays(GL_TRIANGLES, 0, 3 * buf_vbo_num_tris); } +static inline bool gl_get_version(int *major, int *minor, bool *is_es) { + const char *vstr = (const char *)glGetString(GL_VERSION); + if (!vstr || !vstr[0]) return false; + + if (!strncmp(vstr, "OpenGL ES ", 10)) { + vstr += 10; + *is_es = true; + } else if (!strncmp(vstr, "OpenGL ES-CM ", 13)) { + vstr += 13; + *is_es = true; + } + + return (sscanf(vstr, "%d.%d", major, minor) == 2); +} + static void gfx_opengl_init(void) { -#if FOR_WINDOWS - glewInit(); +#if FOR_WINDOWS || defined(OSX_BUILD) + GLenum err; + if ((err = glewInit()) != GLEW_OK) + sys_fatal("could not init GLEW:\n%s", glewGetErrorString(err)); #endif - + + tex_cache_size = TEX_CACHE_STEP; + tex_cache = calloc(tex_cache_size, sizeof(struct GLTexture)); + if (!tex_cache) sys_fatal("out of memory allocating texture cache"); + + // check GL version + int vmajor, vminor; + bool is_es = false; + gl_get_version(&vmajor, &vminor, &is_es); + if (vmajor < 2 && vminor < 1 && !is_es) + sys_fatal("OpenGL 2.1+ is required.\nReported version: %s%d.%d", is_es ? "ES" : "", vmajor, vminor); + glGenBuffers(1, &opengl_vbo); glBindBuffer(GL_ARRAY_BUFFER, opengl_vbo); @@ -503,6 +653,9 @@ static void gfx_opengl_end_frame(void) { static void gfx_opengl_finish_render(void) { } +static void gfx_opengl_shutdown(void) { +} + struct GfxRenderingAPI gfx_opengl_api = { gfx_opengl_z_is_from_0_to_1, gfx_opengl_unload_shader, @@ -525,7 +678,8 @@ struct GfxRenderingAPI gfx_opengl_api = { gfx_opengl_on_resize, gfx_opengl_start_frame, gfx_opengl_end_frame, - gfx_opengl_finish_render + gfx_opengl_finish_render, + gfx_opengl_shutdown }; -#endif +#endif // RAPI_GL diff --git a/src/pc/gfx/gfx_opengl_legacy.c b/src/pc/gfx/gfx_opengl_legacy.c new file mode 100644 index 00000000..5f7c7daa --- /dev/null +++ b/src/pc/gfx/gfx_opengl_legacy.c @@ -0,0 +1,618 @@ +#ifdef RAPI_GL_LEGACY + +#include +#include +#include + +#ifndef _LANGUAGE_C +# define _LANGUAGE_C +#endif +#include + +#ifdef __MINGW32__ +# define FOR_WINDOWS 1 +#else +# define FOR_WINDOWS 0 +#endif + +#include + +#if FOR_WINDOWS || defined(OSX_BUILD) +# define GLEW_STATIC +# include +#endif + +#define GL_GLEXT_PROTOTYPES 1 +#include + +// redefine this if using a different GL loader +#define mglGetProcAddress(name) SDL_GL_GetProcAddress(name) + +// we'll define and load it manually in init, just in case +typedef void (*PFNMGLFOGCOORDPOINTERPROC)(GLenum type, GLsizei stride, const void *pointer); +static PFNMGLFOGCOORDPOINTERPROC mglFogCoordPointer = NULL; + +// since these can have different names, might as well redefine them to a single one +#undef GL_FOG_COORD_SRC +#undef GL_FOG_COORD +#undef GL_FOG_COORD_ARRAY +#define GL_FOG_COORD_SRC 0x8450 +#define GL_FOG_COORD 0x8451 +#define GL_FOG_COORD_ARRAY 0x8457 + +#include "../platform.h" +#include "gfx_cc.h" +#include "gfx_rendering_api.h" +#include "macros.h" + +enum MixFlags { + SH_MF_OVERRIDE_ALPHA = 1, + + SH_MF_MULTIPLY = 2, + SH_MF_MIX = 4, + SH_MF_SINGLE = 8, + + SH_MF_MULTIPLY_ALPHA = 16, + SH_MF_MIX_ALPHA = 32, + SH_MF_SINGLE_ALPHA = 64, + + SH_MF_INPUT_ALPHA = 128, +}; + +enum MixType { + SH_MT_NONE, + SH_MT_TEXTURE, + SH_MT_COLOR, + SH_MT_TEXTURE_TEXTURE, + SH_MT_TEXTURE_COLOR, + SH_MT_COLOR_COLOR, +}; + +struct ShaderProgram { + uint32_t shader_id; + enum MixType mix; + uint32_t mix_flags; + bool texture_used[2]; + int num_inputs; +}; + +static struct ShaderProgram shader_program_pool[64]; +static uint8_t shader_program_pool_size; +static struct ShaderProgram *cur_shader = NULL; + +static const float *cur_buf = NULL; +static const float *cur_fog_ofs = NULL; +static size_t cur_buf_size = 0; +static size_t cur_buf_num_tris = 0; +static size_t cur_buf_stride = 0; +static bool gl_blend = false; +static bool gl_adv_fog = false; + +static const float c_white[] = { 1.f, 1.f, 1.f, 1.f }; + +static bool gfx_opengl_z_is_from_0_to_1(void) { + return false; +} + +#define TEXENV_COMBINE_ON() glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE) +#define TEXENV_COMBINE_OFF() glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE) + +#define TEXENV_COMBINE_OP(num, cval, aval) \ + do { \ + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND ## num ## _RGB, cval); \ + glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND ## num ## _ALPHA, aval); \ + } while (0) + +#define TEXENV_COMBINE_SET1(what, mode, val) \ + do { \ + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ ## what, mode); \ + glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_ ## what, val); \ + } while (0) + +#define TEXENV_COMBINE_SET2(what, mode, val1, val2) \ + do { \ + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ ## what, mode); \ + glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_ ## what, val1); \ + glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_ ## what, val2); \ + } while (0) + +#define TEXENV_COMBINE_SET3(what, mode, val1, val2, val3) \ + do { \ + glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ ## what, mode); \ + glTexEnvi(GL_TEXTURE_ENV, GL_SRC0_ ## what, val1); \ + glTexEnvi(GL_TEXTURE_ENV, GL_SRC1_ ## what, val2); \ + glTexEnvi(GL_TEXTURE_ENV, GL_SRC2_ ## what, val3); \ + } while (0) + +static inline void texenv_set_texture_color(struct ShaderProgram *prg) { + glActiveTexture(GL_TEXTURE0); + + if (prg->mix_flags & SH_MF_OVERRIDE_ALPHA) { + TEXENV_COMBINE_ON(); + if (prg->mix_flags & SH_MF_SINGLE_ALPHA) { + if (prg->mix_flags & SH_MF_MULTIPLY) { + // keep the alpha but modulate the color + const GLenum alphasrc = (prg->mix_flags & SH_MF_INPUT_ALPHA) ? GL_PRIMARY_COLOR : GL_TEXTURE; + TEXENV_COMBINE_SET2(RGB, GL_MODULATE, GL_TEXTURE, GL_PRIMARY_COLOR); + TEXENV_COMBINE_SET1(ALPHA, GL_REPLACE, alphasrc); + } else { + // somehow makes it keep the color while taking the alpha from primary color + TEXENV_COMBINE_SET1(RGB, GL_REPLACE, GL_TEXTURE); + } + } else { // if (prg->mix_flags & SH_MF_SINGLE) { + if (prg->mix_flags & SH_MF_MULTIPLY_ALPHA) { + // modulate the alpha but keep the color + TEXENV_COMBINE_SET2(ALPHA, GL_MODULATE, GL_TEXTURE, GL_PRIMARY_COLOR); + TEXENV_COMBINE_SET1(RGB, GL_REPLACE, GL_TEXTURE); + } else { + // somehow makes it keep the alpha + TEXENV_COMBINE_SET1(ALPHA, GL_REPLACE, GL_TEXTURE); + } + } + // TODO: MIX and the other one + } else if (prg->mix_flags & SH_MF_MULTIPLY) { + // TODO: is this right? + TEXENV_COMBINE_OFF(); + } else if (prg->mix_flags & SH_MF_MIX) { + TEXENV_COMBINE_ON(); + // HACK: determine this using flags and not this crap + if (prg->num_inputs > 1) { + // out.rgb = mix(color0.rgb, color1.rgb, texel0.rgb); + // no color1 tho, so mix with white (texenv color is set in init()) + TEXENV_COMBINE_OP(2, GL_SRC_COLOR, GL_SRC_ALPHA); + TEXENV_COMBINE_SET3(RGB, GL_INTERPOLATE, GL_CONSTANT, GL_PRIMARY_COLOR, GL_TEXTURE); + TEXENV_COMBINE_SET1(ALPHA, GL_REPLACE, GL_CONSTANT); + } else { + // out.rgb = mix(color0.rgb, texel0.rgb, texel0.a); + TEXENV_COMBINE_OP(2, GL_SRC_ALPHA, GL_SRC_ALPHA); + TEXENV_COMBINE_SET3(RGB, GL_INTERPOLATE, GL_TEXTURE, GL_PRIMARY_COLOR, GL_TEXTURE); + } + } else { + TEXENV_COMBINE_OFF(); + } +} + +static inline void texenv_set_texture_texture(UNUSED struct ShaderProgram *prg) { + glActiveTexture(GL_TEXTURE0); + TEXENV_COMBINE_OFF(); + glActiveTexture(GL_TEXTURE1); + TEXENV_COMBINE_ON(); + // out.rgb = mix(texel0.rgb, texel1.rgb, color0.rgb); + TEXENV_COMBINE_OP(2, GL_SRC_COLOR, GL_SRC_ALPHA); + TEXENV_COMBINE_SET3(RGB, GL_INTERPOLATE, GL_PREVIOUS, GL_TEXTURE, GL_PRIMARY_COLOR); + // out.a = texel0.a; + TEXENV_COMBINE_SET1(ALPHA, GL_REPLACE, GL_PREVIOUS); +} + +static void gfx_opengl_apply_shader(struct ShaderProgram *prg) { + const float *ofs = cur_buf; + + // vertices are always there + glVertexPointer(4, GL_FLOAT, cur_buf_stride, ofs); + ofs += 4; + + // have texture(s), specify same texcoords for every active texture + for (int i = 0; i < 2; ++i) { + if (prg->texture_used[i]) { + glEnable(GL_TEXTURE0 + i); + glClientActiveTexture(GL_TEXTURE0 + i); + glActiveTexture(GL_TEXTURE0 + i); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glTexCoordPointer(2, GL_FLOAT, cur_buf_stride, ofs); + glEnable(GL_TEXTURE_2D); + ofs += 2; + } + } + + if (prg->shader_id & SHADER_OPT_FOG) { + // fog requested, we can deal with it in one of two ways + if (gl_adv_fog) { + // if GL_EXT_fog_coord is available, use the provided fog factor as scaled depth for GL fog + const float fogrgb[] = { ofs[0], ofs[1], ofs[2] }; + glEnable(GL_FOG); + glFogfv(GL_FOG_COLOR, fogrgb); // color is the same for all verts, only intensity is different + glEnableClientState(GL_FOG_COORD_ARRAY); + mglFogCoordPointer(GL_FLOAT, cur_buf_stride, ofs + 3); // point it to alpha, which is fog factor + } else { + // if there's no fog coords available, blend it on top of normal tris later + cur_fog_ofs = ofs; + } + ofs += 4; + } + + if (prg->num_inputs) { + // have colors + // TODO: more than one color (maybe glSecondaryColorPointer?) + // HACK: if there's a texture and two colors, one of them is likely for speculars or some shit (see mario head) + // if there's two colors but no texture, the real color is likely the second one + const int hack = (prg->num_inputs > 1) * (4 - (int)prg->texture_used[0]); + glEnableClientState(GL_COLOR_ARRAY); + glColorPointer(4, GL_FLOAT, cur_buf_stride, ofs + hack); + ofs += 4 * prg->num_inputs; + } + + if (prg->shader_id & SHADER_OPT_TEXTURE_EDGE) { + // (horrible) alpha discard + glEnable(GL_ALPHA_TEST); + glAlphaFunc(GL_GREATER, 0.3f); + } + + // configure formulae + switch (prg->mix) { + case SH_MT_TEXTURE: + glActiveTexture(GL_TEXTURE0); + TEXENV_COMBINE_OFF(); + break; + + case SH_MT_TEXTURE_COLOR: + texenv_set_texture_color(prg); + break; + + case SH_MT_TEXTURE_TEXTURE: + texenv_set_texture_texture(prg); + break; + + default: + break; + } +} + +static void gfx_opengl_unload_shader(struct ShaderProgram *old_prg) { + if (cur_shader == old_prg || old_prg == NULL) + cur_shader = NULL; + + glClientActiveTexture(GL_TEXTURE0); + glActiveTexture(GL_TEXTURE0); + glDisable(GL_TEXTURE_2D); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + + glClientActiveTexture(GL_TEXTURE1); + glActiveTexture(GL_TEXTURE1); + glDisable(GL_TEXTURE_2D); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + + glDisable(GL_TEXTURE1); + glDisable(GL_TEXTURE0); + glDisable(GL_TEXTURE_2D); + glDisable(GL_ALPHA_TEST); + glDisable(GL_FOG); + cur_fog_ofs = NULL; // clear fog colors + + glDisableClientState(GL_COLOR_ARRAY); + if (gl_adv_fog) glDisableClientState(GL_FOG_COORD_ARRAY); +} + +static void gfx_opengl_load_shader(struct ShaderProgram *new_prg) { + cur_shader = new_prg; + // gfx_opengl_apply_shader(cur_shader); +} + +static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shader_id) { + uint8_t c[2][4]; + for (int i = 0; i < 4; i++) { + c[0][i] = (shader_id >> (i * 3)) & 7; + c[1][i] = (shader_id >> (12 + i * 3)) & 7; + } + + bool used_textures[2] = {0, 0}; + int num_inputs = 0; + for (int i = 0; i < 2; i++) { + for (int j = 0; j < 4; j++) { + if (c[i][j] >= SHADER_INPUT_1 && c[i][j] <= SHADER_INPUT_4) { + if (c[i][j] > num_inputs) { + num_inputs = c[i][j]; + } + } + if (c[i][j] == SHADER_TEXEL0 || c[i][j] == SHADER_TEXEL0A) { + used_textures[0] = true; + } + if (c[i][j] == SHADER_TEXEL1) { + used_textures[1] = true; + } + } + } + + const bool color_alpha_same = (shader_id & 0xfff) == ((shader_id >> 12) & 0xfff); + const bool do_multiply[2] = {c[0][1] == 0 && c[0][3] == 0, c[1][1] == 0 && c[1][3] == 0}; + const bool do_mix[2] = {c[0][1] == c[0][3], c[1][1] == c[1][3]}; + const bool do_single[2] = {c[0][2] == 0, c[1][2] == 0}; + + struct ShaderProgram *prg = &shader_program_pool[shader_program_pool_size++]; + + prg->shader_id = shader_id; + prg->num_inputs = num_inputs; + prg->texture_used[0] = used_textures[0]; + prg->texture_used[1] = used_textures[1]; + + if (used_textures[0] && used_textures[1]) + prg->mix = SH_MT_TEXTURE_TEXTURE; + else if (used_textures[0] && num_inputs) + prg->mix = SH_MT_TEXTURE_COLOR; + else if (used_textures[0]) + prg->mix = SH_MT_TEXTURE; + else if (num_inputs > 1) + prg->mix = SH_MT_COLOR_COLOR; + else if (num_inputs) + prg->mix = SH_MT_COLOR; + + if (do_single[0]) prg->mix_flags |= SH_MF_SINGLE; + if (do_multiply[0]) prg->mix_flags |= SH_MF_MULTIPLY; + if (do_mix[0]) prg->mix_flags |= SH_MF_MIX; + + if (!color_alpha_same && (shader_id & SHADER_OPT_ALPHA)) { + prg->mix_flags |= SH_MF_OVERRIDE_ALPHA; + if (do_single[1]) prg->mix_flags |= SH_MF_SINGLE_ALPHA; + if (do_multiply[1]) prg->mix_flags |= SH_MF_MULTIPLY_ALPHA; + if (do_mix[1]) prg->mix_flags |= SH_MF_MIX_ALPHA; + if (c[1][3] < SHADER_TEXEL0) prg->mix_flags |= SH_MF_INPUT_ALPHA; + } + + gfx_opengl_load_shader(prg); + + return prg; +} + +static struct ShaderProgram *gfx_opengl_lookup_shader(uint32_t shader_id) { + for (size_t i = 0; i < shader_program_pool_size; i++) { + if (shader_program_pool[i].shader_id == shader_id) { + return &shader_program_pool[i]; + } + } + return NULL; +} + +static void gfx_opengl_shader_get_info(struct ShaderProgram *prg, uint8_t *num_inputs, bool used_textures[2]) { + *num_inputs = prg->num_inputs; + used_textures[0] = prg->texture_used[0]; + used_textures[1] = prg->texture_used[1]; +} + +static GLuint gfx_opengl_new_texture(void) { + GLuint ret; + glGenTextures(1, &ret); + return ret; +} + +static void gfx_opengl_select_texture(int tile, GLuint texture_id) { + glActiveTexture(GL_TEXTURE0 + tile); + glBindTexture(GL_TEXTURE_2D, texture_id); +} + +static void gfx_opengl_upload_texture(uint8_t *rgba32_buf, int width, int height) { + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, rgba32_buf); +} + +static uint32_t gfx_cm_to_opengl(uint32_t val) { + if (val & G_TX_CLAMP) + return GL_CLAMP_TO_EDGE; + return (val & G_TX_MIRROR) ? GL_MIRRORED_REPEAT : GL_REPEAT; +} + +static void gfx_opengl_set_sampler_parameters(int tile, bool linear_filter, uint32_t cms, uint32_t cmt) { + const GLenum filter = linear_filter ? GL_LINEAR : GL_NEAREST; + glActiveTexture(GL_TEXTURE0 + tile); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, gfx_cm_to_opengl(cms)); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, gfx_cm_to_opengl(cmt)); +} + +static void gfx_opengl_set_depth_test(bool depth_test) { + if (depth_test) { + glEnable(GL_DEPTH_TEST); + } else { + glDisable(GL_DEPTH_TEST); + } +} + +static void gfx_opengl_set_depth_mask(bool z_upd) { + glDepthMask(z_upd ? GL_TRUE : GL_FALSE); +} + +static void gfx_opengl_set_zmode_decal(bool zmode_decal) { + if (zmode_decal) { + glPolygonOffset(-2, -2); + glEnable(GL_POLYGON_OFFSET_FILL); + } else { + glPolygonOffset(0, 0); + glDisable(GL_POLYGON_OFFSET_FILL); + } +} + +static void gfx_opengl_set_viewport(int x, int y, int width, int height) { + glViewport(x, y, width, height); +} + +static void gfx_opengl_set_scissor(int x, int y, int width, int height) { + glScissor(x, y, width, height); +} + +static void gfx_opengl_set_use_alpha(bool use_alpha) { + gl_blend = use_alpha; + if (use_alpha) { + glEnable(GL_BLEND); + } else { + glDisable(GL_BLEND); + } +} + +// draws the same triangles as plain fog color + fog intensity as alpha +// on top of the normal tris and blends them to achieve sort of the same effect +// as fog would +static inline void gfx_opengl_blend_fog_tris(void) { + // if a texture was used, replace it with fog color instead, but still keep the alpha + if (cur_shader->texture_used[0]) { + glActiveTexture(GL_TEXTURE0); + TEXENV_COMBINE_ON(); + // out.rgb = input0.rgb + TEXENV_COMBINE_SET1(RGB, GL_REPLACE, GL_PRIMARY_COLOR); + // out.a = texel0.a * input0.a + TEXENV_COMBINE_SET2(ALPHA, GL_MODULATE, GL_TEXTURE, GL_PRIMARY_COLOR); + } + + glEnableClientState(GL_COLOR_ARRAY); // enable color array temporarily + glColorPointer(4, GL_FLOAT, cur_buf_stride, cur_fog_ofs); // set fog colors as primary colors + if (!gl_blend) glEnable(GL_BLEND); // enable blending temporarily + glDepthFunc(GL_LEQUAL); // Z is the same as the base triangles + + glDrawArrays(GL_TRIANGLES, 0, 3 * cur_buf_num_tris); + + glDepthFunc(GL_LESS); // set back to default + if (!gl_blend) glDisable(GL_BLEND); // disable blending if it was disabled + glDisableClientState(GL_COLOR_ARRAY); // will get reenabled later anyway +} + +static void gfx_opengl_draw_triangles(float buf_vbo[], size_t buf_vbo_len, size_t buf_vbo_num_tris) { + //printf("flushing %d tris\n", buf_vbo_num_tris); + + cur_buf = buf_vbo; + cur_buf_size = buf_vbo_len * 4; + cur_buf_num_tris = buf_vbo_num_tris; + cur_buf_stride = cur_buf_size / (3 * cur_buf_num_tris); + + gfx_opengl_apply_shader(cur_shader); + + glDrawArrays(GL_TRIANGLES, 0, 3 * cur_buf_num_tris); + + // cur_fog_ofs is only set if GL_EXT_fog_coord isn't used + if (cur_fog_ofs) gfx_opengl_blend_fog_tris(); +} + +static inline bool gl_check_ext(const char *name) { + static const char *extstr = NULL; + + if (extstr == NULL) + extstr = (const char *)glGetString(GL_EXTENSIONS); + + if (!strstr(extstr, name)) { + fprintf(stderr, "GL extension not supported: %s\n", name); + return false; + } + + printf("GL extension detected: %s\n", name); + return true; +} + +static inline bool gl_get_version(int *major, int *minor, bool *is_es) { + const char *vstr = (const char *)glGetString(GL_VERSION); + if (!vstr || !vstr[0]) return false; + + if (!strncmp(vstr, "OpenGL ES ", 10)) { + vstr += 10; + *is_es = true; + } else if (!strncmp(vstr, "OpenGL ES-CM ", 13)) { + vstr += 13; + *is_es = true; + } + + return (sscanf(vstr, "%d.%d", major, minor) == 2); +} + +static void gfx_opengl_init(void) { +#if FOR_WINDOWS || defined(OSX_BUILD) + GLenum err; + if ((err = glewInit()) != GLEW_OK) + sys_fatal("could not init GLEW:\n%s", glewGetErrorString(err)); +#endif + + // check GL version + int vmajor, vminor; + bool is_es = false; + gl_get_version(&vmajor, &vminor, &is_es); + if (vmajor < 2 && vminor < 2 && !is_es) + sys_fatal("OpenGL 1.2+ is required.\nReported version: %s%d.%d", is_es ? "ES" : "", vmajor, vminor); + + // check extensions that we need + const bool supported = + gl_check_ext("GL_ARB_multitexture") && + gl_check_ext("GL_ARB_texture_env_combine"); + + if (!supported) + sys_fatal("required GL extensions are not supported"); + + gl_adv_fog = false; + + // check whether we can use advanced fog shit + const bool fog_ext = + vmajor > 1 || vminor > 3 || + gl_check_ext("GL_EXT_fog_coord") || + gl_check_ext("GL_ARB_fog_coord"); + + if (fog_ext) { + // try to load manually, as this might be an extension, and even then the ext list may lie + mglFogCoordPointer = mglGetProcAddress("glFogCoordPointer"); + if (!mglFogCoordPointer) mglFogCoordPointer = mglGetProcAddress("glFogCoordPointerEXT"); + if (!mglFogCoordPointer) mglFogCoordPointer = mglGetProcAddress("glFogCoordPointerARB"); + if (!mglFogCoordPointer) + printf("glFogCoordPointer is not actually available, it won't be used.\n"); + else + gl_adv_fog = true; // appears to be all good + } + + printf("GL_VERSION = %s\n", glGetString(GL_VERSION)); + printf("GL_EXTENSIONS =\n%s\n", glGetString(GL_EXTENSIONS)); + + if (gl_adv_fog) { + // set fog params, they never change + printf("GL_EXT_fog_coord available, using that for fog\n"); + glFogi(GL_FOG_COORD_SRC, GL_FOG_COORD); + glFogi(GL_FOG_MODE, GL_LINEAR); + glFogf(GL_FOG_START, 0.0f); + glFogf(GL_FOG_END, 1.0f); + } + + // these also never change + glEnableClientState(GL_VERTEX_ARRAY); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, c_white); + TEXENV_COMBINE_OP(0, GL_SRC_COLOR, GL_SRC_ALPHA); + TEXENV_COMBINE_OP(1, GL_SRC_COLOR, GL_SRC_ALPHA); +} + +static void gfx_opengl_on_resize(void) { +} + +static void gfx_opengl_start_frame(void) { + glDisable(GL_SCISSOR_TEST); + glDepthMask(GL_TRUE); // Must be set to clear Z-buffer + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glEnable(GL_SCISSOR_TEST); +} + +static void gfx_opengl_end_frame(void) { +} + +static void gfx_opengl_finish_render(void) { +} + +static void gfx_opengl_shutdown(void) { +} + +struct GfxRenderingAPI gfx_opengl_api = { + gfx_opengl_z_is_from_0_to_1, + gfx_opengl_unload_shader, + gfx_opengl_load_shader, + gfx_opengl_create_and_load_new_shader, + gfx_opengl_lookup_shader, + gfx_opengl_shader_get_info, + gfx_opengl_new_texture, + gfx_opengl_select_texture, + gfx_opengl_upload_texture, + gfx_opengl_set_sampler_parameters, + gfx_opengl_set_depth_test, + gfx_opengl_set_depth_mask, + gfx_opengl_set_zmode_decal, + gfx_opengl_set_viewport, + gfx_opengl_set_scissor, + gfx_opengl_set_use_alpha, + gfx_opengl_draw_triangles, + gfx_opengl_init, + gfx_opengl_on_resize, + gfx_opengl_start_frame, + gfx_opengl_end_frame, + gfx_opengl_finish_render, + gfx_opengl_shutdown +}; + +#endif // RAPI_GL_LEGACY diff --git a/src/pc/gfx/gfx_pc.c b/src/pc/gfx/gfx_pc.c index ea9faab0..a78f2ffd 100644 --- a/src/pc/gfx/gfx_pc.c +++ b/src/pc/gfx/gfx_pc.c @@ -1,21 +1,33 @@ #include #include #include +#include #include #include #include +#ifdef EXTERNAL_DATA +#define STB_IMAGE_IMPLEMENTATION +#include +#endif + #ifndef _LANGUAGE_C #define _LANGUAGE_C #endif #include +#include "config.h" + #include "gfx_pc.h" #include "gfx_cc.h" #include "gfx_window_manager_api.h" #include "gfx_rendering_api.h" #include "gfx_screen_config.h" +#include "../platform.h" +#include "../configfile.h" +#include "../fs/fs.h" + #define SUPPORT_CHECK(x) assert(x) // SCALE_M_N: upscale/downscale M-bit integer to N-bit @@ -38,6 +50,17 @@ #define MAX_LIGHTS 2 #define MAX_VERTICES 64 +#ifdef EXTERNAL_DATA +# define MAX_CACHED_TEXTURES 4096 // for preloading purposes +# define HASH_SHIFT 0 +#else +# define MAX_CACHED_TEXTURES 512 +# define HASH_SHIFT 5 +#endif + +#define HASHMAP_LEN (MAX_CACHED_TEXTURES * 2) +#define HASH_MASK (HASHMAP_LEN - 1) + struct RGBA { uint8_t r, g, b, a; }; @@ -64,8 +87,8 @@ struct TextureHashmapNode { bool linear_filter; }; static struct { - struct TextureHashmapNode *hashmap[1024]; - struct TextureHashmapNode pool[512]; + struct TextureHashmapNode *hashmap[HASHMAP_LEN]; + struct TextureHashmapNode pool[MAX_CACHED_TEXTURES]; uint32_t pool_pos; } gfx_texture_cache; @@ -153,11 +176,27 @@ static size_t buf_vbo_num_tris; static struct GfxWindowManagerAPI *gfx_wapi; static struct GfxRenderingAPI *gfx_rapi; -#include +// 4x4 pink-black checkerboard texture to indicate missing textures +#define MISSING_W 4 +#define MISSING_H 4 +static const uint8_t missing_texture[MISSING_W * MISSING_H * 4] = { + 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, + 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, +}; + +#ifdef EXTERNAL_DATA +static inline size_t string_hash(const uint8_t *str) { + size_t h = 0; + for (const uint8_t *p = str; *p; p++) + h = 31 * h + *p; + return h; +} +#endif + static unsigned long get_time(void) { - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - return (unsigned long)ts.tv_sec * 1000000 + ts.tv_nsec / 1000; + return 0; } static void gfx_flush(void) { @@ -249,11 +288,19 @@ static struct ColorCombiner *gfx_lookup_or_create_color_combiner(uint32_t cc_id) } static bool gfx_texture_cache_lookup(int tile, struct TextureHashmapNode **n, const uint8_t *orig_addr, uint32_t fmt, uint32_t siz) { + #ifdef EXTERNAL_DATA // hash and compare the data (i.e. the texture name) itself + size_t hash = string_hash(orig_addr); + #define CMPADDR(x, y) (x && !sys_strcasecmp((const char *)x, (const char *)y)) + #else // hash and compare the address size_t hash = (uintptr_t)orig_addr; - hash = (hash >> 5) & 0x3ff; + #define CMPADDR(x, y) x == y + #endif + + hash = (hash >> HASH_SHIFT) & HASH_MASK; + struct TextureHashmapNode **node = &gfx_texture_cache.hashmap[hash]; - while (*node != NULL && *node - gfx_texture_cache.pool < (int)gfx_texture_cache.pool_pos) { - if ((*node)->texture_addr == orig_addr && (*node)->fmt == fmt && (*node)->siz == siz) { + while (*node != NULL && *node - gfx_texture_cache.pool < gfx_texture_cache.pool_pos) { + if (CMPADDR((*node)->texture_addr, orig_addr) && (*node)->fmt == fmt && (*node)->siz == siz) { gfx_rapi->select_texture(tile, (*node)->texture_id); *n = *node; return true; @@ -264,7 +311,7 @@ static bool gfx_texture_cache_lookup(int tile, struct TextureHashmapNode **n, co // Pool is full. We just invalidate everything and start over. gfx_texture_cache.pool_pos = 0; node = &gfx_texture_cache.hashmap[hash]; - //puts("Clearing texture cache"); + // puts("Clearing texture cache"); } *node = &gfx_texture_cache.pool[gfx_texture_cache.pool_pos++]; if ((*node)->texture_addr == NULL) { @@ -281,6 +328,15 @@ static bool gfx_texture_cache_lookup(int tile, struct TextureHashmapNode **n, co (*node)->siz = siz; *n = *node; return false; + #undef CMPADDR +} + +#ifndef EXTERNAL_DATA + +static void import_texture_rgba32(int tile) { + uint32_t width = rdp.texture_tile.line_size_bytes / 2; + uint32_t height = (rdp.loaded_texture[tile].size_bytes / 2) / rdp.texture_tile.line_size_bytes; + gfx_rapi->upload_texture(rdp.loaded_texture[tile].addr, width, height); } static void import_texture_rgba16(int tile) { @@ -304,12 +360,6 @@ static void import_texture_rgba16(int tile) { gfx_rapi->upload_texture(rgba32_buf, width, height); } -static void import_texture_rgba32(int tile) { - uint32_t width = rdp.texture_tile.line_size_bytes / 2; - uint32_t height = (rdp.loaded_texture[tile].size_bytes / 2) / rdp.texture_tile.line_size_bytes; - gfx_rapi->upload_texture(rdp.loaded_texture[tile].addr, width, height); -} - static void import_texture_ia4(int tile) { uint8_t rgba32_buf[32768]; @@ -377,23 +427,19 @@ static void import_texture_ia16(int tile) { static void import_texture_i4(int tile) { uint8_t rgba32_buf[32768]; - + for (uint32_t i = 0; i < rdp.loaded_texture[tile].size_bytes * 2; i++) { uint8_t byte = rdp.loaded_texture[tile].addr[i / 2]; - uint8_t part = (byte >> (4 - (i % 2) * 4)) & 0xf; - uint8_t intensity = part; - uint8_t r = intensity; - uint8_t g = intensity; - uint8_t b = intensity; - rgba32_buf[4*i + 0] = SCALE_4_8(r); - rgba32_buf[4*i + 1] = SCALE_4_8(g); - rgba32_buf[4*i + 2] = SCALE_4_8(b); + uint8_t intensity = (byte >> (4 - (i % 2) * 4)) & 0xf; + rgba32_buf[4*i + 0] = SCALE_4_8(intensity); + rgba32_buf[4*i + 1] = SCALE_4_8(intensity); + rgba32_buf[4*i + 2] = SCALE_4_8(intensity); rgba32_buf[4*i + 3] = 255; } - + uint32_t width = rdp.texture_tile.line_size_bytes * 2; uint32_t height = rdp.loaded_texture[tile].size_bytes / rdp.texture_tile.line_size_bytes; - + gfx_rapi->upload_texture(rgba32_buf, width, height); } @@ -402,22 +448,18 @@ static void import_texture_i8(int tile) { for (uint32_t i = 0; i < rdp.loaded_texture[tile].size_bytes; i++) { uint8_t intensity = rdp.loaded_texture[tile].addr[i]; - uint8_t r = intensity; - uint8_t g = intensity; - uint8_t b = intensity; - rgba32_buf[4*i + 0] = r; - rgba32_buf[4*i + 1] = g; - rgba32_buf[4*i + 2] = b; + rgba32_buf[4*i + 0] = intensity; + rgba32_buf[4*i + 1] = intensity; + rgba32_buf[4*i + 2] = intensity; rgba32_buf[4*i + 3] = 255; } - + uint32_t width = rdp.texture_tile.line_size_bytes; uint32_t height = rdp.loaded_texture[tile].size_bytes / rdp.texture_tile.line_size_bytes; - + gfx_rapi->upload_texture(rgba32_buf, width, height); } - static void import_texture_ci4(int tile) { uint8_t rgba32_buf[32768]; @@ -463,22 +505,129 @@ static void import_texture_ci8(int tile) { gfx_rapi->upload_texture(rgba32_buf, width, height); } +#else // EXTERNAL_DATA + +static inline void load_texture(const char *fullpath) { + int w, h; + u64 imgsize = 0; + + u8 *imgdata = fs_load_file(fullpath, &imgsize); + if (imgdata) { + // TODO: implement stbi_callbacks or some shit instead of loading the whole texture + u8 *data = stbi_load_from_memory(imgdata, imgsize, &w, &h, NULL, 4); + free(imgdata); + if (data) { + gfx_rapi->upload_texture(data, w, h); + stbi_image_free(data); // don't need this anymore + return; + } + } + + fprintf(stderr, "could not load texture: `%s`\n", fullpath); + // replace with missing texture + gfx_rapi->upload_texture(missing_texture, MISSING_W, MISSING_H); +} + + +// this is taken straight from n64graphics +static bool texname_to_texformat(const char *name, u8 *fmt, u8 *siz) { + static const struct { + const char *name; + const u8 format; + const u8 size; + } fmt_table[] = { + { "rgba16", G_IM_FMT_RGBA, G_IM_SIZ_16b }, + { "rgba32", G_IM_FMT_RGBA, G_IM_SIZ_32b }, + { "ia1", G_IM_FMT_IA, G_IM_SIZ_8b }, // uhh + { "ia4", G_IM_FMT_IA, G_IM_SIZ_4b }, + { "ia8", G_IM_FMT_IA, G_IM_SIZ_8b }, + { "ia16", G_IM_FMT_IA, G_IM_SIZ_16b }, + { "i4", G_IM_FMT_I, G_IM_SIZ_4b }, + { "i8", G_IM_FMT_I, G_IM_SIZ_8b }, + { "ci8", G_IM_FMT_I, G_IM_SIZ_8b }, + { "ci16", G_IM_FMT_I, G_IM_SIZ_16b }, + }; + + char *fstr = strrchr(name, '.'); + if (!fstr) return false; // no format string? + fstr++; + + for (unsigned i = 0; i < sizeof(fmt_table) / sizeof(fmt_table[0]); ++i) { + if (!sys_strcasecmp(fstr, fmt_table[i].name)) { + *fmt = fmt_table[i].format; + *siz = fmt_table[i].size; + return true; + } + } + + return false; +} + +// calls import_texture() on every texture in the res folder +// we can get the format and size from the texture files +// and then cache them using gfx_texture_cache_lookup +static bool preload_texture(void *user, const char *path) { + // strip off the extension + char texname[SYS_MAX_PATH]; + strncpy(texname, path, sizeof(texname)); + texname[sizeof(texname)-1] = 0; + char *dot = strrchr(texname, '.'); + if (dot) *dot = 0; + + // get the format and size from filename + u8 fmt, siz; + if (!texname_to_texformat(texname, &fmt, &siz)) { + fprintf(stderr, "unknown texture format: `%s`, skipping\n", texname); + return true; // just skip it, might be a stray skybox or something + } + + char *actualname = texname; + // strip off the prefix // TODO: make a fs_ function for this shit + if (!strncmp(FS_TEXTUREDIR "/", actualname, 4)) actualname += 4; + // this will be stored in the hashtable, so make a copy + actualname = sys_strdup(actualname); + assert(actualname); + + struct TextureHashmapNode *n; + if (!gfx_texture_cache_lookup(0, &n, actualname, fmt, siz)) + load_texture(path); // new texture, load it + + return true; +} + +#endif // EXTERNAL_DATA + static void import_texture(int tile) { uint8_t fmt = rdp.texture_tile.fmt; uint8_t siz = rdp.texture_tile.siz; - + + if (!rdp.loaded_texture[tile].addr) { + fprintf(stderr, "NULL texture: tile %d, format %d/%d, size %d\n", + tile, (int)fmt, (int)siz, (int)rdp.loaded_texture[tile].size_bytes); + return; + } + if (gfx_texture_cache_lookup(tile, &rendering_state.textures[tile], rdp.loaded_texture[tile].addr, fmt, siz)) { return; } - + +#ifdef EXTERNAL_DATA + // the "texture data" is actually a C string with the path to our texture in it + // load it from an external image in our data path + char texname[SYS_MAX_PATH]; + snprintf(texname, sizeof(texname), FS_TEXTUREDIR "/%s.png", (const char*)rdp.loaded_texture[tile].addr); + load_texture(texname); +#else + // the texture data is actual texture data int t0 = get_time(); if (fmt == G_IM_FMT_RGBA) { - if (siz == G_IM_SIZ_16b) { - import_texture_rgba16(tile); - } else if (siz == G_IM_SIZ_32b) { + if (siz == G_IM_SIZ_32b) { import_texture_rgba32(tile); + } + else if (siz == G_IM_SIZ_16b) { + import_texture_rgba16(tile); } else { - abort(); + sys_fatal("unsupported RGBA texture size: %u", siz); } } else if (fmt == G_IM_FMT_IA) { if (siz == G_IM_SIZ_4b) { @@ -488,7 +637,7 @@ static void import_texture(int tile) { } else if (siz == G_IM_SIZ_16b) { import_texture_ia16(tile); } else { - abort(); + sys_fatal("unsupported IA texture size: %u", siz); } } else if (fmt == G_IM_FMT_CI) { if (siz == G_IM_SIZ_4b) { @@ -496,7 +645,7 @@ static void import_texture(int tile) { } else if (siz == G_IM_SIZ_8b) { import_texture_ci8(tile); } else { - abort(); + sys_fatal("unsupported CI texture size: %u", siz); } } else if (fmt == G_IM_FMT_I) { if (siz == G_IM_SIZ_4b) { @@ -504,13 +653,14 @@ static void import_texture(int tile) { } else if (siz == G_IM_SIZ_8b) { import_texture_i8(tile); } else { - abort(); + sys_fatal("unsupported I texture size: %u", siz); } } else { - abort(); + sys_fatal("unsupported texture format: %u", fmt); } int t1 = get_time(); //printf("Time diff: %d\n", t1 - t0); +#endif } static void gfx_normalize_vector(float v[3]) { @@ -551,8 +701,8 @@ static void gfx_matrix_mul(float res[4][4], const float a[4][4], const float b[4 static void gfx_sp_matrix(uint8_t parameters, const int32_t *addr) { float matrix[4][4]; -#ifndef GBI_FLOATS - // Original GBI where fixed point matrices are used +#if 0 + // Original code when fixed point matrices were used for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j += 2) { int32_t int_part = addr[i * 2 + j / 2]; @@ -562,7 +712,6 @@ static void gfx_sp_matrix(uint8_t parameters, const int32_t *addr) { } } #else - // For a modified GBI where fixed point values are replaced with floats memcpy(matrix, addr, sizeof(matrix)); #endif @@ -825,7 +974,7 @@ static void gfx_sp_tri1(uint8_t vtx1_idx, uint8_t vtx2_idx, uint8_t vtx3_idx) { import_texture(i); rdp.textures_changed[i] = false; } - bool linear_filter = (rdp.other_mode_h & (3U << G_MDSFT_TEXTFILT)) != G_TF_POINT; + bool linear_filter = configFiltering && ((rdp.other_mode_h & (3U << G_MDSFT_TEXTFILT)) != G_TF_POINT); if (linear_filter != rendering_state.textures[i]->linear_filter || rdp.texture_tile.cms != rendering_state.textures[i]->cms || rdp.texture_tile.cmt != rendering_state.textures[i]->cmt) { gfx_flush(); gfx_rapi->set_sampler_parameters(i, linear_filter, rdp.texture_tile.cms, rdp.texture_tile.cmt); @@ -1020,11 +1169,12 @@ static void gfx_dp_set_scissor(uint32_t mode, uint32_t ulx, uint32_t uly, uint32 } static void gfx_dp_set_texture_image(uint32_t format, uint32_t size, uint32_t width, const void* addr) { - rdp.texture_to_load.addr = (const uint8_t*) addr; + rdp.texture_to_load.addr = addr; rdp.texture_to_load.siz = size; } static void gfx_dp_set_tile(uint8_t fmt, uint32_t siz, uint32_t line, uint32_t tmem, uint8_t tile, uint32_t palette, uint32_t cmt, uint32_t maskt, uint32_t shiftt, uint32_t cms, uint32_t masks, uint32_t shifts) { + if (tile == G_TX_RENDERTILE) { SUPPORT_CHECK(palette == 0); // palette should set upper 4 bits of color index in 4b mode rdp.texture_tile.fmt = fmt; @@ -1082,7 +1232,6 @@ static void gfx_dp_load_block(uint8_t tile, uint32_t uls, uint32_t ult, uint32_t } uint32_t size_bytes = (lrs + 1) << word_size_shift; rdp.loaded_texture[rdp.texture_to_load.tile_number].size_bytes = size_bytes; - assert(size_bytes <= 4096 && "bug: too big texture"); rdp.loaded_texture[rdp.texture_to_load.tile_number].addr = rdp.texture_to_load.addr; rdp.textures_changed[rdp.texture_to_load.tile_number] = true; @@ -1097,7 +1246,7 @@ static void gfx_dp_load_tile(uint8_t tile, uint32_t uls, uint32_t ult, uint32_t uint32_t word_size_shift; switch (rdp.texture_to_load.siz) { case G_IM_SIZ_4b: - word_size_shift = 0; + word_size_shift = 0; // Or -1? It's unused in SM64 anyway. break; case G_IM_SIZ_8b: word_size_shift = 0; @@ -1113,7 +1262,6 @@ static void gfx_dp_load_tile(uint8_t tile, uint32_t uls, uint32_t ult, uint32_t uint32_t size_bytes = (((lrs >> G_TEXTURE_IMAGE_FRAC) + 1) * ((lrt >> G_TEXTURE_IMAGE_FRAC) + 1)) << word_size_shift; rdp.loaded_texture[rdp.texture_to_load.tile_number].size_bytes = size_bytes; - assert(size_bytes <= 4096 && "bug: too big texture"); rdp.loaded_texture[rdp.texture_to_load.tile_number].addr = rdp.texture_to_load.addr; rdp.texture_tile.uls = uls; rdp.texture_tile.ult = ult; @@ -1123,7 +1271,6 @@ static void gfx_dp_load_tile(uint8_t tile, uint32_t uls, uint32_t ult, uint32_t rdp.textures_changed[rdp.texture_to_load.tile_number] = true; } - static uint8_t color_comb_component(uint32_t v) { switch (v) { case G_CCMUX_TEXEL0: @@ -1400,7 +1547,7 @@ static void gfx_run_dl(Gfx* cmd) { break; case G_VTX: #ifdef F3DEX_GBI_2 - gfx_sp_vertex(C0(12, 8), C0(1, 7) - C0(12, 8), (const Vtx*) seg_addr(cmd->words.w1)); + gfx_sp_vertex(C0(12, 8), C0(1, 7) - C0(12, 8), seg_addr(cmd->words.w1)); #elif defined(F3DEX_GBI) || defined(F3DLP_GBI) gfx_sp_vertex(C0(10, 6), C0(16, 8) / 2, seg_addr(cmd->words.w1)); #else @@ -1572,10 +1719,10 @@ void gfx_get_dimensions(uint32_t *width, uint32_t *height) { gfx_wapi->get_dimensions(width, height); } -void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, const char *game_name, bool start_in_fullscreen) { +void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, const char *window_title) { gfx_wapi = wapi; gfx_rapi = rapi; - gfx_wapi->init(game_name, start_in_fullscreen); + gfx_wapi->init(window_title); gfx_rapi->init(); // Used in the 120 star TAS @@ -1607,11 +1754,18 @@ void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, co 0x0920038d, 0x09200045 }; - for (size_t i = 0; i < sizeof(precomp_shaders) / sizeof(uint32_t); i++) { + + for (size_t i = 0; i < sizeof(precomp_shaders) / sizeof(uint32_t); i++) gfx_lookup_or_create_shader_program(precomp_shaders[i]); - } } +#ifdef EXTERNAL_DATA +void gfx_precache_textures(void) { + // preload all textures + fs_walk(FS_TEXTUREDIR, preload_texture, NULL, true); +} +#endif + struct GfxRenderingAPI *gfx_get_current_rendering_api(void) { return gfx_rapi; } @@ -1653,3 +1807,14 @@ void gfx_end_frame(void) { gfx_wapi->swap_buffers_end(); } } + +void gfx_shutdown(void) { + if (gfx_rapi) { + if (gfx_rapi->shutdown) gfx_rapi->shutdown(); + gfx_rapi = NULL; + } + if (gfx_wapi) { + if (gfx_wapi->shutdown) gfx_wapi->shutdown(); + gfx_wapi = NULL; + } +} diff --git a/src/pc/gfx/gfx_pc.h b/src/pc/gfx/gfx_pc.h index 0ad4a302..716221a4 100644 --- a/src/pc/gfx/gfx_pc.h +++ b/src/pc/gfx/gfx_pc.h @@ -1,8 +1,6 @@ #ifndef GFX_PC_H #define GFX_PC_H -#include - struct GfxRenderingAPI; struct GfxWindowManagerAPI; @@ -17,11 +15,13 @@ extern struct GfxDimensions gfx_current_dimensions; extern "C" { #endif -void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, const char *game_name, bool start_in_fullscreen); +void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, const char *window_title); struct GfxRenderingAPI *gfx_get_current_rendering_api(void); void gfx_start_frame(void); void gfx_run(Gfx *commands); void gfx_end_frame(void); +void gfx_precache_textures(void); +void gfx_shutdown(void); #ifdef __cplusplus } diff --git a/src/pc/gfx/gfx_rendering_api.h b/src/pc/gfx/gfx_rendering_api.h index ed6f1c4c..e76efe74 100644 --- a/src/pc/gfx/gfx_rendering_api.h +++ b/src/pc/gfx/gfx_rendering_api.h @@ -30,6 +30,7 @@ struct GfxRenderingAPI { void (*start_frame)(void); void (*end_frame)(void); void (*finish_render)(void); + void (*shutdown)(void); }; #endif diff --git a/src/pc/gfx/gfx_sdl2.c b/src/pc/gfx/gfx_sdl2.c index 05f1a5ad..4d907893 100644 --- a/src/pc/gfx/gfx_sdl2.c +++ b/src/pc/gfx/gfx_sdl2.c @@ -1,4 +1,4 @@ -#if !defined(__linux__) && defined(ENABLE_OPENGL) +#ifdef WAPI_SDL2 #ifdef __MINGW32__ #define FOR_WINDOWS 1 @@ -7,59 +7,80 @@ #endif #if FOR_WINDOWS +#define GLEW_STATIC #include -#include "SDL.h" +#include #define GL_GLEXT_PROTOTYPES 1 -#include "SDL_opengl.h" +#include #else #include #define GL_GLEXT_PROTOTYPES 1 + +#ifdef OSX_BUILD +#include +#else #include #endif +#endif // End of OS-Specific GL defines + +#include +#include + #include "gfx_window_manager_api.h" #include "gfx_screen_config.h" +#include "../pc_main.h" +#include "../configfile.h" +#include "../cliopts.h" -#define GFX_API_NAME "SDL2 - OpenGL" +#include "src/pc/controller/controller_keyboard.h" + +// TODO: figure out if this shit even works +#ifdef VERSION_EU +# define FRAMERATE 25 +#else +# define FRAMERATE 30 +#endif static SDL_Window *wnd; +static SDL_GLContext ctx = NULL; static int inverted_scancode_table[512]; -static int vsync_enabled = 0; -static unsigned int window_width = DESIRED_SCREEN_WIDTH; -static unsigned int window_height = DESIRED_SCREEN_HEIGHT; -static bool fullscreen_state; -static void (*on_fullscreen_changed_callback)(bool is_now_fullscreen); -static bool (*on_key_down_callback)(int scancode); -static bool (*on_key_up_callback)(int scancode); -static void (*on_all_keys_up_callback)(void); -const SDL_Scancode windows_scancode_table[] = -{ - /* 0 1 2 3 4 5 6 7 */ - /* 8 9 A B C D E F */ - SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_ESCAPE, SDL_SCANCODE_1, SDL_SCANCODE_2, SDL_SCANCODE_3, SDL_SCANCODE_4, SDL_SCANCODE_5, SDL_SCANCODE_6, /* 0 */ - SDL_SCANCODE_7, SDL_SCANCODE_8, SDL_SCANCODE_9, SDL_SCANCODE_0, SDL_SCANCODE_MINUS, SDL_SCANCODE_EQUALS, SDL_SCANCODE_BACKSPACE, SDL_SCANCODE_TAB, /* 0 */ +static kb_callback_t kb_key_down = NULL; +static kb_callback_t kb_key_up = NULL; +static void (*kb_all_keys_up)(void) = NULL; - SDL_SCANCODE_Q, SDL_SCANCODE_W, SDL_SCANCODE_E, SDL_SCANCODE_R, SDL_SCANCODE_T, SDL_SCANCODE_Y, SDL_SCANCODE_U, SDL_SCANCODE_I, /* 1 */ - SDL_SCANCODE_O, SDL_SCANCODE_P, SDL_SCANCODE_LEFTBRACKET, SDL_SCANCODE_RIGHTBRACKET, SDL_SCANCODE_RETURN, SDL_SCANCODE_LCTRL, SDL_SCANCODE_A, SDL_SCANCODE_S, /* 1 */ +// whether to use timer for frame control +static bool use_timer = true; +// time between consequtive game frames +static const int frame_time = 1000 / FRAMERATE; - SDL_SCANCODE_D, SDL_SCANCODE_F, SDL_SCANCODE_G, SDL_SCANCODE_H, SDL_SCANCODE_J, SDL_SCANCODE_K, SDL_SCANCODE_L, SDL_SCANCODE_SEMICOLON, /* 2 */ - SDL_SCANCODE_APOSTROPHE, SDL_SCANCODE_GRAVE, SDL_SCANCODE_LSHIFT, SDL_SCANCODE_BACKSLASH, SDL_SCANCODE_Z, SDL_SCANCODE_X, SDL_SCANCODE_C, SDL_SCANCODE_V, /* 2 */ +const SDL_Scancode windows_scancode_table[] = { + /* 0 1 2 3 4 5 6 7 */ + /* 8 9 A B C D E F */ + SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_ESCAPE, SDL_SCANCODE_1, SDL_SCANCODE_2, SDL_SCANCODE_3, SDL_SCANCODE_4, SDL_SCANCODE_5, SDL_SCANCODE_6, /* 0 */ + SDL_SCANCODE_7, SDL_SCANCODE_8, SDL_SCANCODE_9, SDL_SCANCODE_0, SDL_SCANCODE_MINUS, SDL_SCANCODE_EQUALS, SDL_SCANCODE_BACKSPACE, SDL_SCANCODE_TAB, /* 0 */ - SDL_SCANCODE_B, SDL_SCANCODE_N, SDL_SCANCODE_M, SDL_SCANCODE_COMMA, SDL_SCANCODE_PERIOD, SDL_SCANCODE_SLASH, SDL_SCANCODE_RSHIFT, SDL_SCANCODE_PRINTSCREEN,/* 3 */ - SDL_SCANCODE_LALT, SDL_SCANCODE_SPACE, SDL_SCANCODE_CAPSLOCK, SDL_SCANCODE_F1, SDL_SCANCODE_F2, SDL_SCANCODE_F3, SDL_SCANCODE_F4, SDL_SCANCODE_F5, /* 3 */ + SDL_SCANCODE_Q, SDL_SCANCODE_W, SDL_SCANCODE_E, SDL_SCANCODE_R, SDL_SCANCODE_T, SDL_SCANCODE_Y, SDL_SCANCODE_U, SDL_SCANCODE_I, /* 1 */ + SDL_SCANCODE_O, SDL_SCANCODE_P, SDL_SCANCODE_LEFTBRACKET, SDL_SCANCODE_RIGHTBRACKET, SDL_SCANCODE_RETURN, SDL_SCANCODE_LCTRL, SDL_SCANCODE_A, SDL_SCANCODE_S, /* 1 */ - SDL_SCANCODE_F6, SDL_SCANCODE_F7, SDL_SCANCODE_F8, SDL_SCANCODE_F9, SDL_SCANCODE_F10, SDL_SCANCODE_NUMLOCKCLEAR, SDL_SCANCODE_SCROLLLOCK, SDL_SCANCODE_HOME, /* 4 */ - SDL_SCANCODE_UP, SDL_SCANCODE_PAGEUP, SDL_SCANCODE_KP_MINUS, SDL_SCANCODE_LEFT, SDL_SCANCODE_KP_5, SDL_SCANCODE_RIGHT, SDL_SCANCODE_KP_PLUS, SDL_SCANCODE_END, /* 4 */ + SDL_SCANCODE_D, SDL_SCANCODE_F, SDL_SCANCODE_G, SDL_SCANCODE_H, SDL_SCANCODE_J, SDL_SCANCODE_K, SDL_SCANCODE_L, SDL_SCANCODE_SEMICOLON, /* 2 */ + SDL_SCANCODE_APOSTROPHE, SDL_SCANCODE_GRAVE, SDL_SCANCODE_LSHIFT, SDL_SCANCODE_BACKSLASH, SDL_SCANCODE_Z, SDL_SCANCODE_X, SDL_SCANCODE_C, SDL_SCANCODE_V, /* 2 */ - SDL_SCANCODE_DOWN, SDL_SCANCODE_PAGEDOWN, SDL_SCANCODE_INSERT, SDL_SCANCODE_DELETE, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_NONUSBACKSLASH,SDL_SCANCODE_F11, /* 5 */ - SDL_SCANCODE_F12, SDL_SCANCODE_PAUSE, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_LGUI, SDL_SCANCODE_RGUI, SDL_SCANCODE_APPLICATION, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 5 */ + SDL_SCANCODE_B, SDL_SCANCODE_N, SDL_SCANCODE_M, SDL_SCANCODE_COMMA, SDL_SCANCODE_PERIOD, SDL_SCANCODE_SLASH, SDL_SCANCODE_RSHIFT, SDL_SCANCODE_PRINTSCREEN,/* 3 */ + SDL_SCANCODE_LALT, SDL_SCANCODE_SPACE, SDL_SCANCODE_CAPSLOCK, SDL_SCANCODE_F1, SDL_SCANCODE_F2, SDL_SCANCODE_F3, SDL_SCANCODE_F4, SDL_SCANCODE_F5, /* 3 */ - SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_F13, SDL_SCANCODE_F14, SDL_SCANCODE_F15, SDL_SCANCODE_F16, /* 6 */ - SDL_SCANCODE_F17, SDL_SCANCODE_F18, SDL_SCANCODE_F19, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 6 */ + SDL_SCANCODE_F6, SDL_SCANCODE_F7, SDL_SCANCODE_F8, SDL_SCANCODE_F9, SDL_SCANCODE_F10, SDL_SCANCODE_NUMLOCKCLEAR, SDL_SCANCODE_SCROLLLOCK, SDL_SCANCODE_HOME, /* 4 */ + SDL_SCANCODE_UP, SDL_SCANCODE_PAGEUP, SDL_SCANCODE_KP_MINUS, SDL_SCANCODE_LEFT, SDL_SCANCODE_KP_5, SDL_SCANCODE_RIGHT, SDL_SCANCODE_KP_PLUS, SDL_SCANCODE_END, /* 4 */ - SDL_SCANCODE_INTERNATIONAL2, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL1, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 7 */ - SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL4, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL5, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL3, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN /* 7 */ + SDL_SCANCODE_DOWN, SDL_SCANCODE_PAGEDOWN, SDL_SCANCODE_INSERT, SDL_SCANCODE_DELETE, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_NONUSBACKSLASH, SDL_SCANCODE_F11, /* 5 */ + SDL_SCANCODE_F12, SDL_SCANCODE_PAUSE, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_LGUI, SDL_SCANCODE_RGUI, SDL_SCANCODE_APPLICATION, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 5 */ + + SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_F13, SDL_SCANCODE_F14, SDL_SCANCODE_F15, SDL_SCANCODE_F16, /* 6 */ + SDL_SCANCODE_F17, SDL_SCANCODE_F18, SDL_SCANCODE_F19, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 6 */ + + SDL_SCANCODE_INTERNATIONAL2, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL1, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 7 */ + SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL4, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL5, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL3, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN /* 7 */ }; const SDL_Scancode scancode_rmapping_extended[][2] = { @@ -84,28 +105,7 @@ const SDL_Scancode scancode_rmapping_nonextended[][2] = { {SDL_SCANCODE_KP_MULTIPLY, SDL_SCANCODE_PRINTSCREEN} }; -static void set_fullscreen(bool on, bool call_callback) { - if (fullscreen_state == on) { - return; - } - fullscreen_state = on; - - if (on) { - SDL_DisplayMode mode; - SDL_GetDesktopDisplayMode(0, &mode); - window_width = mode.w; - window_height = mode.h; - } else { - window_width = DESIRED_SCREEN_WIDTH; - window_height = DESIRED_SCREEN_HEIGHT; - } - SDL_SetWindowSize(wnd, window_width, window_height); - SDL_SetWindowFullscreen(wnd, on ? SDL_WINDOW_FULLSCREEN : 0); - - if (on_fullscreen_changed_callback != NULL && call_callback) { - on_fullscreen_changed_callback(on); - } -} +#define IS_FULLSCREEN() ((SDL_GetWindowFlags(wnd) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0) int test_vsync(void) { // Even if SDL_GL_SetSwapInterval succeeds, it doesn't mean that VSync actually works. @@ -116,65 +116,113 @@ int test_vsync(void) { // This method will fail if the refresh rate is changed, which, in // combination with that we can't control the queue size (i.e. lag) // is a reason this generic SDL2 backend should only be used as last resort. - Uint32 start; - Uint32 end; - SDL_GL_SwapWindow(wnd); - SDL_GL_SwapWindow(wnd); - SDL_GL_SwapWindow(wnd); - SDL_GL_SwapWindow(wnd); - SDL_GL_SwapWindow(wnd); - SDL_GL_SwapWindow(wnd); - SDL_GL_SwapWindow(wnd); - SDL_GL_SwapWindow(wnd); - start = SDL_GetTicks(); - SDL_GL_SwapWindow(wnd); - SDL_GL_SwapWindow(wnd); - SDL_GL_SwapWindow(wnd); - SDL_GL_SwapWindow(wnd); - end = SDL_GetTicks(); + for (int i = 0; i < 8; ++i) + SDL_GL_SwapWindow(wnd); - float average = 4.0 * 1000.0 / (end - start); + Uint32 start = SDL_GetTicks(); + SDL_GL_SwapWindow(wnd); + SDL_GL_SwapWindow(wnd); + SDL_GL_SwapWindow(wnd); + SDL_GL_SwapWindow(wnd); + Uint32 end = SDL_GetTicks(); - vsync_enabled = 1; - if (average > 27 && average < 33) { + const float average = 4.0 * 1000.0 / (end - start); + + if (average > 27.0f && average < 33.0f) return 1; + if (average > 57.0f && average < 63.0f) return 2; + if (average > 86.0f && average < 94.0f) return 3; + if (average > 115.0f && average < 125.0f) return 4; + if (average > 234.0f && average < 246.0f) return 8; + + return 0; +} + +static inline void gfx_sdl_set_vsync(const bool enabled) { + if (enabled) { + // try to detect refresh rate SDL_GL_SetSwapInterval(1); - } else if (average > 57 && average < 63) { - SDL_GL_SetSwapInterval(2); - } else if (average > 86 && average < 94) { - SDL_GL_SetSwapInterval(3); - } else if (average > 115 && average < 125) { - SDL_GL_SetSwapInterval(4); + const int vblanks = test_vsync(); + if (vblanks) { + printf("determined swap interval: %d\n", vblanks); + SDL_GL_SetSwapInterval(vblanks); + use_timer = false; + return; + } else { + printf("could not determine swap interval, falling back to timer sync\n"); + } + } + + use_timer = true; + SDL_GL_SetSwapInterval(0); +} + +static void gfx_sdl_set_fullscreen(void) { + if (configWindow.reset) + configWindow.fullscreen = false; + if (configWindow.fullscreen == IS_FULLSCREEN()) + return; + if (configWindow.fullscreen) { + SDL_SetWindowFullscreen(wnd, SDL_WINDOW_FULLSCREEN_DESKTOP); + SDL_ShowCursor(SDL_DISABLE); } else { - vsync_enabled = 0; + SDL_SetWindowFullscreen(wnd, 0); + SDL_ShowCursor(SDL_ENABLE); + configWindow.exiting_fullscreen = true; } } -static void gfx_sdl_init(const char *game_name, bool start_in_fullscreen) { +static void gfx_sdl_reset_dimension_and_pos(void) { + if (configWindow.exiting_fullscreen) + configWindow.exiting_fullscreen = false; + + if (configWindow.reset) { + configWindow.x = WAPI_WIN_CENTERPOS; + configWindow.y = WAPI_WIN_CENTERPOS; + configWindow.w = DESIRED_SCREEN_WIDTH; + configWindow.h = DESIRED_SCREEN_HEIGHT; + configWindow.reset = false; + } else if (!configWindow.settings_changed) { + return; + } + + int xpos = (configWindow.x == WAPI_WIN_CENTERPOS) ? SDL_WINDOWPOS_CENTERED : configWindow.x; + int ypos = (configWindow.y == WAPI_WIN_CENTERPOS) ? SDL_WINDOWPOS_CENTERED : configWindow.y; + + SDL_SetWindowSize(wnd, configWindow.w, configWindow.h); + SDL_SetWindowPosition(wnd, xpos, ypos); + // in case vsync changed + gfx_sdl_set_vsync(configWindow.vsync); +} + +static void gfx_sdl_init(const char *window_title) { SDL_Init(SDL_INIT_VIDEO); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + #ifdef USE_GLES + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); // These attributes allow for hardware acceleration on RPis. + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES); + #endif + //SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); //SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4); - char title[512]; - int len = sprintf(title, "%s (%s)", game_name, GFX_API_NAME); + int xpos = (configWindow.x == WAPI_WIN_CENTERPOS) ? SDL_WINDOWPOS_CENTERED : configWindow.x; + int ypos = (configWindow.y == WAPI_WIN_CENTERPOS) ? SDL_WINDOWPOS_CENTERED : configWindow.y; - wnd = SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, - window_width, window_height, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE); + wnd = SDL_CreateWindow( + window_title, + xpos, ypos, configWindow.w, configWindow.h, + SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE + ); + ctx = SDL_GL_CreateContext(wnd); - if (start_in_fullscreen) { - set_fullscreen(true, false); - } + gfx_sdl_set_vsync(configWindow.vsync); - SDL_GL_CreateContext(wnd); - - SDL_GL_SetSwapInterval(1); - test_vsync(); - if (!vsync_enabled) - puts("Warning: VSync is not enabled or not working. Falling back to timer for synchronization"); + gfx_sdl_set_fullscreen(); for (size_t i = 0; i < sizeof(windows_scancode_table) / sizeof(SDL_Scancode); i++) { inverted_scancode_table[windows_scancode_table[i]] = i; @@ -185,34 +233,20 @@ static void gfx_sdl_init(const char *game_name, bool start_in_fullscreen) { } for (size_t i = 0; i < sizeof(scancode_rmapping_nonextended) / sizeof(scancode_rmapping_nonextended[0]); i++) { - inverted_scancode_table[scancode_rmapping_extended[i][0]] = inverted_scancode_table[scancode_rmapping_extended[i][1]]; - inverted_scancode_table[scancode_rmapping_extended[i][1]] += 0x100; + inverted_scancode_table[scancode_rmapping_nonextended[i][0]] = inverted_scancode_table[scancode_rmapping_nonextended[i][1]]; + inverted_scancode_table[scancode_rmapping_nonextended[i][1]] += 0x100; } } -static void gfx_sdl_set_fullscreen_changed_callback(void (*on_fullscreen_changed)(bool is_now_fullscreen)) { - on_fullscreen_changed_callback = on_fullscreen_changed; -} - -static void gfx_sdl_set_fullscreen(bool enable) { - set_fullscreen(enable, true); -} - -static void gfx_sdl_set_keyboard_callbacks(bool (*on_key_down)(int scancode), bool (*on_key_up)(int scancode), void (*on_all_keys_up)(void)) { - on_key_down_callback = on_key_down; - on_key_up_callback = on_key_up; - on_all_keys_up_callback = on_all_keys_up; -} - static void gfx_sdl_main_loop(void (*run_one_game_iter)(void)) { - while (1) { - run_one_game_iter(); - } + run_one_game_iter(); } static void gfx_sdl_get_dimensions(uint32_t *width, uint32_t *height) { - *width = window_width; - *height = window_height; + int w, h; + SDL_GetWindowSize(wnd, &w, &h); + if (width) *width = w; + if (height) *height = h; } static int translate_scancode(int scancode) { @@ -224,17 +258,20 @@ static int translate_scancode(int scancode) { } static void gfx_sdl_onkeydown(int scancode) { - int key = translate_scancode(scancode); - if (on_key_down_callback != NULL) { - on_key_down_callback(key); + if (kb_key_down) + kb_key_down(translate_scancode(scancode)); + + const Uint8 *state = SDL_GetKeyboardState(NULL); + + if (state[SDL_SCANCODE_LALT] && state[SDL_SCANCODE_RETURN]) { + configWindow.fullscreen = !configWindow.fullscreen; + configWindow.settings_changed = true; } } static void gfx_sdl_onkeyup(int scancode) { - int key = translate_scancode(scancode); - if (on_key_up_callback != NULL) { - on_key_up_callback(key); - } + if (kb_key_up) + kb_key_up(translate_scancode(scancode)); } static void gfx_sdl_handle_events(void) { @@ -244,48 +281,63 @@ static void gfx_sdl_handle_events(void) { #ifndef TARGET_WEB // Scancodes are broken in Emscripten SDL2: https://bugzilla.libsdl.org/show_bug.cgi?id=3259 case SDL_KEYDOWN: - if (event.key.keysym.sym == SDLK_F10) { - set_fullscreen(!fullscreen_state, true); - break; - } gfx_sdl_onkeydown(event.key.keysym.scancode); break; case SDL_KEYUP: gfx_sdl_onkeyup(event.key.keysym.scancode); break; #endif - case SDL_WINDOWEVENT: - if (event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) { - window_width = event.window.data1; - window_height = event.window.data2; + case SDL_WINDOWEVENT: // TODO: Check if this makes sense to be included in the Web build + if (!IS_FULLSCREEN()) { + switch (event.window.event) { + case SDL_WINDOWEVENT_MOVED: + if (!configWindow.exiting_fullscreen) { + if (event.window.data1 >= 0) configWindow.x = event.window.data1; + if (event.window.data2 >= 0) configWindow.y = event.window.data2; + } + break; + case SDL_WINDOWEVENT_SIZE_CHANGED: + configWindow.w = event.window.data1; + configWindow.h = event.window.data2; + break; + } } break; case SDL_QUIT: - exit(0); + game_exit(); + break; } } + + if (configWindow.settings_changed) { + gfx_sdl_set_fullscreen(); + gfx_sdl_reset_dimension_and_pos(); + configWindow.settings_changed = false; + } +} + +static void gfx_sdl_set_keyboard_callbacks(kb_callback_t on_key_down, kb_callback_t on_key_up, void (*on_all_keys_up)(void)) { + kb_key_down = on_key_down; + kb_key_up = on_key_up; + kb_all_keys_up = on_all_keys_up; } static bool gfx_sdl_start_frame(void) { return true; } -static void sync_framerate_with_timer(void) { - // Number of milliseconds a frame should take (30 fps) - const Uint32 FRAME_TIME = 1000 / 30; - static Uint32 last_time; - Uint32 elapsed = SDL_GetTicks() - last_time; - - if (elapsed < FRAME_TIME) - SDL_Delay(FRAME_TIME - elapsed); - last_time += FRAME_TIME; +static inline void sync_framerate_with_timer(void) { + static Uint32 last_time = 0; + // get base timestamp on the first frame (might be different from 0) + if (last_time == 0) last_time = SDL_GetTicks(); + const int elapsed = SDL_GetTicks() - last_time; + if (elapsed < frame_time) + SDL_Delay(frame_time - elapsed); + last_time += frame_time; } static void gfx_sdl_swap_buffers_begin(void) { - if (!vsync_enabled) { - sync_framerate_with_timer(); - } - + if (use_timer) sync_framerate_with_timer(); SDL_GL_SwapWindow(wnd); } @@ -296,18 +348,26 @@ static double gfx_sdl_get_time(void) { return 0.0; } + +static void gfx_sdl_shutdown(void) { + if (SDL_WasInit(0)) { + if (ctx) { SDL_GL_DeleteContext(ctx); ctx = NULL; } + if (wnd) { SDL_DestroyWindow(wnd); wnd = NULL; } + SDL_Quit(); + } +} + struct GfxWindowManagerAPI gfx_sdl = { gfx_sdl_init, gfx_sdl_set_keyboard_callbacks, - gfx_sdl_set_fullscreen_changed_callback, - gfx_sdl_set_fullscreen, gfx_sdl_main_loop, gfx_sdl_get_dimensions, gfx_sdl_handle_events, gfx_sdl_start_frame, gfx_sdl_swap_buffers_begin, gfx_sdl_swap_buffers_end, - gfx_sdl_get_time + gfx_sdl_get_time, + gfx_sdl_shutdown }; -#endif +#endif // BACKEND_WM diff --git a/src/pc/gfx/gfx_window_manager_api.h b/src/pc/gfx/gfx_window_manager_api.h index 6ba4a2d8..67ce5d1a 100644 --- a/src/pc/gfx/gfx_window_manager_api.h +++ b/src/pc/gfx/gfx_window_manager_api.h @@ -4,11 +4,14 @@ #include #include +// special value for window position that signifies centered position +#define WAPI_WIN_CENTERPOS 0xFFFFFFFF + +typedef bool (*kb_callback_t)(int code); + struct GfxWindowManagerAPI { - void (*init)(const char *game_name, bool start_in_fullscreen); - void (*set_keyboard_callbacks)(bool (*on_key_down)(int scancode), bool (*on_key_up)(int scancode), void (*on_all_keys_up)(void)); - void (*set_fullscreen_changed_callback)(void (*on_fullscreen_changed)(bool is_now_fullscreen)); - void (*set_fullscreen)(bool enable); + void (*init)(const char *window_title); + void (*set_keyboard_callbacks)(kb_callback_t on_key_down, kb_callback_t on_key_up, void (*on_all_keys_up)(void)); void (*main_loop)(void (*run_one_game_iter)(void)); void (*get_dimensions)(uint32_t *width, uint32_t *height); void (*handle_events)(void); @@ -16,6 +19,7 @@ struct GfxWindowManagerAPI { void (*swap_buffers_begin)(void); void (*swap_buffers_end)(void); double (*get_time)(void); // For debug + void (*shutdown)(void); }; #endif diff --git a/src/pc/ini.c b/src/pc/ini.c new file mode 100644 index 00000000..e8f1aecf --- /dev/null +++ b/src/pc/ini.c @@ -0,0 +1,275 @@ +/** + * Copyright (c) 2016 rxi + * + * 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 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include +#include +#include +#include "ini.h" + +/* Case insensitive string compare */ +static int strcmpci(const char *a, const char *b) { + for (;;) { + int d = tolower(*a) - tolower(*b); + if (d != 0 || !*a) { + return d; + } + a++, b++; + } +} + +/* Returns the next string in the split data */ +static char* next(ini_t *ini, char *p) { + p += strlen(p); + while (p < ini->end && *p == '\0') { + p++; + } + return p; +} + +static void trim_back(ini_t *ini, char *p) { + while (p >= ini->data && (*p == ' ' || *p == '\t' || *p == '\r')) { + *p-- = '\0'; + } +} + +static char* discard_line(ini_t *ini, char *p) { + while (p < ini->end && *p != '\n') { + *p++ = '\0'; + } + return p; +} + +static char *unescape_quoted_value(ini_t *ini, char *p) { + /* Use `q` as write-head and `p` as read-head, `p` is always ahead of `q` + * as escape sequences are always larger than their resultant data */ + char *q = p; + p++; + while (p < ini->end && *p != '"' && *p != '\r' && *p != '\n') { + if (*p == '\\') { + /* Handle escaped char */ + p++; + switch (*p) { + default : *q = *p; break; + case 'r' : *q = '\r'; break; + case 'n' : *q = '\n'; break; + case 't' : *q = '\t'; break; + case '\r' : + case '\n' : + case '\0' : goto end; + } + + } else { + /* Handle normal char */ + *q = *p; + } + q++, p++; + } +end: + return q; +} + +/* Splits data in place into strings containing section-headers, keys and + * values using one or more '\0' as a delimiter. Unescapes quoted values */ +static void split_data(ini_t *ini) { + char *value_start, *line_start; + char *p = ini->data; + + while (p < ini->end) { + switch (*p) { + case '\r': + case '\n': + case '\t': + case ' ': + *p = '\0'; + /* Fall through */ + + case '\0': + p++; + break; + + case '[': + p += strcspn(p, "]\n"); + *p = '\0'; + break; + + case ';': + p = discard_line(ini, p); + break; + + default: + line_start = p; + p += strcspn(p, "=\n"); + + /* Is line missing a '='? */ + if (*p != '=') { + p = discard_line(ini, line_start); + break; + } + trim_back(ini, p - 1); + + /* Replace '=' and whitespace after it with '\0' */ + do { + *p++ = '\0'; + } while (*p == ' ' || *p == '\r' || *p == '\t'); + + /* Is a value after '=' missing? */ + if (*p == '\n' || *p == '\0') { + p = discard_line(ini, line_start); + break; + } + + if (*p == '"') { + /* Handle quoted string value */ + value_start = p; + p = unescape_quoted_value(ini, p); + + /* Was the string empty? */ + if (p == value_start) { + p = discard_line(ini, line_start); + break; + } + + /* Discard the rest of the line after the string value */ + p = discard_line(ini, p); + + } else { + /* Handle normal value */ + p += strcspn(p, "\n"); + trim_back(ini, p - 1); + } + break; + } + } +} + +/** + * Loads data from specified path. + * @return ini_t struct with loaded data. + */ +ini_t* ini_load(const char *filename) { + ini_t *ini = NULL; + FILE *fp = NULL; + int n, sz; + + /* Init ini struct */ + ini = malloc(sizeof(*ini)); + if (!ini) { + goto fail; + } + memset(ini, 0, sizeof(*ini)); + + /* Open file */ + fp = fopen(filename, "rb"); + if (!fp) { + goto fail; + } + + /* Get file size */ + fseek(fp, 0, SEEK_END); + sz = ftell(fp); + rewind(fp); + + /* Load file content into memory, null terminate, init end var */ + ini->data = malloc(sz + 1); + ini->data[sz] = '\0'; + ini->end = ini->data + sz; + n = fread(ini->data, 1, sz, fp); + if (n != sz) { + goto fail; + } + + /* Prepare data */ + split_data(ini); + + /* Clean up and return */ + fclose(fp); + return ini; + +fail: + if (fp) fclose(fp); + if (ini) ini_free(ini); + return NULL; +} + +/** + * Deletes ini_t struct from memory. + */ +void ini_free(ini_t *ini) { + free(ini->data); + free(ini); +} + +/** + * Gets value by specified key and section. + * @return string with the key. + */ +const char* ini_get(ini_t *ini, const char *section, const char *key) { + char *current_section = ""; + char *val; + char *p = ini->data; + + if (*p == '\0') { + p = next(ini, p); + } + + while (p < ini->end) { + if (*p == '[') { + /* Handle section */ + current_section = p + 1; + + } else { + /* Handle key */ + val = next(ini, p); + if (!section || !strcmpci(section, current_section)) { + if (!strcmpci(p, key)) { + return val; + } + } + p = val; + } + + p = next(ini, p); + } + + return NULL; +} + +/** + * Gets value by specified key, section and format string. + * @return a value specified in the format in `dst`. + */ +int ini_sget( + ini_t *ini, const char *section, const char *key, + const char *scanfmt, void *dst +) { + const char *val = ini_get(ini, section, key); + if (!val) { + return 0; + } + if (scanfmt) { + sscanf(val, scanfmt, dst); + } else { + *((const char**) dst) = val; + } + return 1; +} diff --git a/src/pc/ini.h b/src/pc/ini.h new file mode 100644 index 00000000..ca5b89bb --- /dev/null +++ b/src/pc/ini.h @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2016 rxi + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the MIT license. See `ini.c` for details. + */ + +#ifndef INI_H +#define INI_H + +#define INI_VERSION "0.1.1" + +typedef struct ini_t ini_t; + +struct ini_t { + char *data; + char *end; +}; + +ini_t* ini_load(const char *filename); +void ini_free(ini_t *ini); +const char* ini_get(ini_t *ini, const char *section, const char *key); +int ini_sget(ini_t *ini, const char *section, const char *key, const char *scanfmt, void *dst); + +#endif \ No newline at end of file diff --git a/src/pc/mixer.c b/src/pc/mixer.c index 718517a2..282aef9f 100644 --- a/src/pc/mixer.c +++ b/src/pc/mixer.c @@ -53,70 +53,38 @@ static struct { } rspa; static int16_t resample_table[64][4] = { - {0x0c39, 0x66ad, 0x0d46, (int16_t)0xffdf}, - {0x0b39, 0x6696, 0x0e5f, (int16_t)0xffd8}, - {0x0a44, 0x6669, 0x0f83, (int16_t)0xffd0}, - {0x095a, 0x6626, 0x10b4, (int16_t)0xffc8}, - {0x087d, 0x65cd, 0x11f0, (int16_t)0xffbf}, - {0x07ab, 0x655e, 0x1338, (int16_t)0xffb6}, - {0x06e4, 0x64d9, 0x148c, (int16_t)0xffac}, - {0x0628, 0x643f, 0x15eb, (int16_t)0xffa1}, - {0x0577, 0x638f, 0x1756, (int16_t)0xff96}, - {0x04d1, 0x62cb, 0x18cb, (int16_t)0xff8a}, - {0x0435, 0x61f3, 0x1a4c, (int16_t)0xff7e}, - {0x03a4, 0x6106, 0x1bd7, (int16_t)0xff71}, - {0x031c, 0x6007, 0x1d6c, (int16_t)0xff64}, - {0x029f, 0x5ef5, 0x1f0b, (int16_t)0xff56}, - {0x022a, 0x5dd0, 0x20b3, (int16_t)0xff48}, - {0x01be, 0x5c9a, 0x2264, (int16_t)0xff3a}, - {0x015b, 0x5b53, 0x241e, (int16_t)0xff2c}, - {0x0101, 0x59fc, 0x25e0, (int16_t)0xff1e}, - {0x00ae, 0x5896, 0x27a9, (int16_t)0xff10}, - {0x0063, 0x5720, 0x297a, (int16_t)0xff02}, - {0x001f, 0x559d, 0x2b50, (int16_t)0xfef4}, - {(int16_t)0xffe2, 0x540d, 0x2d2c, (int16_t)0xfee8}, - {(int16_t)0xffac, 0x5270, 0x2f0d, (int16_t)0xfedb}, - {(int16_t)0xff7c, 0x50c7, 0x30f3, (int16_t)0xfed0}, - {(int16_t)0xff53, 0x4f14, 0x32dc, (int16_t)0xfec6}, - {(int16_t)0xff2e, 0x4d57, 0x34c8, (int16_t)0xfebd}, - {(int16_t)0xff0f, 0x4b91, 0x36b6, (int16_t)0xfeb6}, - {(int16_t)0xfef5, 0x49c2, 0x38a5, (int16_t)0xfeb0}, - {(int16_t)0xfedf, 0x47ed, 0x3a95, (int16_t)0xfeac}, - {(int16_t)0xfece, 0x4611, 0x3c85, (int16_t)0xfeab}, - {(int16_t)0xfec0, 0x4430, 0x3e74, (int16_t)0xfeac}, - {(int16_t)0xfeb6, 0x424a, 0x4060, (int16_t)0xfeaf}, - {(int16_t)0xfeaf, 0x4060, 0x424a, (int16_t)0xfeb6}, - {(int16_t)0xfeac, 0x3e74, 0x4430, (int16_t)0xfec0}, - {(int16_t)0xfeab, 0x3c85, 0x4611, (int16_t)0xfece}, - {(int16_t)0xfeac, 0x3a95, 0x47ed, (int16_t)0xfedf}, - {(int16_t)0xfeb0, 0x38a5, 0x49c2, (int16_t)0xfef5}, - {(int16_t)0xfeb6, 0x36b6, 0x4b91, (int16_t)0xff0f}, - {(int16_t)0xfebd, 0x34c8, 0x4d57, (int16_t)0xff2e}, - {(int16_t)0xfec6, 0x32dc, 0x4f14, (int16_t)0xff53}, - {(int16_t)0xfed0, 0x30f3, 0x50c7, (int16_t)0xff7c}, - {(int16_t)0xfedb, 0x2f0d, 0x5270, (int16_t)0xffac}, - {(int16_t)0xfee8, 0x2d2c, 0x540d, (int16_t)0xffe2}, - {(int16_t)0xfef4, 0x2b50, 0x559d, 0x001f}, - {(int16_t)0xff02, 0x297a, 0x5720, 0x0063}, - {(int16_t)0xff10, 0x27a9, 0x5896, 0x00ae}, - {(int16_t)0xff1e, 0x25e0, 0x59fc, 0x0101}, - {(int16_t)0xff2c, 0x241e, 0x5b53, 0x015b}, - {(int16_t)0xff3a, 0x2264, 0x5c9a, 0x01be}, - {(int16_t)0xff48, 0x20b3, 0x5dd0, 0x022a}, - {(int16_t)0xff56, 0x1f0b, 0x5ef5, 0x029f}, - {(int16_t)0xff64, 0x1d6c, 0x6007, 0x031c}, - {(int16_t)0xff71, 0x1bd7, 0x6106, 0x03a4}, - {(int16_t)0xff7e, 0x1a4c, 0x61f3, 0x0435}, - {(int16_t)0xff8a, 0x18cb, 0x62cb, 0x04d1}, - {(int16_t)0xff96, 0x1756, 0x638f, 0x0577}, - {(int16_t)0xffa1, 0x15eb, 0x643f, 0x0628}, - {(int16_t)0xffac, 0x148c, 0x64d9, 0x06e4}, - {(int16_t)0xffb6, 0x1338, 0x655e, 0x07ab}, - {(int16_t)0xffbf, 0x11f0, 0x65cd, 0x087d}, - {(int16_t)0xffc8, 0x10b4, 0x6626, 0x095a}, - {(int16_t)0xffd0, 0x0f83, 0x6669, 0x0a44}, - {(int16_t)0xffd8, 0x0e5f, 0x6696, 0x0b39}, - {(int16_t)0xffdf, 0x0d46, 0x66ad, 0x0c39} + {0x0c39, 0x66ad, 0x0d46, 0xffdf}, {0x0b39, 0x6696, 0x0e5f, 0xffd8}, + {0x0a44, 0x6669, 0x0f83, 0xffd0}, {0x095a, 0x6626, 0x10b4, 0xffc8}, + {0x087d, 0x65cd, 0x11f0, 0xffbf}, {0x07ab, 0x655e, 0x1338, 0xffb6}, + {0x06e4, 0x64d9, 0x148c, 0xffac}, {0x0628, 0x643f, 0x15eb, 0xffa1}, + {0x0577, 0x638f, 0x1756, 0xff96}, {0x04d1, 0x62cb, 0x18cb, 0xff8a}, + {0x0435, 0x61f3, 0x1a4c, 0xff7e}, {0x03a4, 0x6106, 0x1bd7, 0xff71}, + {0x031c, 0x6007, 0x1d6c, 0xff64}, {0x029f, 0x5ef5, 0x1f0b, 0xff56}, + {0x022a, 0x5dd0, 0x20b3, 0xff48}, {0x01be, 0x5c9a, 0x2264, 0xff3a}, + {0x015b, 0x5b53, 0x241e, 0xff2c}, {0x0101, 0x59fc, 0x25e0, 0xff1e}, + {0x00ae, 0x5896, 0x27a9, 0xff10}, {0x0063, 0x5720, 0x297a, 0xff02}, + {0x001f, 0x559d, 0x2b50, 0xfef4}, {0xffe2, 0x540d, 0x2d2c, 0xfee8}, + {0xffac, 0x5270, 0x2f0d, 0xfedb}, {0xff7c, 0x50c7, 0x30f3, 0xfed0}, + {0xff53, 0x4f14, 0x32dc, 0xfec6}, {0xff2e, 0x4d57, 0x34c8, 0xfebd}, + {0xff0f, 0x4b91, 0x36b6, 0xfeb6}, {0xfef5, 0x49c2, 0x38a5, 0xfeb0}, + {0xfedf, 0x47ed, 0x3a95, 0xfeac}, {0xfece, 0x4611, 0x3c85, 0xfeab}, + {0xfec0, 0x4430, 0x3e74, 0xfeac}, {0xfeb6, 0x424a, 0x4060, 0xfeaf}, + {0xfeaf, 0x4060, 0x424a, 0xfeb6}, {0xfeac, 0x3e74, 0x4430, 0xfec0}, + {0xfeab, 0x3c85, 0x4611, 0xfece}, {0xfeac, 0x3a95, 0x47ed, 0xfedf}, + {0xfeb0, 0x38a5, 0x49c2, 0xfef5}, {0xfeb6, 0x36b6, 0x4b91, 0xff0f}, + {0xfebd, 0x34c8, 0x4d57, 0xff2e}, {0xfec6, 0x32dc, 0x4f14, 0xff53}, + {0xfed0, 0x30f3, 0x50c7, 0xff7c}, {0xfedb, 0x2f0d, 0x5270, 0xffac}, + {0xfee8, 0x2d2c, 0x540d, 0xffe2}, {0xfef4, 0x2b50, 0x559d, 0x001f}, + {0xff02, 0x297a, 0x5720, 0x0063}, {0xff10, 0x27a9, 0x5896, 0x00ae}, + {0xff1e, 0x25e0, 0x59fc, 0x0101}, {0xff2c, 0x241e, 0x5b53, 0x015b}, + {0xff3a, 0x2264, 0x5c9a, 0x01be}, {0xff48, 0x20b3, 0x5dd0, 0x022a}, + {0xff56, 0x1f0b, 0x5ef5, 0x029f}, {0xff64, 0x1d6c, 0x6007, 0x031c}, + {0xff71, 0x1bd7, 0x6106, 0x03a4}, {0xff7e, 0x1a4c, 0x61f3, 0x0435}, + {0xff8a, 0x18cb, 0x62cb, 0x04d1}, {0xff96, 0x1756, 0x638f, 0x0577}, + {0xffa1, 0x15eb, 0x643f, 0x0628}, {0xffac, 0x148c, 0x64d9, 0x06e4}, + {0xffb6, 0x1338, 0x655e, 0x07ab}, {0xffbf, 0x11f0, 0x65cd, 0x087d}, + {0xffc8, 0x10b4, 0x6626, 0x095a}, {0xffd0, 0x0f83, 0x6669, 0x0a44}, + {0xffd8, 0x0e5f, 0x6696, 0x0b39}, {0xffdf, 0x0d46, 0x66ad, 0x0c39} }; static inline int16_t clamp16(int32_t v) { diff --git a/src/pc/mixer.h b/src/pc/mixer.h index 13049061..6b55c4f9 100644 --- a/src/pc/mixer.h +++ b/src/pc/mixer.h @@ -37,17 +37,17 @@ void aMixImpl(int16_t gain, uint16_t in_addr, uint16_t out_addr); #define aSegment(pkt, s, b) do { } while(0) #define aClearBuffer(pkt, d, c) aClearBufferImpl(d, c) #define aLoadBuffer(pkt, s) aLoadBufferImpl(s) -#define aSaveBuffer(pkt, s) aSaveBufferImpl((int16_t*) s) -#define aLoadADPCM(pkt, c, d) aLoadADPCMImpl(c, (const int16_t*) d) +#define aSaveBuffer(pkt, s) aSaveBufferImpl(s) +#define aLoadADPCM(pkt, c, d) aLoadADPCMImpl(c, d) #define aSetBuffer(pkt, f, i, o, c) aSetBufferImpl(f, i, o, c) #define aSetVolume(pkt, f, v, t, r) aSetVolumeImpl(f, v, t, r) #define aSetVolume32(pkt, f, v, tr) aSetVolume(pkt, f, v, (int16_t)((tr) >> 16), (int16_t)(tr)) #define aInterleave(pkt, l, r) aInterleaveImpl(l, r) #define aDMEMMove(pkt, i, o, c) aDMEMMoveImpl(i, o, c) -#define aSetLoop(pkt, a) aSetLoopImpl((short(*)[16]) a) -#define aADPCMdec(pkt, f, s) aADPCMdecImpl(f, (short*) s) -#define aResample(pkt, f, p, s) aResampleImpl(f, p, (short*) s) -#define aEnvMixer(pkt, f, s) aEnvMixerImpl(f, (short*) s) +#define aSetLoop(pkt, a) aSetLoopImpl(a) +#define aADPCMdec(pkt, f, s) aADPCMdecImpl(f, s) +#define aResample(pkt, f, p, s) aResampleImpl(f, p, s) +#define aEnvMixer(pkt, f, s) aEnvMixerImpl(f, s) #define aMix(pkt, f, g, i, o) aMixImpl(g, i, o) #endif diff --git a/src/pc/pc_main.c b/src/pc/pc_main.c index 4fb25fa2..b1c6f6e3 100644 --- a/src/pc/pc_main.c +++ b/src/pc/pc_main.c @@ -1,4 +1,5 @@ #include +#include #ifdef TARGET_WEB #include @@ -11,25 +12,32 @@ #include "audio/external.h" #include "gfx/gfx_pc.h" + #include "gfx/gfx_opengl.h" #include "gfx/gfx_direct3d11.h" #include "gfx/gfx_direct3d12.h" + #include "gfx/gfx_dxgi.h" -#include "gfx/gfx_glx.h" #include "gfx/gfx_sdl.h" #include "audio/audio_api.h" -#include "audio/audio_wasapi.h" -#include "audio/audio_pulse.h" -#include "audio/audio_alsa.h" #include "audio/audio_sdl.h" #include "audio/audio_null.h" -#include "controller/controller_keyboard.h" - +#include "pc_main.h" +#include "cliopts.h" #include "configfile.h" +#include "controller/controller_api.h" +#include "controller/controller_keyboard.h" +#include "fs/fs.h" -#define CONFIG_FILE "sm64config.txt" +#include "game/game_init.h" +#include "game/main.h" +#include "game/thread6.h" + +#ifdef DISCORDRPC +#include "pc/discord/discordrpc.h" +#endif OSMesg D_80339BEC; OSMesgQueue gSIEventMesgQueue; @@ -40,6 +48,10 @@ s8 gDebugLevelSelect; s8 gShowProfiler; s8 gShowDebugText; +s32 gRumblePakPfs; +struct RumbleData gRumbleDataQueue[3]; +struct StructSH8031D9B0 gCurrRumbleSettings; + static struct AudioAPI *audio_api; static struct GfxWindowManagerAPI *wm_api; static struct GfxRenderingAPI *rendering_api; @@ -49,24 +61,20 @@ extern void thread5_game_loop(void *arg); extern void create_next_audio_buffer(s16 *samples, u32 num_samples); void game_loop_one_iteration(void); -void dispatch_audio_sptask(UNUSED struct SPTask *spTask) { +void dispatch_audio_sptask(struct SPTask *spTask) { } -void set_vblank_handler(UNUSED s32 index, UNUSED struct VblankHandler *handler, UNUSED OSMesgQueue *queue, UNUSED OSMesg *msg) { +void set_vblank_handler(s32 index, struct VblankHandler *handler, OSMesgQueue *queue, OSMesg *msg) { } -static uint8_t inited = 0; +static bool inited = false; -#include "game/game_init.h" // for gGlobalTimer +#include "game/display.h" // for gGlobalTimer void send_display_list(struct SPTask *spTask) { - if (!inited) { - return; - } + if (!inited) return; gfx_run((Gfx *)spTask->task.t.data_ptr); } -#define printf - #ifdef VERSION_EU #define SAMPLES_HIGH 656 #define SAMPLES_LOW 640 @@ -77,8 +85,15 @@ void send_display_list(struct SPTask *spTask) { void produce_one_frame(void) { gfx_start_frame(); + + const f32 master_mod = (f32)configMasterVolume / 127.0f; + set_sequence_player_volume(SEQ_PLAYER_LEVEL, (f32)configMusicVolume / 127.0f * master_mod); + set_sequence_player_volume(SEQ_PLAYER_SFX, (f32)configSfxVolume / 127.0f * master_mod); + set_sequence_player_volume(SEQ_PLAYER_ENV, (f32)configEnvVolume / 127.0f * master_mod); + game_loop_one_iteration(); - + thread6_rumble_loop(NULL); + int samples_left = audio_api->buffered(); u32 num_audio_samples = samples_left < audio_api->get_desired_buffered() ? SAMPLES_HIGH : SAMPLES_LOW; //printf("Audio samples: %d %u\n", samples_left, num_audio_samples); @@ -91,11 +106,37 @@ void produce_one_frame(void) { create_next_audio_buffer(audio_buffer + i * (num_audio_samples * 2), num_audio_samples); } //printf("Audio samples before submitting: %d\n", audio_api->buffered()); + audio_api->play((u8 *)audio_buffer, 2 * num_audio_samples * 4); - + gfx_end_frame(); } +void audio_shutdown(void) { + if (audio_api) { + if (audio_api->shutdown) audio_api->shutdown(); + audio_api = NULL; + } +} + +void game_deinit(void) { +#ifdef DISCORDRPC + discord_shutdown(); +#endif + configfile_save(configfile_name()); + controller_shutdown(); + audio_shutdown(); + gfx_shutdown(); + inited = false; +} + +void game_exit(void) { + game_deinit(); +#ifndef TARGET_WEB + exit(0); +#endif +} + #ifdef TARGET_WEB static void em_main_loop(void) { } @@ -125,71 +166,75 @@ static void on_anim_frame(double time) { } } - request_anim_frame(on_anim_frame); + if (inited) // only continue if the init flag is still set + request_anim_frame(on_anim_frame); } #endif -static void save_config(void) { - configfile_save(CONFIG_FILE); -} -static void on_fullscreen_changed(bool is_now_fullscreen) { - configFullscreen = is_now_fullscreen; +#ifdef RMODERN +#include "rmodern/rmodern.h" +void main_func(void) +{ + rmodern_init(); } - +#else void main_func(void) { static u64 pool[0x165000/8 / 4 * sizeof(void *)]; main_pool_init(pool, pool + sizeof(pool) / sizeof(pool[0])); gEffectsMemoryPool = mem_pool_init(0x4000, MEMORY_POOL_LEFT); - configfile_load(CONFIG_FILE); - atexit(save_config); + const char *gamedir = gCLIOpts.GameDir[0] ? gCLIOpts.GameDir : FS_BASEDIR; + const char *userpath = gCLIOpts.SavePath[0] ? gCLIOpts.SavePath : sys_user_path(); + fs_init(sys_ropaths, gamedir, userpath); -#ifdef TARGET_WEB - emscripten_set_main_loop(em_main_loop, 0, 0); - request_anim_frame(on_anim_frame); -#endif + configfile_load(configfile_name()); -#if defined(ENABLE_DX12) - rendering_api = &gfx_direct3d12_api; - wm_api = &gfx_dxgi_api; -#elif defined(ENABLE_DX11) - rendering_api = &gfx_direct3d11_api; - wm_api = &gfx_dxgi_api; -#elif defined(ENABLE_OPENGL) - rendering_api = &gfx_opengl_api; - #if defined(__linux__) - wm_api = &gfx_glx; + if (gCLIOpts.FullScreen == 1) + configWindow.fullscreen = true; + else if (gCLIOpts.FullScreen == 2) + configWindow.fullscreen = false; + + #if defined(WAPI_SDL1) || defined(WAPI_SDL2) + wm_api = &gfx_sdl; + #elif defined(WAPI_DXGI) + wm_api = &gfx_dxgi; #else - wm_api = &gfx_sdl; + #error No window API! #endif -#endif - gfx_init(wm_api, rendering_api, "Super Mario 64 PC-Port", configFullscreen); - - wm_api->set_fullscreen_changed_callback(on_fullscreen_changed); + #if defined(RAPI_D3D11) + rendering_api = &gfx_direct3d11_api; + # define RAPI_NAME "DirectX 11" + #elif defined(RAPI_D3D12) + rendering_api = &gfx_direct3d12_api; + # define RAPI_NAME "DirectX 12" + #elif defined(RAPI_GL) || defined(RAPI_GL_LEGACY) + rendering_api = &gfx_opengl_api; + # ifdef USE_GLES + # define RAPI_NAME "OpenGL ES" + # else + # define RAPI_NAME "OpenGL" + # endif + #else + #error No rendering API! + #endif + + char window_title[96] = + "Super Mario 64 Render96ex (" RAPI_NAME ")" + #ifdef NIGHTLY + " nightly " GIT_HASH + #else + " " GIT_HASH + #endif + ; + + gfx_init(wm_api, rendering_api, window_title); wm_api->set_keyboard_callbacks(keyboard_on_key_down, keyboard_on_key_up, keyboard_on_all_keys_up); - -#if HAVE_WASAPI - if (audio_api == NULL && audio_wasapi.init()) { - audio_api = &audio_wasapi; - } -#endif -#if HAVE_PULSE_AUDIO - if (audio_api == NULL && audio_pulse.init()) { - audio_api = &audio_pulse; - } -#endif -#if HAVE_ALSA - if (audio_api == NULL && audio_alsa.init()) { - audio_api = &audio_alsa; - } -#endif -#ifdef TARGET_WEB - if (audio_api == NULL && audio_sdl.init()) { + + if (audio_api == NULL && audio_sdl.init()) audio_api = &audio_sdl; - } -#endif + if (audio_api == NULL) { audio_api = &audio_null; } @@ -198,28 +243,38 @@ void main_func(void) { sound_init(); thread5_game_loop(NULL); + + inited = true; + +#ifdef EXTERNAL_DATA + // precache data if needed + if (configPrecacheRes) { + fprintf(stdout, "precaching data\n"); + fflush(stdout); + gfx_precache_textures(); + } +#endif + +#ifdef DISCORDRPC + discord_init(); +#endif + #ifdef TARGET_WEB - /*for (int i = 0; i < atoi(argv[1]); i++) { - game_loop_one_iteration(); - }*/ - inited = 1; + emscripten_set_main_loop(em_main_loop, 0, 0); + request_anim_frame(on_anim_frame); #else - inited = 1; - while (1) { + while (true) { wm_api->main_loop(produce_one_frame); +#ifdef DISCORDRPC + discord_update_rich_presence(); +#endif } #endif } - -#if defined(_WIN32) || defined(_WIN64) -#include -int WINAPI WinMain(UNUSED HINSTANCE hInstance, UNUSED HINSTANCE hPrevInstance, UNUSED LPSTR pCmdLine, UNUSED int nCmdShow) { - main_func(); - return 0; -} -#else -int main(UNUSED int argc, UNUSED char *argv[]) { - main_func(); - return 0; -} #endif + +int main(int argc, char *argv[]) { + parse_cli_opts(argc, argv); + main_func(); + return 0; +} diff --git a/src/pc/pc_main.h b/src/pc/pc_main.h new file mode 100644 index 00000000..79bff549 --- /dev/null +++ b/src/pc/pc_main.h @@ -0,0 +1,15 @@ +#ifndef _PC_MAIN_H +#define _PC_MAIN_H + +#ifdef __cplusplus +extern "C" { +#endif + +void game_deinit(void); +void game_exit(void); + +#ifdef __cplusplus +} +#endif + +#endif // _PC_MAIN_H diff --git a/src/pc/platform.c b/src/pc/platform.c new file mode 100644 index 00000000..e68370a4 --- /dev/null +++ b/src/pc/platform.c @@ -0,0 +1,181 @@ +#include +#include +#include +#include +#include +#include + +#include "cliopts.h" +#include "fs/fs.h" +#include "configfile.h" + +/* NULL terminated list of platform specific read-only data paths */ +/* priority is top first */ +const char *sys_ropaths[] = { + ".", // working directory + "!", // executable directory +#if defined(__linux__) || defined(__unix__) + // some common UNIX directories for read only stuff + "/usr/local/share/sm64pc", + "/usr/share/sm64pc", + "/opt/sm64pc", +#endif + NULL, +}; + +/* these are not available on some platforms, so might as well */ + +char *sys_strlwr(char *src) { + for (unsigned char *p = (unsigned char *)src; *p; p++) + *p = tolower(*p); + return src; +} + +char *sys_strdup(const char *src) { + const unsigned len = strlen(src) + 1; + char *newstr = malloc(len); + if (newstr) memcpy(newstr, src, len); + return newstr; +} + +int sys_strcasecmp(const char *s1, const char *s2) { + const unsigned char *p1 = (const unsigned char *) s1; + const unsigned char *p2 = (const unsigned char *) s2; + int result; + if (p1 == p2) + return 0; + while ((result = tolower(*p1) - tolower(*p2++)) == 0) + if (*p1++ == '\0') + break; + return result; +} + +const char *sys_file_extension(const char *fpath) { + const char *fname = sys_file_name(fpath); + const char *dot = strrchr(fname, '.'); + if (!dot || !dot[1]) return NULL; // no dot + if (dot == fname) return NULL; // dot is the first char (e.g. .local) + return dot + 1; +} + +const char *sys_file_name(const char *fpath) { + const char *sep1 = strrchr(fpath, '/'); + const char *sep2 = strrchr(fpath, '\\'); + const char *sep = sep1 > sep2 ? sep1 : sep2; + if (!sep) return fpath; + return sep + 1; +} + +/* this calls a platform-specific impl function after forming the error message */ + +static void sys_fatal_impl(const char *msg) __attribute__ ((noreturn)); + +void sys_fatal(const char *fmt, ...) { + static char msg[2048]; + va_list args; + va_start(args, fmt); + vsnprintf(msg, sizeof(msg), fmt, args); + va_end(args); + fflush(stdout); // push all crap out + sys_fatal_impl(msg); +} + +#ifdef HAVE_SDL2 + +// we can just ask SDL for most of this shit if we have it +#include + +// TEMPORARY: check the old save folder and copy contents to the new path +// this will be removed after a while +static inline bool copy_userdata(const char *userdir) { + char oldpath[SYS_MAX_PATH] = { 0 }; + char path[SYS_MAX_PATH] = { 0 }; + + // check if a save already exists in the new folder + snprintf(path, sizeof(path), "%s/" SAVE_FILENAME, userdir); + if (fs_sys_file_exists(path)) return false; + + // check if a save exists in the old folder ('pc' instead of 'ex') + strncpy(oldpath, path, sizeof(oldpath)); + const unsigned int len = strlen(userdir); + oldpath[len - 2] = 'p'; oldpath[len - 1] = 'c'; + if (!fs_sys_file_exists(oldpath)) return false; + + printf("old save detected at '%s', copying to '%s'\n", oldpath, path); + + bool ret = fs_sys_copy_file(oldpath, path); + + // also try to copy the config + path[len] = oldpath[len] = 0; + strncat(path, "/" CONFIGFILE_DEFAULT, sizeof(path) - 1); + strncat(oldpath, "/" CONFIGFILE_DEFAULT, sizeof(oldpath) - 1); + fs_sys_copy_file(oldpath, path); + + return ret; +} + +const char *sys_user_path(void) { + static char path[SYS_MAX_PATH] = { 0 }; + + // get the new pref path from SDL + char *sdlpath = SDL_GetPrefPath("", "sm64ex"); + if (sdlpath) { + const unsigned int len = strlen(sdlpath); + strncpy(path, sdlpath, sizeof(path)); + path[sizeof(path)-1] = 0; + + SDL_free(sdlpath); + + if (path[len-1] == '/' || path[len-1] == '\\') + path[len-1] = 0; // strip the trailing separator + + if (!fs_sys_dir_exists(path) && !fs_sys_mkdir(path)) + path[0] = 0; // somehow failed, we got no user path + else + copy_userdata(path); // TEMPORARY: try to copy old saves, if any + } + + return path; +} + +const char *sys_exe_path(void) { + static char path[SYS_MAX_PATH] = { 0 }; + char *sdlpath = SDL_GetBasePath(); + if (sdlpath && sdlpath[0]) { + // use the SDL path if it exists + const unsigned int len = strlen(sdlpath); + strncpy(path, sdlpath, sizeof(path)); + path[sizeof(path)-1] = 0; + SDL_free(sdlpath); + if (path[len-1] == '/' || path[len-1] == '\\') + path[len-1] = 0; // strip the trailing separator + } + return path; +} + +static void sys_fatal_impl(const char *msg) { + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR , "Fatal error", msg, NULL); + fprintf(stderr, "FATAL ERROR:\n%s\n", msg); + fflush(stderr); + exit(1); +} + +#else + +#warning "You might want to implement these functions for your platform" + +const char *sys_user_path(void) { + return "."; +} + +const char *sys_exe_path(void) { + return "."; +} + +static void sys_fatal_impl(const char *msg) { + fprintf(stderr, "FATAL ERROR:\n%s\n", msg); + fflush(stderr); + exit(1); +} + +#endif // platform switch diff --git a/src/pc/platform.h b/src/pc/platform.h new file mode 100644 index 00000000..168333d1 --- /dev/null +++ b/src/pc/platform.h @@ -0,0 +1,29 @@ +#ifndef _SM64_PLATFORM_H_ +#define _SM64_PLATFORM_H_ + +#include +#include +#include + +/* Platform-specific functions and whatnot */ + +#define SYS_MAX_PATH 1024 // FIXME: define this on different platforms + +// NULL terminated list of platform specific read-only data paths +extern const char *sys_ropaths[]; + +// crossplatform impls of misc stuff +char *sys_strdup(const char *src); +char *sys_strlwr(char *src); +int sys_strcasecmp(const char *s1, const char *s2); + +// path stuff +const char *sys_user_path(void); +const char *sys_exe_path(void); +const char *sys_file_extension(const char *fpath); +const char *sys_file_name(const char *fpath); + +// shows an error message in some way and terminates the game +void sys_fatal(const char *fmt, ...) __attribute__ ((noreturn)); + +#endif // _SM64_PLATFORM_H_ diff --git a/src/pc/rmodern/glad_vulkan.c b/src/pc/rmodern/glad_vulkan.c new file mode 100644 index 00000000..e7328fa3 --- /dev/null +++ b/src/pc/rmodern/glad_vulkan.c @@ -0,0 +1,532 @@ +#include +#include +#include +#include + +#ifndef GLAD_IMPL_UTIL_C_ +#define GLAD_IMPL_UTIL_C_ + +#ifdef _MSC_VER +#define GLAD_IMPL_UTIL_SSCANF sscanf_s +#else +#define GLAD_IMPL_UTIL_SSCANF sscanf +#endif + +#endif /* GLAD_IMPL_UTIL_C_ */ + +#ifdef __cplusplus +extern "C" { +#endif + + + +int GLAD_VK_VERSION_1_0 = 0; +int GLAD_VK_KHR_device_group = 0; +int GLAD_VK_KHR_swapchain = 0; + + + +PFN_vkAcquireNextImage2KHR glad_vkAcquireNextImage2KHR = NULL; +PFN_vkAcquireNextImageKHR glad_vkAcquireNextImageKHR = NULL; +PFN_vkAllocateCommandBuffers glad_vkAllocateCommandBuffers = NULL; +PFN_vkAllocateDescriptorSets glad_vkAllocateDescriptorSets = NULL; +PFN_vkAllocateMemory glad_vkAllocateMemory = NULL; +PFN_vkBeginCommandBuffer glad_vkBeginCommandBuffer = NULL; +PFN_vkBindBufferMemory glad_vkBindBufferMemory = NULL; +PFN_vkBindImageMemory glad_vkBindImageMemory = NULL; +PFN_vkCmdBeginQuery glad_vkCmdBeginQuery = NULL; +PFN_vkCmdBeginRenderPass glad_vkCmdBeginRenderPass = NULL; +PFN_vkCmdBindDescriptorSets glad_vkCmdBindDescriptorSets = NULL; +PFN_vkCmdBindIndexBuffer glad_vkCmdBindIndexBuffer = NULL; +PFN_vkCmdBindPipeline glad_vkCmdBindPipeline = NULL; +PFN_vkCmdBindVertexBuffers glad_vkCmdBindVertexBuffers = NULL; +PFN_vkCmdBlitImage glad_vkCmdBlitImage = NULL; +PFN_vkCmdClearAttachments glad_vkCmdClearAttachments = NULL; +PFN_vkCmdClearColorImage glad_vkCmdClearColorImage = NULL; +PFN_vkCmdClearDepthStencilImage glad_vkCmdClearDepthStencilImage = NULL; +PFN_vkCmdCopyBuffer glad_vkCmdCopyBuffer = NULL; +PFN_vkCmdCopyBufferToImage glad_vkCmdCopyBufferToImage = NULL; +PFN_vkCmdCopyImage glad_vkCmdCopyImage = NULL; +PFN_vkCmdCopyImageToBuffer glad_vkCmdCopyImageToBuffer = NULL; +PFN_vkCmdCopyQueryPoolResults glad_vkCmdCopyQueryPoolResults = NULL; +PFN_vkCmdDispatch glad_vkCmdDispatch = NULL; +PFN_vkCmdDispatchBaseKHR glad_vkCmdDispatchBaseKHR = NULL; +PFN_vkCmdDispatchIndirect glad_vkCmdDispatchIndirect = NULL; +PFN_vkCmdDraw glad_vkCmdDraw = NULL; +PFN_vkCmdDrawIndexed glad_vkCmdDrawIndexed = NULL; +PFN_vkCmdDrawIndexedIndirect glad_vkCmdDrawIndexedIndirect = NULL; +PFN_vkCmdDrawIndirect glad_vkCmdDrawIndirect = NULL; +PFN_vkCmdEndQuery glad_vkCmdEndQuery = NULL; +PFN_vkCmdEndRenderPass glad_vkCmdEndRenderPass = NULL; +PFN_vkCmdExecuteCommands glad_vkCmdExecuteCommands = NULL; +PFN_vkCmdFillBuffer glad_vkCmdFillBuffer = NULL; +PFN_vkCmdNextSubpass glad_vkCmdNextSubpass = NULL; +PFN_vkCmdPipelineBarrier glad_vkCmdPipelineBarrier = NULL; +PFN_vkCmdPushConstants glad_vkCmdPushConstants = NULL; +PFN_vkCmdResetEvent glad_vkCmdResetEvent = NULL; +PFN_vkCmdResetQueryPool glad_vkCmdResetQueryPool = NULL; +PFN_vkCmdResolveImage glad_vkCmdResolveImage = NULL; +PFN_vkCmdSetBlendConstants glad_vkCmdSetBlendConstants = NULL; +PFN_vkCmdSetDepthBias glad_vkCmdSetDepthBias = NULL; +PFN_vkCmdSetDepthBounds glad_vkCmdSetDepthBounds = NULL; +PFN_vkCmdSetDeviceMaskKHR glad_vkCmdSetDeviceMaskKHR = NULL; +PFN_vkCmdSetEvent glad_vkCmdSetEvent = NULL; +PFN_vkCmdSetLineWidth glad_vkCmdSetLineWidth = NULL; +PFN_vkCmdSetScissor glad_vkCmdSetScissor = NULL; +PFN_vkCmdSetStencilCompareMask glad_vkCmdSetStencilCompareMask = NULL; +PFN_vkCmdSetStencilReference glad_vkCmdSetStencilReference = NULL; +PFN_vkCmdSetStencilWriteMask glad_vkCmdSetStencilWriteMask = NULL; +PFN_vkCmdSetViewport glad_vkCmdSetViewport = NULL; +PFN_vkCmdUpdateBuffer glad_vkCmdUpdateBuffer = NULL; +PFN_vkCmdWaitEvents glad_vkCmdWaitEvents = NULL; +PFN_vkCmdWriteTimestamp glad_vkCmdWriteTimestamp = NULL; +PFN_vkCreateBuffer glad_vkCreateBuffer = NULL; +PFN_vkCreateBufferView glad_vkCreateBufferView = NULL; +PFN_vkCreateCommandPool glad_vkCreateCommandPool = NULL; +PFN_vkCreateComputePipelines glad_vkCreateComputePipelines = NULL; +PFN_vkCreateDescriptorPool glad_vkCreateDescriptorPool = NULL; +PFN_vkCreateDescriptorSetLayout glad_vkCreateDescriptorSetLayout = NULL; +PFN_vkCreateDevice glad_vkCreateDevice = NULL; +PFN_vkCreateEvent glad_vkCreateEvent = NULL; +PFN_vkCreateFence glad_vkCreateFence = NULL; +PFN_vkCreateFramebuffer glad_vkCreateFramebuffer = NULL; +PFN_vkCreateGraphicsPipelines glad_vkCreateGraphicsPipelines = NULL; +PFN_vkCreateImage glad_vkCreateImage = NULL; +PFN_vkCreateImageView glad_vkCreateImageView = NULL; +PFN_vkCreateInstance glad_vkCreateInstance = NULL; +PFN_vkCreatePipelineCache glad_vkCreatePipelineCache = NULL; +PFN_vkCreatePipelineLayout glad_vkCreatePipelineLayout = NULL; +PFN_vkCreateQueryPool glad_vkCreateQueryPool = NULL; +PFN_vkCreateRenderPass glad_vkCreateRenderPass = NULL; +PFN_vkCreateSampler glad_vkCreateSampler = NULL; +PFN_vkCreateSemaphore glad_vkCreateSemaphore = NULL; +PFN_vkCreateShaderModule glad_vkCreateShaderModule = NULL; +PFN_vkCreateSwapchainKHR glad_vkCreateSwapchainKHR = NULL; +PFN_vkDestroyBuffer glad_vkDestroyBuffer = NULL; +PFN_vkDestroyBufferView glad_vkDestroyBufferView = NULL; +PFN_vkDestroyCommandPool glad_vkDestroyCommandPool = NULL; +PFN_vkDestroyDescriptorPool glad_vkDestroyDescriptorPool = NULL; +PFN_vkDestroyDescriptorSetLayout glad_vkDestroyDescriptorSetLayout = NULL; +PFN_vkDestroyDevice glad_vkDestroyDevice = NULL; +PFN_vkDestroyEvent glad_vkDestroyEvent = NULL; +PFN_vkDestroyFence glad_vkDestroyFence = NULL; +PFN_vkDestroyFramebuffer glad_vkDestroyFramebuffer = NULL; +PFN_vkDestroyImage glad_vkDestroyImage = NULL; +PFN_vkDestroyImageView glad_vkDestroyImageView = NULL; +PFN_vkDestroyInstance glad_vkDestroyInstance = NULL; +PFN_vkDestroyPipeline glad_vkDestroyPipeline = NULL; +PFN_vkDestroyPipelineCache glad_vkDestroyPipelineCache = NULL; +PFN_vkDestroyPipelineLayout glad_vkDestroyPipelineLayout = NULL; +PFN_vkDestroyQueryPool glad_vkDestroyQueryPool = NULL; +PFN_vkDestroyRenderPass glad_vkDestroyRenderPass = NULL; +PFN_vkDestroySampler glad_vkDestroySampler = NULL; +PFN_vkDestroySemaphore glad_vkDestroySemaphore = NULL; +PFN_vkDestroyShaderModule glad_vkDestroyShaderModule = NULL; +PFN_vkDestroySwapchainKHR glad_vkDestroySwapchainKHR = NULL; +PFN_vkDeviceWaitIdle glad_vkDeviceWaitIdle = NULL; +PFN_vkEndCommandBuffer glad_vkEndCommandBuffer = NULL; +PFN_vkEnumerateDeviceExtensionProperties glad_vkEnumerateDeviceExtensionProperties = NULL; +PFN_vkEnumerateDeviceLayerProperties glad_vkEnumerateDeviceLayerProperties = NULL; +PFN_vkEnumerateInstanceExtensionProperties glad_vkEnumerateInstanceExtensionProperties = NULL; +PFN_vkEnumerateInstanceLayerProperties glad_vkEnumerateInstanceLayerProperties = NULL; +PFN_vkEnumeratePhysicalDevices glad_vkEnumeratePhysicalDevices = NULL; +PFN_vkFlushMappedMemoryRanges glad_vkFlushMappedMemoryRanges = NULL; +PFN_vkFreeCommandBuffers glad_vkFreeCommandBuffers = NULL; +PFN_vkFreeDescriptorSets glad_vkFreeDescriptorSets = NULL; +PFN_vkFreeMemory glad_vkFreeMemory = NULL; +PFN_vkGetBufferMemoryRequirements glad_vkGetBufferMemoryRequirements = NULL; +PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR glad_vkGetDeviceGroupPeerMemoryFeaturesKHR = NULL; +PFN_vkGetDeviceGroupPresentCapabilitiesKHR glad_vkGetDeviceGroupPresentCapabilitiesKHR = NULL; +PFN_vkGetDeviceGroupSurfacePresentModesKHR glad_vkGetDeviceGroupSurfacePresentModesKHR = NULL; +PFN_vkGetDeviceMemoryCommitment glad_vkGetDeviceMemoryCommitment = NULL; +PFN_vkGetDeviceProcAddr glad_vkGetDeviceProcAddr = NULL; +PFN_vkGetDeviceQueue glad_vkGetDeviceQueue = NULL; +PFN_vkGetEventStatus glad_vkGetEventStatus = NULL; +PFN_vkGetFenceStatus glad_vkGetFenceStatus = NULL; +PFN_vkGetImageMemoryRequirements glad_vkGetImageMemoryRequirements = NULL; +PFN_vkGetImageSparseMemoryRequirements glad_vkGetImageSparseMemoryRequirements = NULL; +PFN_vkGetImageSubresourceLayout glad_vkGetImageSubresourceLayout = NULL; +PFN_vkGetInstanceProcAddr glad_vkGetInstanceProcAddr = NULL; +PFN_vkGetPhysicalDeviceFeatures glad_vkGetPhysicalDeviceFeatures = NULL; +PFN_vkGetPhysicalDeviceFormatProperties glad_vkGetPhysicalDeviceFormatProperties = NULL; +PFN_vkGetPhysicalDeviceImageFormatProperties glad_vkGetPhysicalDeviceImageFormatProperties = NULL; +PFN_vkGetPhysicalDeviceMemoryProperties glad_vkGetPhysicalDeviceMemoryProperties = NULL; +PFN_vkGetPhysicalDevicePresentRectanglesKHR glad_vkGetPhysicalDevicePresentRectanglesKHR = NULL; +PFN_vkGetPhysicalDeviceProperties glad_vkGetPhysicalDeviceProperties = NULL; +PFN_vkGetPhysicalDeviceQueueFamilyProperties glad_vkGetPhysicalDeviceQueueFamilyProperties = NULL; +PFN_vkGetPhysicalDeviceSparseImageFormatProperties glad_vkGetPhysicalDeviceSparseImageFormatProperties = NULL; +PFN_vkGetPipelineCacheData glad_vkGetPipelineCacheData = NULL; +PFN_vkGetQueryPoolResults glad_vkGetQueryPoolResults = NULL; +PFN_vkGetRenderAreaGranularity glad_vkGetRenderAreaGranularity = NULL; +PFN_vkGetSwapchainImagesKHR glad_vkGetSwapchainImagesKHR = NULL; +PFN_vkInvalidateMappedMemoryRanges glad_vkInvalidateMappedMemoryRanges = NULL; +PFN_vkMapMemory glad_vkMapMemory = NULL; +PFN_vkMergePipelineCaches glad_vkMergePipelineCaches = NULL; +PFN_vkQueueBindSparse glad_vkQueueBindSparse = NULL; +PFN_vkQueuePresentKHR glad_vkQueuePresentKHR = NULL; +PFN_vkQueueSubmit glad_vkQueueSubmit = NULL; +PFN_vkQueueWaitIdle glad_vkQueueWaitIdle = NULL; +PFN_vkResetCommandBuffer glad_vkResetCommandBuffer = NULL; +PFN_vkResetCommandPool glad_vkResetCommandPool = NULL; +PFN_vkResetDescriptorPool glad_vkResetDescriptorPool = NULL; +PFN_vkResetEvent glad_vkResetEvent = NULL; +PFN_vkResetFences glad_vkResetFences = NULL; +PFN_vkSetEvent glad_vkSetEvent = NULL; +PFN_vkUnmapMemory glad_vkUnmapMemory = NULL; +PFN_vkUpdateDescriptorSets glad_vkUpdateDescriptorSets = NULL; +PFN_vkWaitForFences glad_vkWaitForFences = NULL; + + +static void glad_vk_load_VK_VERSION_1_0( GLADuserptrloadfunc load, void* userptr) { + if(!GLAD_VK_VERSION_1_0) return; + glad_vkAllocateCommandBuffers = (PFN_vkAllocateCommandBuffers) load(userptr, "vkAllocateCommandBuffers"); + glad_vkAllocateDescriptorSets = (PFN_vkAllocateDescriptorSets) load(userptr, "vkAllocateDescriptorSets"); + glad_vkAllocateMemory = (PFN_vkAllocateMemory) load(userptr, "vkAllocateMemory"); + glad_vkBeginCommandBuffer = (PFN_vkBeginCommandBuffer) load(userptr, "vkBeginCommandBuffer"); + glad_vkBindBufferMemory = (PFN_vkBindBufferMemory) load(userptr, "vkBindBufferMemory"); + glad_vkBindImageMemory = (PFN_vkBindImageMemory) load(userptr, "vkBindImageMemory"); + glad_vkCmdBeginQuery = (PFN_vkCmdBeginQuery) load(userptr, "vkCmdBeginQuery"); + glad_vkCmdBeginRenderPass = (PFN_vkCmdBeginRenderPass) load(userptr, "vkCmdBeginRenderPass"); + glad_vkCmdBindDescriptorSets = (PFN_vkCmdBindDescriptorSets) load(userptr, "vkCmdBindDescriptorSets"); + glad_vkCmdBindIndexBuffer = (PFN_vkCmdBindIndexBuffer) load(userptr, "vkCmdBindIndexBuffer"); + glad_vkCmdBindPipeline = (PFN_vkCmdBindPipeline) load(userptr, "vkCmdBindPipeline"); + glad_vkCmdBindVertexBuffers = (PFN_vkCmdBindVertexBuffers) load(userptr, "vkCmdBindVertexBuffers"); + glad_vkCmdBlitImage = (PFN_vkCmdBlitImage) load(userptr, "vkCmdBlitImage"); + glad_vkCmdClearAttachments = (PFN_vkCmdClearAttachments) load(userptr, "vkCmdClearAttachments"); + glad_vkCmdClearColorImage = (PFN_vkCmdClearColorImage) load(userptr, "vkCmdClearColorImage"); + glad_vkCmdClearDepthStencilImage = (PFN_vkCmdClearDepthStencilImage) load(userptr, "vkCmdClearDepthStencilImage"); + glad_vkCmdCopyBuffer = (PFN_vkCmdCopyBuffer) load(userptr, "vkCmdCopyBuffer"); + glad_vkCmdCopyBufferToImage = (PFN_vkCmdCopyBufferToImage) load(userptr, "vkCmdCopyBufferToImage"); + glad_vkCmdCopyImage = (PFN_vkCmdCopyImage) load(userptr, "vkCmdCopyImage"); + glad_vkCmdCopyImageToBuffer = (PFN_vkCmdCopyImageToBuffer) load(userptr, "vkCmdCopyImageToBuffer"); + glad_vkCmdCopyQueryPoolResults = (PFN_vkCmdCopyQueryPoolResults) load(userptr, "vkCmdCopyQueryPoolResults"); + glad_vkCmdDispatch = (PFN_vkCmdDispatch) load(userptr, "vkCmdDispatch"); + glad_vkCmdDispatchIndirect = (PFN_vkCmdDispatchIndirect) load(userptr, "vkCmdDispatchIndirect"); + glad_vkCmdDraw = (PFN_vkCmdDraw) load(userptr, "vkCmdDraw"); + glad_vkCmdDrawIndexed = (PFN_vkCmdDrawIndexed) load(userptr, "vkCmdDrawIndexed"); + glad_vkCmdDrawIndexedIndirect = (PFN_vkCmdDrawIndexedIndirect) load(userptr, "vkCmdDrawIndexedIndirect"); + glad_vkCmdDrawIndirect = (PFN_vkCmdDrawIndirect) load(userptr, "vkCmdDrawIndirect"); + glad_vkCmdEndQuery = (PFN_vkCmdEndQuery) load(userptr, "vkCmdEndQuery"); + glad_vkCmdEndRenderPass = (PFN_vkCmdEndRenderPass) load(userptr, "vkCmdEndRenderPass"); + glad_vkCmdExecuteCommands = (PFN_vkCmdExecuteCommands) load(userptr, "vkCmdExecuteCommands"); + glad_vkCmdFillBuffer = (PFN_vkCmdFillBuffer) load(userptr, "vkCmdFillBuffer"); + glad_vkCmdNextSubpass = (PFN_vkCmdNextSubpass) load(userptr, "vkCmdNextSubpass"); + glad_vkCmdPipelineBarrier = (PFN_vkCmdPipelineBarrier) load(userptr, "vkCmdPipelineBarrier"); + glad_vkCmdPushConstants = (PFN_vkCmdPushConstants) load(userptr, "vkCmdPushConstants"); + glad_vkCmdResetEvent = (PFN_vkCmdResetEvent) load(userptr, "vkCmdResetEvent"); + glad_vkCmdResetQueryPool = (PFN_vkCmdResetQueryPool) load(userptr, "vkCmdResetQueryPool"); + glad_vkCmdResolveImage = (PFN_vkCmdResolveImage) load(userptr, "vkCmdResolveImage"); + glad_vkCmdSetBlendConstants = (PFN_vkCmdSetBlendConstants) load(userptr, "vkCmdSetBlendConstants"); + glad_vkCmdSetDepthBias = (PFN_vkCmdSetDepthBias) load(userptr, "vkCmdSetDepthBias"); + glad_vkCmdSetDepthBounds = (PFN_vkCmdSetDepthBounds) load(userptr, "vkCmdSetDepthBounds"); + glad_vkCmdSetEvent = (PFN_vkCmdSetEvent) load(userptr, "vkCmdSetEvent"); + glad_vkCmdSetLineWidth = (PFN_vkCmdSetLineWidth) load(userptr, "vkCmdSetLineWidth"); + glad_vkCmdSetScissor = (PFN_vkCmdSetScissor) load(userptr, "vkCmdSetScissor"); + glad_vkCmdSetStencilCompareMask = (PFN_vkCmdSetStencilCompareMask) load(userptr, "vkCmdSetStencilCompareMask"); + glad_vkCmdSetStencilReference = (PFN_vkCmdSetStencilReference) load(userptr, "vkCmdSetStencilReference"); + glad_vkCmdSetStencilWriteMask = (PFN_vkCmdSetStencilWriteMask) load(userptr, "vkCmdSetStencilWriteMask"); + glad_vkCmdSetViewport = (PFN_vkCmdSetViewport) load(userptr, "vkCmdSetViewport"); + glad_vkCmdUpdateBuffer = (PFN_vkCmdUpdateBuffer) load(userptr, "vkCmdUpdateBuffer"); + glad_vkCmdWaitEvents = (PFN_vkCmdWaitEvents) load(userptr, "vkCmdWaitEvents"); + glad_vkCmdWriteTimestamp = (PFN_vkCmdWriteTimestamp) load(userptr, "vkCmdWriteTimestamp"); + glad_vkCreateBuffer = (PFN_vkCreateBuffer) load(userptr, "vkCreateBuffer"); + glad_vkCreateBufferView = (PFN_vkCreateBufferView) load(userptr, "vkCreateBufferView"); + glad_vkCreateCommandPool = (PFN_vkCreateCommandPool) load(userptr, "vkCreateCommandPool"); + glad_vkCreateComputePipelines = (PFN_vkCreateComputePipelines) load(userptr, "vkCreateComputePipelines"); + glad_vkCreateDescriptorPool = (PFN_vkCreateDescriptorPool) load(userptr, "vkCreateDescriptorPool"); + glad_vkCreateDescriptorSetLayout = (PFN_vkCreateDescriptorSetLayout) load(userptr, "vkCreateDescriptorSetLayout"); + glad_vkCreateDevice = (PFN_vkCreateDevice) load(userptr, "vkCreateDevice"); + glad_vkCreateEvent = (PFN_vkCreateEvent) load(userptr, "vkCreateEvent"); + glad_vkCreateFence = (PFN_vkCreateFence) load(userptr, "vkCreateFence"); + glad_vkCreateFramebuffer = (PFN_vkCreateFramebuffer) load(userptr, "vkCreateFramebuffer"); + glad_vkCreateGraphicsPipelines = (PFN_vkCreateGraphicsPipelines) load(userptr, "vkCreateGraphicsPipelines"); + glad_vkCreateImage = (PFN_vkCreateImage) load(userptr, "vkCreateImage"); + glad_vkCreateImageView = (PFN_vkCreateImageView) load(userptr, "vkCreateImageView"); + glad_vkCreateInstance = (PFN_vkCreateInstance) load(userptr, "vkCreateInstance"); + glad_vkCreatePipelineCache = (PFN_vkCreatePipelineCache) load(userptr, "vkCreatePipelineCache"); + glad_vkCreatePipelineLayout = (PFN_vkCreatePipelineLayout) load(userptr, "vkCreatePipelineLayout"); + glad_vkCreateQueryPool = (PFN_vkCreateQueryPool) load(userptr, "vkCreateQueryPool"); + glad_vkCreateRenderPass = (PFN_vkCreateRenderPass) load(userptr, "vkCreateRenderPass"); + glad_vkCreateSampler = (PFN_vkCreateSampler) load(userptr, "vkCreateSampler"); + glad_vkCreateSemaphore = (PFN_vkCreateSemaphore) load(userptr, "vkCreateSemaphore"); + glad_vkCreateShaderModule = (PFN_vkCreateShaderModule) load(userptr, "vkCreateShaderModule"); + glad_vkDestroyBuffer = (PFN_vkDestroyBuffer) load(userptr, "vkDestroyBuffer"); + glad_vkDestroyBufferView = (PFN_vkDestroyBufferView) load(userptr, "vkDestroyBufferView"); + glad_vkDestroyCommandPool = (PFN_vkDestroyCommandPool) load(userptr, "vkDestroyCommandPool"); + glad_vkDestroyDescriptorPool = (PFN_vkDestroyDescriptorPool) load(userptr, "vkDestroyDescriptorPool"); + glad_vkDestroyDescriptorSetLayout = (PFN_vkDestroyDescriptorSetLayout) load(userptr, "vkDestroyDescriptorSetLayout"); + glad_vkDestroyDevice = (PFN_vkDestroyDevice) load(userptr, "vkDestroyDevice"); + glad_vkDestroyEvent = (PFN_vkDestroyEvent) load(userptr, "vkDestroyEvent"); + glad_vkDestroyFence = (PFN_vkDestroyFence) load(userptr, "vkDestroyFence"); + glad_vkDestroyFramebuffer = (PFN_vkDestroyFramebuffer) load(userptr, "vkDestroyFramebuffer"); + glad_vkDestroyImage = (PFN_vkDestroyImage) load(userptr, "vkDestroyImage"); + glad_vkDestroyImageView = (PFN_vkDestroyImageView) load(userptr, "vkDestroyImageView"); + glad_vkDestroyInstance = (PFN_vkDestroyInstance) load(userptr, "vkDestroyInstance"); + glad_vkDestroyPipeline = (PFN_vkDestroyPipeline) load(userptr, "vkDestroyPipeline"); + glad_vkDestroyPipelineCache = (PFN_vkDestroyPipelineCache) load(userptr, "vkDestroyPipelineCache"); + glad_vkDestroyPipelineLayout = (PFN_vkDestroyPipelineLayout) load(userptr, "vkDestroyPipelineLayout"); + glad_vkDestroyQueryPool = (PFN_vkDestroyQueryPool) load(userptr, "vkDestroyQueryPool"); + glad_vkDestroyRenderPass = (PFN_vkDestroyRenderPass) load(userptr, "vkDestroyRenderPass"); + glad_vkDestroySampler = (PFN_vkDestroySampler) load(userptr, "vkDestroySampler"); + glad_vkDestroySemaphore = (PFN_vkDestroySemaphore) load(userptr, "vkDestroySemaphore"); + glad_vkDestroyShaderModule = (PFN_vkDestroyShaderModule) load(userptr, "vkDestroyShaderModule"); + glad_vkDeviceWaitIdle = (PFN_vkDeviceWaitIdle) load(userptr, "vkDeviceWaitIdle"); + glad_vkEndCommandBuffer = (PFN_vkEndCommandBuffer) load(userptr, "vkEndCommandBuffer"); + glad_vkEnumerateDeviceExtensionProperties = (PFN_vkEnumerateDeviceExtensionProperties) load(userptr, "vkEnumerateDeviceExtensionProperties"); + glad_vkEnumerateDeviceLayerProperties = (PFN_vkEnumerateDeviceLayerProperties) load(userptr, "vkEnumerateDeviceLayerProperties"); + glad_vkEnumerateInstanceExtensionProperties = (PFN_vkEnumerateInstanceExtensionProperties) load(userptr, "vkEnumerateInstanceExtensionProperties"); + glad_vkEnumerateInstanceLayerProperties = (PFN_vkEnumerateInstanceLayerProperties) load(userptr, "vkEnumerateInstanceLayerProperties"); + glad_vkEnumeratePhysicalDevices = (PFN_vkEnumeratePhysicalDevices) load(userptr, "vkEnumeratePhysicalDevices"); + glad_vkFlushMappedMemoryRanges = (PFN_vkFlushMappedMemoryRanges) load(userptr, "vkFlushMappedMemoryRanges"); + glad_vkFreeCommandBuffers = (PFN_vkFreeCommandBuffers) load(userptr, "vkFreeCommandBuffers"); + glad_vkFreeDescriptorSets = (PFN_vkFreeDescriptorSets) load(userptr, "vkFreeDescriptorSets"); + glad_vkFreeMemory = (PFN_vkFreeMemory) load(userptr, "vkFreeMemory"); + glad_vkGetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements) load(userptr, "vkGetBufferMemoryRequirements"); + glad_vkGetDeviceMemoryCommitment = (PFN_vkGetDeviceMemoryCommitment) load(userptr, "vkGetDeviceMemoryCommitment"); + glad_vkGetDeviceProcAddr = (PFN_vkGetDeviceProcAddr) load(userptr, "vkGetDeviceProcAddr"); + glad_vkGetDeviceQueue = (PFN_vkGetDeviceQueue) load(userptr, "vkGetDeviceQueue"); + glad_vkGetEventStatus = (PFN_vkGetEventStatus) load(userptr, "vkGetEventStatus"); + glad_vkGetFenceStatus = (PFN_vkGetFenceStatus) load(userptr, "vkGetFenceStatus"); + glad_vkGetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements) load(userptr, "vkGetImageMemoryRequirements"); + glad_vkGetImageSparseMemoryRequirements = (PFN_vkGetImageSparseMemoryRequirements) load(userptr, "vkGetImageSparseMemoryRequirements"); + glad_vkGetImageSubresourceLayout = (PFN_vkGetImageSubresourceLayout) load(userptr, "vkGetImageSubresourceLayout"); + glad_vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr) load(userptr, "vkGetInstanceProcAddr"); + glad_vkGetPhysicalDeviceFeatures = (PFN_vkGetPhysicalDeviceFeatures) load(userptr, "vkGetPhysicalDeviceFeatures"); + glad_vkGetPhysicalDeviceFormatProperties = (PFN_vkGetPhysicalDeviceFormatProperties) load(userptr, "vkGetPhysicalDeviceFormatProperties"); + glad_vkGetPhysicalDeviceImageFormatProperties = (PFN_vkGetPhysicalDeviceImageFormatProperties) load(userptr, "vkGetPhysicalDeviceImageFormatProperties"); + glad_vkGetPhysicalDeviceMemoryProperties = (PFN_vkGetPhysicalDeviceMemoryProperties) load(userptr, "vkGetPhysicalDeviceMemoryProperties"); + glad_vkGetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties) load(userptr, "vkGetPhysicalDeviceProperties"); + glad_vkGetPhysicalDeviceQueueFamilyProperties = (PFN_vkGetPhysicalDeviceQueueFamilyProperties) load(userptr, "vkGetPhysicalDeviceQueueFamilyProperties"); + glad_vkGetPhysicalDeviceSparseImageFormatProperties = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties) load(userptr, "vkGetPhysicalDeviceSparseImageFormatProperties"); + glad_vkGetPipelineCacheData = (PFN_vkGetPipelineCacheData) load(userptr, "vkGetPipelineCacheData"); + glad_vkGetQueryPoolResults = (PFN_vkGetQueryPoolResults) load(userptr, "vkGetQueryPoolResults"); + glad_vkGetRenderAreaGranularity = (PFN_vkGetRenderAreaGranularity) load(userptr, "vkGetRenderAreaGranularity"); + glad_vkInvalidateMappedMemoryRanges = (PFN_vkInvalidateMappedMemoryRanges) load(userptr, "vkInvalidateMappedMemoryRanges"); + glad_vkMapMemory = (PFN_vkMapMemory) load(userptr, "vkMapMemory"); + glad_vkMergePipelineCaches = (PFN_vkMergePipelineCaches) load(userptr, "vkMergePipelineCaches"); + glad_vkQueueBindSparse = (PFN_vkQueueBindSparse) load(userptr, "vkQueueBindSparse"); + glad_vkQueueSubmit = (PFN_vkQueueSubmit) load(userptr, "vkQueueSubmit"); + glad_vkQueueWaitIdle = (PFN_vkQueueWaitIdle) load(userptr, "vkQueueWaitIdle"); + glad_vkResetCommandBuffer = (PFN_vkResetCommandBuffer) load(userptr, "vkResetCommandBuffer"); + glad_vkResetCommandPool = (PFN_vkResetCommandPool) load(userptr, "vkResetCommandPool"); + glad_vkResetDescriptorPool = (PFN_vkResetDescriptorPool) load(userptr, "vkResetDescriptorPool"); + glad_vkResetEvent = (PFN_vkResetEvent) load(userptr, "vkResetEvent"); + glad_vkResetFences = (PFN_vkResetFences) load(userptr, "vkResetFences"); + glad_vkSetEvent = (PFN_vkSetEvent) load(userptr, "vkSetEvent"); + glad_vkUnmapMemory = (PFN_vkUnmapMemory) load(userptr, "vkUnmapMemory"); + glad_vkUpdateDescriptorSets = (PFN_vkUpdateDescriptorSets) load(userptr, "vkUpdateDescriptorSets"); + glad_vkWaitForFences = (PFN_vkWaitForFences) load(userptr, "vkWaitForFences"); +} +static void glad_vk_load_VK_KHR_device_group( GLADuserptrloadfunc load, void* userptr) { + if(!GLAD_VK_KHR_device_group) return; + glad_vkAcquireNextImage2KHR = (PFN_vkAcquireNextImage2KHR) load(userptr, "vkAcquireNextImage2KHR"); + glad_vkCmdDispatchBaseKHR = (PFN_vkCmdDispatchBaseKHR) load(userptr, "vkCmdDispatchBaseKHR"); + glad_vkCmdSetDeviceMaskKHR = (PFN_vkCmdSetDeviceMaskKHR) load(userptr, "vkCmdSetDeviceMaskKHR"); + glad_vkGetDeviceGroupPeerMemoryFeaturesKHR = (PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR) load(userptr, "vkGetDeviceGroupPeerMemoryFeaturesKHR"); + glad_vkGetDeviceGroupPresentCapabilitiesKHR = (PFN_vkGetDeviceGroupPresentCapabilitiesKHR) load(userptr, "vkGetDeviceGroupPresentCapabilitiesKHR"); + glad_vkGetDeviceGroupSurfacePresentModesKHR = (PFN_vkGetDeviceGroupSurfacePresentModesKHR) load(userptr, "vkGetDeviceGroupSurfacePresentModesKHR"); + glad_vkGetPhysicalDevicePresentRectanglesKHR = (PFN_vkGetPhysicalDevicePresentRectanglesKHR) load(userptr, "vkGetPhysicalDevicePresentRectanglesKHR"); +} +static void glad_vk_load_VK_KHR_swapchain( GLADuserptrloadfunc load, void* userptr) { + if(!GLAD_VK_KHR_swapchain) return; + glad_vkAcquireNextImage2KHR = (PFN_vkAcquireNextImage2KHR) load(userptr, "vkAcquireNextImage2KHR"); + glad_vkAcquireNextImageKHR = (PFN_vkAcquireNextImageKHR) load(userptr, "vkAcquireNextImageKHR"); + glad_vkCreateSwapchainKHR = (PFN_vkCreateSwapchainKHR) load(userptr, "vkCreateSwapchainKHR"); + glad_vkDestroySwapchainKHR = (PFN_vkDestroySwapchainKHR) load(userptr, "vkDestroySwapchainKHR"); + glad_vkGetDeviceGroupPresentCapabilitiesKHR = (PFN_vkGetDeviceGroupPresentCapabilitiesKHR) load(userptr, "vkGetDeviceGroupPresentCapabilitiesKHR"); + glad_vkGetDeviceGroupSurfacePresentModesKHR = (PFN_vkGetDeviceGroupSurfacePresentModesKHR) load(userptr, "vkGetDeviceGroupSurfacePresentModesKHR"); + glad_vkGetPhysicalDevicePresentRectanglesKHR = (PFN_vkGetPhysicalDevicePresentRectanglesKHR) load(userptr, "vkGetPhysicalDevicePresentRectanglesKHR"); + glad_vkGetSwapchainImagesKHR = (PFN_vkGetSwapchainImagesKHR) load(userptr, "vkGetSwapchainImagesKHR"); + glad_vkQueuePresentKHR = (PFN_vkQueuePresentKHR) load(userptr, "vkQueuePresentKHR"); +} + + +static void glad_vk_resolve_aliases(void) { +} + +static int glad_vk_get_extensions( VkPhysicalDevice physical_device, uint32_t *out_extension_count, char ***out_extensions) { + uint32_t i; + uint32_t instance_extension_count = 0; + uint32_t device_extension_count = 0; + uint32_t max_extension_count; + uint32_t total_extension_count; + char **extensions; + VkExtensionProperties *ext_properties; + VkResult result; + + if (glad_vkEnumerateInstanceExtensionProperties == NULL || (physical_device != NULL && glad_vkEnumerateDeviceExtensionProperties == NULL)) { + return 0; + } + + result = glad_vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, NULL); + if (result != VK_SUCCESS) { + return 0; + } + + if (physical_device != NULL) { + result = glad_vkEnumerateDeviceExtensionProperties(physical_device, NULL, &device_extension_count, NULL); + if (result != VK_SUCCESS) { + return 0; + } + } + + total_extension_count = instance_extension_count + device_extension_count; + max_extension_count = instance_extension_count > device_extension_count + ? instance_extension_count : device_extension_count; + + ext_properties = (VkExtensionProperties*) malloc(max_extension_count * sizeof(VkExtensionProperties)); + if (ext_properties == NULL) { + return 0; + } + + result = glad_vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, ext_properties); + if (result != VK_SUCCESS) { + free((void*) ext_properties); + return 0; + } + + extensions = (char**) calloc(total_extension_count, sizeof(char*)); + if (extensions == NULL) { + free((void*) ext_properties); + return 0; + } + + for (i = 0; i < instance_extension_count; ++i) { + VkExtensionProperties ext = ext_properties[i]; + + size_t extension_name_length = strlen(ext.extensionName) + 1; + extensions[i] = (char*) malloc(extension_name_length * sizeof(char)); + memcpy(extensions[i], ext.extensionName, extension_name_length * sizeof(char)); + } + + if (physical_device != NULL) { + result = glad_vkEnumerateDeviceExtensionProperties(physical_device, NULL, &device_extension_count, ext_properties); + if (result != VK_SUCCESS) { + for (i = 0; i < instance_extension_count; ++i) { + free((void*) extensions[i]); + } + free(extensions); + return 0; + } + + for (i = 0; i < device_extension_count; ++i) { + VkExtensionProperties ext = ext_properties[i]; + + size_t extension_name_length = strlen(ext.extensionName) + 1; + extensions[instance_extension_count + i] = (char*) malloc(extension_name_length * sizeof(char)); + memcpy(extensions[instance_extension_count + i], ext.extensionName, extension_name_length * sizeof(char)); + } + } + + free((void*) ext_properties); + + *out_extension_count = total_extension_count; + *out_extensions = extensions; + + return 1; +} + +static void glad_vk_free_extensions(uint32_t extension_count, char **extensions) { + uint32_t i; + + for(i = 0; i < extension_count ; ++i) { + free((void*) (extensions[i])); + } + + free((void*) extensions); +} + +static int glad_vk_has_extension(const char *name, uint32_t extension_count, char **extensions) { + uint32_t i; + + for (i = 0; i < extension_count; ++i) { + if(strcmp(name, extensions[i]) == 0) { + return 1; + } + } + + return 0; +} + +static GLADapiproc glad_vk_get_proc_from_userptr(void *userptr, const char* name) { + return (GLAD_GNUC_EXTENSION (GLADapiproc (*)(const char *name)) userptr)(name); +} + +static int glad_vk_find_extensions_vulkan( VkPhysicalDevice physical_device) { + uint32_t extension_count = 0; + char **extensions = NULL; + if (!glad_vk_get_extensions(physical_device, &extension_count, &extensions)) return 0; + + GLAD_VK_KHR_device_group = glad_vk_has_extension("VK_KHR_device_group", extension_count, extensions); + GLAD_VK_KHR_swapchain = glad_vk_has_extension("VK_KHR_swapchain", extension_count, extensions); + + glad_vk_free_extensions(extension_count, extensions); + + return 1; +} + +static int glad_vk_find_core_vulkan( VkPhysicalDevice physical_device) { + int major = 1; + int minor = 0; + +#ifdef VK_VERSION_1_1 + if (glad_vkEnumerateInstanceVersion != NULL) { + uint32_t version; + VkResult result; + + result = glad_vkEnumerateInstanceVersion(&version); + if (result == VK_SUCCESS) { + major = (int) VK_VERSION_MAJOR(version); + minor = (int) VK_VERSION_MINOR(version); + } + } +#endif + + if (physical_device != NULL && glad_vkGetPhysicalDeviceProperties != NULL) { + VkPhysicalDeviceProperties properties; + glad_vkGetPhysicalDeviceProperties(physical_device, &properties); + + major = (int) VK_VERSION_MAJOR(properties.apiVersion); + minor = (int) VK_VERSION_MINOR(properties.apiVersion); + } + + GLAD_VK_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1; + + return GLAD_MAKE_VERSION(major, minor); +} + +int gladLoadVulkanUserPtr( VkPhysicalDevice physical_device, GLADuserptrloadfunc load, void *userptr) { + int version; + +#ifdef VK_VERSION_1_1 + glad_vkEnumerateInstanceVersion = (PFN_vkEnumerateInstanceVersion) load(userptr, "vkEnumerateInstanceVersion"); +#endif + version = glad_vk_find_core_vulkan( physical_device); + if (!version) { + return 0; + } + + glad_vk_load_VK_VERSION_1_0(load, userptr); + + if (!glad_vk_find_extensions_vulkan( physical_device)) return 0; + glad_vk_load_VK_KHR_device_group(load, userptr); + glad_vk_load_VK_KHR_swapchain(load, userptr); + + glad_vk_resolve_aliases(); + + return version; +} + + +int gladLoadVulkan( VkPhysicalDevice physical_device, GLADloadfunc load) { + return gladLoadVulkanUserPtr( physical_device, glad_vk_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) load); +} + + + + + + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/src/pc/rmodern/render/rm_rapi.h b/src/pc/rmodern/render/rm_rapi.h new file mode 100644 index 00000000..dd0d84b6 --- /dev/null +++ b/src/pc/rmodern/render/rm_rapi.h @@ -0,0 +1,34 @@ +#ifndef RM_RAPI_H +#define RM_RAPI_H + +#include "engine/graph_node.h" + +class rm_wapi; + +class rm_mesh +{ +public: + virtual void preload() = 0; + virtual void activate() = 0; + virtual void deactivate() = 0; + virtual void cleanup() = 0; + virtual void render() = 0; +}; + +struct RMMeshGraphNode +{ + struct GraphNode node; + rm_mesh* mMesh; +}; + +class rm_rapi +{ +public: + virtual void setWAPI(rm_wapi* wapi) = 0; + virtual bool checkSupport() = 0; + virtual bool init() = 0; + virtual rm_mesh* createMesh() = 0; + +}; + +#endif \ No newline at end of file diff --git a/src/pc/rmodern/render/rm_rapi_vk.cpp b/src/pc/rmodern/render/rm_rapi_vk.cpp new file mode 100644 index 00000000..c3ad7673 --- /dev/null +++ b/src/pc/rmodern/render/rm_rapi_vk.cpp @@ -0,0 +1,40 @@ +#include "rm_vk.h" + +#include + +#include "../window/rm_wapi.h" +#include "vk_helper.h" + +void rm_rapi_vk::setWAPI(rm_wapi* wapi) +{ + this->mWAPI = wapi; +} + +// TODO: add checks for physical device presence +bool rm_rapi_vk::checkSupport() +{ + if(this->mWAPI == nullptr) + return false; + + this->mVkGetInstanceProcAddr = this->mWAPI->getVulkanLoader(); + + if(!this->mVkGetInstanceProcAddr) + return false; + + loadVulkan(VK_NULL_HANDLE, VK_NULL_HANDLE, this->mVkGetInstanceProcAddr); + + if(vkCreateInstance) + return true; + else + return false; +} + +bool rm_rapi_vk::init() +{ + return false; +} + +rm_mesh* rm_rapi_vk::createMesh() +{ + return nullptr; +} \ No newline at end of file diff --git a/src/pc/rmodern/render/rm_vk.h b/src/pc/rmodern/render/rm_vk.h new file mode 100644 index 00000000..4dff2c03 --- /dev/null +++ b/src/pc/rmodern/render/rm_vk.h @@ -0,0 +1,34 @@ +#ifndef RM_VK_H +#define RM_VK_H + +#include "rm_rapi.h" +#include + +class rm_mesh_vk : public rm_mesh +{ +public: + virtual void preload(); + virtual void activate(); + virtual void deactivate(); + virtual void cleanup(); + virtual void render(); +}; + +class rm_rapi_vk : public rm_rapi +{ +public: + virtual void setWAPI(rm_wapi* wapi); + virtual bool checkSupport(); + virtual bool init(); + virtual rm_mesh* createMesh(); + + friend GLADapiproc vkLoadFunc(const char *name); + +private: + VkInstance mInstance = VK_NULL_HANDLE; + PFN_vkGetInstanceProcAddr mVkGetInstanceProcAddr = nullptr; + + rm_wapi* mWAPI = nullptr; +}; + +#endif diff --git a/src/pc/rmodern/render/vk_helper.cpp b/src/pc/rmodern/render/vk_helper.cpp new file mode 100644 index 00000000..2ff9549d --- /dev/null +++ b/src/pc/rmodern/render/vk_helper.cpp @@ -0,0 +1,33 @@ +#include "vk_helper.h" + +#include + +using std::mutex; + +// Globals for use with GLAD +VkInstance gInstance = VK_NULL_HANDLE; +PFN_vkGetInstanceProcAddr gLoadFunc = nullptr; +mutex gLoadMutex; + +GLADapiproc procLoadFunc(const char *name) +{ + if(gLoadFunc == nullptr) + return nullptr; + + return (GLADapiproc) gLoadFunc(gInstance, name); +} + +void loadVulkan(VkInstance instance, VkPhysicalDevice physicalDevice, PFN_vkGetInstanceProcAddr loadFunc) +{ + gLoadMutex.lock(); + + gInstance = instance; + gLoadFunc = loadFunc; + + gladLoadVulkan(physicalDevice, procLoadFunc); + + gInstance = nullptr; + gLoadFunc = nullptr; + + gLoadMutex.unlock(); +} \ No newline at end of file diff --git a/src/pc/rmodern/render/vk_helper.h b/src/pc/rmodern/render/vk_helper.h new file mode 100644 index 00000000..7c4b9050 --- /dev/null +++ b/src/pc/rmodern/render/vk_helper.h @@ -0,0 +1,15 @@ +#ifndef VK_HELPER_H +#define VK_HELPER_H + +#include + +/** + * @brief A thread-safe function that uses a particular VkInstance to load the Vulkan API using GLAD. + * + * @param instance + * @param physicalDevice + * @param loadFunc + */ +void loadVulkan(VkInstance instance, VkPhysicalDevice physicalDevice, PFN_vkGetInstanceProcAddr loadFunc); + +#endif \ No newline at end of file diff --git a/src/pc/rmodern/rmodern.h b/src/pc/rmodern/rmodern.h new file mode 100644 index 00000000..d6561e17 --- /dev/null +++ b/src/pc/rmodern/rmodern.h @@ -0,0 +1,24 @@ +/** + * This header file provides the interface between modern rendering functionality, + * written in C++, and the rest of the codebase. + */ + +#ifndef RMODERN_H +#define RMODERN_H +#ifdef __cplusplus + extern "C" + { +#endif + +#include "types.h" + +void rmodern_init(); + +void rm_geo_process_mesh(struct GraphNode* node, Mat4* matrix, s32 animFrame, u16 **animAttributes); + +struct GraphNode* rm_load_mesh_from_dl(struct AllocOnlyPool *pool, s32 drawingLayer, void *displayList); + +#ifdef __cplusplus + } +#endif +#endif \ No newline at end of file diff --git a/src/pc/rmodern/rmodern_main.cpp b/src/pc/rmodern/rmodern_main.cpp new file mode 100644 index 00000000..a0f469f7 --- /dev/null +++ b/src/pc/rmodern/rmodern_main.cpp @@ -0,0 +1,22 @@ +#include "rmodern.h" + +#include "render/rm_vk.h" +#include "window/rm_wapi_sdl.h" + +#include + +void rmodern_init() +{ + rm_rapi* rapi = new rm_rapi_vk; + rm_wapi* wapi = new rm_wapi_sdl; + + wapi->init(); + + rapi->setWAPI(wapi); + if(rapi->checkSupport()) + std::cout << "Vulkan is supported!!" << std::endl; + else + std::cout << "Vulkan is not supported :(" << std::endl; + + wapi->cleanup(); +} \ No newline at end of file diff --git a/src/pc/rmodern/window/rm_wapi.h b/src/pc/rmodern/window/rm_wapi.h new file mode 100644 index 00000000..bd06cc3b --- /dev/null +++ b/src/pc/rmodern/window/rm_wapi.h @@ -0,0 +1,21 @@ +#ifndef RM_WAPI_H +#define RM_WAPI_H + +#include + +class rm_wapi +{ +public: + virtual bool checkSupport() = 0; + virtual void init() = 0; + virtual void createWindow() = 0; + virtual void destroyWindow() = 0; + virtual void cleanup() = 0; + + virtual PFN_vkGetInstanceProcAddr getVulkanLoader() + { + return nullptr; + } +}; + +#endif \ No newline at end of file diff --git a/src/pc/rmodern/window/rm_wapi_sdl.cpp b/src/pc/rmodern/window/rm_wapi_sdl.cpp new file mode 100644 index 00000000..8fde1b04 --- /dev/null +++ b/src/pc/rmodern/window/rm_wapi_sdl.cpp @@ -0,0 +1,40 @@ +#include "rm_wapi_sdl.h" + +#include +#include + +// TODO: actually check for support +bool rm_wapi_sdl::checkSupport() +{ + return true; +} + +void rm_wapi_sdl::init() +{ + SDL_Init(SDL_INIT_VIDEO); +} + +void rm_wapi_sdl::createWindow() +{ + +} + +void rm_wapi_sdl::destroyWindow() +{ + +} + +void rm_wapi_sdl::cleanup() +{ + SDL_Quit(); +} + +PFN_vkGetInstanceProcAddr rm_wapi_sdl::getVulkanLoader() +{ + int result = SDL_Vulkan_LoadLibrary(NULL); + + if(result != 0) + return nullptr; + + return (PFN_vkGetInstanceProcAddr) SDL_Vulkan_GetVkGetInstanceProcAddr(); +} \ No newline at end of file diff --git a/src/pc/rmodern/window/rm_wapi_sdl.h b/src/pc/rmodern/window/rm_wapi_sdl.h new file mode 100644 index 00000000..d4cf0b04 --- /dev/null +++ b/src/pc/rmodern/window/rm_wapi_sdl.h @@ -0,0 +1,18 @@ +#ifndef RM_WAPI_SDL_H +#define RM_WAPI_SDL_H + +#include "rm_wapi.h" + +class rm_wapi_sdl : public rm_wapi +{ +public: + virtual bool checkSupport(); + virtual void init(); + virtual void createWindow(); + virtual void destroyWindow(); + virtual void cleanup(); + + virtual PFN_vkGetInstanceProcAddr getVulkanLoader(); +}; + +#endif \ No newline at end of file diff --git a/src/pc/ultra_reimplementation.c b/src/pc/ultra_reimplementation.c index 2b28ea84..0389776b 100644 --- a/src/pc/ultra_reimplementation.c +++ b/src/pc/ultra_reimplementation.c @@ -2,6 +2,8 @@ #include #include "lib/src/libultra_internal.h" #include "macros.h" +#include "platform.h" +#include "fs/fs.h" #ifdef TARGET_WEB #include @@ -44,7 +46,7 @@ s32 osSendMesg(UNUSED OSMesgQueue *mq, UNUSED OSMesg msg, UNUSED s32 flag) { return 0; } s32 osRecvMesg(UNUSED OSMesgQueue *mq, UNUSED OSMesg *msg, UNUSED s32 flag) { -#if VERSION_EU +#ifdef VERSION_EU if (mq->validCount == 0) { return -1; } @@ -146,15 +148,15 @@ s32 osEepromLongRead(UNUSED OSMesgQueue *mq, u8 address, u8 *buffer, int nbytes) ret = 0; } #else - FILE *fp = fopen("sm64_save_file.bin", "rb"); + fs_file_t *fp = fs_open(SAVE_FILENAME); if (fp == NULL) { return -1; } - if (fread(content, 1, 512, fp) == 512) { + if (fs_read(fp, content, 512) == 512) { memcpy(buffer, content + address * 8, nbytes); ret = 0; } - fclose(fp); + fs_close(fp); #endif return ret; } @@ -176,7 +178,7 @@ s32 osEepromLongWrite(UNUSED OSMesgQueue *mq, u8 address, u8 *buffer, int nbytes }, content); s32 ret = 0; #else - FILE* fp = fopen("sm64_save_file.bin", "wb"); + FILE *fp = fopen(fs_get_write_path(SAVE_FILENAME), "wb"); if (fp == NULL) { return -1; } diff --git a/src/util/unused.hpp b/src/util/unused.hpp deleted file mode 100644 index 5979259a..00000000 --- a/src/util/unused.hpp +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -static int unused_int = 0; \ No newline at end of file diff --git a/tools/Makefile b/tools/Makefile index 2c13b884..d663fb0a 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,23 +1,11 @@ CC := gcc CXX := g++ -CFLAGS := -I . -Wall -Wextra -Wno-unused-parameter -pedantic -std=c99 -O2 -s +CFLAGS := -I../include -I. -Wall -Wextra -Wno-unused-parameter -pedantic -std=c99 -O2 -s LDFLAGS := -lm PROGRAMS := n64graphics n64graphics_ci mio0 n64cksum textconv patch_libultra_math aifc_decode aiff_extract_codebook vadpcm_enc tabledesign extract_data_for_mio skyconv -# if armips is not found on the system, build it in tools -ifeq (, $(shell which armips 2> /dev/null)) -CXX_PROGRAMS += armips -endif - -ifeq ($(OS),Windows_NT) -ARMIPS_FLAGS := -municode -endif - default: all -armips: armips.cpp - $(CXX) $(CXXFLAGS) -fno-exceptions -fno-rtti -pipe $^ -o $@ -lpthread $(ARMIPS_FLAGS) - n64graphics_SOURCES := n64graphics.c utils.c n64graphics_CFLAGS := -DN64GRAPHICS_STANDALONE diff --git a/tools/aifc_decode.c b/tools/aifc_decode.c index 19d13c6c..102e62bf 100644 --- a/tools/aifc_decode.c +++ b/tools/aifc_decode.c @@ -19,11 +19,19 @@ typedef unsigned int u32; typedef unsigned long long u64; typedef float f32; -#define bswap16(x) __builtin_bswap16(x) -#define bswap32(x) __builtin_bswap32(x) -#define BSWAP16(x) x = __builtin_bswap16(x) -#define BSWAP32(x) x = __builtin_bswap32(x) -#define BSWAP16_MANY(x, n) for (s32 _i = 0; _i < n; _i++) BSWAP16((x)[_i]) +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +# define bswap16(x) (x) +# define bswap32(x) (x) +# define BSWAP16(x) +# define BSWAP32(x) +# define BSWAP16_MANY(x, n) +#else +# define bswap16(x) __builtin_bswap16(x) +# define bswap32(x) __builtin_bswap32(x) +# define BSWAP16(x) x = __builtin_bswap16(x) +# define BSWAP32(x) x = __builtin_bswap32(x) +# define BSWAP16_MANY(x, n) for (s32 _i = 0; _i < n; _i++) BSWAP16((x)[_i]) +#endif #define NORETURN __attribute__((noreturn)) #define UNUSED __attribute__((unused)) diff --git a/tools/aiff_extract_codebook.c b/tools/aiff_extract_codebook.c index 78864e38..481e3133 100644 --- a/tools/aiff_extract_codebook.c +++ b/tools/aiff_extract_codebook.c @@ -15,8 +15,13 @@ typedef int s32; typedef unsigned char u8; typedef unsigned int u32; -#define BSWAP16(x) x = __builtin_bswap16(x) -#define BSWAP32(x) x = __builtin_bswap32(x) +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +# define BSWAP16(x) +# define BSWAP32(x) +#else +# define BSWAP16(x) x = __builtin_bswap16(x) +# define BSWAP32(x) x = __builtin_bswap32(x) +#endif #define NORETURN __attribute__((noreturn)) #define UNUSED __attribute__((unused)) diff --git a/tools/armips.cpp b/tools/armips.cpp deleted file mode 100644 index 271bf558..00000000 --- a/tools/armips.cpp +++ /dev/null @@ -1,19906 +0,0 @@ -// armips assembler v0.11 -// https://github.com/Kingcom/armips/ -// To simplify compilation, all files have been concatenated into one. -// MIPS only, ARM is not included. - -/* -The MIT License (MIT) - -Copyright (c) 2009-2020 Kingcom - -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 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -*/ - -// file: stdafx.h - - -#define _CRT_SECURE_NO_WARNINGS -#undef __STRICT_ANSI__ - -#if defined(__clang__) -#if __has_feature(cxx_exceptions) -#define ARMIPS_EXCEPTIONS 1 -#else -#define ARMIPS_EXCEPTIONS 0 -#endif -#elif defined(_MSC_VER) && defined(_CPPUNWIND) -#define ARMIPS_EXCEPTIONS 1 -#elif defined(__EXCEPTIONS) || defined(__cpp_exceptions) -#define ARMIPS_EXCEPTIONS 1 -#else -#define ARMIPS_EXCEPTIONS 0 -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#define formatString tfm::format - -// Custom make_unique so that C++14 support will not be necessary for compilation -template -std::unique_ptr make_unique(Args&&... args) -{ - return std::unique_ptr(new T(std::forward(args)...)); -} - -// file: ext/tinyformat/tinyformat.h -// tinyformat.h -// Copyright (C) 2011, Chris Foster [chris42f (at) gmail (d0t) com] -// -// Boost Software License - Version 1.0 -// -// Permission is hereby granted, free of charge, to any person or organization -// obtaining a copy of the software and accompanying documentation covered by -// this license (the "Software") to use, reproduce, display, distribute, -// execute, and transmit the Software, and to prepare derivative works of the -// Software, and to permit third-parties to whom the Software is furnished to -// do so, all subject to the following: -// -// The copyright notices in the Software and this entire statement, including -// the above license grant, this restriction and the following disclaimer, -// must be included in all copies of the Software, in whole or in part, and -// all derivative works of the Software, unless such copies or derivative -// works are solely in the form of machine-executable object code generated by -// a source language processor. -// -// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT -// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -//------------------------------------------------------------------------------ -// Tinyformat: A minimal type safe printf replacement -// -// tinyformat.h is a type safe printf replacement library in a single C++ -// header file. Design goals include: -// -// * Type safety and extensibility for user defined types. -// * C99 printf() compatibility, to the extent possible using std::wostream -// * Simplicity and minimalism. A single header file to include and distribute -// with your projects. -// * Augment rather than replace the standard stream formatting mechanism -// * C++98 support, with optional C++11 niceties -// -// -// Main interface example usage -// ---------------------------- -// -// To print a date to std::wcout: -// -// std::wstring weekday = L"Wednesday"; -// const wchar_t* month = L"July"; -// size_t day = 27; -// long hour = 14; -// int min = 44; -// -// tfm::printf("%s, %s %d, %.2d:%.2d\n", weekday, month, day, hour, min); -// -// The strange types here emphasize the type safety of the interface; it is -// possible to print a std::wstring using the "%s" conversion, and a -// size_t using the "%d" conversion. A similar result could be achieved -// using either of the tfm::format() functions. One prints on a user provided -// stream: -// -// tfm::format(std::cerr, L"%s, %s %d, %.2d:%.2d\n", -// weekday, month, day, hour, min); -// -// The other returns a std::wstring: -// -// std::wstring date = tfm::format(L"%s, %s %d, %.2d:%.2d\n", -// weekday, month, day, hour, min); -// std::wcout << date; -// -// These are the three primary interface functions. There is also a -// convenience function printfln() which appends a newline to the usual result -// of printf() for super simple logging. -// -// -// User defined format functions -// ----------------------------- -// -// Simulating variadic templates in C++98 is pretty painful since it requires -// writing out the same function for each desired number of arguments. To make -// this bearable tinyformat comes with a set of macros which are used -// internally to generate the API, but which may also be used in user code. -// -// The three macros TINYFORMAT_ARGTYPES(n), TINYFORMAT_VARARGS(n) and -// TINYFORMAT_PASSARGS(n) will generate a list of n argument types, -// type/name pairs and argument names respectively when called with an integer -// n between 1 and 16. We can use these to define a macro which generates the -// desired user defined function with n arguments. To generate all 16 user -// defined function bodies, use the macro TINYFORMAT_FOREACH_ARGNUM. For an -// example, see the implementation of printf() at the end of the source file. -// -// Sometimes it's useful to be able to pass a list of format arguments through -// to a non-template function. The FormatList class is provided as a way to do -// this by storing the argument list in a type-opaque way. Continuing the -// example from above, we construct a FormatList using makeFormatList(): -// -// FormatListRef formatList = tfm::makeFormatList(weekday, month, day, hour, min); -// -// The format list can now be passed into any non-template function and used -// via a call to the vformat() function: -// -// tfm::vformat(std::wcout, L"%s, %s %d, %.2d:%.2d\n", formatList); -// -// -// Additional API information -// -------------------------- -// -// Error handling: Define TINYFORMAT_ERROR to customize the error handling for -// format strings which are unsupported or have the wrong number of format -// specifiers (calls assert() by default). -// -// User defined types: Uses operator<< for user defined types by default. -// Overload formatValue() for more control. - - -#ifndef TINYFORMAT_H_INCLUDED -#define TINYFORMAT_H_INCLUDED - -namespace tinyformat {} -//------------------------------------------------------------------------------ -// Config section. Customize to your liking! - -// Namespace alias to encourage brevity -namespace tfm = tinyformat; - -// Error handling; calls assert() by default. -// #define TINYFORMAT_ERROR(reasonString) your_error_handler(reasonString) - -// Define for C++11 variadic templates which make the code shorter & more -// general. If you don't define this, C++11 support is autodetected below. -// #define TINYFORMAT_USE_VARIADIC_TEMPLATES - - -//------------------------------------------------------------------------------ -// Implementation details. -#include -#include -#include - -#ifndef TINYFORMAT_ASSERT -# include -# define TINYFORMAT_ASSERT(cond) assert(cond) -#endif - -#define TINYFORMAT_ALLOW_WCHAR_STRINGS -#define TINYFORMAT_USE_VARIADIC_TEMPLATES - -#ifndef TINYFORMAT_ERROR -# include -# define TINYFORMAT_ERROR(reason) assert(0 && reason) -#endif - -#if !defined(TINYFORMAT_USE_VARIADIC_TEMPLATES) && !defined(TINYFORMAT_NO_VARIADIC_TEMPLATES) -# ifdef __GXX_EXPERIMENTAL_CXX0X__ -# define TINYFORMAT_USE_VARIADIC_TEMPLATES -# endif -#endif - -#if defined(__GLIBCXX__) && __GLIBCXX__ < 20080201 -// std::showpos is broken on old libstdc++ as provided with OSX. See -// http://gcc.gnu.org/ml/libstdc++/2007-11/msg00075.html -# define TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND -#endif - -#ifdef __APPLE__ -// Workaround OSX linker warning: xcode uses different default symbol -// visibilities for static libs vs executables (see issue #25) -# define TINYFORMAT_HIDDEN __attribute__((visibility("hidden"))) -#else -# define TINYFORMAT_HIDDEN -#endif - -namespace tinyformat { - -//------------------------------------------------------------------------------ -namespace detail { - -// Test whether type T1 is convertible to type T2 -template -struct is_convertible -{ - private: - // two types of different size - struct fail { wchar_t dummy[2]; }; - struct succeed { wchar_t dummy; }; - // Try to convert a T1 to a T2 by plugging into tryConvert - static fail tryConvert(...); - static succeed tryConvert(const T2&); - static const T1& makeT1(); - public: -# ifdef _MSC_VER - // Disable spurious loss of precision warnings in tryConvert(makeT1()) -# pragma warning(push) -# pragma warning(disable:4244) -# pragma warning(disable:4267) -# endif - // Standard trick: the (...) version of tryConvert will be chosen from - // the overload set only if the version taking a T2 doesn't match. - // Then we compare the sizes of the return types to check which - // function matched. Very neat, in a disgusting kind of way :) - static const bool value = - sizeof(tryConvert(makeT1())) == sizeof(succeed); -# ifdef _MSC_VER -# pragma warning(pop) -# endif -}; - - -// Detect when a type is not a wchar_t string -template struct is_wchar { typedef int tinyformat_wchar_is_not_supported; }; -template<> struct is_wchar {}; -template<> struct is_wchar {}; -template struct is_wchar {}; -template struct is_wchar {}; - - -// Format the value by casting to type fmtT. This default implementation -// should never be called. -template::value> -struct formatValueAsType -{ - static void invoke(std::wostream& /*out*/, const T& /*value*/) { TINYFORMAT_ASSERT(0); } -}; -// Specialized version for types that can actually be converted to fmtT, as -// indicated by the "convertible" template parameter. -template -struct formatValueAsType -{ - static void invoke(std::wostream& out, const T& value) - { out << static_cast(value); } -}; - -#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND -template::value> -struct formatZeroIntegerWorkaround -{ - static bool invoke(std::wostream& /**/, const T& /**/) { return false; } -}; -template -struct formatZeroIntegerWorkaround -{ - static bool invoke(std::wostream& out, const T& value) - { - if (static_cast(value) == 0 && out.flags() & std::ios::showpos) - { - out << "+0"; - return true; - } - return false; - } -}; -#endif // TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND - -// Convert an arbitrary type to integer. The version with convertible=false -// throws an error. -template::value> -struct convertToInt -{ - static int invoke(const T& /*value*/) - { - TINYFORMAT_ERROR("tinyformat: Cannot convert from argument type to " - "integer for use as variable width or precision"); - return 0; - } -}; -// Specialization for convertToInt when conversion is possible -template -struct convertToInt -{ - static int invoke(const T& value) { return static_cast(value); } -}; - -// Format at most ntrunc wchar_tacters to the given stream. -template -inline void formatTruncated(std::wostream& out, const T& value, int ntrunc) -{ - std::wostringstream tmp; - tmp << value; - std::wstring result = tmp.str(); - out.write(result.c_str(), (std::min)(ntrunc, static_cast(result.size()))); -} -#define TINYFORMAT_DEFINE_FORMAT_TRUNCATED_CSTR(type) \ -inline void formatTruncated(std::wostream& out, type* value, int ntrunc) \ -{ \ - std::streamsize len = 0; \ - while(len < ntrunc && value[len] != 0) \ - ++len; \ - out.write(value, len); \ -} -// Overload for const wchar_t* and wchar_t*. Could overload for signed & unsigned -// wchar_t too, but these are technically unneeded for printf compatibility. -TINYFORMAT_DEFINE_FORMAT_TRUNCATED_CSTR(const wchar_t) -TINYFORMAT_DEFINE_FORMAT_TRUNCATED_CSTR(wchar_t) -#undef TINYFORMAT_DEFINE_FORMAT_TRUNCATED_CSTR - -} // namespace detail - - -//------------------------------------------------------------------------------ -// Variable formatting functions. May be overridden for user-defined types if -// desired. - - -/// Format a value into a stream, delegating to operator<< by default. -/// -/// Users may override this for their own types. When this function is called, -/// the stream flags will have been modified according to the format string. -/// The format specification is provided in the range [fmtBegin, fmtEnd). For -/// truncating conversions, ntrunc is set to the desired maximum number of -/// characters, for example "%.7s" calls formatValue with ntrunc = 7. -/// -/// By default, formatValue() uses the usual stream insertion operator -/// operator<< to format the type T, with special cases for the %c and %p -/// conversions. -template -inline void formatValue(std::wostream& out, const wchar_t* /*fmtBegin*/, - const wchar_t* fmtEnd, int ntrunc, const T& value) -{ -#ifndef TINYFORMAT_ALLOW_WCHAR_STRINGS - // Since we don't support printing of wchar_t using "%ls", make it fail at - // compile time in preference to printing as a void* at runtime. - typedef typename detail::is_wchar::tinyformat_wchar_is_not_supported DummyType; - (void) DummyType(); // avoid unused type warning with gcc-4.8 -#endif - // The mess here is to support the %c and %p conversions: if these - // conversions are active we try to convert the type to a wchar_t or const - // void* respectively and format that instead of the value itself. For the - // %p conversion it's important to avoid dereferencing the pointer, which - // could otherwise lead to a crash when printing a dangling (const wchar_t*). - const bool canConvertToChar = detail::is_convertible::value; - const bool canConvertToVoidPtr = detail::is_convertible::value; - if(canConvertToChar && *(fmtEnd-1) == 'c') - detail::formatValueAsType::invoke(out, value); - else if(canConvertToVoidPtr && *(fmtEnd-1) == 'p') - detail::formatValueAsType::invoke(out, value); -#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND - else if(detail::formatZeroIntegerWorkaround::invoke(out, value)) /**/; -#endif - else if(ntrunc >= 0) - { - // Take care not to overread C strings in truncating conversions like - // "%.4s" where at most 4 wchar_tacters may be read. - detail::formatTruncated(out, value, ntrunc); - } - else - out << value; -} - - -// Overloaded version for wchar_t types to support printing as an integer -#define TINYFORMAT_DEFINE_FORMATVALUE_CHAR(wchar_tType) \ -inline void formatValue(std::wostream& out, const wchar_t* /*fmtBegin*/, \ - const wchar_t* fmtEnd, int /**/, wchar_tType value) \ -{ \ - switch(*(fmtEnd-1)) \ - { \ - case 'u': case 'd': case 'i': case 'o': case 'X': case 'x': \ - out << static_cast(value); break; \ - default: \ - out << value; break; \ - } \ -} -// per 3.9.1: char, signed char and unsigned char are all distinct types -TINYFORMAT_DEFINE_FORMATVALUE_CHAR(char) -TINYFORMAT_DEFINE_FORMATVALUE_CHAR(signed char) -TINYFORMAT_DEFINE_FORMATVALUE_CHAR(unsigned char) -#undef TINYFORMAT_DEFINE_FORMATVALUE_CHAR - - -//------------------------------------------------------------------------------ -// Tools for emulating variadic templates in C++98. The basic idea here is -// stolen from the boost preprocessor metaprogramming library and cut down to -// be just general enough for what we need. - -#define TINYFORMAT_ARGTYPES(n) TINYFORMAT_ARGTYPES_ ## n -#define TINYFORMAT_VARARGS(n) TINYFORMAT_VARARGS_ ## n -#define TINYFORMAT_PASSARGS(n) TINYFORMAT_PASSARGS_ ## n -#define TINYFORMAT_PASSARGS_TAIL(n) TINYFORMAT_PASSARGS_TAIL_ ## n - -// To keep it as transparent as possible, the macros below have been generated -// using python via the excellent cog.py code generation script. This avoids -// the need for a bunch of complex (but more general) preprocessor tricks as -// used in boost.preprocessor. -// -// To rerun the code generation in place, use `cog.py -r tinyformat.h` -// (see http://nedbatchelder.com/code/cog). Alternatively you can just create -// extra versions by hand. - -/*[[[cog -maxParams = 16 - -def makeCommaSepLists(lineTemplate, elemTemplate, startInd=1): - for j in range(startInd,maxParams+1): - list = ', '.join([elemTemplate % {'i':i} for i in range(startInd,j+1)]) - cog.outl(lineTemplate % {'j':j, 'list':list}) - -makeCommaSepLists('#define TINYFORMAT_ARGTYPES_%(j)d %(list)s', - 'class T%(i)d') - -cog.outl() -makeCommaSepLists('#define TINYFORMAT_VARARGS_%(j)d %(list)s', - 'const T%(i)d& v%(i)d') - -cog.outl() -makeCommaSepLists('#define TINYFORMAT_PASSARGS_%(j)d %(list)s', 'v%(i)d') - -cog.outl() -cog.outl('#define TINYFORMAT_PASSARGS_TAIL_1') -makeCommaSepLists('#define TINYFORMAT_PASSARGS_TAIL_%(j)d , %(list)s', - 'v%(i)d', startInd = 2) - -cog.outl() -cog.outl('#define TINYFORMAT_FOREACH_ARGNUM(m) \\\n ' + - ' '.join(['m(%d)' % (j,) for j in range(1,maxParams+1)])) -]]]*/ -#define TINYFORMAT_ARGTYPES_1 class T1 -#define TINYFORMAT_ARGTYPES_2 class T1, class T2 -#define TINYFORMAT_ARGTYPES_3 class T1, class T2, class T3 -#define TINYFORMAT_ARGTYPES_4 class T1, class T2, class T3, class T4 -#define TINYFORMAT_ARGTYPES_5 class T1, class T2, class T3, class T4, class T5 -#define TINYFORMAT_ARGTYPES_6 class T1, class T2, class T3, class T4, class T5, class T6 -#define TINYFORMAT_ARGTYPES_7 class T1, class T2, class T3, class T4, class T5, class T6, class T7 -#define TINYFORMAT_ARGTYPES_8 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8 -#define TINYFORMAT_ARGTYPES_9 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9 -#define TINYFORMAT_ARGTYPES_10 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10 -#define TINYFORMAT_ARGTYPES_11 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11 -#define TINYFORMAT_ARGTYPES_12 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12 -#define TINYFORMAT_ARGTYPES_13 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13 -#define TINYFORMAT_ARGTYPES_14 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14 -#define TINYFORMAT_ARGTYPES_15 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15 -#define TINYFORMAT_ARGTYPES_16 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16 - -#define TINYFORMAT_VARARGS_1 const T1& v1 -#define TINYFORMAT_VARARGS_2 const T1& v1, const T2& v2 -#define TINYFORMAT_VARARGS_3 const T1& v1, const T2& v2, const T3& v3 -#define TINYFORMAT_VARARGS_4 const T1& v1, const T2& v2, const T3& v3, const T4& v4 -#define TINYFORMAT_VARARGS_5 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5 -#define TINYFORMAT_VARARGS_6 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6 -#define TINYFORMAT_VARARGS_7 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7 -#define TINYFORMAT_VARARGS_8 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8 -#define TINYFORMAT_VARARGS_9 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8, const T9& v9 -#define TINYFORMAT_VARARGS_10 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8, const T9& v9, const T10& v10 -#define TINYFORMAT_VARARGS_11 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8, const T9& v9, const T10& v10, const T11& v11 -#define TINYFORMAT_VARARGS_12 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8, const T9& v9, const T10& v10, const T11& v11, const T12& v12 -#define TINYFORMAT_VARARGS_13 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8, const T9& v9, const T10& v10, const T11& v11, const T12& v12, const T13& v13 -#define TINYFORMAT_VARARGS_14 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8, const T9& v9, const T10& v10, const T11& v11, const T12& v12, const T13& v13, const T14& v14 -#define TINYFORMAT_VARARGS_15 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8, const T9& v9, const T10& v10, const T11& v11, const T12& v12, const T13& v13, const T14& v14, const T15& v15 -#define TINYFORMAT_VARARGS_16 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8, const T9& v9, const T10& v10, const T11& v11, const T12& v12, const T13& v13, const T14& v14, const T15& v15, const T16& v16 - -#define TINYFORMAT_PASSARGS_1 v1 -#define TINYFORMAT_PASSARGS_2 v1, v2 -#define TINYFORMAT_PASSARGS_3 v1, v2, v3 -#define TINYFORMAT_PASSARGS_4 v1, v2, v3, v4 -#define TINYFORMAT_PASSARGS_5 v1, v2, v3, v4, v5 -#define TINYFORMAT_PASSARGS_6 v1, v2, v3, v4, v5, v6 -#define TINYFORMAT_PASSARGS_7 v1, v2, v3, v4, v5, v6, v7 -#define TINYFORMAT_PASSARGS_8 v1, v2, v3, v4, v5, v6, v7, v8 -#define TINYFORMAT_PASSARGS_9 v1, v2, v3, v4, v5, v6, v7, v8, v9 -#define TINYFORMAT_PASSARGS_10 v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 -#define TINYFORMAT_PASSARGS_11 v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11 -#define TINYFORMAT_PASSARGS_12 v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12 -#define TINYFORMAT_PASSARGS_13 v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13 -#define TINYFORMAT_PASSARGS_14 v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14 -#define TINYFORMAT_PASSARGS_15 v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 -#define TINYFORMAT_PASSARGS_16 v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16 - -#define TINYFORMAT_PASSARGS_TAIL_1 -#define TINYFORMAT_PASSARGS_TAIL_2 , v2 -#define TINYFORMAT_PASSARGS_TAIL_3 , v2, v3 -#define TINYFORMAT_PASSARGS_TAIL_4 , v2, v3, v4 -#define TINYFORMAT_PASSARGS_TAIL_5 , v2, v3, v4, v5 -#define TINYFORMAT_PASSARGS_TAIL_6 , v2, v3, v4, v5, v6 -#define TINYFORMAT_PASSARGS_TAIL_7 , v2, v3, v4, v5, v6, v7 -#define TINYFORMAT_PASSARGS_TAIL_8 , v2, v3, v4, v5, v6, v7, v8 -#define TINYFORMAT_PASSARGS_TAIL_9 , v2, v3, v4, v5, v6, v7, v8, v9 -#define TINYFORMAT_PASSARGS_TAIL_10 , v2, v3, v4, v5, v6, v7, v8, v9, v10 -#define TINYFORMAT_PASSARGS_TAIL_11 , v2, v3, v4, v5, v6, v7, v8, v9, v10, v11 -#define TINYFORMAT_PASSARGS_TAIL_12 , v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12 -#define TINYFORMAT_PASSARGS_TAIL_13 , v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13 -#define TINYFORMAT_PASSARGS_TAIL_14 , v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14 -#define TINYFORMAT_PASSARGS_TAIL_15 , v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 -#define TINYFORMAT_PASSARGS_TAIL_16 , v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16 - -#define TINYFORMAT_FOREACH_ARGNUM(m) \ - m(1) m(2) m(3) m(4) m(5) m(6) m(7) m(8) m(9) m(10) m(11) m(12) m(13) m(14) m(15) m(16) -//[[[end]]] - - - -namespace detail { - -// Type-opaque holder for an argument to format(), with associated actions on -// the type held as explicit function pointers. This allows FormatArg's for -// each argument to be allocated as a homogenous array inside FormatList -// whereas a naive implementation based on inheritance does not. -class FormatArg -{ - public: - FormatArg() - : m_value(NULL), - m_formatImpl(NULL), - m_toIntImpl(NULL) - { } - - template - FormatArg(const T& value) - : m_value(static_cast(&value)), - m_formatImpl(&formatImpl), - m_toIntImpl(&toIntImpl) - { } - - void format(std::wostream& out, const wchar_t* fmtBegin, - const wchar_t* fmtEnd, int ntrunc) const - { - TINYFORMAT_ASSERT(m_value); - TINYFORMAT_ASSERT(m_formatImpl); - m_formatImpl(out, fmtBegin, fmtEnd, ntrunc, m_value); - } - - int toInt() const - { - TINYFORMAT_ASSERT(m_value); - TINYFORMAT_ASSERT(m_toIntImpl); - return m_toIntImpl(m_value); - } - - private: - template - TINYFORMAT_HIDDEN static void formatImpl(std::wostream& out, const wchar_t* fmtBegin, - const wchar_t* fmtEnd, int ntrunc, const void* value) - { - formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast(value)); - } - - template - TINYFORMAT_HIDDEN static int toIntImpl(const void* value) - { - return convertToInt::invoke(*static_cast(value)); - } - - const void* m_value; - void (*m_formatImpl)(std::wostream& out, const wchar_t* fmtBegin, - const wchar_t* fmtEnd, int ntrunc, const void* value); - int (*m_toIntImpl)(const void* value); -}; - - -// Parse and return an integer from the string c, as atoi() -// On return, c is set to one past the end of the integer. -inline int parseIntAndAdvance(const wchar_t*& c) -{ - int i = 0; - for(;*c >= '0' && *c <= '9'; ++c) - i = 10*i + (*c - '0'); - return i; -} - -// Print literal part of format string and return next format spec -// position. -// -// Skips over any occurrences of '%%', printing a literal '%' to the -// output. The position of the first % character of the next -// nontrivial format spec is returned, or the end of string. -inline const wchar_t* printFormatStringLiteral(std::wostream& out, const wchar_t* fmt) -{ - const wchar_t* c = fmt; - for(;; ++c) - { - switch(*c) - { - case '\0': - out.write(fmt, c - fmt); - return c; - case '%': - out.write(fmt, c - fmt); - if(*(c+1) != '%') - return c; - // for "%%", tack trailing % onto next literal section. - fmt = ++c; - break; - default: - break; - } - } -} - - -// Parse a format string and set the stream state accordingly. -// -// The format mini-language recognized here is meant to be the one from C99, -// with the form "%[flags][width][.precision][length]type". -// -// Formatting options which can't be natively represented using the ostream -// state are returned in spacePadPositive (for space padded positive numbers) -// and ntrunc (for truncating conversions). argIndex is incremented if -// necessary to pull out variable width and precision . The function returns a -// pointer to the wchar_tacter after the end of the current format spec. -inline const wchar_t* streamStateFromFormat(std::wostream& out, bool& spacePadPositive, - int& ntrunc, const wchar_t* fmtStart, - const detail::FormatArg* formatters, - int& argIndex, int numFormatters) -{ - if(*fmtStart != '%') - { - TINYFORMAT_ERROR("tinyformat: Not enough conversion specifiers in format string"); - return fmtStart; - } - // Reset stream state to defaults. - out.width(0); - out.precision(6); - out.fill(' '); - // Reset most flags; ignore irrelevant unitbuf & skipws. - out.unsetf(std::ios::adjustfield | std::ios::basefield | - std::ios::floatfield | std::ios::showbase | std::ios::boolalpha | - std::ios::showpoint | std::ios::showpos | std::ios::uppercase); - bool precisionSet = false; - bool widthSet = false; - int widthExtra = 0; - const wchar_t* c = fmtStart + 1; - // 1) Parse flags - for(;; ++c) - { - switch(*c) - { - case '#': - out.setf(std::ios::showpoint | std::ios::showbase); - continue; - case '0': - // overridden by left alignment ('-' flag) - if(!(out.flags() & std::ios::left)) - { - // Use internal padding so that numeric values are - // formatted correctly, eg -00010 rather than 000-10 - out.fill('0'); - out.setf(std::ios::internal, std::ios::adjustfield); - } - continue; - case '-': - out.fill(' '); - out.setf(std::ios::left, std::ios::adjustfield); - continue; - case ' ': - // overridden by show positive sign, '+' flag. - if(!(out.flags() & std::ios::showpos)) - spacePadPositive = true; - continue; - case '+': - out.setf(std::ios::showpos); - spacePadPositive = false; - widthExtra = 1; - continue; - default: - break; - } - break; - } - // 2) Parse width - if(*c >= '0' && *c <= '9') - { - widthSet = true; - out.width(parseIntAndAdvance(c)); - } - if(*c == '*') - { - widthSet = true; - int width = 0; - if(argIndex < numFormatters) - width = formatters[argIndex++].toInt(); - else - TINYFORMAT_ERROR("tinyformat: Not enough arguments to read variable width"); - if(width < 0) - { - // negative widths correspond to '-' flag set - out.fill(' '); - out.setf(std::ios::left, std::ios::adjustfield); - width = -width; - } - out.width(width); - ++c; - } - // 3) Parse precision - if(*c == '.') - { - ++c; - int precision = 0; - if(*c == '*') - { - ++c; - if(argIndex < numFormatters) - precision = formatters[argIndex++].toInt(); - else - TINYFORMAT_ERROR("tinyformat: Not enough arguments to read variable precision"); - } - else - { - if(*c >= '0' && *c <= '9') - precision = parseIntAndAdvance(c); - else if(*c == '-') // negative precisions ignored, treated as zero. - parseIntAndAdvance(++c); - } - out.precision(precision); - precisionSet = true; - } - // 4) Ignore any C99 length modifier - while(*c == 'l' || *c == 'h' || *c == 'L' || - *c == 'j' || *c == 'z' || *c == 't') - ++c; - // 5) We're up to the conversion specifier character. - // Set stream flags based on conversion specifier (thanks to the - // boost::format class for forging the way here). - bool intConversion = false; - switch(*c) - { - case 'u': case 'd': case 'i': - out.setf(std::ios::dec, std::ios::basefield); - intConversion = true; - break; - case 'o': - out.setf(std::ios::oct, std::ios::basefield); - intConversion = true; - break; - case 'X': - out.setf(std::ios::uppercase); - // Falls through - case 'x': case 'p': - out.setf(std::ios::hex, std::ios::basefield); - intConversion = true; - break; - case 'E': - out.setf(std::ios::uppercase); - // Falls through - case 'e': - out.setf(std::ios::scientific, std::ios::floatfield); - out.setf(std::ios::dec, std::ios::basefield); - break; - case 'F': - out.setf(std::ios::uppercase); - // Falls through - case 'f': - out.setf(std::ios::fixed, std::ios::floatfield); - break; - case 'G': - out.setf(std::ios::uppercase); - // Falls through - case 'g': - out.setf(std::ios::dec, std::ios::basefield); - // As in boost::format, let stream decide float format. - out.flags(out.flags() & ~std::ios::floatfield); - break; - case 'a': case 'A': - TINYFORMAT_ERROR("tinyformat: the %a and %A conversion specs " - "are not supported"); - break; - case 'c': - // Handled as special case inside formatValue() - break; - case 's': - if(precisionSet) - ntrunc = static_cast(out.precision()); - // Make %s print booleans as "true" and "false" - out.setf(std::ios::boolalpha); - break; - case 'n': - // Not supported - will cause problems! - TINYFORMAT_ERROR("tinyformat: %n conversion spec not supported"); - break; - case '\0': - TINYFORMAT_ERROR("tinyformat: Conversion spec incorrectly " - "terminated by end of string"); - return c; - default: - break; - } - if(intConversion && precisionSet && !widthSet) - { - // "precision" for integers gives the minimum number of digits (to be - // padded with zeros on the left). This isn't really supported by the - // iostreams, but we can approximately simulate it with the width if - // the width isn't otherwise used. - out.width(out.precision() + widthExtra); - out.setf(std::ios::internal, std::ios::adjustfield); - out.fill('0'); - } - return c+1; -} - - -//------------------------------------------------------------------------------ -inline void formatImpl(std::wostream& out, const wchar_t* fmt, - const detail::FormatArg* formatters, - int numFormatters) -{ - // Saved stream state - std::streamsize origWidth = out.width(); - std::streamsize origPrecision = out.precision(); - std::ios::fmtflags origFlags = out.flags(); - wchar_t origFill = out.fill(); - - for (int argIndex = 0; argIndex < numFormatters; ++argIndex) - { - // Parse the format string - fmt = printFormatStringLiteral(out, fmt); - bool spacePadPositive = false; - int ntrunc = -1; - const wchar_t* fmtEnd = streamStateFromFormat(out, spacePadPositive, ntrunc, fmt, - formatters, argIndex, numFormatters); - if (argIndex >= numFormatters) - { - // Check args remain after reading any variable width/precision - TINYFORMAT_ERROR("tinyformat: Not enough format arguments"); - return; - } - const FormatArg& arg = formatters[argIndex]; - // Format the arg into the stream. - if(!spacePadPositive) - arg.format(out, fmt, fmtEnd, ntrunc); - else - { - // The following is a special case with no direct correspondence - // between stream formatting and the printf() behaviour. Simulate - // it crudely by formatting into a temporary string stream and - // munging the resulting string. - std::wostringstream tmpStream; - tmpStream.copyfmt(out); - tmpStream.setf(std::ios::showpos); - arg.format(tmpStream, fmt, fmtEnd, ntrunc); - std::wstring result = tmpStream.str(); // allocates... yuck. - for(size_t i = 0, iend = result.size(); i < iend; ++i) - if(result[i] == '+') result[i] = ' '; - out << result; - } - fmt = fmtEnd; - } - - // Print remaining part of format string. - fmt = printFormatStringLiteral(out, fmt); - if(*fmt != '\0') - TINYFORMAT_ERROR("tinyformat: Too many conversion specifiers in format string"); - - // Restore stream state - out.width(origWidth); - out.precision(origPrecision); - out.flags(origFlags); - out.fill(origFill); -} - -} // namespace detail - - -/// List of template arguments format(), held in a type-opaque way. -/// -/// A const reference to FormatList (typedef'd as FormatListRef) may be -/// conveniently used to pass arguments to non-template functions: All type -/// information has been stripped from the arguments, leaving just enough of a -/// common interface to perform formatting as required. -class FormatList -{ - public: - FormatList(detail::FormatArg* formatters, int N) - : m_formatters(formatters), m_N(N) { } - - friend void vformat(std::wostream& out, const wchar_t* fmt, - const FormatList& list); - - private: - const detail::FormatArg* m_formatters; - int m_N; -}; - -/// Reference to type-opaque format list for passing to vformat() -typedef const FormatList& FormatListRef; - - -namespace detail { - -// Format list subclass with fixed storage to avoid dynamic allocation -template -class FormatListN : public FormatList -{ - public: -#ifdef TINYFORMAT_USE_VARIADIC_TEMPLATES - template - FormatListN(const Args&... args) - : FormatList(&m_formatterStore[0], N), - m_formatterStore { FormatArg(args)... } - { static_assert(sizeof...(args) == N, "Number of args must be N"); } -#else // C++98 version - void init(int) {} -# define TINYFORMAT_MAKE_FORMATLIST_CONSTRUCTOR(n) \ - \ - template \ - FormatListN(TINYFORMAT_VARARGS(n)) \ - : FormatList(&m_formatterStore[0], n) \ - { TINYFORMAT_ASSERT(n == N); init(0, TINYFORMAT_PASSARGS(n)); } \ - \ - template \ - void init(int i, TINYFORMAT_VARARGS(n)) \ - { \ - m_formatterStore[i] = FormatArg(v1); \ - init(i+1 TINYFORMAT_PASSARGS_TAIL(n)); \ - } - - TINYFORMAT_FOREACH_ARGNUM(TINYFORMAT_MAKE_FORMATLIST_CONSTRUCTOR) -# undef TINYFORMAT_MAKE_FORMATLIST_CONSTRUCTOR -#endif - - private: - FormatArg m_formatterStore[N]; -}; - -// Special 0-arg version - MSVC says zero-sized C array in struct is nonstandard -template<> class FormatListN<0> : public FormatList -{ - public: FormatListN() : FormatList(0, 0) {} -}; - -} // namespace detail - - -//------------------------------------------------------------------------------ -// Primary API functions - -#ifdef TINYFORMAT_USE_VARIADIC_TEMPLATES - -/// Make type-agnostic format list from list of template arguments. -/// -/// The exact return type of this function is an implementation detail and -/// shouldn't be relied upon. Instead it should be stored as a FormatListRef: -/// -/// FormatListRef formatList = makeFormatList( /*...*/ ); -template -detail::FormatListN makeFormatList(const Args&... args) -{ - return detail::FormatListN(args...); -} - -#else // C++98 version - -inline detail::FormatListN<0> makeFormatList() -{ - return detail::FormatListN<0>(); -} -#define TINYFORMAT_MAKE_MAKEFORMATLIST(n) \ -template \ -detail::FormatListN makeFormatList(TINYFORMAT_VARARGS(n)) \ -{ \ - return detail::FormatListN(TINYFORMAT_PASSARGS(n)); \ -} -TINYFORMAT_FOREACH_ARGNUM(TINYFORMAT_MAKE_MAKEFORMATLIST) -#undef TINYFORMAT_MAKE_MAKEFORMATLIST - -#endif - -/// Format list of arguments to the stream according to the given format string. -/// -/// The name vformat() is chosen for the semantic similarity to vprintf(): the -/// list of format arguments is held in a single function argument. -inline void vformat(std::wostream& out, const wchar_t* fmt, FormatListRef list) -{ - detail::formatImpl(out, fmt, list.m_formatters, list.m_N); -} - - -#ifdef TINYFORMAT_USE_VARIADIC_TEMPLATES - -/// Format list of arguments to the stream according to given format string. -template -void format(std::wostream& out, const wchar_t* fmt, const Args&... args) -{ - vformat(out, fmt, makeFormatList(args...)); -} - -/// Format list of arguments according to the given format string and return -/// the result as a string. -template -std::wstring format(const wchar_t* fmt, const Args&... args) -{ - std::wostringstream oss; - format(oss, fmt, args...); - return oss.str(); -} - -/// Format list of arguments to std::wcout, according to the given format string -template -void printf(const wchar_t* fmt, const Args&... args) -{ - format(std::wcout, fmt, args...); -} - -template -void printfln(const wchar_t* fmt, const Args&... args) -{ - format(std::wcout, fmt, args...); - std::wcout << '\n'; -} - - -#else // C++98 version - -inline void format(std::wostream& out, const wchar_t* fmt) -{ - vformat(out, fmt, makeFormatList()); -} - -inline std::wstring format(const wchar_t* fmt) -{ - std::wostringstream oss; - format(oss, fmt); - return oss.str(); -} - -inline void printf(const wchar_t* fmt) -{ - format(std::wcout, fmt); -} - -inline void printfln(const wchar_t* fmt) -{ - format(std::wcout, fmt); - std::wcout << '\n'; -} - -#define TINYFORMAT_MAKE_FORMAT_FUNCS(n) \ - \ -template \ -void format(std::wostream& out, const wchar_t* fmt, TINYFORMAT_VARARGS(n)) \ -{ \ - vformat(out, fmt, makeFormatList(TINYFORMAT_PASSARGS(n))); \ -} \ - \ -template \ -std::wstring format(const wchar_t* fmt, TINYFORMAT_VARARGS(n)) \ -{ \ - std::wostringstream oss; \ - format(oss, fmt, TINYFORMAT_PASSARGS(n)); \ - return oss.str(); \ -} \ - \ -template \ -void printf(const wchar_t* fmt, TINYFORMAT_VARARGS(n)) \ -{ \ - format(std::wcout, fmt, TINYFORMAT_PASSARGS(n)); \ -} \ - \ -template \ -void printfln(const wchar_t* fmt, TINYFORMAT_VARARGS(n)) \ -{ \ - format(std::wcout, fmt, TINYFORMAT_PASSARGS(n)); \ - std::wcout << '\n'; \ -} - -TINYFORMAT_FOREACH_ARGNUM(TINYFORMAT_MAKE_FORMAT_FUNCS) -#undef TINYFORMAT_MAKE_FORMAT_FUNCS - -#endif - - -} // namespace tinyformat - -#endif // TINYFORMAT_H_INCLUDED - -// file: Commands/CAssemblerCommand.h - -class TempData; -class SymbolData; - -class CAssemblerCommand -{ -public: - CAssemblerCommand(); - virtual ~CAssemblerCommand() { }; - virtual bool Validate() = 0; - virtual void Encode() const = 0; - virtual void writeTempData(TempData& tempData) const = 0; - virtual void writeSymData(SymbolData& symData) const { }; - void applyFileInfo(); - int getSection() { return section; } - void updateSection(int num) { section = num; } -protected: - int FileNum; - int FileLine; -private: - int section; -}; - -class DummyCommand: public CAssemblerCommand -{ -public: - virtual bool Validate() { return false; }; - virtual void Encode() const { }; - virtual void writeTempData(TempData& tempData) const { }; - virtual void writeSymData(SymbolData& symData) const { }; -}; - -class InvalidCommand: public CAssemblerCommand -{ -public: - virtual bool Validate() { return false; }; - virtual void Encode() const { }; - virtual void writeTempData(TempData& tempData) const { }; - virtual void writeSymData(SymbolData& symData) const { }; -}; - -// file: Core/Expression.h -#include - -inline std::wstring to_wstring(int64_t value) -{ - return formatString(L"%d", value); -} - -inline std::wstring to_wstring(double value) -{ - return formatString(L"%#.17g", value); -} - -enum class OperatorType -{ - Invalid, - Integer, - Float, - Identifier, - String, - MemoryPos, - Add, - Sub, - Mult, - Div, - Mod, - Neg, - LogNot, - BitNot, - LeftShift, - RightShift, - Less, - Greater, - LessEqual, - GreaterEqual, - Equal, - NotEqual, - BitAnd, - Xor, - BitOr, - LogAnd, - LogOr, - TertiaryIf, - ToString, - FunctionCall -}; - -enum class ExpressionValueType { Invalid, Integer, Float, String}; - -struct ExpressionValue -{ - ExpressionValueType type; - - ExpressionValue() - { - type = ExpressionValueType::Invalid; - } - - ExpressionValue(int64_t value) - { - type = ExpressionValueType::Integer; - intValue = value; - } - - ExpressionValue(double value) - { - type = ExpressionValueType::Float; - floatValue = value; - } - - ExpressionValue(const std::wstring& value) - { - type = ExpressionValueType::String; - strValue = value; - } - - bool isFloat() const - { - return type == ExpressionValueType::Float; - } - - bool isInt() const - { - return type == ExpressionValueType::Integer; - } - - bool isString() const - { - return type == ExpressionValueType::String; - } - - bool isValid() const - { - return type != ExpressionValueType::Invalid; - } - - struct - { - int64_t intValue; - double floatValue; - }; - - std::wstring strValue; - - ExpressionValue operator!() const; - ExpressionValue operator~() const; - bool operator<(const ExpressionValue& other) const; - bool operator<=(const ExpressionValue& other) const; - bool operator>(const ExpressionValue& other) const; - bool operator>=(const ExpressionValue& other) const; - bool operator==(const ExpressionValue& other) const; - bool operator!=(const ExpressionValue& other) const; - ExpressionValue operator+(const ExpressionValue& other) const; - ExpressionValue operator-(const ExpressionValue& other) const; - ExpressionValue operator*(const ExpressionValue& other) const; - ExpressionValue operator/(const ExpressionValue& other) const; - ExpressionValue operator%(const ExpressionValue& other) const; - ExpressionValue operator<<(const ExpressionValue& other) const; - ExpressionValue operator>>(const ExpressionValue& other) const; - ExpressionValue operator&(const ExpressionValue& other) const; - ExpressionValue operator|(const ExpressionValue& other) const; - ExpressionValue operator&&(const ExpressionValue& other) const; - ExpressionValue operator||(const ExpressionValue& other) const; - ExpressionValue operator^(const ExpressionValue& other) const; -}; - -class Label; - -struct ExpressionFunctionEntry; -struct ExpressionLabelFunctionEntry; - -class ExpressionInternal -{ -public: - ExpressionInternal(); - ~ExpressionInternal(); - ExpressionInternal(int64_t value); - ExpressionInternal(double value); - ExpressionInternal(const std::wstring& value, OperatorType type); - ExpressionInternal(OperatorType op, ExpressionInternal* a = nullptr, - ExpressionInternal* b = nullptr, ExpressionInternal* c = nullptr); - ExpressionInternal(const std::wstring& name, const std::vector& parameters); - ExpressionValue evaluate(); - std::wstring toString(); - bool isIdentifier() { return type == OperatorType::Identifier; } - std::wstring getStringValue() { return strValue; } - void replaceMemoryPos(const std::wstring& identifierName); - bool simplify(bool inUnknownOrFalseBlock); - unsigned int getFileNum() { return fileNum; } - unsigned int getSection() { return section; } -private: - void allocate(size_t count); - void deallocate(); - std::wstring formatFunctionCall(); - ExpressionValue executeExpressionFunctionCall(const ExpressionFunctionEntry& entry); - ExpressionValue executeExpressionLabelFunctionCall(const ExpressionLabelFunctionEntry& entry); - ExpressionValue executeFunctionCall(); - bool checkParameterCount(size_t min, size_t max); - - OperatorType type; - ExpressionInternal** children; - size_t childrenCount; - - union - { - int64_t intValue; - double floatValue; - }; - std::wstring strValue; - - unsigned int fileNum, section; -}; - -class Expression -{ -public: - Expression(); - ExpressionValue evaluate(); - bool isLoaded() const { return expression != nullptr; } - void setExpression(ExpressionInternal* exp, bool inUnknownOrFalseBlock); - void replaceMemoryPos(const std::wstring& identifierName); - bool isConstExpression() { return constExpression; } - - template - bool evaluateInteger(T& dest) - { - if (expression == nullptr) - return false; - - ExpressionValue value = expression->evaluate(); - if (value.isInt() == false) - return false; - - dest = (T) value.intValue; - return true; - } - - bool evaluateString(std::wstring& dest, bool convert) - { - if (expression == nullptr) - return false; - - ExpressionValue value = expression->evaluate(); - if (convert && value.isInt()) - { - dest = to_wstring(value.intValue); - return true; - } - - if (convert && value.isFloat()) - { - dest = to_wstring(value.floatValue); - return true; - } - - if (value.isString() == false) - return false; - - dest = value.strValue; - return true; - } - - bool evaluateIdentifier(std::wstring& dest) - { - if (expression == nullptr || expression->isIdentifier() == false) - return false; - - dest = expression->getStringValue(); - return true; - } - - std::wstring toString() { return expression != nullptr ? expression->toString() : L""; }; -private: - std::shared_ptr expression; - std::wstring originalText; - bool constExpression; -}; - -Expression createConstExpression(int64_t value); - -// file: Core/ExpressionFunctions.h -#include - -bool getExpFuncParameter(const std::vector& parameters, size_t index, int64_t& dest, - const std::wstring& funcName, bool optional); - -bool getExpFuncParameter(const std::vector& parameters, size_t index, const std::wstring*& dest, - const std::wstring& funcName, bool optional); - -using ExpressionFunction = ExpressionValue (*)(const std::wstring& funcName, const std::vector&); -using ExpressionLabelFunction = ExpressionValue (*)(const std::wstring& funcName, const std::vector> &); - -enum class ExpFuncSafety -{ - // Result may depend entirely on the internal state - Unsafe, - // Result is unsafe in conditional blocks, safe otherwise - ConditionalUnsafe, - // Result is completely independent of the internal state - Safe, -}; - -struct ExpressionFunctionEntry -{ - ExpressionFunction function; - size_t minParams; - size_t maxParams; - ExpFuncSafety safety; -}; - -struct ExpressionLabelFunctionEntry -{ - ExpressionLabelFunction function; - size_t minParams; - size_t maxParams; - ExpFuncSafety safety; -}; - - -using ExpressionFunctionMap = std::map; -using ExpressionLabelFunctionMap = std::map; - -extern const ExpressionFunctionMap expressionFunctions; -extern const ExpressionLabelFunctionMap expressionLabelFunctions; - -// file: Core/SymbolData.h -#include - -class AssemblerFile; - -struct SymDataSymbol -{ - std::wstring name; - int64_t address; - - bool operator<(const SymDataSymbol& other) const - { - return address < other.address; - } -}; - -struct SymDataAddressInfo -{ - int64_t address; - size_t fileIndex; - size_t lineNumber; - - bool operator<(const SymDataAddressInfo& other) const - { - return address < other.address; - } -}; - -struct SymDataFunction -{ - int64_t address; - size_t size; - - bool operator<(const SymDataFunction& other) const - { - return address < other.address; - } -}; - -struct SymDataData -{ - int64_t address; - size_t size; - int type; - - bool operator<(const SymDataData& other) const - { - if (address != other.address) - return address < other.address; - - if (size != other.size) - return size < other.size; - - return type < other.type; - } -}; - -struct SymDataModule -{ - AssemblerFile* file; - std::vector symbols; - std::vector functions; - std::set data; -}; - -struct SymDataModuleInfo -{ - unsigned int crc32; -}; - -class SymbolData -{ -public: - enum DataType { Data8, Data16, Data32, Data64, DataAscii }; - - SymbolData(); - void clear(); - void setNocashSymFileName(const std::wstring& name, int version) { nocashSymFileName = name; nocashSymVersion = version; }; - void write(); - void setEnabled(bool b) { enabled = b; }; - - void addLabel(int64_t address, const std::wstring& name); - void addData(int64_t address, size_t size, DataType type); - void startModule(AssemblerFile* file); - void endModule(AssemblerFile* file); - void startFunction(int64_t address); - void endFunction(int64_t address); -private: - void writeNocashSym(); - size_t addFileName(const std::wstring& fileName); - - std::wstring nocashSymFileName; - bool enabled; - int nocashSymVersion; - - // entry 0 is for data without parent modules - std::vector modules; - std::vector files; - int currentModule; - int currentFunction; -}; - -// file: Util/Util.h -#include -#include - - -typedef std::vector StringList; - -std::wstring convertUtf8ToWString(const char* source); -std::string convertWCharToUtf8(wchar_t character); -;std::string convertWStringToUtf8(const std::wstring& source); - -std::wstring intToHexString(unsigned int value, int digits, bool prefix = false); -std::wstring intToString(unsigned int value, int digits); -bool stringToInt(const std::wstring& line, size_t start, size_t end, int64_t& result); -int32_t getFloatBits(float value); -float bitsToFloat(int32_t value); -int64_t getDoubleBits(double value); - -StringList getStringListFromArray(wchar_t** source, int count); -StringList splitString(const std::wstring& str, const wchar_t delim, bool skipEmpty); - -int64_t fileSize(const std::wstring& fileName); -bool fileExists(const std::wstring& strFilename); -bool copyFile(const std::wstring& existingFile, const std::wstring& newFile); -bool deleteFile(const std::wstring& fileName);; - -std::wstring toWLowercase(const std::string& str); -std::wstring getFileNameFromPath(const std::wstring& path); -size_t replaceAll(std::wstring& str, const wchar_t* oldValue,const std::wstring& newValue); -bool startsWith(const std::wstring& str, const wchar_t* value, size_t stringPos = 0); - -enum class OpenFileMode { ReadBinary, WriteBinary, ReadWriteBinary }; -FILE* openFile(const std::wstring& fileName, OpenFileMode mode); -std::wstring getCurrentDirectory(); -bool changeDirectory(const std::wstring& dir); -bool isAbsolutePath(const std::wstring& path); - -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(x) (sizeof((x)) / sizeof((x)[0])) -#endif - -// file: Util/FileClasses.h -#include - -class BinaryFile -{ -public: - enum Mode { Read, Write, ReadWrite }; - - BinaryFile(); - ~BinaryFile(); - - bool open(const std::wstring& fileName, Mode mode); - bool open(Mode mode); - bool isOpen() { return handle != nullptr; }; - bool atEnd() { return isOpen() && mode != Write && ftell(handle) == size_; }; - void setPos(long pos) { if (isOpen()) fseek(handle,pos,SEEK_SET); }; - long pos() { return isOpen() ? ftell(handle) : -1; } - long size() { return size_; }; - void close(); - - void setFileName(const std::wstring& name) { fileName = name; }; - const std::wstring& getFileName() { return fileName; }; - - size_t read(void* dest, size_t length); - size_t write(void* source, size_t length); -private: - FILE* handle; - std::wstring fileName; - Mode mode; - long size_; -}; - -class TextFile -{ -public: - enum Encoding { ASCII, UTF8, UTF16LE, UTF16BE, SJIS, GUESS }; - enum Mode { Read, Write }; - - TextFile(); - ~TextFile(); - void openMemory(const std::wstring& content); - bool open(const std::wstring& fileName, Mode mode, Encoding defaultEncoding = GUESS); - bool open(Mode mode, Encoding defaultEncoding = GUESS); - bool isOpen() { return fromMemory || handle != nullptr; }; - bool atEnd() { return isOpen() && mode == Read && tell() >= size_; }; - long size() { return size_; }; - void close(); - - bool hasGuessedEncoding() { return guessedEncoding; }; - bool isFromMemory() { return fromMemory; } - int getNumLines() { return lineCount; } - - void setFileName(const std::wstring& name) { fileName = name; }; - const std::wstring& getFileName() { return fileName; }; - - wchar_t readCharacter(); - std::wstring readLine(); - StringList readAll(); - void writeCharacter(wchar_t character); - void write(const wchar_t* line); - void write(const std::wstring& line); - void write(const char* value); - void write(const std::string& value); - void writeLine(const wchar_t* line); - void writeLine(const std::wstring& line); - void writeLine(const char* line); - void writeLine(const std::string& line); - void writeLines(StringList& list); - - template - void writeFormat(const wchar_t* text, const Args&... args) - { - std::wstring message = formatString(text,args...); - write(message); - } - - bool hasError() { return errorText.size() != 0 && !errorRetrieved; }; - const std::wstring& getErrorText() { errorRetrieved = true; return errorText; }; -private: - long tell(); - void seek(long pos); - - FILE* handle; - std::wstring fileName; - Encoding encoding; - Mode mode; - bool recursion; - bool guessedEncoding; - long size_; - std::wstring errorText; - bool errorRetrieved; - bool fromMemory; - std::wstring content; - size_t contentPos; - int lineCount; - - std::string buf; - size_t bufPos; - - inline unsigned char bufGetChar() - { - if (buf.size() <= bufPos) - { - bufFillRead(); - if (buf.size() == 0) - return 0; - } - return buf[bufPos++]; - } - inline unsigned short bufGet16LE() - { - char c1 = bufGetChar(); - char c2 = bufGetChar(); - return c1 | (c2 << 8); - } - inline unsigned short bufGet16BE() - { - char c1 = bufGetChar(); - char c2 = bufGetChar(); - return c2 | (c1 << 8); - } - - void bufPut(const void *p, const size_t len); - void bufPut(const char c); - - void bufFillRead(); - void bufDrainWrite(); -}; - -wchar_t sjisToUnicode(unsigned short); -TextFile::Encoding getEncodingFromString(const std::wstring& str); - -// file: Util/ByteArray.h - -#include - -#if defined(_MSC_VER) && !defined(ssize_t) -typedef intptr_t ssize_t; -#endif - -typedef unsigned char byte; - -enum class Endianness { Big, Little }; - -class ByteArray -{ -public: - ByteArray(); - ByteArray(const ByteArray& other); - ByteArray(byte* data, size_t size); - ByteArray(ByteArray&& other); - ~ByteArray(); - ByteArray& operator=(ByteArray& other); - ByteArray& operator=(ByteArray&& other); - - size_t append(const ByteArray& other); - size_t append(void* data, size_t size); - size_t appendByte(byte b) { return append(&b,1); }; - void replaceByte(size_t pos, byte b) { data_[pos] = b; }; - void replaceBytes(size_t pos, byte* data, size_t size); - void reserveBytes(size_t count, byte value = 0); - void alignSize(size_t alignment); - - int getWord(size_t pos, Endianness endianness = Endianness::Little) const - { - if (pos+1 >= this->size()) return -1; - unsigned char* d = (unsigned char*) this->data(); - - if (endianness == Endianness::Little) - { - return d[pos+0] | (d[pos+1] << 8); - } else { - return d[pos+1] | (d[pos+0] << 8); - } - } - - int getDoubleWord(size_t pos, Endianness endianness = Endianness::Little) const - { - if (pos+3 >= this->size()) return -1; - unsigned char* d = (unsigned char*) this->data(); - - if (endianness == Endianness::Little) - { - return d[pos+0] | (d[pos+1] << 8) | (d[pos+2] << 16) | (d[pos+3] << 24); - } else { - return d[pos+3] | (d[pos+2] << 8) | (d[pos+1] << 16) | (d[pos+0] << 24); - } - } - - void replaceWord(size_t pos, unsigned int w, Endianness endianness = Endianness::Little) - { - if (pos+1 >= this->size()) return; - unsigned char* d = (unsigned char*) this->data(); - - if (endianness == Endianness::Little) - { - d[pos+0] = w & 0xFF; - d[pos+1] = (w >> 8) & 0xFF; - } else { - d[pos+0] = (w >> 8) & 0xFF; - d[pos+1] = w & 0xFF; - } - } - - void replaceDoubleWord(size_t pos, unsigned int w, Endianness endianness = Endianness::Little) - { - if (pos+3 >= this->size()) return; - unsigned char* d = (unsigned char*) this->data(); - - if (endianness == Endianness::Little) - { - d[pos+0] = w & 0xFF; - d[pos+1] = (w >> 8) & 0xFF; - d[pos+2] = (w >> 16) & 0xFF; - d[pos+3] = (w >> 24) & 0xFF; - } else { - d[pos+0] = (w >> 24) & 0xFF; - d[pos+1] = (w >> 16) & 0xFF; - d[pos+2] = (w >> 8) & 0xFF; - d[pos+3] = w & 0xFF; - } - } - - byte& operator [](size_t index) - { - return data_[index]; - }; - - const byte& operator [](size_t index) const - { - return data_[index]; - }; - - size_t size() const { return size_; }; - byte* data(size_t pos = 0) const { return &data_[pos]; }; - void clear() { size_ = 0; }; - void resize(size_t newSize); - ByteArray mid(size_t start, ssize_t length = 0); - ByteArray left(size_t length) { return mid(0,length); }; - ByteArray right(size_t length) { return mid(size_-length,length); }; - - static ByteArray fromFile(const std::wstring& fileName, long start = 0, size_t size = 0); - bool toFile(const std::wstring& fileName); -private: - void grow(size_t neededSize); - byte* data_; - size_t size_; - size_t allocatedSize_; -}; - -// file: Core/FileManager.h -#include - -class AssemblerFile -{ -public: - virtual ~AssemblerFile() { }; - - virtual bool open(bool onlyCheck) = 0; - virtual void close() = 0; - virtual bool isOpen() = 0; - virtual bool write(void* data, size_t length) = 0; - virtual int64_t getVirtualAddress() = 0; - virtual int64_t getPhysicalAddress() = 0; - virtual int64_t getHeaderSize() = 0; - virtual bool seekVirtual(int64_t virtualAddress) = 0; - virtual bool seekPhysical(int64_t physicalAddress) = 0; - virtual bool getModuleInfo(SymDataModuleInfo& info) { return false; }; - virtual bool hasFixedVirtualAddress() { return false; }; - virtual void beginSymData(SymbolData& symData) { }; - virtual void endSymData(SymbolData& symData) { }; - virtual const std::wstring& getFileName() = 0; -}; - -class GenericAssemblerFile: public AssemblerFile -{ -public: - GenericAssemblerFile(const std::wstring& fileName, int64_t headerSize, bool overwrite); - GenericAssemblerFile(const std::wstring& fileName, const std::wstring& originalFileName, int64_t headerSize); - - virtual bool open(bool onlyCheck); - virtual void close() { if (handle.isOpen()) handle.close(); }; - virtual bool isOpen() { return handle.isOpen(); }; - virtual bool write(void* data, size_t length); - virtual int64_t getVirtualAddress() { return virtualAddress; }; - virtual int64_t getPhysicalAddress() { return virtualAddress-headerSize; }; - virtual int64_t getHeaderSize() { return headerSize; }; - virtual bool seekVirtual(int64_t virtualAddress); - virtual bool seekPhysical(int64_t physicalAddress); - virtual bool hasFixedVirtualAddress() { return true; }; - - virtual const std::wstring& getFileName() { return fileName; }; - const std::wstring& getOriginalFileName() { return originalName; }; - int64_t getOriginalHeaderSize() { return originalHeaderSize; }; - void setHeaderSize(int64_t size) { headerSize = size; }; - -private: - enum Mode { Open, Create, Copy }; - - Mode mode; - int64_t originalHeaderSize; - int64_t headerSize; - int64_t virtualAddress; - BinaryFile handle; - std::wstring fileName; - std::wstring originalName; -}; - - -class FileManager -{ -public: - FileManager(); - ~FileManager(); - void reset(); - bool openFile(std::shared_ptr file, bool onlyCheck); - void addFile(std::shared_ptr file); - bool hasOpenFile() { return activeFile != nullptr; }; - void closeFile(); - bool write(void* data, size_t length); - bool writeU8(uint8_t data); - bool writeU16(uint16_t data); - bool writeU32(uint32_t data); - bool writeU64(uint64_t data); - int64_t getVirtualAddress(); - int64_t getPhysicalAddress(); - int64_t getHeaderSize(); - bool seekVirtual(int64_t virtualAddress); - bool seekPhysical(int64_t physicalAddress); - bool advanceMemory(size_t bytes); - std::shared_ptr getOpenFile() { return activeFile; }; - void setEndianness(Endianness endianness) { this->endianness = endianness; }; - Endianness getEndianness() { return endianness; } -private: - bool checkActiveFile(); - std::vector> files; - std::shared_ptr activeFile; - Endianness endianness; - Endianness ownEndianness; -}; - -// file: Core/ELF/ElfTypes.h - -/////////////////////// -// ELF Header Constants - -// File type -enum ElfType -{ - ET_NONE =0, - ET_REL =1, - ET_EXEC =2, - ET_DYN =3, - ET_CORE =4, - ET_LOPROC =0xFF00, - ET_HIPROC =0xFFFF, -}; - -// Machine/Architecture -enum ElfMachine -{ - EM_NONE =0, - EM_MIPS =8, - EM_ARM =40, -}; - -// File version -#define EV_NONE 0 -#define EV_CURRENT 1 - -// Identification index -#define EI_MAG0 0 -#define EI_MAG1 1 -#define EI_MAG2 2 -#define EI_MAG3 3 -#define EI_CLASS 4 -#define EI_DATA 5 -#define EI_VERSION 6 -#define EI_PAD 7 -#define EI_NIDENT 16 - -// Magic number -#define ELFMAG0 0x7F -#define ELFMAG1 'E' -#define ELFMAG2 'L' -#define ELFMAG3 'F' - -// File class -#define ELFCLASSNONE 0 -#define ELFCLASS32 1 -#define ELFCLASS64 2 - -// Encoding -#define ELFDATANONE 0 -#define ELFDATA2LSB 1 -#define ELFDATA2MSB 2 - - -///////////////////// -// Sections constants - -// Section indexes -#define SHN_UNDEF 0 -#define SHN_LORESERVE 0xFF00 -#define SHN_LOPROC 0xFF00 -#define SHN_HIPROC 0xFF1F -#define SHN_ABS 0xFFF1 -#define SHN_COMMON 0xFFF2 -#define SHN_HIRESERVE 0xFFFF - -// Section types -#define SHT_NULL 0 -#define SHT_PROGBITS 1 -#define SHT_SYMTAB 2 -#define SHT_STRTAB 3 -#define SHT_RELA 4 -#define SHT_HASH 5 -#define SHT_DYNAMIC 6 -#define SHT_NOTE 7 -#define SHT_NOBITS 8 -#define SHT_REL 9 -#define SHT_SHLIB 10 -#define SHT_DYNSYM 11 -#define SHT_INIT_ARRAY 14 -#define SHT_LOPROC 0x70000000 -#define SHT_HIPROC 0x7FFFFFFF -#define SHT_LOUSER 0x80000000 -#define SHT_HIUSER 0xFFFFFFFF - -// Custom section types -#define SHT_PSPREL 0x700000a0 - - -// Section flags -enum ElfSectionFlags -{ - SHF_WRITE =0x1, - SHF_ALLOC =0x2, - SHF_EXECINSTR =0x4, - SHF_MASKPROC =0xF0000000, -}; - -// Symbol binding -#define STB_LOCAL 0 -#define STB_GLOBAL 1 -#define STB_WEAK 2 -#define STB_LOPROC 13 -#define STB_HIPROC 15 - -// Symbol types -#define STT_NOTYPE 0 -#define STT_OBJECT 1 -#define STT_FUNC 2 -#define STT_SECTION 3 -#define STT_FILE 4 -#define STT_LOPROC 13 -#define STT_HIPROC 15 - -// Undefined name -#define STN_UNDEF 0 - -// Relocation types -#define R_386_NONE 0 -#define R_386_32 1 -#define R_386_PC32 2 -#define R_386_GOT32 3 -#define R_386_PLT32 4 -#define R_386_COPY 5 -#define R_386_GLOB_DAT 6 -#define R_386_JMP_SLOT 7 -#define R_386_RELATIVE 8 -#define R_386_GOTOFF 9 -#define R_386_GOTPC 10 - -// Segment types -#define PT_NULL 0 -#define PT_LOAD 1 -#define PT_DYNAMIC 2 -#define PT_INTERP 3 -#define PT_NOTE 4 -#define PT_SHLIB 5 -#define PT_PHDR 6 -#define PT_LOPROC 0x70000000 -#define PT_HIPROC 0x7FFFFFFF - -// Segment flags -#define PF_X 1 -#define PF_W 2 -#define PF_R 4 - -// Dynamic Array Tags -#define DT_NULL 0 -#define DT_NEEDED 1 -#define DT_PLTRELSZ 2 -#define DT_PLTGOT 3 -#define DT_HASH 4 -#define DT_STRTAB 5 -#define DT_SYMTAB 6 -#define DT_RELA 7 -#define DT_RELASZ 8 -#define DT_RELAENT 9 -#define DT_STRSZ 10 -#define DT_SYMENT 11 -#define DT_INIT 12 -#define DT_FINI 13 -#define DT_SONAME 14 -#define DT_RPATH 15 -#define DT_SYMBOLIC 16 -#define DT_REL 17 -#define DT_RELSZ 18 -#define DT_RELENT 19 -#define DT_PLTREL 20 -#define DT_DEBUG 21 -#define DT_TEXTREL 22 -#define DT_JMPREL 23 -#define DT_LOPROC 0x70000000 -#define DT_HIPROC 0x7FFFFFFF - -typedef unsigned int Elf32_Addr; -typedef unsigned short Elf32_Half; -typedef unsigned int Elf32_Off; -typedef signed int Elf32_Sword; -typedef unsigned int Elf32_Word; - - -// ELF file header -struct Elf32_Ehdr -{ - unsigned char e_ident[EI_NIDENT]; - Elf32_Half e_type; - Elf32_Half e_machine; - Elf32_Word e_version; - Elf32_Addr e_entry; - Elf32_Off e_phoff; - Elf32_Off e_shoff; - Elf32_Word e_flags; - Elf32_Half e_ehsize; - Elf32_Half e_phentsize; - Elf32_Half e_phnum; - Elf32_Half e_shentsize; - Elf32_Half e_shnum; - Elf32_Half e_shstrndx; -}; - -// Section header -struct Elf32_Shdr -{ - Elf32_Word sh_name; - Elf32_Word sh_type; - Elf32_Word sh_flags; - Elf32_Addr sh_addr; - Elf32_Off sh_offset; - Elf32_Word sh_size; - Elf32_Word sh_link; - Elf32_Word sh_info; - Elf32_Word sh_addralign; - Elf32_Word sh_entsize; -}; - -// Segment header -struct Elf32_Phdr -{ - Elf32_Word p_type; - Elf32_Off p_offset; - Elf32_Addr p_vaddr; - Elf32_Addr p_paddr; - Elf32_Word p_filesz; - Elf32_Word p_memsz; - Elf32_Word p_flags; - Elf32_Word p_align; -}; - -// Symbol table entry -struct Elf32_Sym -{ - Elf32_Word st_name; - Elf32_Addr st_value; - Elf32_Word st_size; - unsigned char st_info; - unsigned char st_other; - Elf32_Half st_shndx; -}; - -#define ELF32_ST_BIND(i) ((i)>>4) -#define ELF32_ST_TYPE(i) ((i)&0xf) -#define ELF32_ST_INFO(b,t) (((b)<<4)+((t)&0xf)) - -// Relocation entries -struct Elf32_Rel -{ - Elf32_Addr r_offset; - Elf32_Word r_info; - - unsigned char getType() - { - return r_info & 0xFF; - } - - Elf32_Word getSymbolNum() - { - return r_info >> 8; - } -}; - -struct Elf32_Rela -{ - Elf32_Addr r_offset; - Elf32_Word r_info; - Elf32_Sword r_addend; -}; - -#define ELF32_R_SYM(i) ((i)>>8) -#define ELF32_R_TYPE(i) ((unsigned char)(i)) -#define ELF32_R_INFO(s,t) (((s)<<8 )+(unsigned char)(t)) - -// file: Core/ELF/ElfFile.h - -#include - -enum ElfPart { ELFPART_SEGMENTTABLE, ELFPART_SECTIONTABLE, ELFPART_SEGMENTS, ELFPART_SEGMENTLESSSECTIONS }; - -class ElfSegment; -class ElfSection; - -class ElfFile -{ -public: - - bool load(const std::wstring&fileName, bool sort); - bool load(ByteArray& data, bool sort); - void save(const std::wstring&fileName); - - Elf32_Half getType() { return fileHeader.e_type; }; - Elf32_Half getMachine() { return fileHeader.e_machine; }; - Endianness getEndianness() - { - return fileHeader.e_ident[EI_DATA] == ELFDATA2MSB ? Endianness::Big : Endianness::Little; - } - size_t getSegmentCount() { return segments.size(); }; - ElfSegment* getSegment(size_t index) { return segments[index]; }; - - int findSegmentlessSection(const std::string& name); - ElfSection* getSegmentlessSection(size_t index) { return segmentlessSections[index]; }; - size_t getSegmentlessSectionCount() { return segmentlessSections.size(); }; - ByteArray& getFileData() { return fileData; } - - int getSymbolCount(); - bool getSymbol(Elf32_Sym& symbol, size_t index); - const char* getStrTableString(size_t pos); -private: - void loadElfHeader(); - void writeHeader(ByteArray& data, int pos, Endianness endianness); - void loadProgramHeader(Elf32_Phdr& header, ByteArray& data, int pos); - void loadSectionHeader(Elf32_Shdr& header, ByteArray& data, int pos); - void loadSectionNames(); - void determinePartOrder(); - - Elf32_Ehdr fileHeader; - std::vector segments; - std::vector sections; - std::vector segmentlessSections; - ByteArray fileData; - ElfPart partsOrder[4]; - - ElfSection* symTab; - ElfSection* strTab; -}; - - -class ElfSection -{ -public: - ElfSection(Elf32_Shdr header); - void setName(std::string& name) { this->name = name; }; - const std::string& getName() { return name; }; - void setData(ByteArray& data) { this->data = data; }; - void setOwner(ElfSegment* segment); - bool hasOwner() { return owner != nullptr; }; - void writeHeader(ByteArray& data, int pos, Endianness endianness); - void writeData(ByteArray& output); - void setOffsetBase(int base); - ByteArray& getData() { return data; }; - - Elf32_Word getType() { return header.sh_type; }; - Elf32_Off getOffset() { return header.sh_offset; }; - Elf32_Word getSize() { return header.sh_size; }; - Elf32_Word getNameOffset() { return header.sh_name; }; - Elf32_Word getAlignment() { return header.sh_addralign; }; - Elf32_Addr getAddress() { return header.sh_addr; }; - Elf32_Half getInfo() { return header.sh_info; }; - Elf32_Word getFlags() { return header.sh_flags; }; -private: - Elf32_Shdr header; - std::string name; - ByteArray data; - ElfSegment* owner; -}; - -class ElfSegment -{ -public: - ElfSegment(Elf32_Phdr header, ByteArray& segmentData); - bool isSectionPartOf(ElfSection* section); - void addSection(ElfSection* section); - Elf32_Off getOffset() { return header.p_offset; }; - Elf32_Word getPhysSize() { return header.p_filesz; }; - Elf32_Word getType() { return header.p_type; }; - Elf32_Addr getVirtualAddress() { return header.p_vaddr; }; - size_t getSectionCount() { return sections.size(); }; - void writeHeader(ByteArray& data, int pos, Endianness endianness); - void writeData(ByteArray& output); - void splitSections(); - - int findSection(const std::string& name); - ElfSection* getSection(size_t index) { return sections[index]; }; - void writeToData(size_t offset, void* data, size_t size); - void sortSections(); -private: - Elf32_Phdr header; - ByteArray data; - std::vector sections; - ElfSection* paddrSection; -}; - -struct RelocationData -{ - int64_t opcodeOffset; - int64_t relocationBase; - uint32_t opcode; - - int64_t symbolAddress; - int targetSymbolType; - int targetSymbolInfo; -}; - -// file: Core/ELF/ElfRelocator.h - -struct ElfRelocatorCtor -{ - std::wstring symbolName; - size_t size; -}; - -struct RelocationAction -{ - RelocationAction(int64_t offset, uint32_t newValue) : offset(offset), newValue(newValue) {} - int64_t offset; - uint32_t newValue; -}; - -class CAssemblerCommand; -class Parser; - -class IElfRelocator -{ -public: - virtual ~IElfRelocator() {}; - virtual int expectedMachine() const = 0; - virtual bool isDummyRelocationType(int type) const { return false; } - virtual bool relocateOpcode(int type, const RelocationData& data, std::vector& actions, std::vector& errors) = 0; - virtual bool finish(std::vector& actions, std::vector& errors) { return true; } - virtual void setSymbolAddress(RelocationData& data, int64_t symbolAddress, int symbolType) = 0; - - virtual std::unique_ptr generateCtorStub(std::vector& ctors) { return nullptr; } -}; - - -class Label; - -struct ElfRelocatorSection -{ - ElfSection* section; - size_t index; - ElfSection* relSection; - std::shared_ptr