diff --git a/Cargo.toml b/Cargo.toml
index d040482..a21b83f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,27 +4,8 @@ edition = "2018"
name = "doukutsu-rs"
version = "0.1.0"
-#[lib]
-#crate-type = ["lib", "cdylib"]
-
-[package.metadata.android]
-android_version = 29
-target_sdk_version = 28
-min_sdk_version = 26
-build_targets = ["aarch64-linux-android"]
-package_name = "io.github.doukutsu_rs.android"
-apk_label = "doukutsu-rs"
-opengles_version = [3, 1]
-fullscreen = true
-orientation = "sensorLandscape"
-permission = [
- { name = "android.permission.READ_EXTERNAL_STORAGE" },
- { name = "android.permission.WRITE_EXTERNAL_STORAGE" }
-]
-application_metadatas = [
- { name = "android:hardwareAccelerated", value = "true" },
- { name = "android:requestLegacyExternalStorage", value = "true" }
-]
+[lib]
+crate-type = ["lib", "cdylib"]
[profile.release]
lto = 'thin'
@@ -43,20 +24,22 @@ opt-level = 1
default = ["scripting", "backend-sdl", "ogg-playback"]
ogg-playback = ["lewton"]
backend-sdl = ["sdl2"]
-backend-gfx = ["winit", "imgui-gfx-renderer", "imgui-winit-support"]
+#backend-sokol = ["sokol"]
+backend-glutin = ["winit", "glutin"]
scripting = ["lua-ffi"]
editor = []
[dependencies]
+#cpal = { path = "./3rdparty/cpal" }
+#glutin = { path = "./3rdparty/glutin/glutin", optional = true }
bitvec = "0.20"
byteorder = "1.4"
case_insensitive_hashmap = "1.0.0"
chrono = "0.4"
-cpal = "0.13"
+cpal = { git = "https://github.com/doukutsu-rs/cpal.git", rev = "e027550be0b93b7e2912c7de28a4944a7d04e070" }
directories = "3"
+glutin = { git = "https://github.com/doukutsu-rs/glutin.git", rev = "a34ee3c99b3c999b638ca2bae53cf96df2b94c04", optional = true }
imgui = "0.7.0"
-imgui-gfx-renderer = { version = "0.7.0", optional = true }
-imgui-winit-support = { version = "0.7.0", default-features = false, features = ["winit-24"], optional = true }
image = { version = "0.23", default-features = false, features = ["png", "bmp"] }
itertools = "0.10"
lazy_static = "1.4.0"
@@ -69,6 +52,7 @@ num-traits = "0.2.12"
paste = "1.0.0"
pretty_env_logger = "0.4.0"
sdl2 = { version = "0.34", optional = true, features = ["unsafe_textures", "bundled", "static-link"] }
+#sokol = { git = "https://github.com/doukutsu-rs/sokol-rs.git", rev = "", optional = true }
serde = { version = "1", features = ["derive"] }
serde_derive = "1"
serde_yaml = "0.8"
@@ -77,12 +61,16 @@ strum_macros = "0.20"
# remove and replace when drain_filter is in stable
vec_mut_scan = "0.4"
webbrowser = "0.5.5"
-winit = { version = "0.24", features = ["serde"], optional = true }
+winit = { version = "0.24", optional = true }
+
+#[build-dependencies]
+#gl_generator = { version = "0.14.0", optional = true }
[target.'cfg(target_os = "windows")'.dependencies]
winapi = { version = "0.3", features = ["winuser"] }
[target.'cfg(target_os = "android")'.dependencies]
-ndk = "0.3"
-ndk-glue = "0.3"
+ndk = "0.2"
+ndk-glue = "0.2"
+ndk-sys = "0.2"
jni = "0.19"
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..bd3a20d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1,233 @@
+
+# Created by https://www.toptal.com/developers/gitignore/api/androidstudio,gradle,android
+# Edit at https://www.toptal.com/developers/gitignore?templates=androidstudio,gradle,android
+
+### Android ###
+# Built application files
+*.apk
+*.aar
+*.ap_
+*.aab
+
+# Files for the ART/Dalvik VM
+*.dex
+
+# Java class files
+*.class
+
+# Generated files
+bin/
+gen/
+out/
+# Uncomment the following line in case you need and you don't have the release build type files in your app
+# release/
+
+# Gradle files
+.gradle/
+build/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Proguard folder generated by Eclipse
+proguard/
+
+# Log Files
+*.log
+
+# Android Studio Navigation editor temp files
+.navigation/
+
+# Android Studio captures folder
+captures/
+
+# IntelliJ
+*.iml
+.idea/workspace.xml
+.idea/tasks.xml
+.idea/gradle.xml
+.idea/assetWizardSettings.xml
+.idea/dictionaries
+.idea/libraries
+# Android Studio 3 in .gitignore file.
+.idea/caches
+.idea/modules.xml
+# Comment next line if keeping position of elements in Navigation Editor is relevant for you
+.idea/navEditor.xml
+
+# Keystore files
+# Uncomment the following lines if you do not want to check your keystore files in.
+#*.jks
+#*.keystore
+
+# External native build folder generated in Android Studio 2.2 and later
+.externalNativeBuild
+.cxx/
+
+# Google Services (e.g. APIs or Firebase)
+# google-services.json
+
+# Freeline
+freeline.py
+freeline/
+freeline_project_description.json
+
+# fastlane
+fastlane/report.xml
+fastlane/Preview.html
+fastlane/screenshots
+fastlane/test_output
+fastlane/readme.md
+
+# Version control
+vcs.xml
+
+# lint
+lint/intermediates/
+lint/generated/
+lint/outputs/
+lint/tmp/
+# lint/reports/
+
+### Android Patch ###
+gen-external-apklibs
+output.json
+
+# Replacement of .externalNativeBuild directories introduced
+# with Android Studio 3.5.
+
+### Gradle ###
+.gradle
+
+# Ignore Gradle GUI config
+gradle-app.setting
+
+# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
+!gradle-wrapper.jar
+
+# Cache of project
+.gradletasknamecache
+
+# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
+# gradle/wrapper/gradle-wrapper.properties
+
+### Gradle Patch ###
+**/build/
+
+### AndroidStudio ###
+# Covers files to be ignored for android development using Android Studio.
+
+# Built application files
+
+# Files for the ART/Dalvik VM
+
+# Java class files
+
+# Generated files
+
+# Gradle files
+
+# Signing files
+.signing/
+
+# Local configuration file (sdk path, etc)
+
+# Proguard folder generated by Eclipse
+
+# Log Files
+
+# Android Studio
+/*/build/
+/*/local.properties
+/*/out
+/*/*/build
+/*/*/production
+*.ipr
+*~
+*.swp
+
+# Keystore files
+*.jks
+*.keystore
+
+# Google Services (e.g. APIs or Firebase)
+# google-services.json
+
+# Android Patch
+
+# External native build folder generated in Android Studio 2.2 and later
+
+# NDK
+obj/
+*.so
+
+# IntelliJ IDEA
+*.iws
+/out/
+
+# User-specific configurations
+.idea/caches/
+.idea/libraries/
+.idea/shelf/
+.idea/.name
+.idea/compiler.xml
+.idea/copyright/profiles_settings.xml
+.idea/encodings.xml
+.idea/misc.xml
+.idea/scopes/scope_settings.xml
+.idea/vcs.xml
+.idea/jsLibraryMappings.xml
+.idea/datasources.xml
+.idea/dataSources.ids
+.idea/sqlDataSources.xml
+.idea/dynamic.xml
+.idea/uiDesigner.xml
+.idea/jarRepositories.xml
+
+# OS-specific files
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+ehthumbs.db
+Thumbs.db
+
+# Legacy Eclipse project files
+.classpath
+.project
+.cproject
+.settings/
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.war
+*.ear
+
+# virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml)
+hs_err_pid*
+
+## Plugin-specific files:
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Mongo Explorer plugin
+.idea/mongoSettings.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+### AndroidStudio Patch ###
+
+!/gradle/wrapper/gradle-wrapper.jar
+
+# End of https://www.toptal.com/developers/gitignore/api/androidstudio,gradle,android
diff --git a/app/app/.gitignore b/app/app/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/app/app/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/app/app/build.gradle b/app/app/build.gradle
new file mode 100644
index 0000000..cd13dd5
--- /dev/null
+++ b/app/app/build.gradle
@@ -0,0 +1,99 @@
+plugins {
+ id 'com.android.application'
+ id 'com.github.willir.rust.cargo-ndk-android'
+}
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+ //ndkVersion "21.3.6528147"
+
+ defaultConfig {
+ applicationId "io.github.doukutsu_rs"
+ minSdkVersion 24
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+
+ ndk {
+ abiFilters 'x86', 'arm64-v8a'
+ }
+
+ externalNativeBuild {
+ cmake {
+ arguments "-DANDROID_STL=c++_shared"
+ }
+ }
+
+ def documentsAuthorityValue = applicationId + ".documents"
+
+ manifestPlaceholders =
+ [documentsAuthority: documentsAuthorityValue]
+
+ buildConfigField "String",
+ "DOCUMENTS_AUTHORITY",
+ "\"${documentsAuthorityValue}\""
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+ buildFeatures {
+ viewBinding true
+ }
+
+ externalNativeBuild {
+ cmake {
+ path "src/main/cpp/CMakeLists.txt"
+ }
+ }
+}
+
+dependencies {
+ implementation 'com.android.support:support-annotations:28.0.0'
+}
+
+println("cargo target: ${project.buildDir.getAbsolutePath()}/rust-target")
+
+cargoNdk {
+ targets = [
+ "x86",
+ "arm64"
+ ]
+ librariesNames = ["libdoukutsu_rs.so"]
+ //targetDirectory = "${project.buildDir.getAbsolutePath()}/rust-target"
+ module = "../"
+ extraCargoEnv = ["ANDROID_NDK_HOME": android.ndkDirectory]
+ extraCargoBuildArguments = ["--no-default-features", "--features", "backend-glutin ogg-playback scripting"]
+ verbose = true
+
+ buildTypes {
+ release {
+ buildType = "release"
+ }
+ debug {
+ buildType = "debug"
+ }
+ }
+}
+
+tasks.whenTaskAdded { task ->
+ if (task.name == 'javaPreCompileDebug') {
+ task.dependsOn 'buildCargoNdkDebug'
+ }
+
+ if (task.name == 'javaPreCompileRelease') {
+ task.dependsOn 'buildCargoNdkRelease'
+ }
+}
diff --git a/app/app/proguard-rules.pro b/app/app/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/app/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/app/app/src/main/AndroidManifest.xml b/app/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..0621a0c
--- /dev/null
+++ b/app/app/src/main/AndroidManifest.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/app/src/main/cpp/CMakeLists.txt b/app/app/src/main/cpp/CMakeLists.txt
new file mode 100644
index 0000000..3ac7e5b
--- /dev/null
+++ b/app/app/src/main/cpp/CMakeLists.txt
@@ -0,0 +1,53 @@
+# Sets the minimum version of CMake required to build your native library.
+# This ensures that a certain set of CMake features is available to
+# your build.
+
+cmake_minimum_required(VERSION 3.10)
+
+# Copy shared STL files to Android Studio output directory so they can be
+# packaged in the APK.
+# Usage:
+#
+# find_package(ndk-stl REQUIRED)
+#
+# or
+#
+# find_package(ndk-stl REQUIRED PATHS ".")
+
+if(NOT ${ANDROID_STL} MATCHES "_shared")
+ return()
+endif()
+
+function(configure_shared_stl lib_path so_base)
+ message("Configuring STL ${so_base} for ${ANDROID_ABI}")
+ configure_file(
+ "${ANDROID_NDK}/sources/cxx-stl/${lib_path}/libs/${ANDROID_ABI}/lib${so_base}.so"
+ "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${so_base}.so"
+ COPYONLY)
+endfunction()
+
+if("${ANDROID_STL}" STREQUAL "libstdc++")
+ # The default minimal system C++ runtime library.
+elseif("${ANDROID_STL}" STREQUAL "gabi++_shared")
+ # The GAbi++ runtime (shared).
+ message(FATAL_ERROR "gabi++_shared was not configured by ndk-stl package")
+elseif("${ANDROID_STL}" STREQUAL "stlport_shared")
+ # The STLport runtime (shared).
+ configure_shared_stl("stlport" "stlport_shared")
+elseif("${ANDROID_STL}" STREQUAL "gnustl_shared")
+ # The GNU STL (shared).
+ configure_shared_stl("gnu-libstdc++/4.9" "gnustl_shared")
+elseif("${ANDROID_STL}" STREQUAL "c++_shared")
+ # The LLVM libc++ runtime (static).
+ configure_shared_stl("llvm-libc++" "c++_shared")
+else()
+ message(FATAL_ERROR "STL configuration ANDROID_STL=${ANDROID_STL} is not supported")
+endif()
+
+# Specifies a library name, specifies whether the library is STATIC or
+# SHARED, and provides relative paths to the source code. You can
+# define multiple libraries by adding multiple add_library() commands,
+# and CMake builds them for you. When you build your app, Gradle
+# automatically packages shared libraries with your APK.
+
+#add_library(dummy SHARED dummy.cpp)
diff --git a/app/app/src/main/cpp/dummy.cpp b/app/app/src/main/cpp/dummy.cpp
new file mode 100644
index 0000000..b1e9dbb
--- /dev/null
+++ b/app/app/src/main/cpp/dummy.cpp
@@ -0,0 +1,2 @@
+void drs_dummy_export() {
+}
diff --git a/app/app/src/main/ic_launcher-playstore.png b/app/app/src/main/ic_launcher-playstore.png
new file mode 100644
index 0000000..c320b1c
Binary files /dev/null and b/app/app/src/main/ic_launcher-playstore.png differ
diff --git a/app/app/src/main/java/io/github/doukutsu_rs/DoukutsuDocumentsProvider.java b/app/app/src/main/java/io/github/doukutsu_rs/DoukutsuDocumentsProvider.java
new file mode 100644
index 0000000..01fe368
--- /dev/null
+++ b/app/app/src/main/java/io/github/doukutsu_rs/DoukutsuDocumentsProvider.java
@@ -0,0 +1,279 @@
+package io.github.doukutsu_rs;
+
+import android.database.Cursor;
+import android.database.MatrixCursor;
+import android.database.MatrixCursor.RowBuilder;
+import android.os.CancellationSignal;
+import android.os.ParcelFileDescriptor;
+import android.provider.DocumentsContract.Document;
+import android.provider.DocumentsContract.Root;
+import android.provider.DocumentsProvider;
+import android.util.Log;
+import android.webkit.MimeTypeMap;
+import androidx.annotation.Nullable;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.nio.file.Files;
+
+public class DoukutsuDocumentsProvider extends DocumentsProvider {
+ private final static String[] DEFAULT_ROOT_PROJECTION =
+ new String[]{
+ Root.COLUMN_DOCUMENT_ID,
+ Root.COLUMN_ROOT_ID,
+ Root.COLUMN_ICON,
+ Root.COLUMN_TITLE,
+ Root.COLUMN_MIME_TYPES,
+ Root.COLUMN_AVAILABLE_BYTES,
+ Root.COLUMN_FLAGS
+ };
+
+ private final static String[] DEFAULT_DOCUMENT_PROJECTION =
+ new String[]{
+ Document.COLUMN_DOCUMENT_ID,
+ Document.COLUMN_DISPLAY_NAME,
+ Document.COLUMN_SIZE,
+ Document.COLUMN_LAST_MODIFIED,
+ Document.COLUMN_MIME_TYPE,
+ Document.COLUMN_FLAGS
+ };
+
+ @Override
+ public Cursor queryRoots(String[] projection) throws FileNotFoundException {
+ File file = getContext().getFilesDir();
+ String id = file.getAbsolutePath();
+ Log.d(DoukutsuDocumentsProvider.class.getName(), "files dir location: " + id);
+
+ MatrixCursor result = new MatrixCursor(projection != null ?
+ projection : DEFAULT_ROOT_PROJECTION);
+
+ RowBuilder row = result.newRow();
+
+ row.add(Root.COLUMN_DOCUMENT_ID, id);
+ row.add(Root.COLUMN_ROOT_ID, id);
+ row.add(Root.COLUMN_ICON, R.mipmap.ic_launcher);
+ row.add(Root.COLUMN_TITLE,
+ getContext().getString(R.string.document_provider_name));
+ row.add(Root.COLUMN_MIME_TYPES, "*/*");
+ row.add(Root.COLUMN_AVAILABLE_BYTES, file.getFreeSpace());
+ row.add(Root.COLUMN_FLAGS, Root.FLAG_SUPPORTS_IS_CHILD | Root.FLAG_SUPPORTS_CREATE);
+
+ return result;
+ }
+
+ @Override
+ public Cursor queryDocument(String documentId, String[] projection) throws FileNotFoundException {
+ MatrixCursor result = new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION);
+
+ Log.d("dupa", "queryDocument: " + documentId);
+ pushFile(result, new File(documentId));
+
+ return result;
+ }
+
+ @Override
+ public Cursor queryChildDocuments(String parentDocumentId, String[] projection, String sortOrder) throws FileNotFoundException {
+ MatrixCursor result = new MatrixCursor(projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION);
+
+ File root = new File(parentDocumentId);
+ Log.d("dupa", "doc id:" + parentDocumentId);
+
+ if (!root.exists()) {
+ Log.d("dupa", "no such file");
+ throw new FileNotFoundException("No such file: " + root.getAbsolutePath());
+ }
+
+ if (!root.isDirectory()) {
+ Log.d("dupa", "not a directory");
+ return null;
+ }
+
+ File[] files = root.listFiles();
+ if (files != null) {
+ for (File file : files) {
+ pushFile(result, file);
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public ParcelFileDescriptor openDocument(String documentId, String mode, @Nullable CancellationSignal signal) throws FileNotFoundException {
+ File file = new File(documentId);
+ int imode = ParcelFileDescriptor.parseMode(mode);
+ return ParcelFileDescriptor.open(file, imode);
+ }
+
+ @Override
+ public String createDocument(String parentDocumentId, String mimeType, String displayName) throws FileNotFoundException {
+ File file = new File(parentDocumentId, displayName);
+
+ if (file.exists()) {
+ int nextId = 1;
+
+ while (file.exists()) {
+ // maybe let's put the id before extension?
+ file = new File(parentDocumentId, String.format("%s (%d)", displayName, nextId));
+
+ ++nextId;
+ }
+ }
+
+ try {
+ if (mimeType != null && mimeType.equals(Document.MIME_TYPE_DIR)) {
+ if (!file.mkdir()) {
+ throw new FileNotFoundException("Couldn't create directory: " + file.getAbsolutePath());
+ }
+ } else {
+ if (!file.createNewFile()) {
+ throw new FileNotFoundException("Couldn't create file: " + file.getAbsolutePath());
+ }
+ }
+ } catch (IOException e) {
+ throw new FileNotFoundException("Couldn't create file: " + e.getMessage());
+ }
+
+ return file.getAbsolutePath();
+ }
+
+ @Override
+ public void deleteDocument(String documentId) throws FileNotFoundException {
+ File file = new File(documentId);
+
+ if (!file.exists()) {
+ throw new FileNotFoundException("Couldn't find file: " + file.getAbsolutePath());
+ }
+
+ deleteRecursive(file);
+ // todo refresh this shit
+ // getContext().getContentResolver().refresh()
+ }
+
+ @Override
+ public String getDocumentType(String documentId) throws FileNotFoundException {
+ File file = new File(documentId);
+
+ if (!file.exists()) {
+ throw new FileNotFoundException("Couldn't find file: " + file.getAbsolutePath());
+ } else if (file.isDirectory()) {
+ return Document.MIME_TYPE_DIR;
+ } else if (file.isFile()) {
+ return getMimeType(file.getAbsolutePath());
+ }
+
+ return null;
+ }
+
+ @Override
+ public boolean onCreate() {
+ return true;
+ }
+
+ @Override
+ public boolean isChildDocument(String parentDocumentId, String documentId) {
+ return documentId.startsWith(parentDocumentId);
+ }
+
+ @Override
+ public String renameDocument(String documentId, String displayName) throws FileNotFoundException {
+ File file = new File(documentId);
+
+ if (!file.exists()) {
+ throw new FileNotFoundException("Couldn't find file: " + file.getAbsolutePath());
+ }
+
+ File newPath = new File(file.getParentFile().getAbsolutePath() + "/" + displayName);
+
+ try {
+ Files.move(file.toPath(), newPath.toPath());
+ } catch (IOException e) {
+ throw new FileNotFoundException(e.getMessage());
+ }
+
+ return newPath.getAbsolutePath();
+ }
+
+ @Override
+ public void removeDocument(String documentId, String parentDocumentId) throws FileNotFoundException {
+ deleteDocument(documentId);
+ }
+
+ private static void deleteRecursive(File file) {
+ if (file.isDirectory()) {
+ File[] files = file.listFiles();
+ if (files != null) {
+ for (File f : files) {
+ if (!Files.isSymbolicLink(f.toPath())) {
+ deleteRecursive(f);
+ }
+ }
+ }
+ }
+
+ file.delete();
+ }
+
+
+ private static String getMimeType(String url) {
+ String type = null;
+ String extension = MimeTypeMap.getFileExtensionFromUrl(url.toLowerCase());
+
+ if (extension != null) {
+ switch (extension) {
+ case "pbm":
+ type = "image/bmp";
+ break;
+ case "yml":
+ type = "text/x-yaml";
+ break;
+ default:
+ type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
+ break;
+ }
+ }
+
+ if (type == null) {
+ type = "application/octet-stream";
+ }
+
+ return type;
+ }
+
+ private void pushFile(MatrixCursor result, File file) throws FileNotFoundException {
+ if (!file.exists()) {
+ throw new FileNotFoundException("Couldn't find file: " + file.getAbsolutePath());
+ }
+
+ String mimeType = "application/octet-stream";
+ int flags = 0;
+
+ if (file.isDirectory()) {
+ mimeType = Document.MIME_TYPE_DIR;
+
+ if (file.canWrite()) {
+ flags |= Document.FLAG_DIR_SUPPORTS_CREATE;
+ }
+ } else if (file.isFile()) {
+ mimeType = getMimeType(file.getAbsolutePath());
+
+ if (file.canWrite()) {
+ flags |= Document.FLAG_SUPPORTS_WRITE;
+ }
+ }
+
+ if (file.getParentFile().canWrite()) {
+ flags |= Document.FLAG_SUPPORTS_DELETE | Document.FLAG_SUPPORTS_RENAME;
+ }
+
+ RowBuilder row = result.newRow();
+ row.add(Document.COLUMN_DOCUMENT_ID, file.getAbsolutePath());
+ row.add(Document.COLUMN_DISPLAY_NAME, file.getName());
+ row.add(Document.COLUMN_SIZE, file.length());
+ row.add(Document.COLUMN_LAST_MODIFIED, file.lastModified());
+ row.add(Document.COLUMN_FLAGS, flags);
+ row.add(Document.COLUMN_MIME_TYPE, mimeType);
+ row.add(Document.COLUMN_ICON, R.mipmap.ic_launcher);
+ }
+}
diff --git a/app/app/src/main/java/io/github/doukutsu_rs/MainActivity.java b/app/app/src/main/java/io/github/doukutsu_rs/MainActivity.java
new file mode 100644
index 0000000..27ecfcb
--- /dev/null
+++ b/app/app/src/main/java/io/github/doukutsu_rs/MainActivity.java
@@ -0,0 +1,76 @@
+package io.github.doukutsu_rs;
+
+import android.app.NativeActivity;
+import android.content.res.Configuration;
+import android.hardware.SensorManager;
+import android.os.Build;
+import android.os.Bundle;
+import android.view.OrientationEventListener;
+import android.view.WindowInsets;
+
+import static android.os.Build.VERSION.SDK_INT;
+
+public class MainActivity extends NativeActivity {
+ private int[] displayInsets = new int[]{0, 0, 0, 0};
+ private OrientationEventListener listener;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ listener = new OrientationEventListener(this, SensorManager.SENSOR_DELAY_UI) {
+ @Override
+ public void onOrientationChanged(int orientation) {
+ MainActivity.this.updateCutouts();
+ }
+ };
+
+ if (listener.canDetectOrientation()) {
+ listener.enable();
+ } else {
+ listener = null;
+ }
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+
+ if (listener != null) {
+ listener.disable();
+
+ listener = null;
+ }
+ }
+
+ @Override
+ public void onAttachedToWindow() {
+ super.onAttachedToWindow();
+
+ this.updateCutouts();
+ }
+
+ @Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+
+ this.updateCutouts();
+ }
+
+ private void updateCutouts() {
+ if (SDK_INT >= Build.VERSION_CODES.P) {
+ WindowInsets insets = getWindow().getDecorView().getRootWindowInsets();
+
+ if (insets != null) {
+ android.view.DisplayCutout cutout = insets.getDisplayCutout();
+
+ if (cutout != null) {
+ this.displayInsets[0] = cutout.getSafeInsetLeft();
+ this.displayInsets[1] = cutout.getSafeInsetTop();
+ this.displayInsets[2] = cutout.getSafeInsetRight();
+ this.displayInsets[3] = cutout.getSafeInsetBottom();
+ }
+ }
+ }
+ }
+}
diff --git a/app/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/app/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/app/src/main/res/drawable/ic_launcher_background.xml b/app/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/app/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..036d09b
--- /dev/null
+++ b/app/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..036d09b
--- /dev/null
+++ b/app/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..19daeed
Binary files /dev/null and b/app/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/app/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/app/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
new file mode 100644
index 0000000..f3ce124
Binary files /dev/null and b/app/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ
diff --git a/app/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..19daeed
Binary files /dev/null and b/app/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/app/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..c4f5d9c
Binary files /dev/null and b/app/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/app/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/app/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
new file mode 100644
index 0000000..b2c9e7a
Binary files /dev/null and b/app/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ
diff --git a/app/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..c4f5d9c
Binary files /dev/null and b/app/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/app/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..d02f039
Binary files /dev/null and b/app/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/app/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/app/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
new file mode 100644
index 0000000..4cea2ad
Binary files /dev/null and b/app/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ
diff --git a/app/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..d02f039
Binary files /dev/null and b/app/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/app/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..65c0161
Binary files /dev/null and b/app/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/app/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/app/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
new file mode 100644
index 0000000..e7d46ef
Binary files /dev/null and b/app/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ
diff --git a/app/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..65c0161
Binary files /dev/null and b/app/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/app/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..deaddf6
Binary files /dev/null and b/app/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
new file mode 100644
index 0000000..e70b535
Binary files /dev/null and b/app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ
diff --git a/app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..deaddf6
Binary files /dev/null and b/app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/app/app/src/main/res/values-v27/themes.xml b/app/app/src/main/res/values-v27/themes.xml
new file mode 100644
index 0000000..b80b02c
--- /dev/null
+++ b/app/app/src/main/res/values-v27/themes.xml
@@ -0,0 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/app/src/main/res/values/colors.xml b/app/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..f8c6127
--- /dev/null
+++ b/app/app/src/main/res/values/colors.xml
@@ -0,0 +1,10 @@
+
+
+ #FFBB86FC
+ #FF6200EE
+ #FF3700B3
+ #FF03DAC5
+ #FF018786
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/app/app/src/main/res/values/ic_launcher_background.xml b/app/app/src/main/res/values/ic_launcher_background.xml
new file mode 100644
index 0000000..15079f8
--- /dev/null
+++ b/app/app/src/main/res/values/ic_launcher_background.xml
@@ -0,0 +1,4 @@
+
+
+ #8DA5F8
+
\ No newline at end of file
diff --git a/app/app/src/main/res/values/strings.xml b/app/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..69fc23f
--- /dev/null
+++ b/app/app/src/main/res/values/strings.xml
@@ -0,0 +1,4 @@
+
+ doukutsu-rs
+ doukutsu-rs game data
+
diff --git a/app/app/src/main/res/values/themes.xml b/app/app/src/main/res/values/themes.xml
new file mode 100644
index 0000000..c10477f
--- /dev/null
+++ b/app/app/src/main/res/values/themes.xml
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..a92b8a5
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,28 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ repositories {
+ google()
+ jcenter()
+ maven {
+ url "https://plugins.gradle.org/m2/"
+ }
+ }
+ dependencies {
+ classpath "com.android.tools.build:gradle:4.0.2"
+ classpath "gradle.plugin.com.github.willir.rust:plugin:0.3.4"
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/app/gradle.properties b/app/gradle.properties
new file mode 100644
index 0000000..c09e1e3
--- /dev/null
+++ b/app/gradle.properties
@@ -0,0 +1,17 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app"s APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
diff --git a/app/gradle/wrapper/gradle-wrapper.jar b/app/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..f6b961f
Binary files /dev/null and b/app/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/app/gradle/wrapper/gradle-wrapper.properties b/app/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..bb9bece
--- /dev/null
+++ b/app/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Wed Feb 17 23:16:31 CET 2021
+distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
+distributionPath=wrapper/dists
+zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
diff --git a/app/gradlew b/app/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/app/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/app/gradlew.bat b/app/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/app/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/app/settings.gradle b/app/settings.gradle
new file mode 100644
index 0000000..8a4ed28
--- /dev/null
+++ b/app/settings.gradle
@@ -0,0 +1,2 @@
+rootProject.name = "doukutsu-rs"
+include ':app'
diff --git a/build.rs b/build.rs
new file mode 100644
index 0000000..96a3ac1
--- /dev/null
+++ b/build.rs
@@ -0,0 +1,28 @@
+use std::env;
+use std::fs::File;
+use std::path::PathBuf;
+
+// #[cfg(feature = "generate-gl")]
+// use gl_generator::{Api, Fallbacks, Profile, Registry};
+
+fn main() {
+ // let dest = PathBuf::from(&env::var("OUT_DIR").unwrap());
+ let target = env::var("TARGET").unwrap_or_else(|e| panic!(e));
+ let is_android = cfg!(target_os = "android") || (cfg!(target_os = "linux") && target.contains("android")); // hack
+
+ println!("cargo:rerun-if-changed=build.rs");
+ //
+ // #[cfg(feature = "generate-gl")]
+ // {
+ // let mut file = File::create(&dest.join("gl_bindings.rs")).unwrap();
+ //
+ // Registry::new(Api::Gles2, (3, 0), Profile::Core, Fallbacks::All, [])
+ // .write_bindings(gl_generator::StructGenerator, &mut file)
+ // .unwrap();
+ // }
+
+ if is_android {
+ println!("cargo:rustc-link-lib=dylib=GLESv2");
+ println!("cargo:rustc-link-lib=dylib=EGL");
+ }
+}
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..f6b961f
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..0c3290c
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Thu Feb 18 11:02:22 CET 2021
+distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
+distributionPath=wrapper/dists
+zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
diff --git a/gradlew b/gradlew
new file mode 100644
index 0000000..cccdd3d
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/src/builtin/shaders/basic-110.frag.glsl b/src/builtin/shaders/basic-110.frag.glsl
new file mode 100644
index 0000000..876c917
--- /dev/null
+++ b/src/builtin/shaders/basic-110.frag.glsl
@@ -0,0 +1,8 @@
+#version 330
+
+varying vec4 color;
+varying vec4 frag_color;
+
+void main() {
+ frag_color = color;
+}
diff --git a/src/builtin/shaders/basic_150.vert.glsl b/src/builtin/shaders/basic_150.vert.glsl
deleted file mode 100644
index f40b974..0000000
--- a/src/builtin/shaders/basic_150.vert.glsl
+++ /dev/null
@@ -1,27 +0,0 @@
-#version 150 core
-
-in vec2 a_Pos;
-in vec2 a_Uv;
-
-in vec4 a_Src;
-in vec4 a_TCol1;
-in vec4 a_TCol2;
-in vec4 a_TCol3;
-in vec4 a_TCol4;
-in vec4 a_Color;
-
-layout (std140) uniform Globals {
- mat4 u_MVP;
-};
-
-out vec2 v_Uv;
-out vec4 v_Color;
-
-void main() {
- v_Uv = a_Uv * a_Src.zw + a_Src.xy;
- v_Color = a_Color;
- mat4 instance_transform = mat4(a_TCol1, a_TCol2, a_TCol3, a_TCol4);
- vec4 position = instance_transform * vec4(a_Pos, 0.0, 1.0);
-
- gl_Position = u_MVP * position;
-}
diff --git a/src/builtin/shaders/basic_es100.frag.glsl b/src/builtin/shaders/basic_es100.frag.glsl
deleted file mode 100644
index 16b511e..0000000
--- a/src/builtin/shaders/basic_es100.frag.glsl
+++ /dev/null
@@ -1,13 +0,0 @@
-#version 300 es
-
-uniform mediump sampler2D t_Texture;
-varying mediump vec2 v_Uv;
-varying mediump vec4 v_Color;
-
-//uniform mediump mat4 u_MVP;
-
-mediump vec4 Target0;
-
-void main() {
- gl_FragColor = texture2D(t_Texture, v_Uv) * v_Color;
-}
diff --git a/src/builtin/shaders/basic_es100.vert.glsl b/src/builtin/shaders/basic_es100.vert.glsl
deleted file mode 100644
index 143770d..0000000
--- a/src/builtin/shaders/basic_es100.vert.glsl
+++ /dev/null
@@ -1,26 +0,0 @@
-#version 300 es
-
-attribute mediump vec2 a_Pos;
-attribute mediump vec2 a_Uv;
-attribute mediump vec4 a_VertColor;
-
-attribute mediump vec4 a_Src;
-attribute mediump vec4 a_TCol1;
-attribute mediump vec4 a_TCol2;
-attribute mediump vec4 a_TCol3;
-attribute mediump vec4 a_TCol4;
-attribute mediump vec4 a_Color;
-
-uniform mediump mat4 u_MVP;
-
-varying mediump vec2 v_Uv;
-varying mediump vec4 v_Color;
-
-void main() {
- v_Uv = a_Uv * a_Src.zw + a_Src.xy;
- v_Color = a_Color * a_VertColor;
- mat4 instance_transform = mat4(a_TCol1, a_TCol2, a_TCol3, a_TCol4);
- vec4 position = instance_transform * vec4(a_Pos, 0.0, 1.0);
-
- gl_Position = u_MVP * position;
-}
diff --git a/src/builtin/shaders/basic_es300.vert.glsl b/src/builtin/shaders/basic_es300.vert.glsl
deleted file mode 100644
index 5cefa11..0000000
--- a/src/builtin/shaders/basic_es300.vert.glsl
+++ /dev/null
@@ -1,27 +0,0 @@
-#version 300 es
-
-in vec2 a_Pos;
-in vec2 a_Uv;
-
-in vec4 a_Src;
-in vec4 a_TCol1;
-in vec4 a_TCol2;
-in vec4 a_TCol3;
-in vec4 a_TCol4;
-in vec4 a_Color;
-
-layout (std140) uniform Globals {
- mat4 u_MVP;
-};
-
-out vec2 v_Uv;
-out vec4 v_Color;
-
-void main() {
- v_Uv = a_Uv * a_Src.zw + a_Src.xy;
- v_Color = a_Color;
- mat4 instance_transform = mat4(a_TCol1, a_TCol2, a_TCol3, a_TCol4);
- vec4 position = instance_transform * vec4(a_Pos, 0.0, 1.0);
-
- gl_Position = u_MVP * position;
-}
diff --git a/src/builtin_fs.rs b/src/builtin_fs.rs
index da7adc2..98165c2 100644
--- a/src/builtin_fs.rs
+++ b/src/builtin_fs.rs
@@ -113,10 +113,10 @@ impl BuiltinFS {
FSNode::File("organya-wavetable-doukutsu.bin", include_bytes!("builtin/organya-wavetable-doukutsu.bin")),
FSNode::File("touch.png", include_bytes!("builtin/touch.png")),
FSNode::Directory("shaders", vec![
- FSNode::File("basic_150.vert.glsl", include_bytes!("builtin/shaders/basic_150.vert.glsl")),
- FSNode::File("water_150.frag.glsl", include_bytes!("builtin/shaders/water_150.frag.glsl")),
- FSNode::File("basic_es300.vert.glsl", include_bytes!("builtin/shaders/basic_es300.vert.glsl")),
- FSNode::File("water_es300.frag.glsl", include_bytes!("builtin/shaders/water_es300.frag.glsl")),
+ // FSNode::File("basic_150.vert.glsl", include_bytes!("builtin/shaders/basic_150.vert.glsl")),
+ // FSNode::File("water_150.frag.glsl", include_bytes!("builtin/shaders/water_150.frag.glsl")),
+ // FSNode::File("basic_es300.vert.glsl", include_bytes!("builtin/shaders/basic_es300.vert.glsl")),
+ // FSNode::File("water_es300.frag.glsl", include_bytes!("builtin/shaders/water_es300.frag.glsl")),
]),
FSNode::Directory("lightmap", vec![
FSNode::File("spot.png", include_bytes!("builtin/lightmap/spot.png")),
diff --git a/src/components/hud.rs b/src/components/hud.rs
index 1957c48..05430a3 100644
--- a/src/components/hud.rs
+++ b/src/components/hud.rs
@@ -1,10 +1,10 @@
-use crate::framework::context::Context;
-use crate::framework::error::GameResult;
-
use crate::common::Rect;
-use crate::components::draw_common::{Alignment, draw_number};
+use crate::components::draw_common::{draw_number, Alignment};
use crate::entity::GameEntity;
use crate::frame::Frame;
+use crate::framework::context::Context;
+use crate::framework::error::GameResult;
+use crate::framework::graphics::screen_insets_scaled;
use crate::inventory::Inventory;
use crate::player::Player;
use crate::shared_game_state::SharedGameState;
@@ -78,11 +78,7 @@ impl GameEntity<(&Player, &mut Inventory)> for HUD {
self.current_level = inventory.get_current_level() as usize;
for (a, slot) in self.weapon_types.iter_mut().enumerate() {
- *slot = if let Some(weapon) = inventory.get_weapon(a) {
- weapon.wtype as u8
- } else {
- 0
- };
+ *slot = if let Some(weapon) = inventory.get_weapon(a) { weapon.wtype as u8 } else { 0 };
}
// update health bar
@@ -163,13 +159,19 @@ impl GameEntity<(&Player, &mut Inventory)> for HUD {
return Ok(());
}
+ let (left, top, right, bottom) = screen_insets_scaled(ctx, state.scale);
+
// none
let weap_x = self.weapon_x_pos as f32;
let batch = state.texture_set.get_or_load_batch(ctx, &state.constants, "TextBox")?;
let (bar_offset, num_offset, weapon_offset) = match self.alignment {
- Alignment::Left => (0.0, 0.0, 0.0),
- Alignment::Right => (state.canvas_size.0 - 112.0, state.canvas_size.0 - 48.0, state.canvas_size.0 - 40.0),
+ Alignment::Left => (left, left, left),
+ Alignment::Right => (
+ state.canvas_size.0 - 112.0 - right,
+ state.canvas_size.0 - 48.0 - right,
+ state.canvas_size.0 - 40.0 - right,
+ ),
};
let air_offset = if self.has_player2 {
50.0 * match self.alignment {
@@ -181,31 +183,24 @@ impl GameEntity<(&Player, &mut Inventory)> for HUD {
};
if self.max_ammo == 0 {
- batch.add_rect(bar_offset + weap_x + 48.0, 16.0,
- &Rect::new_size(80, 48, 16, 8));
- batch.add_rect(bar_offset + weap_x + 48.0, 24.0,
- &Rect::new_size(80, 48, 16, 8));
+ batch.add_rect(bar_offset + weap_x + 48.0, 16.0 + top, &Rect::new_size(80, 48, 16, 8));
+ batch.add_rect(bar_offset + weap_x + 48.0, 24.0 + top, &Rect::new_size(80, 48, 16, 8));
}
// per
- batch.add_rect(bar_offset + weap_x + 32.0, 24.0,
- &Rect::new_size(72, 48, 8, 8));
+ batch.add_rect(bar_offset + weap_x + 32.0, 24.0 + top, &Rect::new_size(72, 48, 8, 8));
// lv
- batch.add_rect(num_offset + weap_x, 32.0,
- &Rect::new_size(80, 80, 16, 8));
+ batch.add_rect(num_offset + weap_x, 32.0 + top, &Rect::new_size(80, 80, 16, 8));
// xp box
- batch.add_rect(bar_offset + weap_x + 24.0, 32.0,
- &Rect::new_size(0, 72, 40, 8));
+ batch.add_rect(bar_offset + weap_x + 24.0, 32.0 + top, &Rect::new_size(0, 72, 40, 8));
if self.max_level {
- batch.add_rect(bar_offset + weap_x + 24.0, 32.0,
- &Rect::new_size(40, 72, 40, 8));
+ batch.add_rect(bar_offset + weap_x + 24.0, 32.0 + top, &Rect::new_size(40, 72, 40, 8));
} else if self.max_xp > 0 {
// xp bar
let bar_width = (self.xp as f32 / self.max_xp as f32 * 40.0) as u16;
- batch.add_rect(bar_offset + weap_x + 24.0, 32.0,
- &Rect::new_size(0, 80, bar_width, 8));
+ batch.add_rect(bar_offset + weap_x + 24.0, 32.0 + top, &Rect::new_size(0, 80, bar_width, 8));
}
if self.max_life != 0 {
@@ -213,28 +208,23 @@ impl GameEntity<(&Player, &mut Inventory)> for HUD {
let bar_width = (self.life as f32 / self.max_life as f32 * 39.0) as u16;
// heart/hp number box
- batch.add_rect(num_offset + 16.0, 40.0,
- &Rect::new_size(0, 40, 24, 8));
+ batch.add_rect(num_offset + 16.0, 40.0 + top, &Rect::new_size(0, 40, 24, 8));
// life box
- batch.add_rect(bar_offset + 40.0, 40.0,
- &Rect::new_size(24, 40, 40, 8));
+ batch.add_rect(bar_offset + 40.0, 40.0 + top, &Rect::new_size(24, 40, 40, 8));
// yellow bar
- batch.add_rect(bar_offset + 40.0, 40.0,
- &Rect::new_size(0, 32, yellow_bar_width, 8));
+ batch.add_rect(bar_offset + 40.0, 40.0 + top, &Rect::new_size(0, 32, yellow_bar_width, 8));
// life
- batch.add_rect(bar_offset + 40.0, 40.0,
- &Rect::new_size(0, 24, bar_width, 8));
+ batch.add_rect(bar_offset + 40.0, 40.0 + top, &Rect::new_size(0, 24, bar_width, 8));
}
if self.air_counter > 0 {
- let rect = if self.air % 30 > 10 {
- Rect::new_size(112, 72, 32, 8)
- } else {
- Rect::new_size(112, 80, 32, 8)
- };
+ let rect = if self.air % 30 > 10 { Rect::new_size(112, 72, 32, 8) } else { Rect::new_size(112, 80, 32, 8) };
- batch.add_rect((state.canvas_size.0 / 2.0).floor() - 40.0 + air_offset,
- (state.canvas_size.1 / 2.0).floor(), &rect);
+ batch.add_rect(
+ left + ((state.canvas_size.0 - left - right) / 2.0).floor() - 40.0 + air_offset,
+ top + ((state.canvas_size.1 - top - bottom) / 2.0).floor(),
+ &rect,
+ );
}
batch.draw(ctx)?;
@@ -267,7 +257,7 @@ impl GameEntity<(&Player, &mut Inventory)> for HUD {
if wtype != 0 {
rect.left = wtype as u16 * 16;
rect.right = rect.left + 16;
- batch.add_rect(pos_x + weapon_offset, 16.0, &rect);
+ batch.add_rect(pos_x + weapon_offset, 16.0 + top, &rect);
}
}
}
@@ -275,17 +265,22 @@ impl GameEntity<(&Player, &mut Inventory)> for HUD {
batch.draw(ctx)?;
if self.air_counter > 0 && self.air_counter % 6 < 4 {
- draw_number((state.canvas_size.0 / 2.0).floor() + 8.0 + air_offset,
- (state.canvas_size.1 / 2.0).floor(),
- (self.air / 10) as usize, Alignment::Left, state, ctx)?;
+ draw_number(
+ left + ((state.canvas_size.0 - left - right) / 2.0).floor() + 8.0 + air_offset,
+ top + ((state.canvas_size.1 - top - bottom) / 2.0).floor(),
+ (self.air / 10) as usize,
+ Alignment::Left,
+ state,
+ ctx,
+ )?;
}
if self.max_ammo != 0 {
- draw_number(num_offset + weap_x + 64.0, 16.0, self.ammo as usize, Alignment::Right, state, ctx)?;
- draw_number(num_offset + weap_x + 64.0, 24.0, self.max_ammo as usize, Alignment::Right, state, ctx)?;
+ draw_number(num_offset + weap_x + 64.0, 16.0 + top, self.ammo as usize, Alignment::Right, state, ctx)?;
+ draw_number(num_offset + weap_x + 64.0, 24.0 + top, self.max_ammo as usize, Alignment::Right, state, ctx)?;
}
- draw_number(num_offset + weap_x + 24.0, 32.0, self.current_level, Alignment::Right, state, ctx)?;
- draw_number(num_offset + 40.0, 40.0, self.life_bar as usize, Alignment::Right, state, ctx)?;
+ draw_number(num_offset + weap_x + 24.0, 32.0 + top, self.current_level, Alignment::Right, state, ctx)?;
+ draw_number(num_offset + 40.0, 40.0 + top, self.life_bar as usize, Alignment::Right, state, ctx)?;
Ok(())
}
diff --git a/src/framework/backend.rs b/src/framework/backend.rs
index 510e9a1..2359db8 100644
--- a/src/framework/backend.rs
+++ b/src/framework/backend.rs
@@ -21,6 +21,10 @@ pub trait BackendRenderer {
fn present(&mut self) -> GameResult;
+ fn prepare_draw(&mut self, width: f32, height: f32) -> GameResult {
+ Ok(())
+ }
+
fn create_texture_mutable(&mut self, width: u16, height: u16) -> GameResult>;
fn create_texture(&mut self, width: u16, height: u16, data: &[u8]) -> GameResult>;
@@ -36,8 +40,6 @@ pub trait BackendRenderer {
fn imgui(&self) -> GameResult<&mut imgui::Context>;
fn render_imgui(&mut self, draw_data: &DrawData) -> GameResult;
-
- fn prepare_frame(&self, ui: &imgui::Ui) -> GameResult;
}
pub trait BackendTexture {
@@ -51,10 +53,20 @@ pub trait BackendTexture {
}
pub fn init_backend() -> GameResult> {
- #[cfg(feature = "backend_sdl")]
- {
- return crate::framework::backend_sdl2::SDL2Backend::new()
- }
+ #[cfg(all(feature = "backend-glutin"))]
+ {
+ return crate::framework::backend_opengl::GlutinBackend::new();
+ }
+
+ #[cfg(feature = "backend-sokol")]
+ {
+ return crate::framework::backend_sokol::SokolBackend::new();
+ }
+
+ #[cfg(feature = "backend-sdl")]
+ {
+ return crate::framework::backend_sdl2::SDL2Backend::new();
+ }
log::warn!("No backend compiled in, using null backend instead.");
crate::framework::backend_null::NullBackend::new()
diff --git a/src/framework/backend_null.rs b/src/framework/backend_null.rs
index 320406c..4cfbce5 100644
--- a/src/framework/backend_null.rs
+++ b/src/framework/backend_null.rs
@@ -29,6 +29,9 @@ impl BackendEventLoop for NullEventLoop {
fn run(&mut self, game: &mut Game, ctx: &mut Context) {
let state_ref = unsafe { &mut *game.state.get() };
+ ctx.screen_size = (640.0, 480.0);
+ state_ref.handle_resize(ctx).unwrap();
+
loop {
game.update(ctx).unwrap();
if state_ref.shutdown {
@@ -118,8 +121,4 @@ impl BackendRenderer for NullRenderer {
fn render_imgui(&mut self, draw_data: &DrawData) -> GameResult {
Ok(())
}
-
- fn prepare_frame<'ui>(&self, ui: &Ui<'ui>) -> GameResult {
- Ok(())
- }
}
diff --git a/src/framework/backend_opengl.rs b/src/framework/backend_opengl.rs
new file mode 100644
index 0000000..9e904bb
--- /dev/null
+++ b/src/framework/backend_opengl.rs
@@ -0,0 +1,1121 @@
+use std::cell::{RefCell, UnsafeCell};
+use std::ffi::CStr;
+use std::mem;
+use std::rc::Rc;
+use std::sync::Arc;
+
+use glutin::event::{Event, TouchPhase, WindowEvent};
+use glutin::event_loop::{ControlFlow, EventLoop};
+use glutin::window::WindowBuilder;
+use glutin::{Api, ContextBuilder, GlProfile, GlRequest, PossiblyCurrent, WindowedContext};
+use imgui::{DrawCmd, DrawCmdParams, DrawData, DrawIdx, DrawVert};
+use jni::sys::jintArray;
+
+use gl::types::*;
+
+use crate::common::{Color, Rect};
+use crate::framework::backend::{Backend, BackendEventLoop, BackendRenderer, BackendTexture, SpriteBatchCommand};
+use crate::framework::context::Context;
+use crate::framework::error::GameError::RenderError;
+use crate::framework::error::{GameError, GameResult};
+use crate::framework::gl;
+use crate::framework::graphics::BlendMode;
+use crate::input::touch_controls::TouchPoint;
+use crate::{Game, GAME_SUSPENDED};
+
+pub struct GlutinBackend;
+
+impl GlutinBackend {
+ pub fn new() -> GameResult> {
+ Ok(Box::new(GlutinBackend))
+ }
+}
+
+impl Backend for GlutinBackend {
+ fn create_event_loop(&self) -> GameResult> {
+ #[cfg(target_os = "android")]
+ loop {
+ match ndk_glue::native_window().as_ref() {
+ Some(_) => {
+ log::info!("NativeWindow Found: {:?}", ndk_glue::native_window());
+ break;
+ }
+ None => (),
+ }
+ }
+
+ Ok(Box::new(GlutinEventLoop { refs: Rc::new(UnsafeCell::new(None)) }))
+ }
+}
+
+pub struct GlutinEventLoop {
+ refs: Rc>>>,
+}
+
+impl GlutinEventLoop {
+ fn get_context(&self, event_loop: &EventLoop<()>) -> &mut WindowedContext {
+ let mut refs = unsafe { &mut *self.refs.get() };
+
+ if refs.is_none() {
+ let window = WindowBuilder::new();
+ let windowed_context = ContextBuilder::new()
+ .with_gl(GlRequest::Specific(Api::OpenGlEs, (2, 0)))
+ .with_gl_profile(GlProfile::Core)
+ .with_gl_debug_flag(false)
+ .with_pixel_format(24, 8)
+ .with_vsync(true)
+ .build_windowed(window, event_loop)
+ .unwrap();
+
+ let windowed_context = unsafe { windowed_context.make_current().unwrap() };
+
+ #[cfg(target_os = "android")]
+ if let Some(nwin) = ndk_glue::native_window().as_ref() {
+ unsafe {
+ windowed_context.surface_created(nwin.ptr().as_ptr() as *mut std::ffi::c_void);
+ }
+ }
+
+ refs.replace(windowed_context);
+ }
+
+ refs.as_mut().unwrap()
+ }
+}
+
+#[cfg(target_os = "android")]
+fn request_android_redraw() {
+ match ndk_glue::native_window().as_ref() {
+ Some(native_window) => {
+ let a_native_window: *mut ndk_sys::ANativeWindow = native_window.ptr().as_ptr();
+ let a_native_activity: *mut ndk_sys::ANativeActivity = ndk_glue::native_activity().ptr().as_ptr();
+ unsafe {
+ match (*(*a_native_activity).callbacks).onNativeWindowRedrawNeeded {
+ Some(callback) => callback(a_native_activity, a_native_window),
+ None => (),
+ };
+ };
+ }
+ None => (),
+ }
+}
+
+#[cfg(target_os = "android")]
+fn get_insets() -> GameResult<(f32, f32, f32, f32)> {
+ unsafe {
+ let vm_ptr = ndk_glue::native_activity().vm();
+ let vm = unsafe { jni::JavaVM::from_raw(vm_ptr) }?;
+ let vm_env = vm.attach_current_thread()?;
+
+ //let class = vm_env.find_class("io/github/doukutsu_rs/MainActivity")?;
+ let class = vm_env.new_global_ref(ndk_glue::native_activity().activity())?;
+ let field = vm_env.get_field(class.as_obj(), "displayInsets", "[I")?.to_jni().l as jni::sys::jintArray;
+
+ let mut elements = [0; 4];
+ vm_env.get_int_array_region(field, 0, &mut elements)?;
+
+ Ok((elements[0] as f32, elements[1] as f32, elements[2] as f32, elements[3] as f32))
+ }
+}
+
+impl BackendEventLoop for GlutinEventLoop {
+ fn run(&mut self, game: &mut Game, ctx: &mut Context) {
+ let event_loop = EventLoop::new();
+ let state_ref = unsafe { &mut *game.state.get() };
+ let window: &'static mut WindowedContext =
+ unsafe { std::mem::transmute(self.get_context(&event_loop)) };
+
+ {
+ let size = window.window().inner_size();
+ ctx.screen_size = (size.width.max(1) as f32, size.height.max(1) as f32);
+ state_ref.handle_resize(ctx).unwrap();
+ }
+
+ // it won't ever return
+ let (game, ctx): (&'static mut Game, &'static mut Context) =
+ unsafe { (std::mem::transmute(game), std::mem::transmute(ctx)) };
+
+ event_loop.run(move |event, _, control_flow| {
+ *control_flow = ControlFlow::Wait;
+
+ match event {
+ Event::WindowEvent { event: WindowEvent::CloseRequested, window_id }
+ if window_id == window.window().id() =>
+ {
+ state_ref.shutdown();
+ }
+ Event::Resumed => {
+ println!("resumed!");
+ {
+ let mut mutex = GAME_SUSPENDED.lock().unwrap();
+ *mutex = false;
+ }
+
+ #[cfg(target_os = "android")]
+ if let Some(nwin) = ndk_glue::native_window().as_ref() {
+ state_ref.graphics_reset();
+ unsafe {
+ window.surface_created(nwin.ptr().as_ptr() as *mut std::ffi::c_void);
+ request_android_redraw();
+ }
+ }
+ }
+ Event::Suspended => {
+ println!("suspended!");
+ {
+ let mut mutex = GAME_SUSPENDED.lock().unwrap();
+ *mutex = true;
+ }
+
+ #[cfg(target_os = "android")]
+ unsafe {
+ window.surface_destroyed();
+ }
+ }
+ Event::WindowEvent { event: WindowEvent::Resized(size), window_id }
+ if window_id == window.window().id() =>
+ {
+ if let Some(renderer) = ctx.renderer.as_ref() {
+ if let Ok(imgui) = renderer.imgui() {
+ imgui.io_mut().display_size = [size.width as f32, size.height as f32];
+ }
+
+ ctx.screen_size = (size.width as f32, size.height as f32);
+ state_ref.handle_resize(ctx).unwrap();
+ }
+ }
+ Event::WindowEvent { event: WindowEvent::Touch(touch), window_id }
+ if window_id == window.window().id() =>
+ {
+ let mut controls = &mut state_ref.touch_controls;
+ let scale = state_ref.scale as f64;
+
+ match touch.phase {
+ TouchPhase::Started | TouchPhase::Moved => {
+ if let Some(point) = controls.points.iter_mut().find(|p| p.id == touch.id) {
+ point.last_position = point.position;
+ point.position = (touch.location.x / scale, touch.location.y / scale);
+ } else {
+ controls.touch_id_counter = controls.touch_id_counter.wrapping_add(1);
+
+ let point = TouchPoint {
+ id: touch.id,
+ touch_id: controls.touch_id_counter,
+ position: (touch.location.x / scale, touch.location.y / scale),
+ last_position: (0.0, 0.0),
+ };
+ controls.points.push(point);
+
+ if touch.phase == TouchPhase::Started {
+ controls.clicks.push(point);
+ }
+ }
+ }
+ TouchPhase::Ended | TouchPhase::Cancelled => {
+ controls.points.retain(|p| p.id != touch.id);
+ controls.clicks.retain(|p| p.id != touch.id);
+ }
+ }
+ }
+ Event::RedrawRequested(id) if id == window.window().id() => {
+ {
+ let mutex = GAME_SUSPENDED.lock().unwrap();
+ if *mutex {
+ return;
+ }
+ }
+
+ #[cfg(not(target_os = "android"))]
+ {
+ if let Err(err) = game.draw(ctx) {
+ log::error!("Failed to draw frame: {}", err);
+ }
+
+ window.window().request_redraw();
+ }
+
+ #[cfg(target_os = "android")]
+ request_android_redraw();
+ }
+ Event::MainEventsCleared => {
+ if state_ref.shutdown {
+ log::info!("Shutting down...");
+ *control_flow = ControlFlow::Exit;
+ return;
+ }
+
+ {
+ let mutex = GAME_SUSPENDED.lock().unwrap();
+ if *mutex {
+ return;
+ }
+ }
+
+ game.update(ctx).unwrap();
+
+ #[cfg(target_os = "android")]
+ {
+ match get_insets() {
+ Ok(insets) => {
+ ctx.screen_insets = insets;
+ }
+ Err(e) => {
+ log::error!("Failed to update insets: {}", e);
+ }
+ }
+
+ if let Err(err) = game.draw(ctx) {
+ log::error!("Failed to draw frame: {}", err);
+ }
+ }
+
+ if state_ref.next_scene.is_some() {
+ mem::swap(&mut game.scene, &mut state_ref.next_scene);
+ state_ref.next_scene = None;
+ game.scene.as_mut().unwrap().init(state_ref, ctx).unwrap();
+ game.loops = 0;
+ state_ref.frame_time = 0.0;
+ }
+ }
+ _ => (),
+ }
+ });
+ }
+
+ fn new_renderer(&self) -> GameResult> {
+ let mut imgui = imgui::Context::create();
+ imgui.io_mut().display_size = [640.0, 480.0];
+
+ Ok(Box::new(GlutinRenderer {
+ refs: self.refs.clone(),
+ imgui: UnsafeCell::new(imgui),
+ imgui_data: ImguiData::new(),
+ context_active: Arc::new(RefCell::new(true)),
+ }))
+ }
+}
+
+pub struct GlutinTexture {
+ width: u16,
+ height: u16,
+ texture_id: u32,
+ locs: Locs,
+ vbo: GLuint,
+ vertices: Vec,
+ context_active: Arc>,
+}
+
+#[repr(C)]
+#[derive(Copy, Clone)]
+struct VertexData {
+ position: (f32, f32),
+ uv: (f32, f32),
+ color: (u8, u8, u8, u8),
+}
+
+impl BackendTexture for GlutinTexture {
+ fn dimensions(&self) -> (u16, u16) {
+ (self.width, self.height)
+ }
+
+ fn add(&mut self, command: SpriteBatchCommand) {
+ let (tex_scale_x, tex_scale_y) = (1.0 / self.width as f32, 1.0 / self.height as f32);
+
+ match command {
+ SpriteBatchCommand::DrawRect(src, dest) => {
+ let vertices = [
+ VertexData {
+ position: (dest.left, dest.bottom),
+ uv: (src.left * tex_scale_x, src.bottom * tex_scale_y),
+ color: (255, 255, 255, 255),
+ },
+ VertexData {
+ position: (dest.left, dest.top),
+ uv: (src.left * tex_scale_x, src.top * tex_scale_y),
+ color: (255, 255, 255, 255),
+ },
+ VertexData {
+ position: (dest.right, dest.top),
+ uv: (src.right * tex_scale_x, src.top * tex_scale_y),
+ color: (255, 255, 255, 255),
+ },
+ VertexData {
+ position: (dest.left, dest.bottom),
+ uv: (src.left * tex_scale_x, src.bottom * tex_scale_y),
+ color: (255, 255, 255, 255),
+ },
+ VertexData {
+ position: (dest.right, dest.top),
+ uv: (src.right * tex_scale_x, src.top * tex_scale_y),
+ color: (255, 255, 255, 255),
+ },
+ VertexData {
+ position: (dest.right, dest.bottom),
+ uv: (src.right * tex_scale_x, src.bottom * tex_scale_y),
+ color: (255, 255, 255, 255),
+ },
+ ];
+ self.vertices.extend_from_slice(&vertices);
+ }
+ SpriteBatchCommand::DrawRectFlip(mut src, dest, flip_x, flip_y) => {
+ if flip_x {
+ std::mem::swap(&mut src.left, &mut src.right);
+ }
+
+ if flip_y {
+ std::mem::swap(&mut src.top, &mut src.bottom);
+ }
+
+ let vertices = [
+ VertexData {
+ position: (dest.left, dest.bottom),
+ uv: (src.left * tex_scale_x, src.bottom * tex_scale_y),
+ color: (255, 255, 255, 255),
+ },
+ VertexData {
+ position: (dest.left, dest.top),
+ uv: (src.left * tex_scale_x, src.top * tex_scale_y),
+ color: (255, 255, 255, 255),
+ },
+ VertexData {
+ position: (dest.right, dest.top),
+ uv: (src.right * tex_scale_x, src.top * tex_scale_y),
+ color: (255, 255, 255, 255),
+ },
+ VertexData {
+ position: (dest.left, dest.bottom),
+ uv: (src.left * tex_scale_x, src.bottom * tex_scale_y),
+ color: (255, 255, 255, 255),
+ },
+ VertexData {
+ position: (dest.right, dest.top),
+ uv: (src.right * tex_scale_x, src.top * tex_scale_y),
+ color: (255, 255, 255, 255),
+ },
+ VertexData {
+ position: (dest.right, dest.bottom),
+ uv: (src.right * tex_scale_x, src.bottom * tex_scale_y),
+ color: (255, 255, 255, 255),
+ },
+ ];
+ self.vertices.extend_from_slice(&vertices);
+ }
+ SpriteBatchCommand::DrawRectTinted(src, dest, color) => {
+ let color = color.to_rgba();
+ let vertices = [
+ VertexData {
+ position: (dest.left, dest.bottom),
+ uv: (src.left * tex_scale_x, src.bottom * tex_scale_y),
+ color,
+ },
+ VertexData {
+ position: (dest.left, dest.top),
+ uv: (src.left * tex_scale_x, src.top * tex_scale_y),
+ color,
+ },
+ VertexData {
+ position: (dest.right, dest.top),
+ uv: (src.right * tex_scale_x, src.top * tex_scale_y),
+ color,
+ },
+ VertexData {
+ position: (dest.left, dest.bottom),
+ uv: (src.left * tex_scale_x, src.bottom * tex_scale_y),
+ color,
+ },
+ VertexData {
+ position: (dest.right, dest.top),
+ uv: (src.right * tex_scale_x, src.top * tex_scale_y),
+ color,
+ },
+ VertexData {
+ position: (dest.right, dest.bottom),
+ uv: (src.right * tex_scale_x, src.bottom * tex_scale_y),
+ color,
+ },
+ ];
+ self.vertices.extend_from_slice(&vertices);
+ }
+ }
+ }
+
+ fn clear(&mut self) {
+ self.vertices.clear();
+ }
+
+ fn draw(&mut self) -> GameResult {
+ unsafe {
+ if let Some(gl) = GL_PROC.as_ref() {
+ if self.texture_id == 0 {
+ return Ok(());
+ }
+
+ if gl.gl.BindSampler.is_loaded() {
+ gl.gl.BindSampler(0, 0);
+ }
+
+ gl.gl.Enable(gl::TEXTURE_2D);
+ gl.gl.Enable(gl::BLEND);
+ gl.gl.Disable(gl::DEPTH_TEST);
+
+ gl.gl.BindTexture(gl::TEXTURE_2D, self.texture_id);
+ gl.gl.BindBuffer(gl::ARRAY_BUFFER, self.vbo);
+ gl.gl.EnableVertexAttribArray(self.locs.position);
+ gl.gl.EnableVertexAttribArray(self.locs.uv);
+ gl.gl.EnableVertexAttribArray(self.locs.color);
+
+ gl.gl.VertexAttribPointer(
+ self.locs.position,
+ 2,
+ gl::FLOAT,
+ gl::FALSE,
+ mem::size_of::() as _,
+ field_offset::(|v| &v.position) as _,
+ );
+
+ gl.gl.VertexAttribPointer(
+ self.locs.uv,
+ 2,
+ gl::FLOAT,
+ gl::FALSE,
+ mem::size_of::() as _,
+ field_offset::(|v| &v.uv) as _,
+ );
+
+ gl.gl.VertexAttribPointer(
+ self.locs.color,
+ 4,
+ gl::UNSIGNED_BYTE,
+ gl::TRUE,
+ mem::size_of::() as _,
+ field_offset::(|v| &v.color) as _,
+ );
+
+ gl.gl.BindBuffer(gl::ARRAY_BUFFER, self.vbo);
+ gl.gl.BufferData(
+ gl::ARRAY_BUFFER,
+ (self.vertices.len() * mem::size_of::()) as _,
+ self.vertices.as_ptr() as _,
+ gl::STREAM_DRAW,
+ );
+
+ gl.gl.DrawArrays(gl::TRIANGLES, 0, self.vertices.len() as _);
+
+ gl.gl.BindTexture(gl::TEXTURE_2D, 0);
+ gl.gl.BindBuffer(gl::ARRAY_BUFFER, 0);
+
+ Ok(())
+ } else {
+ Err(RenderError("No OpenGL context available!".to_string()))
+ }
+ }
+ }
+}
+
+impl Drop for GlutinTexture {
+ fn drop(&mut self) {
+ if *self.context_active.as_ref().borrow() {
+ unsafe {
+ if let Some(gl) = GL_PROC.as_ref() {
+ let texture_id = &self.texture_id;
+ gl.gl.DeleteTextures(1, texture_id as *const _);
+ }
+ }
+ }
+ }
+}
+
+fn check_shader_compile_status(shader: u32, gl: &Gl) -> bool {
+ unsafe {
+ let mut status: GLint = 0;
+ gl.gl.GetShaderiv(shader, gl::COMPILE_STATUS, (&mut status) as *mut _);
+
+ if status == (gl::FALSE as GLint) {
+ let mut max_length: GLint = 0;
+ let mut msg_length: GLsizei = 0;
+ gl.gl.GetShaderiv(shader, gl::INFO_LOG_LENGTH, (&mut max_length) as *mut _);
+
+ let mut data: Vec = vec![0; max_length as usize];
+ gl.gl.GetShaderInfoLog(
+ shader,
+ max_length as GLsizei,
+ (&mut msg_length) as *mut _,
+ data.as_mut_ptr() as *mut _,
+ );
+
+ let data = String::from_utf8_lossy(&data);
+ log::error!("Failed to compile shader {}: {}", shader, data);
+
+ return false;
+ }
+ }
+
+ true
+}
+
+const IMGUI_SHADER_VERT: &str = r"
+#version 100
+
+precision mediump float;
+
+uniform mat4 ProjMtx;
+attribute vec2 Position;
+attribute vec2 UV;
+attribute vec4 Color;
+varying vec2 Frag_UV;
+varying vec4 Frag_Color;
+
+void main()
+{
+ Frag_UV = UV;
+ Frag_Color = Color;
+ gl_Position = ProjMtx * vec4(Position.xy, 0.0, 1.0);
+}
+
+";
+
+const IMGUI_SHADER_FRAG: &str = r"
+#version 100
+
+precision mediump float;
+
+uniform sampler2D Texture;
+varying vec2 Frag_UV;
+varying vec4 Frag_Color;
+
+void main()
+{
+ gl_FragColor = Frag_Color * texture2D(Texture, Frag_UV.st);
+}
+
+";
+
+#[derive(Copy, Clone)]
+struct Locs {
+ texture: GLint,
+ proj_mtx: GLint,
+ position: GLuint,
+ uv: GLuint,
+ color: GLuint,
+}
+
+struct ImguiData {
+ initialized: bool,
+ program: GLuint,
+ locs: Locs,
+ vbo: GLuint,
+ ebo: GLuint,
+ font_texture: GLuint,
+ font_tex_size: (f32, f32),
+}
+
+impl ImguiData {
+ fn new() -> Self {
+ ImguiData {
+ initialized: false,
+ program: 0,
+ locs: Locs { texture: 0, proj_mtx: 0, position: 0, uv: 0, color: 0 },
+ vbo: 0,
+ ebo: 0,
+ font_texture: 0,
+ font_tex_size: (1.0, 1.0),
+ }
+ }
+
+ fn init(&mut self, imgui: &mut imgui::Context, gl: &Gl) {
+ self.initialized = true;
+
+ let vert_sources = [IMGUI_SHADER_VERT.as_ptr() as *const GLchar];
+ let frag_sources = [IMGUI_SHADER_FRAG.as_ptr() as *const GLchar];
+ let vert_sources_len = [IMGUI_SHADER_VERT.len() as GLint - 1];
+ let frag_sources_len = [IMGUI_SHADER_FRAG.len() as GLint - 1];
+
+ unsafe {
+ self.program = gl.gl.CreateProgram();
+ let vert_shader = gl.gl.CreateShader(gl::VERTEX_SHADER);
+ let frag_shader = gl.gl.CreateShader(gl::FRAGMENT_SHADER);
+ gl.gl.ShaderSource(vert_shader, 1, vert_sources.as_ptr(), vert_sources_len.as_ptr());
+ gl.gl.ShaderSource(frag_shader, 1, frag_sources.as_ptr(), frag_sources_len.as_ptr());
+ gl.gl.CompileShader(vert_shader);
+
+ gl.gl.CompileShader(frag_shader);
+ gl.gl.AttachShader(self.program, vert_shader);
+ gl.gl.AttachShader(self.program, frag_shader);
+ gl.gl.LinkProgram(self.program);
+
+ if !check_shader_compile_status(vert_shader, gl) {
+ gl.gl.DeleteShader(vert_shader);
+ }
+
+ if !check_shader_compile_status(frag_shader, gl) {
+ gl.gl.DeleteShader(frag_shader);
+ }
+
+ self.locs = Locs {
+ texture: gl.gl.GetUniformLocation(self.program, b"Texture\0".as_ptr() as _),
+ proj_mtx: gl.gl.GetUniformLocation(self.program, b"ProjMtx\0".as_ptr() as _),
+ position: gl.gl.GetAttribLocation(self.program, b"Position\0".as_ptr() as _) as _,
+ uv: gl.gl.GetAttribLocation(self.program, b"UV\0".as_ptr() as _) as _,
+ color: gl.gl.GetAttribLocation(self.program, b"Color\0".as_ptr() as _) as _,
+ };
+
+ self.vbo = return_param(|x| gl.gl.GenBuffers(1, x));
+ self.ebo = return_param(|x| gl.gl.GenBuffers(1, x));
+
+ let mut current_texture = 0;
+ gl.gl.GetIntegerv(gl::TEXTURE_BINDING_2D, &mut current_texture);
+
+ self.font_texture = return_param(|x| gl.gl.GenTextures(1, x));
+ gl.gl.BindTexture(gl::TEXTURE_2D, self.font_texture);
+ gl.gl.TexParameteri(gl::TEXTURE_2D, gl::TEXTURE_MIN_FILTER, gl::LINEAR as _);
+ gl.gl.TexParameteri(gl::TEXTURE_2D, gl::TEXTURE_MAG_FILTER, gl::LINEAR as _);
+ //gl.gl.PixelStorei(gl::UNPACK_ROW_LENGTH, 0);
+
+ {
+ let mut atlas = imgui.fonts();
+
+ let texture = atlas.build_rgba32_texture();
+ self.font_tex_size = (texture.width as _, texture.height as _);
+
+ gl.gl.TexImage2D(
+ gl::TEXTURE_2D,
+ 0,
+ gl::RGBA as _,
+ texture.width as _,
+ texture.height as _,
+ 0,
+ gl::RGBA,
+ gl::UNSIGNED_BYTE,
+ texture.data.as_ptr() as _,
+ );
+
+ atlas.tex_id = (self.font_texture as usize).into();
+ }
+
+ gl.gl.BindTexture(gl::TEXTURE_2D, current_texture as _);
+ }
+ }
+}
+
+pub struct GlutinRenderer {
+ refs: Rc>>>,
+ imgui: UnsafeCell,
+ imgui_data: ImguiData,
+ context_active: Arc>,
+}
+
+pub struct Gl {
+ pub gl: gl::Gles2,
+}
+
+static mut GL_PROC: Option = None;
+
+pub fn load_gl(gl_context: &glutin::Context) -> &'static Gl {
+ unsafe {
+ if let Some(gl) = GL_PROC.as_ref() {
+ return gl;
+ }
+
+ let gl = gl::Gles2::load_with(|ptr| gl_context.get_proc_address(ptr) as *const _);
+
+ let version = unsafe {
+ let data = CStr::from_ptr(gl.GetString(gl::VERSION) as *const _).to_bytes().to_vec();
+ String::from_utf8(data).unwrap()
+ };
+
+ log::info!("OpenGL version {}", version);
+
+ GL_PROC = Some(Gl { gl });
+ GL_PROC.as_ref().unwrap()
+ }
+}
+
+impl GlutinRenderer {
+ fn get_context(&mut self) -> Option<(&mut WindowedContext, &'static Gl)> {
+ let (refs, imgui) = unsafe { ((&mut *self.refs.get()).as_mut(), &mut *self.imgui.get()) };
+
+ refs.map(|context| {
+ let gl = load_gl(context);
+
+ if !self.imgui_data.initialized {
+ self.imgui_data.init(imgui, gl);
+ }
+
+ (context, gl)
+ })
+ }
+}
+
+fn field_offset FnOnce(&'a T) -> &'a U>(f: F) -> usize {
+ unsafe {
+ let instance = mem::zeroed::();
+
+ let offset = {
+ let field: &U = f(&instance);
+ field as *const U as usize - &instance as *const T as usize
+ };
+
+ mem::forget(instance);
+
+ offset
+ }
+}
+
+fn return_param(f: F) -> T
+where
+ F: FnOnce(&mut T),
+{
+ let mut val = unsafe { mem::zeroed() };
+ f(&mut val);
+ val
+}
+
+impl BackendRenderer for GlutinRenderer {
+ fn clear(&mut self, color: Color) {
+ if let Some((_, gl)) = self.get_context() {
+ unsafe {
+ gl.gl.ClearColor(color.r, color.g, color.b, color.a);
+ gl.gl.Clear(gl::COLOR_BUFFER_BIT);
+ }
+ }
+ }
+
+ fn present(&mut self) -> GameResult {
+ {
+ let mutex = GAME_SUSPENDED.lock().unwrap();
+ if *mutex {
+ return Ok(());
+ }
+ }
+
+ if let Some((context, gl)) = self.get_context() {
+ unsafe {
+ gl.gl.Finish();
+ }
+
+ context.swap_buffers().map_err(|e| RenderError(e.to_string()))?;
+ }
+
+ Ok(())
+ }
+
+ fn prepare_draw(&mut self, width: f32, height: f32) -> GameResult {
+ if let Some((_, gl)) = self.get_context() {
+ unsafe {
+ gl.gl.ActiveTexture(gl::TEXTURE0);
+ gl.gl.BlendEquation(gl::FUNC_ADD);
+ gl.gl.BlendFunc(gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA);
+
+ gl.gl.Viewport(0, 0, width as _, height as _);
+
+ let matrix = [
+ [2.0 / width, 0.0, 0.0, 0.0],
+ [0.0, 2.0 / -height, 0.0, 0.0],
+ [0.0, 0.0, -1.0, 0.0],
+ [-1.0, 1.0, 0.0, 1.0],
+ ];
+
+ gl.gl.BindBuffer(gl::ARRAY_BUFFER, 0);
+ gl.gl.BindBuffer(gl::ELEMENT_ARRAY_BUFFER, 0);
+ gl.gl.UseProgram(self.imgui_data.program);
+ gl.gl.Uniform1i(self.imgui_data.locs.texture, 0);
+ gl.gl.UniformMatrix4fv(self.imgui_data.locs.proj_mtx, 1, gl::FALSE, matrix.as_ptr() as _);
+ }
+
+ Ok(())
+ } else {
+ Err(RenderError("No OpenGL context available!".to_string()))
+ }
+ }
+
+ fn create_texture_mutable(&mut self, width: u16, height: u16) -> GameResult> {
+ Ok(Box::new(GlutinTexture {
+ texture_id: 0,
+ width,
+ height,
+ vertices: Vec::new(),
+ locs: self.imgui_data.locs,
+ vbo: self.imgui_data.vbo,
+ context_active: self.context_active.clone(),
+ }))
+ }
+
+ fn create_texture(&mut self, width: u16, height: u16, data: &[u8]) -> GameResult> {
+ if let Some((_, gl)) = self.get_context() {
+ unsafe {
+ let current_texture_id = return_param(|x| gl.gl.GetIntegerv(gl::TEXTURE_BINDING_2D, x)) as u32;
+ let texture_id = return_param(|x| gl.gl.GenTextures(1, x));
+ gl.gl.BindTexture(gl::TEXTURE_2D, texture_id);
+ gl.gl.TexParameteri(gl::TEXTURE_2D, gl::TEXTURE_MIN_FILTER, gl::NEAREST as _);
+ gl.gl.TexParameteri(gl::TEXTURE_2D, gl::TEXTURE_MAG_FILTER, gl::NEAREST as _);
+
+ gl.gl.TexImage2D(
+ gl::TEXTURE_2D,
+ 0,
+ gl::RGBA as _,
+ width as _,
+ height as _,
+ 0,
+ gl::RGBA,
+ gl::UNSIGNED_BYTE,
+ data.as_ptr() as _,
+ );
+
+ gl.gl.BindTexture(gl::TEXTURE_2D, current_texture_id);
+
+ Ok(Box::new(GlutinTexture {
+ texture_id,
+ width,
+ height,
+ vertices: Vec::new(),
+ locs: self.imgui_data.locs,
+ vbo: self.imgui_data.vbo,
+ context_active: self.context_active.clone(),
+ }))
+ }
+ } else {
+ Err(RenderError("No OpenGL context available!".to_string()))
+ }
+ }
+
+ fn set_blend_mode(&mut self, blend: BlendMode) -> GameResult {
+ if let Some((_, gl)) = self.get_context() {
+ match blend {
+ BlendMode::Add => unsafe {
+ gl.gl.BlendEquation(gl::FUNC_ADD);
+ gl.gl.BlendFunc(gl::ONE, gl::ONE);
+ },
+ BlendMode::Alpha => unsafe {
+ gl.gl.BlendEquation(gl::FUNC_ADD);
+ gl.gl.BlendFunc(gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA);
+ },
+ BlendMode::Multiply => unsafe {
+ gl.gl.BlendEquation(gl::FUNC_ADD);
+ gl.gl.BlendFuncSeparate(gl::ZERO, gl::SRC_COLOR, gl::ZERO, gl::SRC_ALPHA);
+ },
+ }
+
+ Ok(())
+ } else {
+ Err(RenderError("No OpenGL context available!".to_string()))
+ }
+ }
+
+ fn set_render_target(&mut self, texture: Option<&Box>) -> GameResult {
+ Ok(())
+ }
+
+ fn draw_rect(&mut self, rect: Rect, color: Color) -> GameResult {
+ unsafe {
+ if let Some(gl) = GL_PROC.as_ref() {
+ let color = color.to_rgba();
+ let mut uv = self.imgui_data.font_tex_size;
+ uv.0 = 0.0 / uv.0;
+ uv.1 = 0.0 / uv.1;
+
+ let vertices = [
+ VertexData { position: (rect.left as _, rect.bottom as _), uv, color },
+ VertexData { position: (rect.left as _, rect.top as _), uv, color },
+ VertexData { position: (rect.right as _, rect.top as _), uv, color },
+ VertexData { position: (rect.left as _, rect.bottom as _), uv, color },
+ VertexData { position: (rect.right as _, rect.top as _), uv, color },
+ VertexData { position: (rect.right as _, rect.bottom as _), uv, color },
+ ];
+
+ if gl.gl.BindSampler.is_loaded() {
+ gl.gl.BindSampler(0, 0);
+ }
+
+ gl.gl.BindBuffer(gl::ARRAY_BUFFER, self.imgui_data.vbo);
+ gl.gl.EnableVertexAttribArray(self.imgui_data.locs.position);
+ gl.gl.EnableVertexAttribArray(self.imgui_data.locs.uv);
+ gl.gl.EnableVertexAttribArray(self.imgui_data.locs.color);
+
+ gl.gl.VertexAttribPointer(
+ self.imgui_data.locs.position,
+ 2,
+ gl::FLOAT,
+ gl::FALSE,
+ mem::size_of::() as _,
+ field_offset::(|v| &v.position) as _,
+ );
+
+ gl.gl.VertexAttribPointer(
+ self.imgui_data.locs.uv,
+ 2,
+ gl::FLOAT,
+ gl::FALSE,
+ mem::size_of::() as _,
+ field_offset::(|v| &v.uv) as _,
+ );
+
+ gl.gl.VertexAttribPointer(
+ self.imgui_data.locs.color,
+ 4,
+ gl::UNSIGNED_BYTE,
+ gl::TRUE,
+ mem::size_of::() as _,
+ field_offset::(|v| &v.color) as _,
+ );
+
+ gl.gl.BindTexture(gl::TEXTURE_2D, self.imgui_data.font_texture);
+ gl.gl.BindBuffer(gl::ARRAY_BUFFER, self.imgui_data.vbo);
+ gl.gl.BufferData(
+ gl::ARRAY_BUFFER,
+ (vertices.len() * mem::size_of::()) as _,
+ vertices.as_ptr() as _,
+ gl::STREAM_DRAW,
+ );
+
+ gl.gl.DrawArrays(gl::TRIANGLES, 0, vertices.len() as _);
+
+ gl.gl.BindTexture(gl::TEXTURE_2D, 0);
+ gl.gl.BindBuffer(gl::ARRAY_BUFFER, 0);
+
+ Ok(())
+ } else {
+ Err(RenderError("No OpenGL context available!".to_string()))
+ }
+ }
+ }
+
+ fn draw_outline_rect(&mut self, rect: Rect, line_width: usize, color: Color) -> GameResult {
+ Ok(())
+ }
+
+ fn imgui(&self) -> GameResult<&mut imgui::Context> {
+ unsafe { Ok(&mut *self.imgui.get()) }
+ }
+
+ fn render_imgui(&mut self, draw_data: &DrawData) -> GameResult {
+ // https://github.com/michaelfairley/rust-imgui-opengl-renderer
+ if let Some((_, gl)) = self.get_context() {
+ unsafe {
+ gl.gl.ActiveTexture(gl::TEXTURE0);
+ gl.gl.Enable(gl::BLEND);
+ gl.gl.BlendEquation(gl::FUNC_ADD);
+ gl.gl.BlendFunc(gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA);
+ gl.gl.Disable(gl::CULL_FACE);
+ gl.gl.Disable(gl::DEPTH_TEST);
+ gl.gl.Enable(gl::SCISSOR_TEST);
+
+ let imgui = self.imgui()?;
+ let [width, height] = imgui.io().display_size;
+ let [scale_w, scale_h] = imgui.io().display_framebuffer_scale;
+
+ let fb_width = width * scale_w;
+ let fb_height = height * scale_h;
+
+ gl.gl.Viewport(0, 0, fb_width as _, fb_height as _);
+ let matrix = [
+ [2.0 / width as f32, 0.0, 0.0, 0.0],
+ [0.0, 2.0 / -(height as f32), 0.0, 0.0],
+ [0.0, 0.0, -1.0, 0.0],
+ [-1.0, 1.0, 0.0, 1.0],
+ ];
+ gl.gl.UseProgram(self.imgui_data.program);
+ gl.gl.Uniform1i(self.imgui_data.locs.texture, 0);
+ gl.gl.UniformMatrix4fv(self.imgui_data.locs.proj_mtx, 1, gl::FALSE, matrix.as_ptr() as _);
+
+ if gl.gl.BindSampler.is_loaded() {
+ gl.gl.BindSampler(0, 0);
+ }
+
+ // let vao = return_param(|x| gl.gl.GenVertexArrays(1, x));
+ //gl.gl.BindVertexArray(vao);
+ gl.gl.BindBuffer(gl::ARRAY_BUFFER, self.imgui_data.vbo);
+ gl.gl.EnableVertexAttribArray(self.imgui_data.locs.position);
+ gl.gl.EnableVertexAttribArray(self.imgui_data.locs.uv);
+ gl.gl.EnableVertexAttribArray(self.imgui_data.locs.color);
+
+ gl.gl.VertexAttribPointer(
+ self.imgui_data.locs.position,
+ 2,
+ gl::FLOAT,
+ gl::FALSE,
+ mem::size_of::() as _,
+ field_offset::(|v| &v.pos) as _,
+ );
+
+ gl.gl.VertexAttribPointer(
+ self.imgui_data.locs.uv,
+ 2,
+ gl::FLOAT,
+ gl::FALSE,
+ mem::size_of::() as _,
+ field_offset::(|v| &v.uv) as _,
+ );
+
+ gl.gl.VertexAttribPointer(
+ self.imgui_data.locs.color,
+ 4,
+ gl::UNSIGNED_BYTE,
+ gl::TRUE,
+ mem::size_of::() as _,
+ field_offset::(|v| &v.col) as _,
+ );
+
+ for draw_list in draw_data.draw_lists() {
+ let vtx_buffer = draw_list.vtx_buffer();
+ let idx_buffer = draw_list.idx_buffer();
+
+ gl.gl.BindBuffer(gl::ARRAY_BUFFER, self.imgui_data.vbo);
+ gl.gl.BufferData(
+ gl::ARRAY_BUFFER,
+ (vtx_buffer.len() * mem::size_of::()) as _,
+ vtx_buffer.as_ptr() as _,
+ gl::STREAM_DRAW,
+ );
+
+ gl.gl.BindBuffer(gl::ELEMENT_ARRAY_BUFFER, self.imgui_data.ebo);
+ gl.gl.BufferData(
+ gl::ELEMENT_ARRAY_BUFFER,
+ (idx_buffer.len() * mem::size_of::()) as _,
+ idx_buffer.as_ptr() as _,
+ gl::STREAM_DRAW,
+ );
+
+ for cmd in draw_list.commands() {
+ match cmd {
+ DrawCmd::Elements {
+ count,
+ cmd_params: DrawCmdParams { clip_rect: [x, y, z, w], texture_id, idx_offset, .. },
+ } => {
+ gl.gl.BindTexture(gl::TEXTURE_2D, texture_id.id() as _);
+
+ gl.gl.Scissor(
+ (x * scale_w) as GLint,
+ (fb_height - w * scale_h) as GLint,
+ ((z - x) * scale_w) as GLint,
+ ((w - y) * scale_h) as GLint,
+ );
+
+ let idx_size =
+ if mem::size_of::() == 2 { gl::UNSIGNED_SHORT } else { gl::UNSIGNED_INT };
+
+ gl.gl.DrawElements(
+ gl::TRIANGLES,
+ count as _,
+ idx_size,
+ (idx_offset * mem::size_of::()) as _,
+ );
+ }
+ DrawCmd::ResetRenderState => {}
+ DrawCmd::RawCallback { .. } => {}
+ }
+ }
+ }
+
+ //gl.gl.DeleteVertexArrays(1, &vao);
+ }
+ }
+
+ Ok(())
+ }
+}
+
+impl Drop for GlutinRenderer {
+ fn drop(&mut self) {
+ *self.context_active.as_ref().borrow_mut() = false;
+ }
+}
diff --git a/src/framework/backend_sdl2.rs b/src/framework/backend_sdl2.rs
index 4ec5f71..9ed2cad 100644
--- a/src/framework/backend_sdl2.rs
+++ b/src/framework/backend_sdl2.rs
@@ -564,14 +564,8 @@ impl BackendRenderer for SDL2Renderer {
Ok(())
}
-
- fn prepare_frame<'ui>(&self, _ui: &Ui<'ui>) -> GameResult {
- Ok(())
- }
}
-impl SDL2Renderer {}
-
struct SDL2Texture {
refs: Rc>,
texture: Option,
diff --git a/src/framework/backend_sokol.rs b/src/framework/backend_sokol.rs
new file mode 100644
index 0000000..3590c16
--- /dev/null
+++ b/src/framework/backend_sokol.rs
@@ -0,0 +1,358 @@
+use std::cell::RefCell;
+use std::mem;
+use std::ops::DerefMut;
+use std::time::Duration;
+
+use imgui::{DrawData, Ui};
+use ndk::input_queue::InputQueue;
+use sokol::app::{SApp, SAppDesc, SAppEvent, SAppEventType, SAppKeycode};
+use sokol::gfx::{sg_isvalid, sg_query_backend, sg_shutdown};
+
+use crate::common::{Color, Rect};
+use crate::framework::backend::{Backend, BackendEventLoop, BackendRenderer, BackendTexture, SpriteBatchCommand};
+use crate::framework::context::Context;
+use crate::framework::error::GameResult;
+use crate::framework::graphics::BlendMode;
+use crate::framework::keyboard::ScanCode;
+use crate::Game;
+
+pub struct SokolBackend;
+
+impl SokolBackend {
+ pub fn new() -> GameResult> {
+ Ok(Box::new(SokolBackend))
+ }
+}
+
+impl Backend for SokolBackend {
+ fn create_event_loop(&self) -> GameResult> {
+ Ok(Box::new(SokolEventLoop))
+ }
+}
+
+pub struct SokolEventLoop;
+
+#[cfg(target_os = "android")]
+extern "C" {
+ fn sapp_android_on_create(
+ activity: *mut ndk_sys::ANativeActivity,
+ window: *mut ndk_sys::ANativeWindow,
+ input_queue: *mut ndk_sys::AInputQueue,
+ );
+}
+
+impl BackendEventLoop for SokolEventLoop {
+ fn run(&mut self, game: &mut Game, ctx: &mut Context) {
+ #[cfg(target_os = "android")]
+ unsafe {
+ let activity = ndk_glue::native_activity().ptr().as_ptr();
+ let window = match ndk_glue::native_window().as_ref() {
+ None => std::ptr::null_mut(),
+ Some(p) => p.ptr().as_ptr(),
+ };
+ let input_queue = match ndk_glue::input_queue().as_ref() {
+ None => std::ptr::null_mut(),
+ Some(p) => p.ptr().as_ptr(),
+ };
+
+ println!("activity = {:?} window = {:?} input_queue = {:?}", activity, window, input_queue);
+
+ sapp_android_on_create(activity, window, input_queue);
+ }
+
+ struct Callbacks<'a, 'b> {
+ ctx: &'a mut Context,
+ game: &'b mut Game,
+ };
+
+ impl<'a, 'b> SApp for Callbacks<'a, 'b> {
+ fn sapp_init(&mut self) {
+ let state_ref = unsafe { &mut *self.game.state.get() };
+
+ self.ctx.screen_size = (640.0, 480.0);
+ state_ref.handle_resize(self.ctx).unwrap();
+ }
+
+ fn sapp_frame(&mut self) {
+ let state_ref = unsafe { &mut *self.game.state.get() };
+
+ self.game.update(self.ctx).unwrap();
+
+ // todo: not really supported on iOS/consoles
+ if state_ref.shutdown {
+ log::info!("Shutting down...");
+ std::process::exit(0);
+ return;
+ }
+
+ if state_ref.next_scene.is_some() {
+ mem::swap(&mut self.game.scene, &mut state_ref.next_scene);
+ state_ref.next_scene = None;
+ self.game.scene.as_mut().unwrap().init(state_ref, self.ctx).unwrap();
+ self.game.loops = 0;
+ state_ref.frame_time = 0.0;
+ }
+
+ self.game.draw(self.ctx).unwrap();
+ }
+
+ fn sapp_cleanup(&mut self) {
+ if sg_isvalid() {
+ sg_shutdown();
+ }
+ }
+
+ fn sapp_event(&mut self, event: SAppEvent) {
+ let state_ref = unsafe { &mut *self.game.state.get() };
+ println!("event: {:?}", event.event_type);
+
+ match event.event_type {
+ SAppEventType::Invalid => {}
+ SAppEventType::KeyDown => {
+ if let Some(drs_scan) = conv_scancode(event.key_code) {
+ state_ref.process_debug_keys(drs_scan);
+ self.ctx.keyboard_context.set_key(drs_scan, true);
+ }
+ }
+ SAppEventType::KeyUp => {
+ if let Some(drs_scan) = conv_scancode(event.key_code) {
+ self.ctx.keyboard_context.set_key(drs_scan, false);
+ }
+ }
+ SAppEventType::Char => {}
+ SAppEventType::MouseDown => {}
+ SAppEventType::MouseUp => {}
+ SAppEventType::MouseScroll => {}
+ SAppEventType::MouseMove => {}
+ SAppEventType::MouseEnter => {}
+ SAppEventType::MouseLeave => {}
+ SAppEventType::TouchesBegan => {}
+ SAppEventType::TouchesMoved => {}
+ SAppEventType::TouchesEnded => {}
+ SAppEventType::TouchesCancelled => {}
+ SAppEventType::Resized => {}
+ SAppEventType::Iconified => {}
+ SAppEventType::Restored => {}
+ SAppEventType::Suspended => {}
+ SAppEventType::Resumed => {}
+ SAppEventType::UpdateCursor => {}
+ SAppEventType::QuitRequested => {
+ state_ref.shutdown();
+ }
+ }
+ }
+ }
+
+ sokol::app::sapp_run(
+ Callbacks { ctx: unsafe { std::mem::transmute(ctx) }, game: unsafe { std::mem::transmute(game) } },
+ SAppDesc {
+ width: 640,
+ height: 480,
+ window_title: "doukutsu-rs".to_string(),
+ ios_keyboard_resizes_canvas: false,
+ ..Default::default()
+ },
+ );
+
+ loop {
+ std::thread::sleep(Duration::from_millis(10))
+ }
+ }
+
+ fn new_renderer(&self) -> GameResult> {
+ let mut imgui = imgui::Context::create();
+ imgui.io_mut().display_size = [640.0, 480.0];
+ imgui.fonts().build_alpha8_texture();
+
+ log::info!("Using Sokol backend: {:?}", sg_query_backend());
+
+ Ok(Box::new(SokolRenderer(RefCell::new(imgui))))
+ }
+}
+
+pub struct NullTexture(u16, u16);
+
+impl BackendTexture for NullTexture {
+ fn dimensions(&self) -> (u16, u16) {
+ (self.0, self.1)
+ }
+
+ fn add(&mut self, command: SpriteBatchCommand) {}
+
+ fn clear(&mut self) {}
+
+ fn draw(&mut self) -> GameResult<()> {
+ Ok(())
+ }
+}
+
+pub struct SokolRenderer(RefCell);
+
+impl BackendRenderer for SokolRenderer {
+ fn clear(&mut self, color: Color) {}
+
+ fn present(&mut self) -> GameResult {
+ Ok(())
+ }
+
+ fn create_texture_mutable(&mut self, width: u16, height: u16) -> GameResult> {
+ Ok(Box::new(NullTexture(width, height)))
+ }
+
+ fn create_texture(&mut self, width: u16, height: u16, data: &[u8]) -> GameResult> {
+ Ok(Box::new(NullTexture(width, height)))
+ }
+
+ fn set_blend_mode(&mut self, blend: BlendMode) -> GameResult {
+ Ok(())
+ }
+
+ fn set_render_target(&mut self, texture: Option<&Box>) -> GameResult {
+ Ok(())
+ }
+
+ fn draw_rect(&mut self, rect: Rect, color: Color) -> GameResult {
+ Ok(())
+ }
+
+ fn draw_outline_rect(&mut self, rect: Rect, line_width: usize, color: Color) -> GameResult {
+ Ok(())
+ }
+
+ fn imgui(&self) -> GameResult<&mut imgui::Context> {
+ unsafe { Ok(&mut *self.0.as_ptr()) }
+ }
+
+ fn render_imgui(&mut self, draw_data: &DrawData) -> GameResult {
+ Ok(())
+ }
+
+ fn prepare_frame<'ui>(&self, ui: &Ui<'ui>) -> GameResult {
+ Ok(())
+ }
+}
+
+fn conv_scancode(code: SAppKeycode) -> Option {
+ match code {
+ SAppKeycode::KeySpace => Some(ScanCode::Space),
+ SAppKeycode::KeyApostrophe => Some(ScanCode::Apostrophe),
+ SAppKeycode::KeyComma => Some(ScanCode::Comma),
+ SAppKeycode::KeyMinus => Some(ScanCode::Minus),
+ SAppKeycode::KeyPeriod => Some(ScanCode::Period),
+ SAppKeycode::KeySlash => Some(ScanCode::Slash),
+ SAppKeycode::Key0 => Some(ScanCode::Key0),
+ SAppKeycode::Key1 => Some(ScanCode::Key1),
+ SAppKeycode::Key2 => Some(ScanCode::Key2),
+ SAppKeycode::Key3 => Some(ScanCode::Key3),
+ SAppKeycode::Key4 => Some(ScanCode::Key4),
+ SAppKeycode::Key5 => Some(ScanCode::Key5),
+ SAppKeycode::Key6 => Some(ScanCode::Key6),
+ SAppKeycode::Key7 => Some(ScanCode::Key7),
+ SAppKeycode::Key8 => Some(ScanCode::Key8),
+ SAppKeycode::Key9 => Some(ScanCode::Key9),
+ SAppKeycode::KeySemicolon => Some(ScanCode::Semicolon),
+ SAppKeycode::KeyEqual => Some(ScanCode::Equals),
+ SAppKeycode::KeyA => Some(ScanCode::A),
+ SAppKeycode::KeyB => Some(ScanCode::B),
+ SAppKeycode::KeyC => Some(ScanCode::C),
+ SAppKeycode::KeyD => Some(ScanCode::D),
+ SAppKeycode::KeyE => Some(ScanCode::E),
+ SAppKeycode::KeyF => Some(ScanCode::F),
+ SAppKeycode::KeyG => Some(ScanCode::G),
+ SAppKeycode::KeyH => Some(ScanCode::H),
+ SAppKeycode::KeyI => Some(ScanCode::I),
+ SAppKeycode::KeyJ => Some(ScanCode::J),
+ SAppKeycode::KeyK => Some(ScanCode::K),
+ SAppKeycode::KeyL => Some(ScanCode::L),
+ SAppKeycode::KeyM => Some(ScanCode::M),
+ SAppKeycode::KeyN => Some(ScanCode::N),
+ SAppKeycode::KeyO => Some(ScanCode::O),
+ SAppKeycode::KeyP => Some(ScanCode::P),
+ SAppKeycode::KeyQ => Some(ScanCode::Q),
+ SAppKeycode::KeyR => Some(ScanCode::R),
+ SAppKeycode::KeyS => Some(ScanCode::S),
+ SAppKeycode::KeyT => Some(ScanCode::T),
+ SAppKeycode::KeyU => Some(ScanCode::U),
+ SAppKeycode::KeyV => Some(ScanCode::V),
+ SAppKeycode::KeyW => Some(ScanCode::W),
+ SAppKeycode::KeyX => Some(ScanCode::X),
+ SAppKeycode::KeyY => Some(ScanCode::Y),
+ SAppKeycode::KeyZ => Some(ScanCode::Z),
+ SAppKeycode::KeyLeftBracket => Some(ScanCode::LBracket),
+ SAppKeycode::KeyBackslash => Some(ScanCode::Backslash),
+ SAppKeycode::KeyRightBracket => Some(ScanCode::RBracket),
+ SAppKeycode::KeyGraveAccent => Some(ScanCode::Grave),
+ SAppKeycode::KeyWorld1 => Some(ScanCode::AbntC1),
+ SAppKeycode::KeyWorld2 => Some(ScanCode::AbntC2),
+ SAppKeycode::KeyEscape => Some(ScanCode::Escape),
+ SAppKeycode::KeyEnter => Some(ScanCode::Return),
+ SAppKeycode::KeyTab => Some(ScanCode::Tab),
+ SAppKeycode::KeyBackspace => Some(ScanCode::Backspace),
+ SAppKeycode::KeyInsert => Some(ScanCode::Insert),
+ SAppKeycode::KeyDelete => Some(ScanCode::Delete),
+ SAppKeycode::KeyRight => Some(ScanCode::Right),
+ SAppKeycode::KeyLeft => Some(ScanCode::Left),
+ SAppKeycode::KeyDown => Some(ScanCode::Down),
+ SAppKeycode::KeyUp => Some(ScanCode::Up),
+ SAppKeycode::KeyPageUp => Some(ScanCode::PageUp),
+ SAppKeycode::KeyPageDown => Some(ScanCode::PageDown),
+ SAppKeycode::KeyHome => Some(ScanCode::Home),
+ SAppKeycode::KeyEnd => Some(ScanCode::End),
+ SAppKeycode::KeyCapsLock => Some(ScanCode::Capslock),
+ SAppKeycode::KeyScrollLock => Some(ScanCode::Scrolllock),
+ SAppKeycode::KeyNumLock => Some(ScanCode::Numlock),
+ SAppKeycode::KeyPrintScreen => Some(ScanCode::Sysrq),
+ SAppKeycode::KeyPause => Some(ScanCode::Pause),
+ SAppKeycode::KeyF1 => Some(ScanCode::F1),
+ SAppKeycode::KeyF2 => Some(ScanCode::F2),
+ SAppKeycode::KeyF3 => Some(ScanCode::F3),
+ SAppKeycode::KeyF4 => Some(ScanCode::F4),
+ SAppKeycode::KeyF5 => Some(ScanCode::F5),
+ SAppKeycode::KeyF6 => Some(ScanCode::F6),
+ SAppKeycode::KeyF7 => Some(ScanCode::F7),
+ SAppKeycode::KeyF8 => Some(ScanCode::F8),
+ SAppKeycode::KeyF9 => Some(ScanCode::F9),
+ SAppKeycode::KeyF10 => Some(ScanCode::F10),
+ SAppKeycode::KeyF11 => Some(ScanCode::F11),
+ SAppKeycode::KeyF12 => Some(ScanCode::F12),
+ SAppKeycode::KeyF13 => Some(ScanCode::F13),
+ SAppKeycode::KeyF14 => Some(ScanCode::F14),
+ SAppKeycode::KeyF15 => Some(ScanCode::F15),
+ SAppKeycode::KeyF16 => Some(ScanCode::F16),
+ SAppKeycode::KeyF17 => Some(ScanCode::F17),
+ SAppKeycode::KeyF18 => Some(ScanCode::F18),
+ SAppKeycode::KeyF19 => Some(ScanCode::F19),
+ SAppKeycode::KeyF20 => Some(ScanCode::F20),
+ SAppKeycode::KeyF21 => Some(ScanCode::F21),
+ SAppKeycode::KeyF22 => Some(ScanCode::F22),
+ SAppKeycode::KeyF23 => Some(ScanCode::F23),
+ SAppKeycode::KeyF24 => Some(ScanCode::F24),
+ SAppKeycode::KeyKP0 => Some(ScanCode::Numpad0),
+ SAppKeycode::KeyKP1 => Some(ScanCode::Numpad1),
+ SAppKeycode::KeyKP2 => Some(ScanCode::Numpad2),
+ SAppKeycode::KeyKP3 => Some(ScanCode::Numpad3),
+ SAppKeycode::KeyKP4 => Some(ScanCode::Numpad4),
+ SAppKeycode::KeyKP5 => Some(ScanCode::Numpad5),
+ SAppKeycode::KeyKP6 => Some(ScanCode::Numpad6),
+ SAppKeycode::KeyKP7 => Some(ScanCode::Numpad7),
+ SAppKeycode::KeyKP8 => Some(ScanCode::Numpad8),
+ SAppKeycode::KeyKP9 => Some(ScanCode::Numpad9),
+ SAppKeycode::KeyKPDecimal => Some(ScanCode::NumpadDecimal),
+ SAppKeycode::KeyKPDivide => Some(ScanCode::NumpadDivide),
+ SAppKeycode::KeyKPMultiply => Some(ScanCode::NumpadMultiply),
+ SAppKeycode::KeyKPSubtract => Some(ScanCode::NumpadSubtract),
+ SAppKeycode::KeyKPAdd => Some(ScanCode::NumpadAdd),
+ SAppKeycode::KeyKPEnter => Some(ScanCode::NumpadEnter),
+ SAppKeycode::KeyKPEqual => Some(ScanCode::NumpadEquals),
+ SAppKeycode::KeyLeftShift => Some(ScanCode::LShift),
+ SAppKeycode::KeyLeftControl => Some(ScanCode::LControl),
+ SAppKeycode::KeyLeftAlt => Some(ScanCode::LAlt),
+ SAppKeycode::KeyLeftSuper => Some(ScanCode::LWin),
+ SAppKeycode::KeyRightShift => Some(ScanCode::RShift),
+ SAppKeycode::KeyRightControl => Some(ScanCode::RControl),
+ SAppKeycode::KeyRightAlt => Some(ScanCode::RAlt),
+ SAppKeycode::KeyRightSuper => Some(ScanCode::RWin),
+ SAppKeycode::KeyMenu => Some(ScanCode::Menu),
+ _ => None,
+ }
+}
diff --git a/src/framework/context.rs b/src/framework/context.rs
index 3a2688d..158d4fd 100644
--- a/src/framework/context.rs
+++ b/src/framework/context.rs
@@ -1,14 +1,15 @@
use crate::framework::backend::{init_backend, BackendRenderer};
use crate::framework::error::GameResult;
use crate::framework::filesystem::Filesystem;
-use crate::Game;
use crate::framework::keyboard::KeyboardContext;
+use crate::Game;
pub struct Context {
pub(crate) filesystem: Filesystem,
pub(crate) renderer: Option>,
pub(crate) keyboard_context: KeyboardContext,
pub(crate) screen_size: (f32, f32),
+ pub(crate) screen_insets: (f32, f32, f32, f32),
}
impl Context {
@@ -18,6 +19,7 @@ impl Context {
renderer: None,
keyboard_context: KeyboardContext::new(),
screen_size: (320.0, 240.0),
+ screen_insets: (0.0, 0.0, 0.0, 0.0),
}
}
diff --git a/src/framework/gl.rs b/src/framework/gl.rs
new file mode 100644
index 0000000..56f6e20
--- /dev/null
+++ b/src/framework/gl.rs
@@ -0,0 +1,1965 @@
+
+ mod __gl_imports {
+ pub use std::mem;
+ pub use std::marker::Send;
+ pub use std::os::raw;
+ }
+
+
+ pub mod types {
+ #![allow(non_camel_case_types, non_snake_case, dead_code, missing_copy_implementations)]
+
+// Common types from OpenGL 1.1
+pub type GLenum = super::__gl_imports::raw::c_uint;
+pub type GLboolean = super::__gl_imports::raw::c_uchar;
+pub type GLbitfield = super::__gl_imports::raw::c_uint;
+pub type GLvoid = super::__gl_imports::raw::c_void;
+pub type GLbyte = super::__gl_imports::raw::c_char;
+pub type GLshort = super::__gl_imports::raw::c_short;
+pub type GLint = super::__gl_imports::raw::c_int;
+pub type GLclampx = super::__gl_imports::raw::c_int;
+pub type GLubyte = super::__gl_imports::raw::c_uchar;
+pub type GLushort = super::__gl_imports::raw::c_ushort;
+pub type GLuint = super::__gl_imports::raw::c_uint;
+pub type GLsizei = super::__gl_imports::raw::c_int;
+pub type GLfloat = super::__gl_imports::raw::c_float;
+pub type GLclampf = super::__gl_imports::raw::c_float;
+pub type GLdouble = super::__gl_imports::raw::c_double;
+pub type GLclampd = super::__gl_imports::raw::c_double;
+pub type GLeglImageOES = *const super::__gl_imports::raw::c_void;
+pub type GLchar = super::__gl_imports::raw::c_char;
+pub type GLcharARB = super::__gl_imports::raw::c_char;
+
+#[cfg(target_os = "macos")]
+pub type GLhandleARB = *const super::__gl_imports::raw::c_void;
+#[cfg(not(target_os = "macos"))]
+pub type GLhandleARB = super::__gl_imports::raw::c_uint;
+
+pub type GLhalfARB = super::__gl_imports::raw::c_ushort;
+pub type GLhalf = super::__gl_imports::raw::c_ushort;
+
+// Must be 32 bits
+pub type GLfixed = GLint;
+
+pub type GLintptr = isize;
+pub type GLsizeiptr = isize;
+pub type GLint64 = i64;
+pub type GLuint64 = u64;
+pub type GLintptrARB = isize;
+pub type GLsizeiptrARB = isize;
+pub type GLint64EXT = i64;
+pub type GLuint64EXT = u64;
+
+pub enum __GLsync {}
+pub type GLsync = *const __GLsync;
+
+// compatible with OpenCL cl_context
+pub enum _cl_context {}
+pub enum _cl_event {}
+
+pub type GLDEBUGPROC = Option;
+pub type GLDEBUGPROCARB = Option;
+pub type GLDEBUGPROCKHR = Option;
+
+// GLES 1 types
+// "pub type GLclampx = i32;",
+
+// GLES 1/2 types (tagged for GLES 1)
+// "pub type GLbyte = i8;",
+// "pub type GLubyte = u8;",
+// "pub type GLfloat = GLfloat;",
+// "pub type GLclampf = GLfloat;",
+// "pub type GLfixed = i32;",
+// "pub type GLint64 = i64;",
+// "pub type GLuint64 = u64;",
+// "pub type GLintptr = intptr_t;",
+// "pub type GLsizeiptr = ssize_t;",
+
+// GLES 1/2 types (tagged for GLES 2 - attribute syntax is limited)
+// "pub type GLbyte = i8;",
+// "pub type GLubyte = u8;",
+// "pub type GLfloat = GLfloat;",
+// "pub type GLclampf = GLfloat;",
+// "pub type GLfixed = i32;",
+// "pub type GLint64 = i64;",
+// "pub type GLuint64 = u64;",
+// "pub type GLint64EXT = i64;",
+// "pub type GLuint64EXT = u64;",
+// "pub type GLintptr = intptr_t;",
+// "pub type GLsizeiptr = ssize_t;",
+
+// GLES 2 types (none currently)
+
+// Vendor extension types
+pub type GLDEBUGPROCAMD = Option;
+pub type GLhalfNV = super::__gl_imports::raw::c_ushort;
+pub type GLvdpauSurfaceNV = GLintptr;
+
+}
+#[allow(dead_code, non_upper_case_globals)] pub const ACTIVE_ATTRIBUTES: types::GLenum = 0x8B89;
+#[allow(dead_code, non_upper_case_globals)] pub const ACTIVE_ATTRIBUTE_MAX_LENGTH: types::GLenum = 0x8B8A;
+#[allow(dead_code, non_upper_case_globals)] pub const ACTIVE_TEXTURE: types::GLenum = 0x84E0;
+#[allow(dead_code, non_upper_case_globals)] pub const ACTIVE_UNIFORMS: types::GLenum = 0x8B86;
+#[allow(dead_code, non_upper_case_globals)] pub const ACTIVE_UNIFORM_BLOCKS: types::GLenum = 0x8A36;
+#[allow(dead_code, non_upper_case_globals)] pub const ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH: types::GLenum = 0x8A35;
+#[allow(dead_code, non_upper_case_globals)] pub const ACTIVE_UNIFORM_MAX_LENGTH: types::GLenum = 0x8B87;
+#[allow(dead_code, non_upper_case_globals)] pub const ALIASED_LINE_WIDTH_RANGE: types::GLenum = 0x846E;
+#[allow(dead_code, non_upper_case_globals)] pub const ALIASED_POINT_SIZE_RANGE: types::GLenum = 0x846D;
+#[allow(dead_code, non_upper_case_globals)] pub const ALPHA: types::GLenum = 0x1906;
+#[allow(dead_code, non_upper_case_globals)] pub const ALPHA_BITS: types::GLenum = 0x0D55;
+#[allow(dead_code, non_upper_case_globals)] pub const ALREADY_SIGNALED: types::GLenum = 0x911A;
+#[allow(dead_code, non_upper_case_globals)] pub const ALWAYS: types::GLenum = 0x0207;
+#[allow(dead_code, non_upper_case_globals)] pub const ANY_SAMPLES_PASSED: types::GLenum = 0x8C2F;
+#[allow(dead_code, non_upper_case_globals)] pub const ANY_SAMPLES_PASSED_CONSERVATIVE: types::GLenum = 0x8D6A;
+#[allow(dead_code, non_upper_case_globals)] pub const ARRAY_BUFFER: types::GLenum = 0x8892;
+#[allow(dead_code, non_upper_case_globals)] pub const ARRAY_BUFFER_BINDING: types::GLenum = 0x8894;
+#[allow(dead_code, non_upper_case_globals)] pub const ATTACHED_SHADERS: types::GLenum = 0x8B85;
+#[allow(dead_code, non_upper_case_globals)] pub const BACK: types::GLenum = 0x0405;
+#[allow(dead_code, non_upper_case_globals)] pub const BLEND: types::GLenum = 0x0BE2;
+#[allow(dead_code, non_upper_case_globals)] pub const BLEND_COLOR: types::GLenum = 0x8005;
+#[allow(dead_code, non_upper_case_globals)] pub const BLEND_DST_ALPHA: types::GLenum = 0x80CA;
+#[allow(dead_code, non_upper_case_globals)] pub const BLEND_DST_RGB: types::GLenum = 0x80C8;
+#[allow(dead_code, non_upper_case_globals)] pub const BLEND_EQUATION: types::GLenum = 0x8009;
+#[allow(dead_code, non_upper_case_globals)] pub const BLEND_EQUATION_ALPHA: types::GLenum = 0x883D;
+#[allow(dead_code, non_upper_case_globals)] pub const BLEND_EQUATION_RGB: types::GLenum = 0x8009;
+#[allow(dead_code, non_upper_case_globals)] pub const BLEND_SRC_ALPHA: types::GLenum = 0x80CB;
+#[allow(dead_code, non_upper_case_globals)] pub const BLEND_SRC_RGB: types::GLenum = 0x80C9;
+#[allow(dead_code, non_upper_case_globals)] pub const BLUE: types::GLenum = 0x1905;
+#[allow(dead_code, non_upper_case_globals)] pub const BLUE_BITS: types::GLenum = 0x0D54;
+#[allow(dead_code, non_upper_case_globals)] pub const BOOL: types::GLenum = 0x8B56;
+#[allow(dead_code, non_upper_case_globals)] pub const BOOL_VEC2: types::GLenum = 0x8B57;
+#[allow(dead_code, non_upper_case_globals)] pub const BOOL_VEC3: types::GLenum = 0x8B58;
+#[allow(dead_code, non_upper_case_globals)] pub const BOOL_VEC4: types::GLenum = 0x8B59;
+#[allow(dead_code, non_upper_case_globals)] pub const BUFFER_ACCESS_FLAGS: types::GLenum = 0x911F;
+#[allow(dead_code, non_upper_case_globals)] pub const BUFFER_MAPPED: types::GLenum = 0x88BC;
+#[allow(dead_code, non_upper_case_globals)] pub const BUFFER_MAP_LENGTH: types::GLenum = 0x9120;
+#[allow(dead_code, non_upper_case_globals)] pub const BUFFER_MAP_OFFSET: types::GLenum = 0x9121;
+#[allow(dead_code, non_upper_case_globals)] pub const BUFFER_MAP_POINTER: types::GLenum = 0x88BD;
+#[allow(dead_code, non_upper_case_globals)] pub const BUFFER_SIZE: types::GLenum = 0x8764;
+#[allow(dead_code, non_upper_case_globals)] pub const BUFFER_USAGE: types::GLenum = 0x8765;
+#[allow(dead_code, non_upper_case_globals)] pub const BYTE: types::GLenum = 0x1400;
+#[allow(dead_code, non_upper_case_globals)] pub const CCW: types::GLenum = 0x0901;
+#[allow(dead_code, non_upper_case_globals)] pub const CLAMP_TO_EDGE: types::GLenum = 0x812F;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR: types::GLenum = 0x1800;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT0: types::GLenum = 0x8CE0;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT1: types::GLenum = 0x8CE1;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT10: types::GLenum = 0x8CEA;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT11: types::GLenum = 0x8CEB;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT12: types::GLenum = 0x8CEC;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT13: types::GLenum = 0x8CED;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT14: types::GLenum = 0x8CEE;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT15: types::GLenum = 0x8CEF;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT16: types::GLenum = 0x8CF0;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT17: types::GLenum = 0x8CF1;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT18: types::GLenum = 0x8CF2;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT19: types::GLenum = 0x8CF3;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT2: types::GLenum = 0x8CE2;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT20: types::GLenum = 0x8CF4;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT21: types::GLenum = 0x8CF5;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT22: types::GLenum = 0x8CF6;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT23: types::GLenum = 0x8CF7;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT24: types::GLenum = 0x8CF8;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT25: types::GLenum = 0x8CF9;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT26: types::GLenum = 0x8CFA;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT27: types::GLenum = 0x8CFB;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT28: types::GLenum = 0x8CFC;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT29: types::GLenum = 0x8CFD;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT3: types::GLenum = 0x8CE3;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT30: types::GLenum = 0x8CFE;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT31: types::GLenum = 0x8CFF;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT4: types::GLenum = 0x8CE4;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT5: types::GLenum = 0x8CE5;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT6: types::GLenum = 0x8CE6;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT7: types::GLenum = 0x8CE7;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT8: types::GLenum = 0x8CE8;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_ATTACHMENT9: types::GLenum = 0x8CE9;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_BUFFER_BIT: types::GLenum = 0x00004000;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_CLEAR_VALUE: types::GLenum = 0x0C22;
+#[allow(dead_code, non_upper_case_globals)] pub const COLOR_WRITEMASK: types::GLenum = 0x0C23;
+#[allow(dead_code, non_upper_case_globals)] pub const COMPARE_REF_TO_TEXTURE: types::GLenum = 0x884E;
+#[allow(dead_code, non_upper_case_globals)] pub const COMPILE_STATUS: types::GLenum = 0x8B81;
+#[allow(dead_code, non_upper_case_globals)] pub const COMPRESSED_R11_EAC: types::GLenum = 0x9270;
+#[allow(dead_code, non_upper_case_globals)] pub const COMPRESSED_RG11_EAC: types::GLenum = 0x9272;
+#[allow(dead_code, non_upper_case_globals)] pub const COMPRESSED_RGB8_ETC2: types::GLenum = 0x9274;
+#[allow(dead_code, non_upper_case_globals)] pub const COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: types::GLenum = 0x9276;
+#[allow(dead_code, non_upper_case_globals)] pub const COMPRESSED_RGBA8_ETC2_EAC: types::GLenum = 0x9278;
+#[allow(dead_code, non_upper_case_globals)] pub const COMPRESSED_SIGNED_R11_EAC: types::GLenum = 0x9271;
+#[allow(dead_code, non_upper_case_globals)] pub const COMPRESSED_SIGNED_RG11_EAC: types::GLenum = 0x9273;
+#[allow(dead_code, non_upper_case_globals)] pub const COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: types::GLenum = 0x9279;
+#[allow(dead_code, non_upper_case_globals)] pub const COMPRESSED_SRGB8_ETC2: types::GLenum = 0x9275;
+#[allow(dead_code, non_upper_case_globals)] pub const COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: types::GLenum = 0x9277;
+#[allow(dead_code, non_upper_case_globals)] pub const COMPRESSED_TEXTURE_FORMATS: types::GLenum = 0x86A3;
+#[allow(dead_code, non_upper_case_globals)] pub const CONDITION_SATISFIED: types::GLenum = 0x911C;
+#[allow(dead_code, non_upper_case_globals)] pub const CONSTANT_ALPHA: types::GLenum = 0x8003;
+#[allow(dead_code, non_upper_case_globals)] pub const CONSTANT_COLOR: types::GLenum = 0x8001;
+#[allow(dead_code, non_upper_case_globals)] pub const COPY_READ_BUFFER: types::GLenum = 0x8F36;
+#[allow(dead_code, non_upper_case_globals)] pub const COPY_READ_BUFFER_BINDING: types::GLenum = 0x8F36;
+#[allow(dead_code, non_upper_case_globals)] pub const COPY_WRITE_BUFFER: types::GLenum = 0x8F37;
+#[allow(dead_code, non_upper_case_globals)] pub const COPY_WRITE_BUFFER_BINDING: types::GLenum = 0x8F37;
+#[allow(dead_code, non_upper_case_globals)] pub const CULL_FACE: types::GLenum = 0x0B44;
+#[allow(dead_code, non_upper_case_globals)] pub const CULL_FACE_MODE: types::GLenum = 0x0B45;
+#[allow(dead_code, non_upper_case_globals)] pub const CURRENT_PROGRAM: types::GLenum = 0x8B8D;
+#[allow(dead_code, non_upper_case_globals)] pub const CURRENT_QUERY: types::GLenum = 0x8865;
+#[allow(dead_code, non_upper_case_globals)] pub const CURRENT_VERTEX_ATTRIB: types::GLenum = 0x8626;
+#[allow(dead_code, non_upper_case_globals)] pub const CW: types::GLenum = 0x0900;
+#[allow(dead_code, non_upper_case_globals)] pub const DECR: types::GLenum = 0x1E03;
+#[allow(dead_code, non_upper_case_globals)] pub const DECR_WRAP: types::GLenum = 0x8508;
+#[allow(dead_code, non_upper_case_globals)] pub const DELETE_STATUS: types::GLenum = 0x8B80;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH: types::GLenum = 0x1801;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH24_STENCIL8: types::GLenum = 0x88F0;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH32F_STENCIL8: types::GLenum = 0x8CAD;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH_ATTACHMENT: types::GLenum = 0x8D00;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH_BITS: types::GLenum = 0x0D56;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH_BUFFER_BIT: types::GLenum = 0x00000100;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH_CLEAR_VALUE: types::GLenum = 0x0B73;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH_COMPONENT: types::GLenum = 0x1902;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH_COMPONENT16: types::GLenum = 0x81A5;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH_COMPONENT24: types::GLenum = 0x81A6;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH_COMPONENT32F: types::GLenum = 0x8CAC;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH_FUNC: types::GLenum = 0x0B74;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH_RANGE: types::GLenum = 0x0B70;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH_STENCIL: types::GLenum = 0x84F9;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH_STENCIL_ATTACHMENT: types::GLenum = 0x821A;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH_TEST: types::GLenum = 0x0B71;
+#[allow(dead_code, non_upper_case_globals)] pub const DEPTH_WRITEMASK: types::GLenum = 0x0B72;
+#[allow(dead_code, non_upper_case_globals)] pub const DITHER: types::GLenum = 0x0BD0;
+#[allow(dead_code, non_upper_case_globals)] pub const DONT_CARE: types::GLenum = 0x1100;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER0: types::GLenum = 0x8825;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER1: types::GLenum = 0x8826;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER10: types::GLenum = 0x882F;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER11: types::GLenum = 0x8830;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER12: types::GLenum = 0x8831;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER13: types::GLenum = 0x8832;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER14: types::GLenum = 0x8833;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER15: types::GLenum = 0x8834;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER2: types::GLenum = 0x8827;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER3: types::GLenum = 0x8828;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER4: types::GLenum = 0x8829;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER5: types::GLenum = 0x882A;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER6: types::GLenum = 0x882B;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER7: types::GLenum = 0x882C;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER8: types::GLenum = 0x882D;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER9: types::GLenum = 0x882E;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_FRAMEBUFFER: types::GLenum = 0x8CA9;
+#[allow(dead_code, non_upper_case_globals)] pub const DRAW_FRAMEBUFFER_BINDING: types::GLenum = 0x8CA6;
+#[allow(dead_code, non_upper_case_globals)] pub const DST_ALPHA: types::GLenum = 0x0304;
+#[allow(dead_code, non_upper_case_globals)] pub const DST_COLOR: types::GLenum = 0x0306;
+#[allow(dead_code, non_upper_case_globals)] pub const DYNAMIC_COPY: types::GLenum = 0x88EA;
+#[allow(dead_code, non_upper_case_globals)] pub const DYNAMIC_DRAW: types::GLenum = 0x88E8;
+#[allow(dead_code, non_upper_case_globals)] pub const DYNAMIC_READ: types::GLenum = 0x88E9;
+#[allow(dead_code, non_upper_case_globals)] pub const ELEMENT_ARRAY_BUFFER: types::GLenum = 0x8893;
+#[allow(dead_code, non_upper_case_globals)] pub const ELEMENT_ARRAY_BUFFER_BINDING: types::GLenum = 0x8895;
+#[allow(dead_code, non_upper_case_globals)] pub const EQUAL: types::GLenum = 0x0202;
+#[allow(dead_code, non_upper_case_globals)] pub const EXTENSIONS: types::GLenum = 0x1F03;
+#[allow(dead_code, non_upper_case_globals)] pub const FALSE: types::GLboolean = 0;
+#[allow(dead_code, non_upper_case_globals)] pub const FASTEST: types::GLenum = 0x1101;
+#[allow(dead_code, non_upper_case_globals)] pub const FIXED: types::GLenum = 0x140C;
+#[allow(dead_code, non_upper_case_globals)] pub const FLOAT: types::GLenum = 0x1406;
+#[allow(dead_code, non_upper_case_globals)] pub const FLOAT_32_UNSIGNED_INT_24_8_REV: types::GLenum = 0x8DAD;
+#[allow(dead_code, non_upper_case_globals)] pub const FLOAT_MAT2: types::GLenum = 0x8B5A;
+#[allow(dead_code, non_upper_case_globals)] pub const FLOAT_MAT2x3: types::GLenum = 0x8B65;
+#[allow(dead_code, non_upper_case_globals)] pub const FLOAT_MAT2x4: types::GLenum = 0x8B66;
+#[allow(dead_code, non_upper_case_globals)] pub const FLOAT_MAT3: types::GLenum = 0x8B5B;
+#[allow(dead_code, non_upper_case_globals)] pub const FLOAT_MAT3x2: types::GLenum = 0x8B67;
+#[allow(dead_code, non_upper_case_globals)] pub const FLOAT_MAT3x4: types::GLenum = 0x8B68;
+#[allow(dead_code, non_upper_case_globals)] pub const FLOAT_MAT4: types::GLenum = 0x8B5C;
+#[allow(dead_code, non_upper_case_globals)] pub const FLOAT_MAT4x2: types::GLenum = 0x8B69;
+#[allow(dead_code, non_upper_case_globals)] pub const FLOAT_MAT4x3: types::GLenum = 0x8B6A;
+#[allow(dead_code, non_upper_case_globals)] pub const FLOAT_VEC2: types::GLenum = 0x8B50;
+#[allow(dead_code, non_upper_case_globals)] pub const FLOAT_VEC3: types::GLenum = 0x8B51;
+#[allow(dead_code, non_upper_case_globals)] pub const FLOAT_VEC4: types::GLenum = 0x8B52;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAGMENT_SHADER: types::GLenum = 0x8B30;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAGMENT_SHADER_DERIVATIVE_HINT: types::GLenum = 0x8B8B;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER: types::GLenum = 0x8D40;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: types::GLenum = 0x8215;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: types::GLenum = 0x8214;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: types::GLenum = 0x8210;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: types::GLenum = 0x8211;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: types::GLenum = 0x8216;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: types::GLenum = 0x8213;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: types::GLenum = 0x8CD1;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: types::GLenum = 0x8CD0;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_ATTACHMENT_RED_SIZE: types::GLenum = 0x8212;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: types::GLenum = 0x8217;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: types::GLenum = 0x8CD3;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: types::GLenum = 0x8CD4;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: types::GLenum = 0x8CD2;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_BINDING: types::GLenum = 0x8CA6;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_COMPLETE: types::GLenum = 0x8CD5;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_DEFAULT: types::GLenum = 0x8218;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_INCOMPLETE_ATTACHMENT: types::GLenum = 0x8CD6;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_INCOMPLETE_DIMENSIONS: types::GLenum = 0x8CD9;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: types::GLenum = 0x8CD7;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: types::GLenum = 0x8D56;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_UNDEFINED: types::GLenum = 0x8219;
+#[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_UNSUPPORTED: types::GLenum = 0x8CDD;
+#[allow(dead_code, non_upper_case_globals)] pub const FRONT: types::GLenum = 0x0404;
+#[allow(dead_code, non_upper_case_globals)] pub const FRONT_AND_BACK: types::GLenum = 0x0408;
+#[allow(dead_code, non_upper_case_globals)] pub const FRONT_FACE: types::GLenum = 0x0B46;
+#[allow(dead_code, non_upper_case_globals)] pub const FUNC_ADD: types::GLenum = 0x8006;
+#[allow(dead_code, non_upper_case_globals)] pub const FUNC_REVERSE_SUBTRACT: types::GLenum = 0x800B;
+#[allow(dead_code, non_upper_case_globals)] pub const FUNC_SUBTRACT: types::GLenum = 0x800A;
+#[allow(dead_code, non_upper_case_globals)] pub const GENERATE_MIPMAP_HINT: types::GLenum = 0x8192;
+#[allow(dead_code, non_upper_case_globals)] pub const GEQUAL: types::GLenum = 0x0206;
+#[allow(dead_code, non_upper_case_globals)] pub const GREATER: types::GLenum = 0x0204;
+#[allow(dead_code, non_upper_case_globals)] pub const GREEN: types::GLenum = 0x1904;
+#[allow(dead_code, non_upper_case_globals)] pub const GREEN_BITS: types::GLenum = 0x0D53;
+#[allow(dead_code, non_upper_case_globals)] pub const HALF_FLOAT: types::GLenum = 0x140B;
+#[allow(dead_code, non_upper_case_globals)] pub const HIGH_FLOAT: types::GLenum = 0x8DF2;
+#[allow(dead_code, non_upper_case_globals)] pub const HIGH_INT: types::GLenum = 0x8DF5;
+#[allow(dead_code, non_upper_case_globals)] pub const IMPLEMENTATION_COLOR_READ_FORMAT: types::GLenum = 0x8B9B;
+#[allow(dead_code, non_upper_case_globals)] pub const IMPLEMENTATION_COLOR_READ_TYPE: types::GLenum = 0x8B9A;
+#[allow(dead_code, non_upper_case_globals)] pub const INCR: types::GLenum = 0x1E02;
+#[allow(dead_code, non_upper_case_globals)] pub const INCR_WRAP: types::GLenum = 0x8507;
+#[allow(dead_code, non_upper_case_globals)] pub const INFO_LOG_LENGTH: types::GLenum = 0x8B84;
+#[allow(dead_code, non_upper_case_globals)] pub const INT: types::GLenum = 0x1404;
+#[allow(dead_code, non_upper_case_globals)] pub const INTERLEAVED_ATTRIBS: types::GLenum = 0x8C8C;
+#[allow(dead_code, non_upper_case_globals)] pub const INT_2_10_10_10_REV: types::GLenum = 0x8D9F;
+#[allow(dead_code, non_upper_case_globals)] pub const INT_SAMPLER_2D: types::GLenum = 0x8DCA;
+#[allow(dead_code, non_upper_case_globals)] pub const INT_SAMPLER_2D_ARRAY: types::GLenum = 0x8DCF;
+#[allow(dead_code, non_upper_case_globals)] pub const INT_SAMPLER_3D: types::GLenum = 0x8DCB;
+#[allow(dead_code, non_upper_case_globals)] pub const INT_SAMPLER_CUBE: types::GLenum = 0x8DCC;
+#[allow(dead_code, non_upper_case_globals)] pub const INT_VEC2: types::GLenum = 0x8B53;
+#[allow(dead_code, non_upper_case_globals)] pub const INT_VEC3: types::GLenum = 0x8B54;
+#[allow(dead_code, non_upper_case_globals)] pub const INT_VEC4: types::GLenum = 0x8B55;
+#[allow(dead_code, non_upper_case_globals)] pub const INVALID_ENUM: types::GLenum = 0x0500;
+#[allow(dead_code, non_upper_case_globals)] pub const INVALID_FRAMEBUFFER_OPERATION: types::GLenum = 0x0506;
+#[allow(dead_code, non_upper_case_globals)] pub const INVALID_INDEX: types::GLuint = 0xFFFFFFFF;
+#[allow(dead_code, non_upper_case_globals)] pub const INVALID_OPERATION: types::GLenum = 0x0502;
+#[allow(dead_code, non_upper_case_globals)] pub const INVALID_VALUE: types::GLenum = 0x0501;
+#[allow(dead_code, non_upper_case_globals)] pub const INVERT: types::GLenum = 0x150A;
+#[allow(dead_code, non_upper_case_globals)] pub const KEEP: types::GLenum = 0x1E00;
+#[allow(dead_code, non_upper_case_globals)] pub const LEQUAL: types::GLenum = 0x0203;
+#[allow(dead_code, non_upper_case_globals)] pub const LESS: types::GLenum = 0x0201;
+#[allow(dead_code, non_upper_case_globals)] pub const LINEAR: types::GLenum = 0x2601;
+#[allow(dead_code, non_upper_case_globals)] pub const LINEAR_MIPMAP_LINEAR: types::GLenum = 0x2703;
+#[allow(dead_code, non_upper_case_globals)] pub const LINEAR_MIPMAP_NEAREST: types::GLenum = 0x2701;
+#[allow(dead_code, non_upper_case_globals)] pub const LINES: types::GLenum = 0x0001;
+#[allow(dead_code, non_upper_case_globals)] pub const LINE_LOOP: types::GLenum = 0x0002;
+#[allow(dead_code, non_upper_case_globals)] pub const LINE_STRIP: types::GLenum = 0x0003;
+#[allow(dead_code, non_upper_case_globals)] pub const LINE_WIDTH: types::GLenum = 0x0B21;
+#[allow(dead_code, non_upper_case_globals)] pub const LINK_STATUS: types::GLenum = 0x8B82;
+#[allow(dead_code, non_upper_case_globals)] pub const LOW_FLOAT: types::GLenum = 0x8DF0;
+#[allow(dead_code, non_upper_case_globals)] pub const LOW_INT: types::GLenum = 0x8DF3;
+#[allow(dead_code, non_upper_case_globals)] pub const LUMINANCE: types::GLenum = 0x1909;
+#[allow(dead_code, non_upper_case_globals)] pub const LUMINANCE_ALPHA: types::GLenum = 0x190A;
+#[allow(dead_code, non_upper_case_globals)] pub const MAJOR_VERSION: types::GLenum = 0x821B;
+#[allow(dead_code, non_upper_case_globals)] pub const MAP_FLUSH_EXPLICIT_BIT: types::GLenum = 0x0010;
+#[allow(dead_code, non_upper_case_globals)] pub const MAP_INVALIDATE_BUFFER_BIT: types::GLenum = 0x0008;
+#[allow(dead_code, non_upper_case_globals)] pub const MAP_INVALIDATE_RANGE_BIT: types::GLenum = 0x0004;
+#[allow(dead_code, non_upper_case_globals)] pub const MAP_READ_BIT: types::GLenum = 0x0001;
+#[allow(dead_code, non_upper_case_globals)] pub const MAP_UNSYNCHRONIZED_BIT: types::GLenum = 0x0020;
+#[allow(dead_code, non_upper_case_globals)] pub const MAP_WRITE_BIT: types::GLenum = 0x0002;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX: types::GLenum = 0x8008;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_3D_TEXTURE_SIZE: types::GLenum = 0x8073;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_ARRAY_TEXTURE_LAYERS: types::GLenum = 0x88FF;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_COLOR_ATTACHMENTS: types::GLenum = 0x8CDF;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: types::GLenum = 0x8A33;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_COMBINED_TEXTURE_IMAGE_UNITS: types::GLenum = 0x8B4D;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_COMBINED_UNIFORM_BLOCKS: types::GLenum = 0x8A2E;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: types::GLenum = 0x8A31;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_CUBE_MAP_TEXTURE_SIZE: types::GLenum = 0x851C;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_DRAW_BUFFERS: types::GLenum = 0x8824;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_ELEMENTS_INDICES: types::GLenum = 0x80E9;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_ELEMENTS_VERTICES: types::GLenum = 0x80E8;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_ELEMENT_INDEX: types::GLenum = 0x8D6B;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_FRAGMENT_INPUT_COMPONENTS: types::GLenum = 0x9125;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_FRAGMENT_UNIFORM_BLOCKS: types::GLenum = 0x8A2D;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_FRAGMENT_UNIFORM_COMPONENTS: types::GLenum = 0x8B49;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_FRAGMENT_UNIFORM_VECTORS: types::GLenum = 0x8DFD;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_PROGRAM_TEXEL_OFFSET: types::GLenum = 0x8905;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_RENDERBUFFER_SIZE: types::GLenum = 0x84E8;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_SAMPLES: types::GLenum = 0x8D57;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_SERVER_WAIT_TIMEOUT: types::GLenum = 0x9111;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_TEXTURE_IMAGE_UNITS: types::GLenum = 0x8872;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_TEXTURE_LOD_BIAS: types::GLenum = 0x84FD;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_TEXTURE_SIZE: types::GLenum = 0x0D33;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: types::GLenum = 0x8C8A;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: types::GLenum = 0x8C8B;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: types::GLenum = 0x8C80;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_UNIFORM_BLOCK_SIZE: types::GLenum = 0x8A30;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_UNIFORM_BUFFER_BINDINGS: types::GLenum = 0x8A2F;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_VARYING_COMPONENTS: types::GLenum = 0x8B4B;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_VARYING_VECTORS: types::GLenum = 0x8DFC;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_VERTEX_ATTRIBS: types::GLenum = 0x8869;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_VERTEX_OUTPUT_COMPONENTS: types::GLenum = 0x9122;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_VERTEX_TEXTURE_IMAGE_UNITS: types::GLenum = 0x8B4C;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_VERTEX_UNIFORM_BLOCKS: types::GLenum = 0x8A2B;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_VERTEX_UNIFORM_COMPONENTS: types::GLenum = 0x8B4A;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_VERTEX_UNIFORM_VECTORS: types::GLenum = 0x8DFB;
+#[allow(dead_code, non_upper_case_globals)] pub const MAX_VIEWPORT_DIMS: types::GLenum = 0x0D3A;
+#[allow(dead_code, non_upper_case_globals)] pub const MEDIUM_FLOAT: types::GLenum = 0x8DF1;
+#[allow(dead_code, non_upper_case_globals)] pub const MEDIUM_INT: types::GLenum = 0x8DF4;
+#[allow(dead_code, non_upper_case_globals)] pub const MIN: types::GLenum = 0x8007;
+#[allow(dead_code, non_upper_case_globals)] pub const MINOR_VERSION: types::GLenum = 0x821C;
+#[allow(dead_code, non_upper_case_globals)] pub const MIN_PROGRAM_TEXEL_OFFSET: types::GLenum = 0x8904;
+#[allow(dead_code, non_upper_case_globals)] pub const MIRRORED_REPEAT: types::GLenum = 0x8370;
+#[allow(dead_code, non_upper_case_globals)] pub const NEAREST: types::GLenum = 0x2600;
+#[allow(dead_code, non_upper_case_globals)] pub const NEAREST_MIPMAP_LINEAR: types::GLenum = 0x2702;
+#[allow(dead_code, non_upper_case_globals)] pub const NEAREST_MIPMAP_NEAREST: types::GLenum = 0x2700;
+#[allow(dead_code, non_upper_case_globals)] pub const NEVER: types::GLenum = 0x0200;
+#[allow(dead_code, non_upper_case_globals)] pub const NICEST: types::GLenum = 0x1102;
+#[allow(dead_code, non_upper_case_globals)] pub const NONE: types::GLenum = 0;
+#[allow(dead_code, non_upper_case_globals)] pub const NOTEQUAL: types::GLenum = 0x0205;
+#[allow(dead_code, non_upper_case_globals)] pub const NO_ERROR: types::GLenum = 0;
+#[allow(dead_code, non_upper_case_globals)] pub const NUM_COMPRESSED_TEXTURE_FORMATS: types::GLenum = 0x86A2;
+#[allow(dead_code, non_upper_case_globals)] pub const NUM_EXTENSIONS: types::GLenum = 0x821D;
+#[allow(dead_code, non_upper_case_globals)] pub const NUM_PROGRAM_BINARY_FORMATS: types::GLenum = 0x87FE;
+#[allow(dead_code, non_upper_case_globals)] pub const NUM_SAMPLE_COUNTS: types::GLenum = 0x9380;
+#[allow(dead_code, non_upper_case_globals)] pub const NUM_SHADER_BINARY_FORMATS: types::GLenum = 0x8DF9;
+#[allow(dead_code, non_upper_case_globals)] pub const OBJECT_TYPE: types::GLenum = 0x9112;
+#[allow(dead_code, non_upper_case_globals)] pub const ONE: types::GLenum = 1;
+#[allow(dead_code, non_upper_case_globals)] pub const ONE_MINUS_CONSTANT_ALPHA: types::GLenum = 0x8004;
+#[allow(dead_code, non_upper_case_globals)] pub const ONE_MINUS_CONSTANT_COLOR: types::GLenum = 0x8002;
+#[allow(dead_code, non_upper_case_globals)] pub const ONE_MINUS_DST_ALPHA: types::GLenum = 0x0305;
+#[allow(dead_code, non_upper_case_globals)] pub const ONE_MINUS_DST_COLOR: types::GLenum = 0x0307;
+#[allow(dead_code, non_upper_case_globals)] pub const ONE_MINUS_SRC_ALPHA: types::GLenum = 0x0303;
+#[allow(dead_code, non_upper_case_globals)] pub const ONE_MINUS_SRC_COLOR: types::GLenum = 0x0301;
+#[allow(dead_code, non_upper_case_globals)] pub const OUT_OF_MEMORY: types::GLenum = 0x0505;
+#[allow(dead_code, non_upper_case_globals)] pub const PACK_ALIGNMENT: types::GLenum = 0x0D05;
+#[allow(dead_code, non_upper_case_globals)] pub const PACK_ROW_LENGTH: types::GLenum = 0x0D02;
+#[allow(dead_code, non_upper_case_globals)] pub const PACK_SKIP_PIXELS: types::GLenum = 0x0D04;
+#[allow(dead_code, non_upper_case_globals)] pub const PACK_SKIP_ROWS: types::GLenum = 0x0D03;
+#[allow(dead_code, non_upper_case_globals)] pub const PIXEL_PACK_BUFFER: types::GLenum = 0x88EB;
+#[allow(dead_code, non_upper_case_globals)] pub const PIXEL_PACK_BUFFER_BINDING: types::GLenum = 0x88ED;
+#[allow(dead_code, non_upper_case_globals)] pub const PIXEL_UNPACK_BUFFER: types::GLenum = 0x88EC;
+#[allow(dead_code, non_upper_case_globals)] pub const PIXEL_UNPACK_BUFFER_BINDING: types::GLenum = 0x88EF;
+#[allow(dead_code, non_upper_case_globals)] pub const POINTS: types::GLenum = 0x0000;
+#[allow(dead_code, non_upper_case_globals)] pub const POLYGON_OFFSET_FACTOR: types::GLenum = 0x8038;
+#[allow(dead_code, non_upper_case_globals)] pub const POLYGON_OFFSET_FILL: types::GLenum = 0x8037;
+#[allow(dead_code, non_upper_case_globals)] pub const POLYGON_OFFSET_UNITS: types::GLenum = 0x2A00;
+#[allow(dead_code, non_upper_case_globals)] pub const PRIMITIVE_RESTART_FIXED_INDEX: types::GLenum = 0x8D69;
+#[allow(dead_code, non_upper_case_globals)] pub const PROGRAM_BINARY_FORMATS: types::GLenum = 0x87FF;
+#[allow(dead_code, non_upper_case_globals)] pub const PROGRAM_BINARY_LENGTH: types::GLenum = 0x8741;
+#[allow(dead_code, non_upper_case_globals)] pub const PROGRAM_BINARY_RETRIEVABLE_HINT: types::GLenum = 0x8257;
+#[allow(dead_code, non_upper_case_globals)] pub const QUERY_RESULT: types::GLenum = 0x8866;
+#[allow(dead_code, non_upper_case_globals)] pub const QUERY_RESULT_AVAILABLE: types::GLenum = 0x8867;
+#[allow(dead_code, non_upper_case_globals)] pub const R11F_G11F_B10F: types::GLenum = 0x8C3A;
+#[allow(dead_code, non_upper_case_globals)] pub const R16F: types::GLenum = 0x822D;
+#[allow(dead_code, non_upper_case_globals)] pub const R16I: types::GLenum = 0x8233;
+#[allow(dead_code, non_upper_case_globals)] pub const R16UI: types::GLenum = 0x8234;
+#[allow(dead_code, non_upper_case_globals)] pub const R32F: types::GLenum = 0x822E;
+#[allow(dead_code, non_upper_case_globals)] pub const R32I: types::GLenum = 0x8235;
+#[allow(dead_code, non_upper_case_globals)] pub const R32UI: types::GLenum = 0x8236;
+#[allow(dead_code, non_upper_case_globals)] pub const R8: types::GLenum = 0x8229;
+#[allow(dead_code, non_upper_case_globals)] pub const R8I: types::GLenum = 0x8231;
+#[allow(dead_code, non_upper_case_globals)] pub const R8UI: types::GLenum = 0x8232;
+#[allow(dead_code, non_upper_case_globals)] pub const R8_SNORM: types::GLenum = 0x8F94;
+#[allow(dead_code, non_upper_case_globals)] pub const RASTERIZER_DISCARD: types::GLenum = 0x8C89;
+#[allow(dead_code, non_upper_case_globals)] pub const READ_BUFFER: types::GLenum = 0x0C02;
+#[allow(dead_code, non_upper_case_globals)] pub const READ_FRAMEBUFFER: types::GLenum = 0x8CA8;
+#[allow(dead_code, non_upper_case_globals)] pub const READ_FRAMEBUFFER_BINDING: types::GLenum = 0x8CAA;
+#[allow(dead_code, non_upper_case_globals)] pub const RED: types::GLenum = 0x1903;
+#[allow(dead_code, non_upper_case_globals)] pub const RED_BITS: types::GLenum = 0x0D52;
+#[allow(dead_code, non_upper_case_globals)] pub const RED_INTEGER: types::GLenum = 0x8D94;
+#[allow(dead_code, non_upper_case_globals)] pub const RENDERBUFFER: types::GLenum = 0x8D41;
+#[allow(dead_code, non_upper_case_globals)] pub const RENDERBUFFER_ALPHA_SIZE: types::GLenum = 0x8D53;
+#[allow(dead_code, non_upper_case_globals)] pub const RENDERBUFFER_BINDING: types::GLenum = 0x8CA7;
+#[allow(dead_code, non_upper_case_globals)] pub const RENDERBUFFER_BLUE_SIZE: types::GLenum = 0x8D52;
+#[allow(dead_code, non_upper_case_globals)] pub const RENDERBUFFER_DEPTH_SIZE: types::GLenum = 0x8D54;
+#[allow(dead_code, non_upper_case_globals)] pub const RENDERBUFFER_GREEN_SIZE: types::GLenum = 0x8D51;
+#[allow(dead_code, non_upper_case_globals)] pub const RENDERBUFFER_HEIGHT: types::GLenum = 0x8D43;
+#[allow(dead_code, non_upper_case_globals)] pub const RENDERBUFFER_INTERNAL_FORMAT: types::GLenum = 0x8D44;
+#[allow(dead_code, non_upper_case_globals)] pub const RENDERBUFFER_RED_SIZE: types::GLenum = 0x8D50;
+#[allow(dead_code, non_upper_case_globals)] pub const RENDERBUFFER_SAMPLES: types::GLenum = 0x8CAB;
+#[allow(dead_code, non_upper_case_globals)] pub const RENDERBUFFER_STENCIL_SIZE: types::GLenum = 0x8D55;
+#[allow(dead_code, non_upper_case_globals)] pub const RENDERBUFFER_WIDTH: types::GLenum = 0x8D42;
+#[allow(dead_code, non_upper_case_globals)] pub const RENDERER: types::GLenum = 0x1F01;
+#[allow(dead_code, non_upper_case_globals)] pub const REPEAT: types::GLenum = 0x2901;
+#[allow(dead_code, non_upper_case_globals)] pub const REPLACE: types::GLenum = 0x1E01;
+#[allow(dead_code, non_upper_case_globals)] pub const RG: types::GLenum = 0x8227;
+#[allow(dead_code, non_upper_case_globals)] pub const RG16F: types::GLenum = 0x822F;
+#[allow(dead_code, non_upper_case_globals)] pub const RG16I: types::GLenum = 0x8239;
+#[allow(dead_code, non_upper_case_globals)] pub const RG16UI: types::GLenum = 0x823A;
+#[allow(dead_code, non_upper_case_globals)] pub const RG32F: types::GLenum = 0x8230;
+#[allow(dead_code, non_upper_case_globals)] pub const RG32I: types::GLenum = 0x823B;
+#[allow(dead_code, non_upper_case_globals)] pub const RG32UI: types::GLenum = 0x823C;
+#[allow(dead_code, non_upper_case_globals)] pub const RG8: types::GLenum = 0x822B;
+#[allow(dead_code, non_upper_case_globals)] pub const RG8I: types::GLenum = 0x8237;
+#[allow(dead_code, non_upper_case_globals)] pub const RG8UI: types::GLenum = 0x8238;
+#[allow(dead_code, non_upper_case_globals)] pub const RG8_SNORM: types::GLenum = 0x8F95;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB: types::GLenum = 0x1907;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB10_A2: types::GLenum = 0x8059;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB10_A2UI: types::GLenum = 0x906F;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB16F: types::GLenum = 0x881B;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB16I: types::GLenum = 0x8D89;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB16UI: types::GLenum = 0x8D77;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB32F: types::GLenum = 0x8815;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB32I: types::GLenum = 0x8D83;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB32UI: types::GLenum = 0x8D71;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB565: types::GLenum = 0x8D62;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB5_A1: types::GLenum = 0x8057;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB8: types::GLenum = 0x8051;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB8I: types::GLenum = 0x8D8F;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB8UI: types::GLenum = 0x8D7D;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB8_SNORM: types::GLenum = 0x8F96;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB9_E5: types::GLenum = 0x8C3D;
+#[allow(dead_code, non_upper_case_globals)] pub const RGBA: types::GLenum = 0x1908;
+#[allow(dead_code, non_upper_case_globals)] pub const RGBA16F: types::GLenum = 0x881A;
+#[allow(dead_code, non_upper_case_globals)] pub const RGBA16I: types::GLenum = 0x8D88;
+#[allow(dead_code, non_upper_case_globals)] pub const RGBA16UI: types::GLenum = 0x8D76;
+#[allow(dead_code, non_upper_case_globals)] pub const RGBA32F: types::GLenum = 0x8814;
+#[allow(dead_code, non_upper_case_globals)] pub const RGBA32I: types::GLenum = 0x8D82;
+#[allow(dead_code, non_upper_case_globals)] pub const RGBA32UI: types::GLenum = 0x8D70;
+#[allow(dead_code, non_upper_case_globals)] pub const RGBA4: types::GLenum = 0x8056;
+#[allow(dead_code, non_upper_case_globals)] pub const RGBA8: types::GLenum = 0x8058;
+#[allow(dead_code, non_upper_case_globals)] pub const RGBA8I: types::GLenum = 0x8D8E;
+#[allow(dead_code, non_upper_case_globals)] pub const RGBA8UI: types::GLenum = 0x8D7C;
+#[allow(dead_code, non_upper_case_globals)] pub const RGBA8_SNORM: types::GLenum = 0x8F97;
+#[allow(dead_code, non_upper_case_globals)] pub const RGBA_INTEGER: types::GLenum = 0x8D99;
+#[allow(dead_code, non_upper_case_globals)] pub const RGB_INTEGER: types::GLenum = 0x8D98;
+#[allow(dead_code, non_upper_case_globals)] pub const RG_INTEGER: types::GLenum = 0x8228;
+#[allow(dead_code, non_upper_case_globals)] pub const SAMPLER_2D: types::GLenum = 0x8B5E;
+#[allow(dead_code, non_upper_case_globals)] pub const SAMPLER_2D_ARRAY: types::GLenum = 0x8DC1;
+#[allow(dead_code, non_upper_case_globals)] pub const SAMPLER_2D_ARRAY_SHADOW: types::GLenum = 0x8DC4;
+#[allow(dead_code, non_upper_case_globals)] pub const SAMPLER_2D_SHADOW: types::GLenum = 0x8B62;
+#[allow(dead_code, non_upper_case_globals)] pub const SAMPLER_3D: types::GLenum = 0x8B5F;
+#[allow(dead_code, non_upper_case_globals)] pub const SAMPLER_BINDING: types::GLenum = 0x8919;
+#[allow(dead_code, non_upper_case_globals)] pub const SAMPLER_CUBE: types::GLenum = 0x8B60;
+#[allow(dead_code, non_upper_case_globals)] pub const SAMPLER_CUBE_SHADOW: types::GLenum = 0x8DC5;
+#[allow(dead_code, non_upper_case_globals)] pub const SAMPLES: types::GLenum = 0x80A9;
+#[allow(dead_code, non_upper_case_globals)] pub const SAMPLE_ALPHA_TO_COVERAGE: types::GLenum = 0x809E;
+#[allow(dead_code, non_upper_case_globals)] pub const SAMPLE_BUFFERS: types::GLenum = 0x80A8;
+#[allow(dead_code, non_upper_case_globals)] pub const SAMPLE_COVERAGE: types::GLenum = 0x80A0;
+#[allow(dead_code, non_upper_case_globals)] pub const SAMPLE_COVERAGE_INVERT: types::GLenum = 0x80AB;
+#[allow(dead_code, non_upper_case_globals)] pub const SAMPLE_COVERAGE_VALUE: types::GLenum = 0x80AA;
+#[allow(dead_code, non_upper_case_globals)] pub const SCISSOR_BOX: types::GLenum = 0x0C10;
+#[allow(dead_code, non_upper_case_globals)] pub const SCISSOR_TEST: types::GLenum = 0x0C11;
+#[allow(dead_code, non_upper_case_globals)] pub const SEPARATE_ATTRIBS: types::GLenum = 0x8C8D;
+#[allow(dead_code, non_upper_case_globals)] pub const SHADER_BINARY_FORMATS: types::GLenum = 0x8DF8;
+#[allow(dead_code, non_upper_case_globals)] pub const SHADER_COMPILER: types::GLenum = 0x8DFA;
+#[allow(dead_code, non_upper_case_globals)] pub const SHADER_SOURCE_LENGTH: types::GLenum = 0x8B88;
+#[allow(dead_code, non_upper_case_globals)] pub const SHADER_TYPE: types::GLenum = 0x8B4F;
+#[allow(dead_code, non_upper_case_globals)] pub const SHADING_LANGUAGE_VERSION: types::GLenum = 0x8B8C;
+#[allow(dead_code, non_upper_case_globals)] pub const SHORT: types::GLenum = 0x1402;
+#[allow(dead_code, non_upper_case_globals)] pub const SIGNALED: types::GLenum = 0x9119;
+#[allow(dead_code, non_upper_case_globals)] pub const SIGNED_NORMALIZED: types::GLenum = 0x8F9C;
+#[allow(dead_code, non_upper_case_globals)] pub const SRC_ALPHA: types::GLenum = 0x0302;
+#[allow(dead_code, non_upper_case_globals)] pub const SRC_ALPHA_SATURATE: types::GLenum = 0x0308;
+#[allow(dead_code, non_upper_case_globals)] pub const SRC_COLOR: types::GLenum = 0x0300;
+#[allow(dead_code, non_upper_case_globals)] pub const SRGB: types::GLenum = 0x8C40;
+#[allow(dead_code, non_upper_case_globals)] pub const SRGB8: types::GLenum = 0x8C41;
+#[allow(dead_code, non_upper_case_globals)] pub const SRGB8_ALPHA8: types::GLenum = 0x8C43;
+#[allow(dead_code, non_upper_case_globals)] pub const STATIC_COPY: types::GLenum = 0x88E6;
+#[allow(dead_code, non_upper_case_globals)] pub const STATIC_DRAW: types::GLenum = 0x88E4;
+#[allow(dead_code, non_upper_case_globals)] pub const STATIC_READ: types::GLenum = 0x88E5;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL: types::GLenum = 0x1802;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_ATTACHMENT: types::GLenum = 0x8D20;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_BACK_FAIL: types::GLenum = 0x8801;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_BACK_FUNC: types::GLenum = 0x8800;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_BACK_PASS_DEPTH_FAIL: types::GLenum = 0x8802;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_BACK_PASS_DEPTH_PASS: types::GLenum = 0x8803;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_BACK_REF: types::GLenum = 0x8CA3;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_BACK_VALUE_MASK: types::GLenum = 0x8CA4;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_BACK_WRITEMASK: types::GLenum = 0x8CA5;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_BITS: types::GLenum = 0x0D57;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_BUFFER_BIT: types::GLenum = 0x00000400;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_CLEAR_VALUE: types::GLenum = 0x0B91;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_FAIL: types::GLenum = 0x0B94;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_FUNC: types::GLenum = 0x0B92;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_INDEX8: types::GLenum = 0x8D48;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_PASS_DEPTH_FAIL: types::GLenum = 0x0B95;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_PASS_DEPTH_PASS: types::GLenum = 0x0B96;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_REF: types::GLenum = 0x0B97;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_TEST: types::GLenum = 0x0B90;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_VALUE_MASK: types::GLenum = 0x0B93;
+#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_WRITEMASK: types::GLenum = 0x0B98;
+#[allow(dead_code, non_upper_case_globals)] pub const STREAM_COPY: types::GLenum = 0x88E2;
+#[allow(dead_code, non_upper_case_globals)] pub const STREAM_DRAW: types::GLenum = 0x88E0;
+#[allow(dead_code, non_upper_case_globals)] pub const STREAM_READ: types::GLenum = 0x88E1;
+#[allow(dead_code, non_upper_case_globals)] pub const SUBPIXEL_BITS: types::GLenum = 0x0D50;
+#[allow(dead_code, non_upper_case_globals)] pub const SYNC_CONDITION: types::GLenum = 0x9113;
+#[allow(dead_code, non_upper_case_globals)] pub const SYNC_FENCE: types::GLenum = 0x9116;
+#[allow(dead_code, non_upper_case_globals)] pub const SYNC_FLAGS: types::GLenum = 0x9115;
+#[allow(dead_code, non_upper_case_globals)] pub const SYNC_FLUSH_COMMANDS_BIT: types::GLenum = 0x00000001;
+#[allow(dead_code, non_upper_case_globals)] pub const SYNC_GPU_COMMANDS_COMPLETE: types::GLenum = 0x9117;
+#[allow(dead_code, non_upper_case_globals)] pub const SYNC_STATUS: types::GLenum = 0x9114;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE: types::GLenum = 0x1702;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE0: types::GLenum = 0x84C0;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE1: types::GLenum = 0x84C1;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE10: types::GLenum = 0x84CA;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE11: types::GLenum = 0x84CB;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE12: types::GLenum = 0x84CC;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE13: types::GLenum = 0x84CD;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE14: types::GLenum = 0x84CE;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE15: types::GLenum = 0x84CF;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE16: types::GLenum = 0x84D0;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE17: types::GLenum = 0x84D1;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE18: types::GLenum = 0x84D2;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE19: types::GLenum = 0x84D3;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE2: types::GLenum = 0x84C2;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE20: types::GLenum = 0x84D4;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE21: types::GLenum = 0x84D5;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE22: types::GLenum = 0x84D6;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE23: types::GLenum = 0x84D7;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE24: types::GLenum = 0x84D8;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE25: types::GLenum = 0x84D9;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE26: types::GLenum = 0x84DA;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE27: types::GLenum = 0x84DB;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE28: types::GLenum = 0x84DC;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE29: types::GLenum = 0x84DD;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE3: types::GLenum = 0x84C3;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE30: types::GLenum = 0x84DE;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE31: types::GLenum = 0x84DF;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE4: types::GLenum = 0x84C4;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE5: types::GLenum = 0x84C5;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE6: types::GLenum = 0x84C6;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE7: types::GLenum = 0x84C7;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE8: types::GLenum = 0x84C8;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE9: types::GLenum = 0x84C9;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_2D: types::GLenum = 0x0DE1;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_2D_ARRAY: types::GLenum = 0x8C1A;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_3D: types::GLenum = 0x806F;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_BASE_LEVEL: types::GLenum = 0x813C;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_BINDING_2D: types::GLenum = 0x8069;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_BINDING_2D_ARRAY: types::GLenum = 0x8C1D;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_BINDING_3D: types::GLenum = 0x806A;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_BINDING_CUBE_MAP: types::GLenum = 0x8514;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_COMPARE_FUNC: types::GLenum = 0x884D;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_COMPARE_MODE: types::GLenum = 0x884C;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_CUBE_MAP: types::GLenum = 0x8513;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_CUBE_MAP_NEGATIVE_X: types::GLenum = 0x8516;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_CUBE_MAP_NEGATIVE_Y: types::GLenum = 0x8518;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_CUBE_MAP_NEGATIVE_Z: types::GLenum = 0x851A;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_CUBE_MAP_POSITIVE_X: types::GLenum = 0x8515;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_CUBE_MAP_POSITIVE_Y: types::GLenum = 0x8517;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_CUBE_MAP_POSITIVE_Z: types::GLenum = 0x8519;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_IMMUTABLE_FORMAT: types::GLenum = 0x912F;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_IMMUTABLE_LEVELS: types::GLenum = 0x82DF;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_MAG_FILTER: types::GLenum = 0x2800;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_MAX_LEVEL: types::GLenum = 0x813D;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_MAX_LOD: types::GLenum = 0x813B;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_MIN_FILTER: types::GLenum = 0x2801;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_MIN_LOD: types::GLenum = 0x813A;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_SWIZZLE_A: types::GLenum = 0x8E45;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_SWIZZLE_B: types::GLenum = 0x8E44;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_SWIZZLE_G: types::GLenum = 0x8E43;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_SWIZZLE_R: types::GLenum = 0x8E42;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_WRAP_R: types::GLenum = 0x8072;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_WRAP_S: types::GLenum = 0x2802;
+#[allow(dead_code, non_upper_case_globals)] pub const TEXTURE_WRAP_T: types::GLenum = 0x2803;
+#[allow(dead_code, non_upper_case_globals)] pub const TIMEOUT_EXPIRED: types::GLenum = 0x911B;
+#[allow(dead_code, non_upper_case_globals)] pub const TIMEOUT_IGNORED: types::GLuint64 = 0xFFFFFFFFFFFFFFFF;
+#[allow(dead_code, non_upper_case_globals)] pub const TRANSFORM_FEEDBACK: types::GLenum = 0x8E22;
+#[allow(dead_code, non_upper_case_globals)] pub const TRANSFORM_FEEDBACK_ACTIVE: types::GLenum = 0x8E24;
+#[allow(dead_code, non_upper_case_globals)] pub const TRANSFORM_FEEDBACK_BINDING: types::GLenum = 0x8E25;
+#[allow(dead_code, non_upper_case_globals)] pub const TRANSFORM_FEEDBACK_BUFFER: types::GLenum = 0x8C8E;
+#[allow(dead_code, non_upper_case_globals)] pub const TRANSFORM_FEEDBACK_BUFFER_BINDING: types::GLenum = 0x8C8F;
+#[allow(dead_code, non_upper_case_globals)] pub const TRANSFORM_FEEDBACK_BUFFER_MODE: types::GLenum = 0x8C7F;
+#[allow(dead_code, non_upper_case_globals)] pub const TRANSFORM_FEEDBACK_BUFFER_SIZE: types::GLenum = 0x8C85;
+#[allow(dead_code, non_upper_case_globals)] pub const TRANSFORM_FEEDBACK_BUFFER_START: types::GLenum = 0x8C84;
+#[allow(dead_code, non_upper_case_globals)] pub const TRANSFORM_FEEDBACK_PAUSED: types::GLenum = 0x8E23;
+#[allow(dead_code, non_upper_case_globals)] pub const TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: types::GLenum = 0x8C88;
+#[allow(dead_code, non_upper_case_globals)] pub const TRANSFORM_FEEDBACK_VARYINGS: types::GLenum = 0x8C83;
+#[allow(dead_code, non_upper_case_globals)] pub const TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH: types::GLenum = 0x8C76;
+#[allow(dead_code, non_upper_case_globals)] pub const TRIANGLES: types::GLenum = 0x0004;
+#[allow(dead_code, non_upper_case_globals)] pub const TRIANGLE_FAN: types::GLenum = 0x0006;
+#[allow(dead_code, non_upper_case_globals)] pub const TRIANGLE_STRIP: types::GLenum = 0x0005;
+#[allow(dead_code, non_upper_case_globals)] pub const TRUE: types::GLboolean = 1;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_ARRAY_STRIDE: types::GLenum = 0x8A3C;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_BLOCK_ACTIVE_UNIFORMS: types::GLenum = 0x8A42;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: types::GLenum = 0x8A43;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_BLOCK_BINDING: types::GLenum = 0x8A3F;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_BLOCK_DATA_SIZE: types::GLenum = 0x8A40;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_BLOCK_INDEX: types::GLenum = 0x8A3A;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_BLOCK_NAME_LENGTH: types::GLenum = 0x8A41;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: types::GLenum = 0x8A46;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: types::GLenum = 0x8A44;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_BUFFER: types::GLenum = 0x8A11;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_BUFFER_BINDING: types::GLenum = 0x8A28;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_BUFFER_OFFSET_ALIGNMENT: types::GLenum = 0x8A34;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_BUFFER_SIZE: types::GLenum = 0x8A2A;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_BUFFER_START: types::GLenum = 0x8A29;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_IS_ROW_MAJOR: types::GLenum = 0x8A3E;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_MATRIX_STRIDE: types::GLenum = 0x8A3D;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_NAME_LENGTH: types::GLenum = 0x8A39;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_OFFSET: types::GLenum = 0x8A3B;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_SIZE: types::GLenum = 0x8A38;
+#[allow(dead_code, non_upper_case_globals)] pub const UNIFORM_TYPE: types::GLenum = 0x8A37;
+#[allow(dead_code, non_upper_case_globals)] pub const UNPACK_ALIGNMENT: types::GLenum = 0x0CF5;
+#[allow(dead_code, non_upper_case_globals)] pub const UNPACK_IMAGE_HEIGHT: types::GLenum = 0x806E;
+#[allow(dead_code, non_upper_case_globals)] pub const UNPACK_ROW_LENGTH: types::GLenum = 0x0CF2;
+#[allow(dead_code, non_upper_case_globals)] pub const UNPACK_SKIP_IMAGES: types::GLenum = 0x806D;
+#[allow(dead_code, non_upper_case_globals)] pub const UNPACK_SKIP_PIXELS: types::GLenum = 0x0CF4;
+#[allow(dead_code, non_upper_case_globals)] pub const UNPACK_SKIP_ROWS: types::GLenum = 0x0CF3;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNALED: types::GLenum = 0x9118;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_BYTE: types::GLenum = 0x1401;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_INT: types::GLenum = 0x1405;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_INT_10F_11F_11F_REV: types::GLenum = 0x8C3B;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_INT_24_8: types::GLenum = 0x84FA;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_INT_2_10_10_10_REV: types::GLenum = 0x8368;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_INT_5_9_9_9_REV: types::GLenum = 0x8C3E;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_INT_SAMPLER_2D: types::GLenum = 0x8DD2;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_INT_SAMPLER_2D_ARRAY: types::GLenum = 0x8DD7;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_INT_SAMPLER_3D: types::GLenum = 0x8DD3;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_INT_SAMPLER_CUBE: types::GLenum = 0x8DD4;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_INT_VEC2: types::GLenum = 0x8DC6;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_INT_VEC3: types::GLenum = 0x8DC7;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_INT_VEC4: types::GLenum = 0x8DC8;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_NORMALIZED: types::GLenum = 0x8C17;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_SHORT: types::GLenum = 0x1403;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_SHORT_4_4_4_4: types::GLenum = 0x8033;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_SHORT_5_5_5_1: types::GLenum = 0x8034;
+#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_SHORT_5_6_5: types::GLenum = 0x8363;
+#[allow(dead_code, non_upper_case_globals)] pub const VALIDATE_STATUS: types::GLenum = 0x8B83;
+#[allow(dead_code, non_upper_case_globals)] pub const VENDOR: types::GLenum = 0x1F00;
+#[allow(dead_code, non_upper_case_globals)] pub const VERSION: types::GLenum = 0x1F02;
+#[allow(dead_code, non_upper_case_globals)] pub const VERTEX_ARRAY_BINDING: types::GLenum = 0x85B5;
+#[allow(dead_code, non_upper_case_globals)] pub const VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: types::GLenum = 0x889F;
+#[allow(dead_code, non_upper_case_globals)] pub const VERTEX_ATTRIB_ARRAY_DIVISOR: types::GLenum = 0x88FE;
+#[allow(dead_code, non_upper_case_globals)] pub const VERTEX_ATTRIB_ARRAY_ENABLED: types::GLenum = 0x8622;
+#[allow(dead_code, non_upper_case_globals)] pub const VERTEX_ATTRIB_ARRAY_INTEGER: types::GLenum = 0x88FD;
+#[allow(dead_code, non_upper_case_globals)] pub const VERTEX_ATTRIB_ARRAY_NORMALIZED: types::GLenum = 0x886A;
+#[allow(dead_code, non_upper_case_globals)] pub const VERTEX_ATTRIB_ARRAY_POINTER: types::GLenum = 0x8645;
+#[allow(dead_code, non_upper_case_globals)] pub const VERTEX_ATTRIB_ARRAY_SIZE: types::GLenum = 0x8623;
+#[allow(dead_code, non_upper_case_globals)] pub const VERTEX_ATTRIB_ARRAY_STRIDE: types::GLenum = 0x8624;
+#[allow(dead_code, non_upper_case_globals)] pub const VERTEX_ATTRIB_ARRAY_TYPE: types::GLenum = 0x8625;
+#[allow(dead_code, non_upper_case_globals)] pub const VERTEX_SHADER: types::GLenum = 0x8B31;
+#[allow(dead_code, non_upper_case_globals)] pub const VIEWPORT: types::GLenum = 0x0BA2;
+#[allow(dead_code, non_upper_case_globals)] pub const WAIT_FAILED: types::GLenum = 0x911D;
+#[allow(dead_code, non_upper_case_globals)] pub const ZERO: types::GLenum = 0;
+
+ #[allow(dead_code, missing_copy_implementations)]
+ #[derive(Clone)]
+ pub struct FnPtr {
+ /// The function pointer that will be used when calling the function.
+ f: *const __gl_imports::raw::c_void,
+ /// True if the pointer points to a real function, false if points to a `panic!` fn.
+ is_loaded: bool,
+ }
+
+ impl FnPtr {
+ /// Creates a `FnPtr` from a load attempt.
+ fn new(ptr: *const __gl_imports::raw::c_void) -> FnPtr {
+ if ptr.is_null() {
+ FnPtr {
+ f: missing_fn_panic as *const __gl_imports::raw::c_void,
+ is_loaded: false
+ }
+ } else {
+ FnPtr { f: ptr, is_loaded: true }
+ }
+ }
+
+ /// Returns `true` if the function has been successfully loaded.
+ ///
+ /// If it returns `false`, calling the corresponding function will fail.
+ #[inline]
+ #[allow(dead_code)]
+ pub fn is_loaded(&self) -> bool {
+ self.is_loaded
+ }
+ }
+
+#[inline(never)]
+ fn missing_fn_panic() -> ! {
+ panic!("gles2 function was not loaded")
+ }
+
+ #[allow(non_camel_case_types, non_snake_case, dead_code)]
+ #[derive(Clone)]
+ pub struct Gles2 {
+/// Fallbacks: ActiveTextureARB
+pub ActiveTexture: FnPtr,
+/// Fallbacks: AttachObjectARB
+pub AttachShader: FnPtr,
+/// Fallbacks: BeginQueryARB
+pub BeginQuery: FnPtr,
+/// Fallbacks: BeginTransformFeedbackEXT, BeginTransformFeedbackNV
+pub BeginTransformFeedback: FnPtr,
+/// Fallbacks: BindAttribLocationARB
+pub BindAttribLocation: FnPtr,
+/// Fallbacks: BindBufferARB
+pub BindBuffer: FnPtr,
+/// Fallbacks: BindBufferBaseEXT, BindBufferBaseNV
+pub BindBufferBase: FnPtr,
+/// Fallbacks: BindBufferRangeEXT, BindBufferRangeNV
+pub BindBufferRange: FnPtr,
+pub BindFramebuffer: FnPtr,
+pub BindRenderbuffer: FnPtr,
+pub BindSampler: FnPtr,
+/// Fallbacks: BindTextureEXT
+pub BindTexture: FnPtr,
+pub BindTransformFeedback: FnPtr,
+/// Fallbacks: BindVertexArrayOES
+pub BindVertexArray: FnPtr,
+/// Fallbacks: BlendColorEXT
+pub BlendColor: FnPtr,
+/// Fallbacks: BlendEquationEXT
+pub BlendEquation: FnPtr,
+/// Fallbacks: BlendEquationSeparateEXT
+pub BlendEquationSeparate: FnPtr,
+pub BlendFunc: FnPtr,
+/// Fallbacks: BlendFuncSeparateEXT, BlendFuncSeparateINGR
+pub BlendFuncSeparate: FnPtr,
+/// Fallbacks: BlitFramebufferEXT, BlitFramebufferNV
+pub BlitFramebuffer: FnPtr,
+/// Fallbacks: BufferDataARB
+pub BufferData: FnPtr,
+/// Fallbacks: BufferSubDataARB
+pub BufferSubData: FnPtr,
+/// Fallbacks: CheckFramebufferStatusEXT
+pub CheckFramebufferStatus: FnPtr,
+pub Clear: FnPtr,
+pub ClearBufferfi: FnPtr,
+pub ClearBufferfv: FnPtr,
+pub ClearBufferiv: FnPtr,
+pub ClearBufferuiv: FnPtr,
+pub ClearColor: FnPtr,
+/// Fallbacks: ClearDepthfOES
+pub ClearDepthf: FnPtr,
+pub ClearStencil: FnPtr,
+/// Fallbacks: ClientWaitSyncAPPLE
+pub ClientWaitSync: FnPtr,
+pub ColorMask: FnPtr,
+/// Fallbacks: CompileShaderARB
+pub CompileShader: FnPtr,
+/// Fallbacks: CompressedTexImage2DARB
+pub CompressedTexImage2D: FnPtr,
+/// Fallbacks: CompressedTexImage3DARB
+pub CompressedTexImage3D: FnPtr,
+/// Fallbacks: CompressedTexSubImage2DARB
+pub CompressedTexSubImage2D: FnPtr,
+/// Fallbacks: CompressedTexSubImage3DARB
+pub CompressedTexSubImage3D: FnPtr,
+/// Fallbacks: CopyBufferSubDataNV
+pub CopyBufferSubData: FnPtr,
+/// Fallbacks: CopyTexImage2DEXT
+pub CopyTexImage2D: FnPtr,
+/// Fallbacks: CopyTexSubImage2DEXT
+pub CopyTexSubImage2D: FnPtr,
+/// Fallbacks: CopyTexSubImage3DEXT
+pub CopyTexSubImage3D: FnPtr,
+/// Fallbacks: CreateProgramObjectARB
+pub CreateProgram: FnPtr,
+/// Fallbacks: CreateShaderObjectARB
+pub CreateShader: FnPtr,
+pub CullFace: FnPtr,
+/// Fallbacks: DeleteBuffersARB
+pub DeleteBuffers: FnPtr,
+/// Fallbacks: DeleteFramebuffersEXT
+pub DeleteFramebuffers: FnPtr,
+pub DeleteProgram: FnPtr,
+/// Fallbacks: DeleteQueriesARB
+pub DeleteQueries: FnPtr,
+/// Fallbacks: DeleteRenderbuffersEXT
+pub DeleteRenderbuffers: FnPtr,
+pub DeleteSamplers: FnPtr,
+pub DeleteShader: FnPtr,
+/// Fallbacks: DeleteSyncAPPLE
+pub DeleteSync: FnPtr,
+pub DeleteTextures: FnPtr,
+/// Fallbacks: DeleteTransformFeedbacksNV
+pub DeleteTransformFeedbacks: FnPtr,
+/// Fallbacks: DeleteVertexArraysAPPLE, DeleteVertexArraysOES
+pub DeleteVertexArrays: FnPtr,
+pub DepthFunc: FnPtr,
+pub DepthMask: FnPtr,
+/// Fallbacks: DepthRangefOES
+pub DepthRangef: FnPtr,
+/// Fallbacks: DetachObjectARB
+pub DetachShader: FnPtr,
+pub Disable: FnPtr,
+/// Fallbacks: DisableVertexAttribArrayARB
+pub DisableVertexAttribArray: FnPtr,
+/// Fallbacks: DrawArraysEXT
+pub DrawArrays: FnPtr,
+/// Fallbacks: DrawArraysInstancedANGLE, DrawArraysInstancedARB, DrawArraysInstancedEXT, DrawArraysInstancedNV
+pub DrawArraysInstanced: FnPtr,
+/// Fallbacks: DrawBuffersARB, DrawBuffersATI, DrawBuffersEXT
+pub DrawBuffers: FnPtr,
+pub DrawElements: FnPtr,
+/// Fallbacks: DrawElementsInstancedANGLE, DrawElementsInstancedARB, DrawElementsInstancedEXT, DrawElementsInstancedNV
+pub DrawElementsInstanced: FnPtr,
+/// Fallbacks: DrawRangeElementsEXT
+pub DrawRangeElements: FnPtr,
+pub Enable: FnPtr,
+/// Fallbacks: EnableVertexAttribArrayARB
+pub EnableVertexAttribArray: FnPtr,
+/// Fallbacks: EndQueryARB
+pub EndQuery: FnPtr,
+/// Fallbacks: EndTransformFeedbackEXT, EndTransformFeedbackNV
+pub EndTransformFeedback: FnPtr,
+/// Fallbacks: FenceSyncAPPLE
+pub FenceSync: FnPtr,
+pub Finish: FnPtr,
+pub Flush: FnPtr,
+/// Fallbacks: FlushMappedBufferRangeAPPLE, FlushMappedBufferRangeEXT
+pub FlushMappedBufferRange: FnPtr,
+/// Fallbacks: FramebufferRenderbufferEXT
+pub FramebufferRenderbuffer: FnPtr,
+/// Fallbacks: FramebufferTexture2DEXT
+pub FramebufferTexture2D: FnPtr,
+/// Fallbacks: FramebufferTextureLayerARB, FramebufferTextureLayerEXT
+pub FramebufferTextureLayer: FnPtr,
+pub FrontFace: FnPtr,
+/// Fallbacks: GenBuffersARB
+pub GenBuffers: FnPtr,
+/// Fallbacks: GenFramebuffersEXT
+pub GenFramebuffers: FnPtr,
+/// Fallbacks: GenQueriesARB
+pub GenQueries: FnPtr,
+/// Fallbacks: GenRenderbuffersEXT
+pub GenRenderbuffers: FnPtr,
+pub GenSamplers: FnPtr,
+pub GenTextures: FnPtr,
+/// Fallbacks: GenTransformFeedbacksNV
+pub GenTransformFeedbacks: FnPtr,
+/// Fallbacks: GenVertexArraysAPPLE, GenVertexArraysOES
+pub GenVertexArrays: FnPtr,
+/// Fallbacks: GenerateMipmapEXT
+pub GenerateMipmap: FnPtr,
+/// Fallbacks: GetActiveAttribARB
+pub GetActiveAttrib: FnPtr,
+/// Fallbacks: GetActiveUniformARB
+pub GetActiveUniform: FnPtr,
+pub GetActiveUniformBlockName: FnPtr,
+pub GetActiveUniformBlockiv: FnPtr,
+pub GetActiveUniformsiv: FnPtr,
+pub GetAttachedShaders: FnPtr,
+/// Fallbacks: GetAttribLocationARB
+pub GetAttribLocation: FnPtr,
+pub GetBooleanv: FnPtr,
+pub GetBufferParameteri64v: FnPtr,
+/// Fallbacks: GetBufferParameterivARB
+pub GetBufferParameteriv: FnPtr,
+/// Fallbacks: GetBufferPointervARB, GetBufferPointervOES
+pub GetBufferPointerv: FnPtr,
+pub GetError: FnPtr,
+pub GetFloatv: FnPtr,
+/// Fallbacks: GetFragDataLocationEXT
+pub GetFragDataLocation: FnPtr,
+/// Fallbacks: GetFramebufferAttachmentParameterivEXT
+pub GetFramebufferAttachmentParameteriv: FnPtr,
+pub GetInteger64i_v: FnPtr,
+/// Fallbacks: GetInteger64vAPPLE
+pub GetInteger64v: FnPtr,
+/// Fallbacks: GetIntegerIndexedvEXT
+pub GetIntegeri_v: FnPtr,
+pub GetIntegerv: FnPtr,
+pub GetInternalformativ: FnPtr,
+/// Fallbacks: GetProgramBinaryOES
+pub GetProgramBinary: FnPtr,
+pub GetProgramInfoLog: FnPtr,
+pub GetProgramiv: FnPtr,
+/// Fallbacks: GetQueryObjectuivARB
+pub GetQueryObjectuiv: FnPtr,
+/// Fallbacks: GetQueryivARB
+pub GetQueryiv: FnPtr,
+/// Fallbacks: GetRenderbufferParameterivEXT
+pub GetRenderbufferParameteriv: FnPtr,
+pub GetSamplerParameterfv: FnPtr,
+pub GetSamplerParameteriv: FnPtr,
+pub GetShaderInfoLog: FnPtr,
+pub GetShaderPrecisionFormat: FnPtr,
+/// Fallbacks: GetShaderSourceARB
+pub GetShaderSource: FnPtr,
+pub GetShaderiv: FnPtr,
+pub GetString: FnPtr,
+pub GetStringi: FnPtr,
+/// Fallbacks: GetSyncivAPPLE
+pub GetSynciv: FnPtr,
+pub GetTexParameterfv: FnPtr,
+pub GetTexParameteriv: FnPtr,
+/// Fallbacks: GetTransformFeedbackVaryingEXT
+pub GetTransformFeedbackVarying: FnPtr,
+pub GetUniformBlockIndex: FnPtr,
+pub GetUniformIndices: FnPtr,
+/// Fallbacks: GetUniformLocationARB
+pub GetUniformLocation: FnPtr,
+/// Fallbacks: GetUniformfvARB
+pub GetUniformfv: FnPtr,
+/// Fallbacks: GetUniformivARB
+pub GetUniformiv: FnPtr,
+/// Fallbacks: GetUniformuivEXT
+pub GetUniformuiv: FnPtr,
+/// Fallbacks: GetVertexAttribIivEXT
+pub GetVertexAttribIiv: FnPtr,
+/// Fallbacks: GetVertexAttribIuivEXT
+pub GetVertexAttribIuiv: FnPtr,
+/// Fallbacks: GetVertexAttribPointervARB, GetVertexAttribPointervNV
+pub GetVertexAttribPointerv: FnPtr,
+/// Fallbacks: GetVertexAttribfvARB, GetVertexAttribfvNV
+pub GetVertexAttribfv: FnPtr,
+/// Fallbacks: GetVertexAttribivARB, GetVertexAttribivNV
+pub GetVertexAttribiv: FnPtr,
+pub Hint: FnPtr,
+pub InvalidateFramebuffer: FnPtr,
+pub InvalidateSubFramebuffer: FnPtr,
+/// Fallbacks: IsBufferARB
+pub IsBuffer: FnPtr,
+pub IsEnabled: FnPtr,
+/// Fallbacks: IsFramebufferEXT
+pub IsFramebuffer: FnPtr,
+pub IsProgram: FnPtr,
+/// Fallbacks: IsQueryARB
+pub IsQuery: FnPtr,
+/// Fallbacks: IsRenderbufferEXT
+pub IsRenderbuffer: FnPtr,
+pub IsSampler: FnPtr,
+pub IsShader: FnPtr,
+/// Fallbacks: IsSyncAPPLE
+pub IsSync: FnPtr,
+pub IsTexture: FnPtr,
+/// Fallbacks: IsTransformFeedbackNV
+pub IsTransformFeedback: FnPtr,
+/// Fallbacks: IsVertexArrayAPPLE, IsVertexArrayOES
+pub IsVertexArray: FnPtr,
+pub LineWidth: FnPtr,
+/// Fallbacks: LinkProgramARB
+pub LinkProgram: FnPtr,
+/// Fallbacks: MapBufferRangeEXT
+pub MapBufferRange: FnPtr,
+/// Fallbacks: PauseTransformFeedbackNV
+pub PauseTransformFeedback: FnPtr,
+pub PixelStorei: FnPtr,
+pub PolygonOffset: FnPtr,
+/// Fallbacks: ProgramBinaryOES
+pub ProgramBinary: FnPtr,
+/// Fallbacks: ProgramParameteriARB, ProgramParameteriEXT
+pub ProgramParameteri: FnPtr,
+pub ReadBuffer: FnPtr,
+pub ReadPixels: FnPtr,
+pub ReleaseShaderCompiler: FnPtr,
+/// Fallbacks: RenderbufferStorageEXT
+pub RenderbufferStorage: FnPtr,
+/// Fallbacks: RenderbufferStorageMultisampleEXT, RenderbufferStorageMultisampleNV
+pub RenderbufferStorageMultisample: FnPtr,
+/// Fallbacks: ResumeTransformFeedbackNV
+pub ResumeTransformFeedback: FnPtr,
+/// Fallbacks: SampleCoverageARB
+pub SampleCoverage: FnPtr,
+pub SamplerParameterf: FnPtr,
+pub SamplerParameterfv: FnPtr,
+pub SamplerParameteri: FnPtr,
+pub SamplerParameteriv: FnPtr,
+pub Scissor: FnPtr,
+pub ShaderBinary: FnPtr,
+/// Fallbacks: ShaderSourceARB
+pub ShaderSource: FnPtr,
+pub StencilFunc: FnPtr,
+pub StencilFuncSeparate: FnPtr,
+pub StencilMask: FnPtr,
+pub StencilMaskSeparate: FnPtr,
+pub StencilOp: FnPtr,
+/// Fallbacks: StencilOpSeparateATI
+pub StencilOpSeparate: FnPtr,
+pub TexImage2D: FnPtr,
+/// Fallbacks: TexImage3DEXT
+pub TexImage3D: FnPtr,
+pub TexParameterf: FnPtr,
+pub TexParameterfv: FnPtr,
+pub TexParameteri: FnPtr,
+pub TexParameteriv: FnPtr,
+/// Fallbacks: TexStorage2DEXT
+pub TexStorage2D: FnPtr,
+/// Fallbacks: TexStorage3DEXT
+pub TexStorage3D: FnPtr,
+/// Fallbacks: TexSubImage2DEXT
+pub TexSubImage2D: FnPtr,
+/// Fallbacks: TexSubImage3DEXT
+pub TexSubImage3D: FnPtr,
+/// Fallbacks: TransformFeedbackVaryingsEXT
+pub TransformFeedbackVaryings: FnPtr,
+/// Fallbacks: Uniform1fARB
+pub Uniform1f: FnPtr,
+/// Fallbacks: Uniform1fvARB
+pub Uniform1fv: FnPtr,
+/// Fallbacks: Uniform1iARB
+pub Uniform1i: FnPtr,
+/// Fallbacks: Uniform1ivARB
+pub Uniform1iv: FnPtr,
+/// Fallbacks: Uniform1uiEXT
+pub Uniform1ui: FnPtr,
+/// Fallbacks: Uniform1uivEXT
+pub Uniform1uiv: FnPtr,
+/// Fallbacks: Uniform2fARB
+pub Uniform2f: FnPtr,
+/// Fallbacks: Uniform2fvARB
+pub Uniform2fv: FnPtr,
+/// Fallbacks: Uniform2iARB
+pub Uniform2i: FnPtr,
+/// Fallbacks: Uniform2ivARB
+pub Uniform2iv: FnPtr,
+/// Fallbacks: Uniform2uiEXT
+pub Uniform2ui: FnPtr,
+/// Fallbacks: Uniform2uivEXT
+pub Uniform2uiv: FnPtr,
+/// Fallbacks: Uniform3fARB
+pub Uniform3f: FnPtr,
+/// Fallbacks: Uniform3fvARB
+pub Uniform3fv: FnPtr,
+/// Fallbacks: Uniform3iARB
+pub Uniform3i: FnPtr,
+/// Fallbacks: Uniform3ivARB
+pub Uniform3iv: FnPtr,
+/// Fallbacks: Uniform3uiEXT
+pub Uniform3ui: FnPtr,
+/// Fallbacks: Uniform3uivEXT
+pub Uniform3uiv: FnPtr,
+/// Fallbacks: Uniform4fARB
+pub Uniform4f: FnPtr,
+/// Fallbacks: Uniform4fvARB
+pub Uniform4fv: FnPtr,
+/// Fallbacks: Uniform4iARB
+pub Uniform4i: FnPtr,
+/// Fallbacks: Uniform4ivARB
+pub Uniform4iv: FnPtr,
+/// Fallbacks: Uniform4uiEXT
+pub Uniform4ui: FnPtr,
+/// Fallbacks: Uniform4uivEXT
+pub Uniform4uiv: FnPtr,
+pub UniformBlockBinding: FnPtr,
+/// Fallbacks: UniformMatrix2fvARB
+pub UniformMatrix2fv: FnPtr,
+/// Fallbacks: UniformMatrix2x3fvNV
+pub UniformMatrix2x3fv: FnPtr,
+/// Fallbacks: UniformMatrix2x4fvNV
+pub UniformMatrix2x4fv: FnPtr,
+/// Fallbacks: UniformMatrix3fvARB
+pub UniformMatrix3fv: FnPtr,
+/// Fallbacks: UniformMatrix3x2fvNV
+pub UniformMatrix3x2fv: FnPtr,
+/// Fallbacks: UniformMatrix3x4fvNV
+pub UniformMatrix3x4fv: FnPtr,
+/// Fallbacks: UniformMatrix4fvARB
+pub UniformMatrix4fv: FnPtr,
+/// Fallbacks: UniformMatrix4x2fvNV
+pub UniformMatrix4x2fv: FnPtr,
+/// Fallbacks: UniformMatrix4x3fvNV
+pub UniformMatrix4x3fv: FnPtr,
+/// Fallbacks: UnmapBufferARB, UnmapBufferOES
+pub UnmapBuffer: FnPtr,
+/// Fallbacks: UseProgramObjectARB
+pub UseProgram: FnPtr,
+/// Fallbacks: ValidateProgramARB
+pub ValidateProgram: FnPtr,
+/// Fallbacks: VertexAttrib1fARB, VertexAttrib1fNV
+pub VertexAttrib1f: FnPtr,
+/// Fallbacks: VertexAttrib1fvARB, VertexAttrib1fvNV
+pub VertexAttrib1fv: FnPtr,
+/// Fallbacks: VertexAttrib2fARB, VertexAttrib2fNV
+pub VertexAttrib2f: FnPtr,
+/// Fallbacks: VertexAttrib2fvARB, VertexAttrib2fvNV
+pub VertexAttrib2fv: FnPtr,
+/// Fallbacks: VertexAttrib3fARB, VertexAttrib3fNV
+pub VertexAttrib3f: FnPtr,
+/// Fallbacks: VertexAttrib3fvARB, VertexAttrib3fvNV
+pub VertexAttrib3fv: FnPtr,
+/// Fallbacks: VertexAttrib4fARB, VertexAttrib4fNV
+pub VertexAttrib4f: FnPtr,
+/// Fallbacks: VertexAttrib4fvARB, VertexAttrib4fvNV
+pub VertexAttrib4fv: FnPtr,
+/// Fallbacks: VertexAttribDivisorANGLE, VertexAttribDivisorARB, VertexAttribDivisorEXT, VertexAttribDivisorNV
+pub VertexAttribDivisor: FnPtr,
+/// Fallbacks: VertexAttribI4iEXT
+pub VertexAttribI4i: FnPtr,
+/// Fallbacks: VertexAttribI4ivEXT
+pub VertexAttribI4iv: FnPtr,
+/// Fallbacks: VertexAttribI4uiEXT
+pub VertexAttribI4ui: FnPtr,
+/// Fallbacks: VertexAttribI4uivEXT
+pub VertexAttribI4uiv: FnPtr,
+/// Fallbacks: VertexAttribIPointerEXT
+pub VertexAttribIPointer: FnPtr,
+/// Fallbacks: VertexAttribPointerARB
+pub VertexAttribPointer: FnPtr,
+pub Viewport: FnPtr,
+/// Fallbacks: WaitSyncAPPLE
+pub WaitSync: FnPtr,
+_priv: ()
+}
+impl Gles2 {
+ /// Load each OpenGL symbol using a custom load function. This allows for the
+ /// use of functions like `glfwGetProcAddress` or `SDL_GL_GetProcAddress`.
+ ///
+ /// ~~~ignore
+ /// let gl = Gl::load_with(|s| glfw.get_proc_address(s));
+ /// ~~~
+ #[allow(dead_code, unused_variables)]
+ pub fn load_with(mut loadfn: F) -> Gles2 where F: FnMut(&'static str) -> *const __gl_imports::raw::c_void {
+ #[inline(never)]
+ fn do_metaloadfn(loadfn: &mut dyn FnMut(&'static str) -> *const __gl_imports::raw::c_void,
+ symbol: &'static str,
+ symbols: &[&'static str])
+ -> *const __gl_imports::raw::c_void {
+ let mut ptr = loadfn(symbol);
+ if ptr.is_null() {
+ for &sym in symbols {
+ ptr = loadfn(sym);
+ if !ptr.is_null() { break; }
+ }
+ }
+ ptr
+ }
+ let mut metaloadfn = |symbol: &'static str, symbols: &[&'static str]| {
+ do_metaloadfn(&mut loadfn, symbol, symbols)
+ };
+ Gles2 {
+ActiveTexture: FnPtr::new(metaloadfn("glActiveTexture", &["glActiveTextureARB"])),
+AttachShader: FnPtr::new(metaloadfn("glAttachShader", &["glAttachObjectARB"])),
+BeginQuery: FnPtr::new(metaloadfn("glBeginQuery", &["glBeginQueryARB"])),
+BeginTransformFeedback: FnPtr::new(metaloadfn("glBeginTransformFeedback", &["glBeginTransformFeedbackEXT", "glBeginTransformFeedbackNV"])),
+BindAttribLocation: FnPtr::new(metaloadfn("glBindAttribLocation", &["glBindAttribLocationARB"])),
+BindBuffer: FnPtr::new(metaloadfn("glBindBuffer", &["glBindBufferARB"])),
+BindBufferBase: FnPtr::new(metaloadfn("glBindBufferBase", &["glBindBufferBaseEXT", "glBindBufferBaseNV"])),
+BindBufferRange: FnPtr::new(metaloadfn("glBindBufferRange", &["glBindBufferRangeEXT", "glBindBufferRangeNV"])),
+BindFramebuffer: FnPtr::new(metaloadfn("glBindFramebuffer", &[])),
+BindRenderbuffer: FnPtr::new(metaloadfn("glBindRenderbuffer", &[])),
+BindSampler: FnPtr::new(metaloadfn("glBindSampler", &[])),
+BindTexture: FnPtr::new(metaloadfn("glBindTexture", &["glBindTextureEXT"])),
+BindTransformFeedback: FnPtr::new(metaloadfn("glBindTransformFeedback", &[])),
+BindVertexArray: FnPtr::new(metaloadfn("glBindVertexArray", &["glBindVertexArrayOES"])),
+BlendColor: FnPtr::new(metaloadfn("glBlendColor", &["glBlendColorEXT"])),
+BlendEquation: FnPtr::new(metaloadfn("glBlendEquation", &["glBlendEquationEXT"])),
+BlendEquationSeparate: FnPtr::new(metaloadfn("glBlendEquationSeparate", &["glBlendEquationSeparateEXT"])),
+BlendFunc: FnPtr::new(metaloadfn("glBlendFunc", &[])),
+BlendFuncSeparate: FnPtr::new(metaloadfn("glBlendFuncSeparate", &["glBlendFuncSeparateEXT", "glBlendFuncSeparateINGR"])),
+BlitFramebuffer: FnPtr::new(metaloadfn("glBlitFramebuffer", &["glBlitFramebufferEXT", "glBlitFramebufferNV"])),
+BufferData: FnPtr::new(metaloadfn("glBufferData", &["glBufferDataARB"])),
+BufferSubData: FnPtr::new(metaloadfn("glBufferSubData", &["glBufferSubDataARB"])),
+CheckFramebufferStatus: FnPtr::new(metaloadfn("glCheckFramebufferStatus", &["glCheckFramebufferStatusEXT"])),
+Clear: FnPtr::new(metaloadfn("glClear", &[])),
+ClearBufferfi: FnPtr::new(metaloadfn("glClearBufferfi", &[])),
+ClearBufferfv: FnPtr::new(metaloadfn("glClearBufferfv", &[])),
+ClearBufferiv: FnPtr::new(metaloadfn("glClearBufferiv", &[])),
+ClearBufferuiv: FnPtr::new(metaloadfn("glClearBufferuiv", &[])),
+ClearColor: FnPtr::new(metaloadfn("glClearColor", &[])),
+ClearDepthf: FnPtr::new(metaloadfn("glClearDepthf", &["glClearDepthfOES"])),
+ClearStencil: FnPtr::new(metaloadfn("glClearStencil", &[])),
+ClientWaitSync: FnPtr::new(metaloadfn("glClientWaitSync", &["glClientWaitSyncAPPLE"])),
+ColorMask: FnPtr::new(metaloadfn("glColorMask", &[])),
+CompileShader: FnPtr::new(metaloadfn("glCompileShader", &["glCompileShaderARB"])),
+CompressedTexImage2D: FnPtr::new(metaloadfn("glCompressedTexImage2D", &["glCompressedTexImage2DARB"])),
+CompressedTexImage3D: FnPtr::new(metaloadfn("glCompressedTexImage3D", &["glCompressedTexImage3DARB"])),
+CompressedTexSubImage2D: FnPtr::new(metaloadfn("glCompressedTexSubImage2D", &["glCompressedTexSubImage2DARB"])),
+CompressedTexSubImage3D: FnPtr::new(metaloadfn("glCompressedTexSubImage3D", &["glCompressedTexSubImage3DARB"])),
+CopyBufferSubData: FnPtr::new(metaloadfn("glCopyBufferSubData", &["glCopyBufferSubDataNV"])),
+CopyTexImage2D: FnPtr::new(metaloadfn("glCopyTexImage2D", &["glCopyTexImage2DEXT"])),
+CopyTexSubImage2D: FnPtr::new(metaloadfn("glCopyTexSubImage2D", &["glCopyTexSubImage2DEXT"])),
+CopyTexSubImage3D: FnPtr::new(metaloadfn("glCopyTexSubImage3D", &["glCopyTexSubImage3DEXT"])),
+CreateProgram: FnPtr::new(metaloadfn("glCreateProgram", &["glCreateProgramObjectARB"])),
+CreateShader: FnPtr::new(metaloadfn("glCreateShader", &["glCreateShaderObjectARB"])),
+CullFace: FnPtr::new(metaloadfn("glCullFace", &[])),
+DeleteBuffers: FnPtr::new(metaloadfn("glDeleteBuffers", &["glDeleteBuffersARB"])),
+DeleteFramebuffers: FnPtr::new(metaloadfn("glDeleteFramebuffers", &["glDeleteFramebuffersEXT"])),
+DeleteProgram: FnPtr::new(metaloadfn("glDeleteProgram", &[])),
+DeleteQueries: FnPtr::new(metaloadfn("glDeleteQueries", &["glDeleteQueriesARB"])),
+DeleteRenderbuffers: FnPtr::new(metaloadfn("glDeleteRenderbuffers", &["glDeleteRenderbuffersEXT"])),
+DeleteSamplers: FnPtr::new(metaloadfn("glDeleteSamplers", &[])),
+DeleteShader: FnPtr::new(metaloadfn("glDeleteShader", &[])),
+DeleteSync: FnPtr::new(metaloadfn("glDeleteSync", &["glDeleteSyncAPPLE"])),
+DeleteTextures: FnPtr::new(metaloadfn("glDeleteTextures", &[])),
+DeleteTransformFeedbacks: FnPtr::new(metaloadfn("glDeleteTransformFeedbacks", &["glDeleteTransformFeedbacksNV"])),
+DeleteVertexArrays: FnPtr::new(metaloadfn("glDeleteVertexArrays", &["glDeleteVertexArraysAPPLE", "glDeleteVertexArraysOES"])),
+DepthFunc: FnPtr::new(metaloadfn("glDepthFunc", &[])),
+DepthMask: FnPtr::new(metaloadfn("glDepthMask", &[])),
+DepthRangef: FnPtr::new(metaloadfn("glDepthRangef", &["glDepthRangefOES"])),
+DetachShader: FnPtr::new(metaloadfn("glDetachShader", &["glDetachObjectARB"])),
+Disable: FnPtr::new(metaloadfn("glDisable", &[])),
+DisableVertexAttribArray: FnPtr::new(metaloadfn("glDisableVertexAttribArray", &["glDisableVertexAttribArrayARB"])),
+DrawArrays: FnPtr::new(metaloadfn("glDrawArrays", &["glDrawArraysEXT"])),
+DrawArraysInstanced: FnPtr::new(metaloadfn("glDrawArraysInstanced", &["glDrawArraysInstancedANGLE", "glDrawArraysInstancedARB", "glDrawArraysInstancedEXT", "glDrawArraysInstancedNV"])),
+DrawBuffers: FnPtr::new(metaloadfn("glDrawBuffers", &["glDrawBuffersARB", "glDrawBuffersATI", "glDrawBuffersEXT"])),
+DrawElements: FnPtr::new(metaloadfn("glDrawElements", &[])),
+DrawElementsInstanced: FnPtr::new(metaloadfn("glDrawElementsInstanced", &["glDrawElementsInstancedANGLE", "glDrawElementsInstancedARB", "glDrawElementsInstancedEXT", "glDrawElementsInstancedNV"])),
+DrawRangeElements: FnPtr::new(metaloadfn("glDrawRangeElements", &["glDrawRangeElementsEXT"])),
+Enable: FnPtr::new(metaloadfn("glEnable", &[])),
+EnableVertexAttribArray: FnPtr::new(metaloadfn("glEnableVertexAttribArray", &["glEnableVertexAttribArrayARB"])),
+EndQuery: FnPtr::new(metaloadfn("glEndQuery", &["glEndQueryARB"])),
+EndTransformFeedback: FnPtr::new(metaloadfn("glEndTransformFeedback", &["glEndTransformFeedbackEXT", "glEndTransformFeedbackNV"])),
+FenceSync: FnPtr::new(metaloadfn("glFenceSync", &["glFenceSyncAPPLE"])),
+Finish: FnPtr::new(metaloadfn("glFinish", &[])),
+Flush: FnPtr::new(metaloadfn("glFlush", &[])),
+FlushMappedBufferRange: FnPtr::new(metaloadfn("glFlushMappedBufferRange", &["glFlushMappedBufferRangeAPPLE", "glFlushMappedBufferRangeEXT"])),
+FramebufferRenderbuffer: FnPtr::new(metaloadfn("glFramebufferRenderbuffer", &["glFramebufferRenderbufferEXT"])),
+FramebufferTexture2D: FnPtr::new(metaloadfn("glFramebufferTexture2D", &["glFramebufferTexture2DEXT"])),
+FramebufferTextureLayer: FnPtr::new(metaloadfn("glFramebufferTextureLayer", &["glFramebufferTextureLayerARB", "glFramebufferTextureLayerEXT"])),
+FrontFace: FnPtr::new(metaloadfn("glFrontFace", &[])),
+GenBuffers: FnPtr::new(metaloadfn("glGenBuffers", &["glGenBuffersARB"])),
+GenFramebuffers: FnPtr::new(metaloadfn("glGenFramebuffers", &["glGenFramebuffersEXT"])),
+GenQueries: FnPtr::new(metaloadfn("glGenQueries", &["glGenQueriesARB"])),
+GenRenderbuffers: FnPtr::new(metaloadfn("glGenRenderbuffers", &["glGenRenderbuffersEXT"])),
+GenSamplers: FnPtr::new(metaloadfn("glGenSamplers", &[])),
+GenTextures: FnPtr::new(metaloadfn("glGenTextures", &[])),
+GenTransformFeedbacks: FnPtr::new(metaloadfn("glGenTransformFeedbacks", &["glGenTransformFeedbacksNV"])),
+GenVertexArrays: FnPtr::new(metaloadfn("glGenVertexArrays", &["glGenVertexArraysAPPLE", "glGenVertexArraysOES"])),
+GenerateMipmap: FnPtr::new(metaloadfn("glGenerateMipmap", &["glGenerateMipmapEXT"])),
+GetActiveAttrib: FnPtr::new(metaloadfn("glGetActiveAttrib", &["glGetActiveAttribARB"])),
+GetActiveUniform: FnPtr::new(metaloadfn("glGetActiveUniform", &["glGetActiveUniformARB"])),
+GetActiveUniformBlockName: FnPtr::new(metaloadfn("glGetActiveUniformBlockName", &[])),
+GetActiveUniformBlockiv: FnPtr::new(metaloadfn("glGetActiveUniformBlockiv", &[])),
+GetActiveUniformsiv: FnPtr::new(metaloadfn("glGetActiveUniformsiv", &[])),
+GetAttachedShaders: FnPtr::new(metaloadfn("glGetAttachedShaders", &[])),
+GetAttribLocation: FnPtr::new(metaloadfn("glGetAttribLocation", &["glGetAttribLocationARB"])),
+GetBooleanv: FnPtr::new(metaloadfn("glGetBooleanv", &[])),
+GetBufferParameteri64v: FnPtr::new(metaloadfn("glGetBufferParameteri64v", &[])),
+GetBufferParameteriv: FnPtr::new(metaloadfn("glGetBufferParameteriv", &["glGetBufferParameterivARB"])),
+GetBufferPointerv: FnPtr::new(metaloadfn("glGetBufferPointerv", &["glGetBufferPointervARB", "glGetBufferPointervOES"])),
+GetError: FnPtr::new(metaloadfn("glGetError", &[])),
+GetFloatv: FnPtr::new(metaloadfn("glGetFloatv", &[])),
+GetFragDataLocation: FnPtr::new(metaloadfn("glGetFragDataLocation", &["glGetFragDataLocationEXT"])),
+GetFramebufferAttachmentParameteriv: FnPtr::new(metaloadfn("glGetFramebufferAttachmentParameteriv", &["glGetFramebufferAttachmentParameterivEXT"])),
+GetInteger64i_v: FnPtr::new(metaloadfn("glGetInteger64i_v", &[])),
+GetInteger64v: FnPtr::new(metaloadfn("glGetInteger64v", &["glGetInteger64vAPPLE"])),
+GetIntegeri_v: FnPtr::new(metaloadfn("glGetIntegeri_v", &["glGetIntegerIndexedvEXT"])),
+GetIntegerv: FnPtr::new(metaloadfn("glGetIntegerv", &[])),
+GetInternalformativ: FnPtr::new(metaloadfn("glGetInternalformativ", &[])),
+GetProgramBinary: FnPtr::new(metaloadfn("glGetProgramBinary", &["glGetProgramBinaryOES"])),
+GetProgramInfoLog: FnPtr::new(metaloadfn("glGetProgramInfoLog", &[])),
+GetProgramiv: FnPtr::new(metaloadfn("glGetProgramiv", &[])),
+GetQueryObjectuiv: FnPtr::new(metaloadfn("glGetQueryObjectuiv", &["glGetQueryObjectuivARB"])),
+GetQueryiv: FnPtr::new(metaloadfn("glGetQueryiv", &["glGetQueryivARB"])),
+GetRenderbufferParameteriv: FnPtr::new(metaloadfn("glGetRenderbufferParameteriv", &["glGetRenderbufferParameterivEXT"])),
+GetSamplerParameterfv: FnPtr::new(metaloadfn("glGetSamplerParameterfv", &[])),
+GetSamplerParameteriv: FnPtr::new(metaloadfn("glGetSamplerParameteriv", &[])),
+GetShaderInfoLog: FnPtr::new(metaloadfn("glGetShaderInfoLog", &[])),
+GetShaderPrecisionFormat: FnPtr::new(metaloadfn("glGetShaderPrecisionFormat", &[])),
+GetShaderSource: FnPtr::new(metaloadfn("glGetShaderSource", &["glGetShaderSourceARB"])),
+GetShaderiv: FnPtr::new(metaloadfn("glGetShaderiv", &[])),
+GetString: FnPtr::new(metaloadfn("glGetString", &[])),
+GetStringi: FnPtr::new(metaloadfn("glGetStringi", &[])),
+GetSynciv: FnPtr::new(metaloadfn("glGetSynciv", &["glGetSyncivAPPLE"])),
+GetTexParameterfv: FnPtr::new(metaloadfn("glGetTexParameterfv", &[])),
+GetTexParameteriv: FnPtr::new(metaloadfn("glGetTexParameteriv", &[])),
+GetTransformFeedbackVarying: FnPtr::new(metaloadfn("glGetTransformFeedbackVarying", &["glGetTransformFeedbackVaryingEXT"])),
+GetUniformBlockIndex: FnPtr::new(metaloadfn("glGetUniformBlockIndex", &[])),
+GetUniformIndices: FnPtr::new(metaloadfn("glGetUniformIndices", &[])),
+GetUniformLocation: FnPtr::new(metaloadfn("glGetUniformLocation", &["glGetUniformLocationARB"])),
+GetUniformfv: FnPtr::new(metaloadfn("glGetUniformfv", &["glGetUniformfvARB"])),
+GetUniformiv: FnPtr::new(metaloadfn("glGetUniformiv", &["glGetUniformivARB"])),
+GetUniformuiv: FnPtr::new(metaloadfn("glGetUniformuiv", &["glGetUniformuivEXT"])),
+GetVertexAttribIiv: FnPtr::new(metaloadfn("glGetVertexAttribIiv", &["glGetVertexAttribIivEXT"])),
+GetVertexAttribIuiv: FnPtr::new(metaloadfn("glGetVertexAttribIuiv", &["glGetVertexAttribIuivEXT"])),
+GetVertexAttribPointerv: FnPtr::new(metaloadfn("glGetVertexAttribPointerv", &["glGetVertexAttribPointervARB", "glGetVertexAttribPointervNV"])),
+GetVertexAttribfv: FnPtr::new(metaloadfn("glGetVertexAttribfv", &["glGetVertexAttribfvARB", "glGetVertexAttribfvNV"])),
+GetVertexAttribiv: FnPtr::new(metaloadfn("glGetVertexAttribiv", &["glGetVertexAttribivARB", "glGetVertexAttribivNV"])),
+Hint: FnPtr::new(metaloadfn("glHint", &[])),
+InvalidateFramebuffer: FnPtr::new(metaloadfn("glInvalidateFramebuffer", &[])),
+InvalidateSubFramebuffer: FnPtr::new(metaloadfn("glInvalidateSubFramebuffer", &[])),
+IsBuffer: FnPtr::new(metaloadfn("glIsBuffer", &["glIsBufferARB"])),
+IsEnabled: FnPtr::new(metaloadfn("glIsEnabled", &[])),
+IsFramebuffer: FnPtr::new(metaloadfn("glIsFramebuffer", &["glIsFramebufferEXT"])),
+IsProgram: FnPtr::new(metaloadfn("glIsProgram", &[])),
+IsQuery: FnPtr::new(metaloadfn("glIsQuery", &["glIsQueryARB"])),
+IsRenderbuffer: FnPtr::new(metaloadfn("glIsRenderbuffer", &["glIsRenderbufferEXT"])),
+IsSampler: FnPtr::new(metaloadfn("glIsSampler", &[])),
+IsShader: FnPtr::new(metaloadfn("glIsShader", &[])),
+IsSync: FnPtr::new(metaloadfn("glIsSync", &["glIsSyncAPPLE"])),
+IsTexture: FnPtr::new(metaloadfn("glIsTexture", &[])),
+IsTransformFeedback: FnPtr::new(metaloadfn("glIsTransformFeedback", &["glIsTransformFeedbackNV"])),
+IsVertexArray: FnPtr::new(metaloadfn("glIsVertexArray", &["glIsVertexArrayAPPLE", "glIsVertexArrayOES"])),
+LineWidth: FnPtr::new(metaloadfn("glLineWidth", &[])),
+LinkProgram: FnPtr::new(metaloadfn("glLinkProgram", &["glLinkProgramARB"])),
+MapBufferRange: FnPtr::new(metaloadfn("glMapBufferRange", &["glMapBufferRangeEXT"])),
+PauseTransformFeedback: FnPtr::new(metaloadfn("glPauseTransformFeedback", &["glPauseTransformFeedbackNV"])),
+PixelStorei: FnPtr::new(metaloadfn("glPixelStorei", &[])),
+PolygonOffset: FnPtr::new(metaloadfn("glPolygonOffset", &[])),
+ProgramBinary: FnPtr::new(metaloadfn("glProgramBinary", &["glProgramBinaryOES"])),
+ProgramParameteri: FnPtr::new(metaloadfn("glProgramParameteri", &["glProgramParameteriARB", "glProgramParameteriEXT"])),
+ReadBuffer: FnPtr::new(metaloadfn("glReadBuffer", &[])),
+ReadPixels: FnPtr::new(metaloadfn("glReadPixels", &[])),
+ReleaseShaderCompiler: FnPtr::new(metaloadfn("glReleaseShaderCompiler", &[])),
+RenderbufferStorage: FnPtr::new(metaloadfn("glRenderbufferStorage", &["glRenderbufferStorageEXT"])),
+RenderbufferStorageMultisample: FnPtr::new(metaloadfn("glRenderbufferStorageMultisample", &["glRenderbufferStorageMultisampleEXT", "glRenderbufferStorageMultisampleNV"])),
+ResumeTransformFeedback: FnPtr::new(metaloadfn("glResumeTransformFeedback", &["glResumeTransformFeedbackNV"])),
+SampleCoverage: FnPtr::new(metaloadfn("glSampleCoverage", &["glSampleCoverageARB"])),
+SamplerParameterf: FnPtr::new(metaloadfn("glSamplerParameterf", &[])),
+SamplerParameterfv: FnPtr::new(metaloadfn("glSamplerParameterfv", &[])),
+SamplerParameteri: FnPtr::new(metaloadfn("glSamplerParameteri", &[])),
+SamplerParameteriv: FnPtr::new(metaloadfn("glSamplerParameteriv", &[])),
+Scissor: FnPtr::new(metaloadfn("glScissor", &[])),
+ShaderBinary: FnPtr::new(metaloadfn("glShaderBinary", &[])),
+ShaderSource: FnPtr::new(metaloadfn("glShaderSource", &["glShaderSourceARB"])),
+StencilFunc: FnPtr::new(metaloadfn("glStencilFunc", &[])),
+StencilFuncSeparate: FnPtr::new(metaloadfn("glStencilFuncSeparate", &[])),
+StencilMask: FnPtr::new(metaloadfn("glStencilMask", &[])),
+StencilMaskSeparate: FnPtr::new(metaloadfn("glStencilMaskSeparate", &[])),
+StencilOp: FnPtr::new(metaloadfn("glStencilOp", &[])),
+StencilOpSeparate: FnPtr::new(metaloadfn("glStencilOpSeparate", &["glStencilOpSeparateATI"])),
+TexImage2D: FnPtr::new(metaloadfn("glTexImage2D", &[])),
+TexImage3D: FnPtr::new(metaloadfn("glTexImage3D", &["glTexImage3DEXT"])),
+TexParameterf: FnPtr::new(metaloadfn("glTexParameterf", &[])),
+TexParameterfv: FnPtr::new(metaloadfn("glTexParameterfv", &[])),
+TexParameteri: FnPtr::new(metaloadfn("glTexParameteri", &[])),
+TexParameteriv: FnPtr::new(metaloadfn("glTexParameteriv", &[])),
+TexStorage2D: FnPtr::new(metaloadfn("glTexStorage2D", &["glTexStorage2DEXT"])),
+TexStorage3D: FnPtr::new(metaloadfn("glTexStorage3D", &["glTexStorage3DEXT"])),
+TexSubImage2D: FnPtr::new(metaloadfn("glTexSubImage2D", &["glTexSubImage2DEXT"])),
+TexSubImage3D: FnPtr::new(metaloadfn("glTexSubImage3D", &["glTexSubImage3DEXT"])),
+TransformFeedbackVaryings: FnPtr::new(metaloadfn("glTransformFeedbackVaryings", &["glTransformFeedbackVaryingsEXT"])),
+Uniform1f: FnPtr::new(metaloadfn("glUniform1f", &["glUniform1fARB"])),
+Uniform1fv: FnPtr::new(metaloadfn("glUniform1fv", &["glUniform1fvARB"])),
+Uniform1i: FnPtr::new(metaloadfn("glUniform1i", &["glUniform1iARB"])),
+Uniform1iv: FnPtr::new(metaloadfn("glUniform1iv", &["glUniform1ivARB"])),
+Uniform1ui: FnPtr::new(metaloadfn("glUniform1ui", &["glUniform1uiEXT"])),
+Uniform1uiv: FnPtr::new(metaloadfn("glUniform1uiv", &["glUniform1uivEXT"])),
+Uniform2f: FnPtr::new(metaloadfn("glUniform2f", &["glUniform2fARB"])),
+Uniform2fv: FnPtr::new(metaloadfn("glUniform2fv", &["glUniform2fvARB"])),
+Uniform2i: FnPtr::new(metaloadfn("glUniform2i", &["glUniform2iARB"])),
+Uniform2iv: FnPtr::new(metaloadfn("glUniform2iv", &["glUniform2ivARB"])),
+Uniform2ui: FnPtr::new(metaloadfn("glUniform2ui", &["glUniform2uiEXT"])),
+Uniform2uiv: FnPtr::new(metaloadfn("glUniform2uiv", &["glUniform2uivEXT"])),
+Uniform3f: FnPtr::new(metaloadfn("glUniform3f", &["glUniform3fARB"])),
+Uniform3fv: FnPtr::new(metaloadfn("glUniform3fv", &["glUniform3fvARB"])),
+Uniform3i: FnPtr::new(metaloadfn("glUniform3i", &["glUniform3iARB"])),
+Uniform3iv: FnPtr::new(metaloadfn("glUniform3iv", &["glUniform3ivARB"])),
+Uniform3ui: FnPtr::new(metaloadfn("glUniform3ui", &["glUniform3uiEXT"])),
+Uniform3uiv: FnPtr::new(metaloadfn("glUniform3uiv", &["glUniform3uivEXT"])),
+Uniform4f: FnPtr::new(metaloadfn("glUniform4f", &["glUniform4fARB"])),
+Uniform4fv: FnPtr::new(metaloadfn("glUniform4fv", &["glUniform4fvARB"])),
+Uniform4i: FnPtr::new(metaloadfn("glUniform4i", &["glUniform4iARB"])),
+Uniform4iv: FnPtr::new(metaloadfn("glUniform4iv", &["glUniform4ivARB"])),
+Uniform4ui: FnPtr::new(metaloadfn("glUniform4ui", &["glUniform4uiEXT"])),
+Uniform4uiv: FnPtr::new(metaloadfn("glUniform4uiv", &["glUniform4uivEXT"])),
+UniformBlockBinding: FnPtr::new(metaloadfn("glUniformBlockBinding", &[])),
+UniformMatrix2fv: FnPtr::new(metaloadfn("glUniformMatrix2fv", &["glUniformMatrix2fvARB"])),
+UniformMatrix2x3fv: FnPtr::new(metaloadfn("glUniformMatrix2x3fv", &["glUniformMatrix2x3fvNV"])),
+UniformMatrix2x4fv: FnPtr::new(metaloadfn("glUniformMatrix2x4fv", &["glUniformMatrix2x4fvNV"])),
+UniformMatrix3fv: FnPtr::new(metaloadfn("glUniformMatrix3fv", &["glUniformMatrix3fvARB"])),
+UniformMatrix3x2fv: FnPtr::new(metaloadfn("glUniformMatrix3x2fv", &["glUniformMatrix3x2fvNV"])),
+UniformMatrix3x4fv: FnPtr::new(metaloadfn("glUniformMatrix3x4fv", &["glUniformMatrix3x4fvNV"])),
+UniformMatrix4fv: FnPtr::new(metaloadfn("glUniformMatrix4fv", &["glUniformMatrix4fvARB"])),
+UniformMatrix4x2fv: FnPtr::new(metaloadfn("glUniformMatrix4x2fv", &["glUniformMatrix4x2fvNV"])),
+UniformMatrix4x3fv: FnPtr::new(metaloadfn("glUniformMatrix4x3fv", &["glUniformMatrix4x3fvNV"])),
+UnmapBuffer: FnPtr::new(metaloadfn("glUnmapBuffer", &["glUnmapBufferARB", "glUnmapBufferOES"])),
+UseProgram: FnPtr::new(metaloadfn("glUseProgram", &["glUseProgramObjectARB"])),
+ValidateProgram: FnPtr::new(metaloadfn("glValidateProgram", &["glValidateProgramARB"])),
+VertexAttrib1f: FnPtr::new(metaloadfn("glVertexAttrib1f", &["glVertexAttrib1fARB", "glVertexAttrib1fNV"])),
+VertexAttrib1fv: FnPtr::new(metaloadfn("glVertexAttrib1fv", &["glVertexAttrib1fvARB", "glVertexAttrib1fvNV"])),
+VertexAttrib2f: FnPtr::new(metaloadfn("glVertexAttrib2f", &["glVertexAttrib2fARB", "glVertexAttrib2fNV"])),
+VertexAttrib2fv: FnPtr::new(metaloadfn("glVertexAttrib2fv", &["glVertexAttrib2fvARB", "glVertexAttrib2fvNV"])),
+VertexAttrib3f: FnPtr::new(metaloadfn("glVertexAttrib3f", &["glVertexAttrib3fARB", "glVertexAttrib3fNV"])),
+VertexAttrib3fv: FnPtr::new(metaloadfn("glVertexAttrib3fv", &["glVertexAttrib3fvARB", "glVertexAttrib3fvNV"])),
+VertexAttrib4f: FnPtr::new(metaloadfn("glVertexAttrib4f", &["glVertexAttrib4fARB", "glVertexAttrib4fNV"])),
+VertexAttrib4fv: FnPtr::new(metaloadfn("glVertexAttrib4fv", &["glVertexAttrib4fvARB", "glVertexAttrib4fvNV"])),
+VertexAttribDivisor: FnPtr::new(metaloadfn("glVertexAttribDivisor", &["glVertexAttribDivisorANGLE", "glVertexAttribDivisorARB", "glVertexAttribDivisorEXT", "glVertexAttribDivisorNV"])),
+VertexAttribI4i: FnPtr::new(metaloadfn("glVertexAttribI4i", &["glVertexAttribI4iEXT"])),
+VertexAttribI4iv: FnPtr::new(metaloadfn("glVertexAttribI4iv", &["glVertexAttribI4ivEXT"])),
+VertexAttribI4ui: FnPtr::new(metaloadfn("glVertexAttribI4ui", &["glVertexAttribI4uiEXT"])),
+VertexAttribI4uiv: FnPtr::new(metaloadfn("glVertexAttribI4uiv", &["glVertexAttribI4uivEXT"])),
+VertexAttribIPointer: FnPtr::new(metaloadfn("glVertexAttribIPointer", &["glVertexAttribIPointerEXT"])),
+VertexAttribPointer: FnPtr::new(metaloadfn("glVertexAttribPointer", &["glVertexAttribPointerARB"])),
+Viewport: FnPtr::new(metaloadfn("glViewport", &[])),
+WaitSync: FnPtr::new(metaloadfn("glWaitSync", &["glWaitSyncAPPLE"])),
+_priv: ()
+}
+ }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ActiveTexture(&self, texture: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum) -> ()>(self.ActiveTexture.f)(texture) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn AttachShader(&self, program: types::GLuint, shader: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLuint) -> ()>(self.AttachShader.f)(program, shader) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BeginQuery(&self, target: types::GLenum, id: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLuint) -> ()>(self.BeginQuery.f)(target, id) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BeginTransformFeedback(&self, primitiveMode: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum) -> ()>(self.BeginTransformFeedback.f)(primitiveMode) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BindAttribLocation(&self, program: types::GLuint, index: types::GLuint, name: *const types::GLchar) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLuint, *const types::GLchar) -> ()>(self.BindAttribLocation.f)(program, index, name) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BindBuffer(&self, target: types::GLenum, buffer: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLuint) -> ()>(self.BindBuffer.f)(target, buffer) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BindBufferBase(&self, target: types::GLenum, index: types::GLuint, buffer: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLuint, types::GLuint) -> ()>(self.BindBufferBase.f)(target, index, buffer) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BindBufferRange(&self, target: types::GLenum, index: types::GLuint, buffer: types::GLuint, offset: types::GLintptr, size: types::GLsizeiptr) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLuint, types::GLuint, types::GLintptr, types::GLsizeiptr) -> ()>(self.BindBufferRange.f)(target, index, buffer, offset, size) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BindFramebuffer(&self, target: types::GLenum, framebuffer: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLuint) -> ()>(self.BindFramebuffer.f)(target, framebuffer) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BindRenderbuffer(&self, target: types::GLenum, renderbuffer: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLuint) -> ()>(self.BindRenderbuffer.f)(target, renderbuffer) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BindSampler(&self, unit: types::GLuint, sampler: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLuint) -> ()>(self.BindSampler.f)(unit, sampler) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BindTexture(&self, target: types::GLenum, texture: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLuint) -> ()>(self.BindTexture.f)(target, texture) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BindTransformFeedback(&self, target: types::GLenum, id: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLuint) -> ()>(self.BindTransformFeedback.f)(target, id) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BindVertexArray(&self, array: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> ()>(self.BindVertexArray.f)(array) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BlendColor(&self, red: types::GLfloat, green: types::GLfloat, blue: types::GLfloat, alpha: types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLfloat, types::GLfloat, types::GLfloat, types::GLfloat) -> ()>(self.BlendColor.f)(red, green, blue, alpha) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BlendEquation(&self, mode: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum) -> ()>(self.BlendEquation.f)(mode) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BlendEquationSeparate(&self, modeRGB: types::GLenum, modeAlpha: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum) -> ()>(self.BlendEquationSeparate.f)(modeRGB, modeAlpha) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BlendFunc(&self, sfactor: types::GLenum, dfactor: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum) -> ()>(self.BlendFunc.f)(sfactor, dfactor) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BlendFuncSeparate(&self, sfactorRGB: types::GLenum, dfactorRGB: types::GLenum, sfactorAlpha: types::GLenum, dfactorAlpha: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, types::GLenum, types::GLenum) -> ()>(self.BlendFuncSeparate.f)(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BlitFramebuffer(&self, srcX0: types::GLint, srcY0: types::GLint, srcX1: types::GLint, srcY1: types::GLint, dstX0: types::GLint, dstY0: types::GLint, dstX1: types::GLint, dstY1: types::GLint, mask: types::GLbitfield, filter: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLint, types::GLint, types::GLint, types::GLint, types::GLint, types::GLint, types::GLint, types::GLbitfield, types::GLenum) -> ()>(self.BlitFramebuffer.f)(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BufferData(&self, target: types::GLenum, size: types::GLsizeiptr, data: *const __gl_imports::raw::c_void, usage: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLsizeiptr, *const __gl_imports::raw::c_void, types::GLenum) -> ()>(self.BufferData.f)(target, size, data, usage) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn BufferSubData(&self, target: types::GLenum, offset: types::GLintptr, size: types::GLsizeiptr, data: *const __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLintptr, types::GLsizeiptr, *const __gl_imports::raw::c_void) -> ()>(self.BufferSubData.f)(target, offset, size, data) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn CheckFramebufferStatus(&self, target: types::GLenum) -> types::GLenum { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum) -> types::GLenum>(self.CheckFramebufferStatus.f)(target) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Clear(&self, mask: types::GLbitfield) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLbitfield) -> ()>(self.Clear.f)(mask) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ClearBufferfi(&self, buffer: types::GLenum, drawbuffer: types::GLint, depth: types::GLfloat, stencil: types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, types::GLfloat, types::GLint) -> ()>(self.ClearBufferfi.f)(buffer, drawbuffer, depth, stencil) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ClearBufferfv(&self, buffer: types::GLenum, drawbuffer: types::GLint, value: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, *const types::GLfloat) -> ()>(self.ClearBufferfv.f)(buffer, drawbuffer, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ClearBufferiv(&self, buffer: types::GLenum, drawbuffer: types::GLint, value: *const types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, *const types::GLint) -> ()>(self.ClearBufferiv.f)(buffer, drawbuffer, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ClearBufferuiv(&self, buffer: types::GLenum, drawbuffer: types::GLint, value: *const types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, *const types::GLuint) -> ()>(self.ClearBufferuiv.f)(buffer, drawbuffer, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ClearColor(&self, red: types::GLfloat, green: types::GLfloat, blue: types::GLfloat, alpha: types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLfloat, types::GLfloat, types::GLfloat, types::GLfloat) -> ()>(self.ClearColor.f)(red, green, blue, alpha) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ClearDepthf(&self, d: types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLfloat) -> ()>(self.ClearDepthf.f)(d) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ClearStencil(&self, s: types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint) -> ()>(self.ClearStencil.f)(s) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ClientWaitSync(&self, sync: types::GLsync, flags: types::GLbitfield, timeout: types::GLuint64) -> types::GLenum { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsync, types::GLbitfield, types::GLuint64) -> types::GLenum>(self.ClientWaitSync.f)(sync, flags, timeout) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ColorMask(&self, red: types::GLboolean, green: types::GLboolean, blue: types::GLboolean, alpha: types::GLboolean) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLboolean, types::GLboolean, types::GLboolean, types::GLboolean) -> ()>(self.ColorMask.f)(red, green, blue, alpha) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn CompileShader(&self, shader: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> ()>(self.CompileShader.f)(shader) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn CompressedTexImage2D(&self, target: types::GLenum, level: types::GLint, internalformat: types::GLenum, width: types::GLsizei, height: types::GLsizei, border: types::GLint, imageSize: types::GLsizei, data: *const __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, types::GLenum, types::GLsizei, types::GLsizei, types::GLint, types::GLsizei, *const __gl_imports::raw::c_void) -> ()>(self.CompressedTexImage2D.f)(target, level, internalformat, width, height, border, imageSize, data) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn CompressedTexImage3D(&self, target: types::GLenum, level: types::GLint, internalformat: types::GLenum, width: types::GLsizei, height: types::GLsizei, depth: types::GLsizei, border: types::GLint, imageSize: types::GLsizei, data: *const __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, types::GLenum, types::GLsizei, types::GLsizei, types::GLsizei, types::GLint, types::GLsizei, *const __gl_imports::raw::c_void) -> ()>(self.CompressedTexImage3D.f)(target, level, internalformat, width, height, depth, border, imageSize, data) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn CompressedTexSubImage2D(&self, target: types::GLenum, level: types::GLint, xoffset: types::GLint, yoffset: types::GLint, width: types::GLsizei, height: types::GLsizei, format: types::GLenum, imageSize: types::GLsizei, data: *const __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, types::GLint, types::GLint, types::GLsizei, types::GLsizei, types::GLenum, types::GLsizei, *const __gl_imports::raw::c_void) -> ()>(self.CompressedTexSubImage2D.f)(target, level, xoffset, yoffset, width, height, format, imageSize, data) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn CompressedTexSubImage3D(&self, target: types::GLenum, level: types::GLint, xoffset: types::GLint, yoffset: types::GLint, zoffset: types::GLint, width: types::GLsizei, height: types::GLsizei, depth: types::GLsizei, format: types::GLenum, imageSize: types::GLsizei, data: *const __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, types::GLint, types::GLint, types::GLint, types::GLsizei, types::GLsizei, types::GLsizei, types::GLenum, types::GLsizei, *const __gl_imports::raw::c_void) -> ()>(self.CompressedTexSubImage3D.f)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn CopyBufferSubData(&self, readTarget: types::GLenum, writeTarget: types::GLenum, readOffset: types::GLintptr, writeOffset: types::GLintptr, size: types::GLsizeiptr) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, types::GLintptr, types::GLintptr, types::GLsizeiptr) -> ()>(self.CopyBufferSubData.f)(readTarget, writeTarget, readOffset, writeOffset, size) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn CopyTexImage2D(&self, target: types::GLenum, level: types::GLint, internalformat: types::GLenum, x: types::GLint, y: types::GLint, width: types::GLsizei, height: types::GLsizei, border: types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, types::GLenum, types::GLint, types::GLint, types::GLsizei, types::GLsizei, types::GLint) -> ()>(self.CopyTexImage2D.f)(target, level, internalformat, x, y, width, height, border) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn CopyTexSubImage2D(&self, target: types::GLenum, level: types::GLint, xoffset: types::GLint, yoffset: types::GLint, x: types::GLint, y: types::GLint, width: types::GLsizei, height: types::GLsizei) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, types::GLint, types::GLint, types::GLint, types::GLint, types::GLsizei, types::GLsizei) -> ()>(self.CopyTexSubImage2D.f)(target, level, xoffset, yoffset, x, y, width, height) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn CopyTexSubImage3D(&self, target: types::GLenum, level: types::GLint, xoffset: types::GLint, yoffset: types::GLint, zoffset: types::GLint, x: types::GLint, y: types::GLint, width: types::GLsizei, height: types::GLsizei) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, types::GLint, types::GLint, types::GLint, types::GLint, types::GLint, types::GLsizei, types::GLsizei) -> ()>(self.CopyTexSubImage3D.f)(target, level, xoffset, yoffset, zoffset, x, y, width, height) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn CreateProgram(&self, ) -> types::GLuint { __gl_imports::mem::transmute::<_, extern "system" fn() -> types::GLuint>(self.CreateProgram.f)() }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn CreateShader(&self, type_: types::GLenum) -> types::GLuint { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum) -> types::GLuint>(self.CreateShader.f)(type_) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn CullFace(&self, mode: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum) -> ()>(self.CullFace.f)(mode) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DeleteBuffers(&self, n: types::GLsizei, buffers: *const types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *const types::GLuint) -> ()>(self.DeleteBuffers.f)(n, buffers) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DeleteFramebuffers(&self, n: types::GLsizei, framebuffers: *const types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *const types::GLuint) -> ()>(self.DeleteFramebuffers.f)(n, framebuffers) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DeleteProgram(&self, program: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> ()>(self.DeleteProgram.f)(program) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DeleteQueries(&self, n: types::GLsizei, ids: *const types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *const types::GLuint) -> ()>(self.DeleteQueries.f)(n, ids) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DeleteRenderbuffers(&self, n: types::GLsizei, renderbuffers: *const types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *const types::GLuint) -> ()>(self.DeleteRenderbuffers.f)(n, renderbuffers) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DeleteSamplers(&self, count: types::GLsizei, samplers: *const types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *const types::GLuint) -> ()>(self.DeleteSamplers.f)(count, samplers) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DeleteShader(&self, shader: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> ()>(self.DeleteShader.f)(shader) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DeleteSync(&self, sync: types::GLsync) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsync) -> ()>(self.DeleteSync.f)(sync) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DeleteTextures(&self, n: types::GLsizei, textures: *const types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *const types::GLuint) -> ()>(self.DeleteTextures.f)(n, textures) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DeleteTransformFeedbacks(&self, n: types::GLsizei, ids: *const types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *const types::GLuint) -> ()>(self.DeleteTransformFeedbacks.f)(n, ids) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DeleteVertexArrays(&self, n: types::GLsizei, arrays: *const types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *const types::GLuint) -> ()>(self.DeleteVertexArrays.f)(n, arrays) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DepthFunc(&self, func: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum) -> ()>(self.DepthFunc.f)(func) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DepthMask(&self, flag: types::GLboolean) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLboolean) -> ()>(self.DepthMask.f)(flag) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DepthRangef(&self, n: types::GLfloat, f: types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLfloat, types::GLfloat) -> ()>(self.DepthRangef.f)(n, f) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DetachShader(&self, program: types::GLuint, shader: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLuint) -> ()>(self.DetachShader.f)(program, shader) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Disable(&self, cap: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum) -> ()>(self.Disable.f)(cap) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DisableVertexAttribArray(&self, index: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> ()>(self.DisableVertexAttribArray.f)(index) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DrawArrays(&self, mode: types::GLenum, first: types::GLint, count: types::GLsizei) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, types::GLsizei) -> ()>(self.DrawArrays.f)(mode, first, count) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DrawArraysInstanced(&self, mode: types::GLenum, first: types::GLint, count: types::GLsizei, instancecount: types::GLsizei) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, types::GLsizei, types::GLsizei) -> ()>(self.DrawArraysInstanced.f)(mode, first, count, instancecount) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DrawBuffers(&self, n: types::GLsizei, bufs: *const types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *const types::GLenum) -> ()>(self.DrawBuffers.f)(n, bufs) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DrawElements(&self, mode: types::GLenum, count: types::GLsizei, type_: types::GLenum, indices: *const __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLsizei, types::GLenum, *const __gl_imports::raw::c_void) -> ()>(self.DrawElements.f)(mode, count, type_, indices) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DrawElementsInstanced(&self, mode: types::GLenum, count: types::GLsizei, type_: types::GLenum, indices: *const __gl_imports::raw::c_void, instancecount: types::GLsizei) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLsizei, types::GLenum, *const __gl_imports::raw::c_void, types::GLsizei) -> ()>(self.DrawElementsInstanced.f)(mode, count, type_, indices, instancecount) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn DrawRangeElements(&self, mode: types::GLenum, start: types::GLuint, end: types::GLuint, count: types::GLsizei, type_: types::GLenum, indices: *const __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLuint, types::GLuint, types::GLsizei, types::GLenum, *const __gl_imports::raw::c_void) -> ()>(self.DrawRangeElements.f)(mode, start, end, count, type_, indices) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Enable(&self, cap: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum) -> ()>(self.Enable.f)(cap) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn EnableVertexAttribArray(&self, index: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> ()>(self.EnableVertexAttribArray.f)(index) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn EndQuery(&self, target: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum) -> ()>(self.EndQuery.f)(target) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn EndTransformFeedback(&self, ) -> () { __gl_imports::mem::transmute::<_, extern "system" fn() -> ()>(self.EndTransformFeedback.f)() }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn FenceSync(&self, condition: types::GLenum, flags: types::GLbitfield) -> types::GLsync { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLbitfield) -> types::GLsync>(self.FenceSync.f)(condition, flags) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Finish(&self, ) -> () { __gl_imports::mem::transmute::<_, extern "system" fn() -> ()>(self.Finish.f)() }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Flush(&self, ) -> () { __gl_imports::mem::transmute::<_, extern "system" fn() -> ()>(self.Flush.f)() }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn FlushMappedBufferRange(&self, target: types::GLenum, offset: types::GLintptr, length: types::GLsizeiptr) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLintptr, types::GLsizeiptr) -> ()>(self.FlushMappedBufferRange.f)(target, offset, length) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn FramebufferRenderbuffer(&self, target: types::GLenum, attachment: types::GLenum, renderbuffertarget: types::GLenum, renderbuffer: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, types::GLenum, types::GLuint) -> ()>(self.FramebufferRenderbuffer.f)(target, attachment, renderbuffertarget, renderbuffer) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn FramebufferTexture2D(&self, target: types::GLenum, attachment: types::GLenum, textarget: types::GLenum, texture: types::GLuint, level: types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, types::GLenum, types::GLuint, types::GLint) -> ()>(self.FramebufferTexture2D.f)(target, attachment, textarget, texture, level) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn FramebufferTextureLayer(&self, target: types::GLenum, attachment: types::GLenum, texture: types::GLuint, level: types::GLint, layer: types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, types::GLuint, types::GLint, types::GLint) -> ()>(self.FramebufferTextureLayer.f)(target, attachment, texture, level, layer) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn FrontFace(&self, mode: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum) -> ()>(self.FrontFace.f)(mode) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GenBuffers(&self, n: types::GLsizei, buffers: *mut types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *mut types::GLuint) -> ()>(self.GenBuffers.f)(n, buffers) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GenFramebuffers(&self, n: types::GLsizei, framebuffers: *mut types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *mut types::GLuint) -> ()>(self.GenFramebuffers.f)(n, framebuffers) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GenQueries(&self, n: types::GLsizei, ids: *mut types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *mut types::GLuint) -> ()>(self.GenQueries.f)(n, ids) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GenRenderbuffers(&self, n: types::GLsizei, renderbuffers: *mut types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *mut types::GLuint) -> ()>(self.GenRenderbuffers.f)(n, renderbuffers) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GenSamplers(&self, count: types::GLsizei, samplers: *mut types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *mut types::GLuint) -> ()>(self.GenSamplers.f)(count, samplers) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GenTextures(&self, n: types::GLsizei, textures: *mut types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *mut types::GLuint) -> ()>(self.GenTextures.f)(n, textures) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GenTransformFeedbacks(&self, n: types::GLsizei, ids: *mut types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *mut types::GLuint) -> ()>(self.GenTransformFeedbacks.f)(n, ids) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GenVertexArrays(&self, n: types::GLsizei, arrays: *mut types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *mut types::GLuint) -> ()>(self.GenVertexArrays.f)(n, arrays) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GenerateMipmap(&self, target: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum) -> ()>(self.GenerateMipmap.f)(target) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetActiveAttrib(&self, program: types::GLuint, index: types::GLuint, bufSize: types::GLsizei, length: *mut types::GLsizei, size: *mut types::GLint, type_: *mut types::GLenum, name: *mut types::GLchar) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLuint, types::GLsizei, *mut types::GLsizei, *mut types::GLint, *mut types::GLenum, *mut types::GLchar) -> ()>(self.GetActiveAttrib.f)(program, index, bufSize, length, size, type_, name) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetActiveUniform(&self, program: types::GLuint, index: types::GLuint, bufSize: types::GLsizei, length: *mut types::GLsizei, size: *mut types::GLint, type_: *mut types::GLenum, name: *mut types::GLchar) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLuint, types::GLsizei, *mut types::GLsizei, *mut types::GLint, *mut types::GLenum, *mut types::GLchar) -> ()>(self.GetActiveUniform.f)(program, index, bufSize, length, size, type_, name) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetActiveUniformBlockName(&self, program: types::GLuint, uniformBlockIndex: types::GLuint, bufSize: types::GLsizei, length: *mut types::GLsizei, uniformBlockName: *mut types::GLchar) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLuint, types::GLsizei, *mut types::GLsizei, *mut types::GLchar) -> ()>(self.GetActiveUniformBlockName.f)(program, uniformBlockIndex, bufSize, length, uniformBlockName) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetActiveUniformBlockiv(&self, program: types::GLuint, uniformBlockIndex: types::GLuint, pname: types::GLenum, params: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLuint, types::GLenum, *mut types::GLint) -> ()>(self.GetActiveUniformBlockiv.f)(program, uniformBlockIndex, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetActiveUniformsiv(&self, program: types::GLuint, uniformCount: types::GLsizei, uniformIndices: *const types::GLuint, pname: types::GLenum, params: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLsizei, *const types::GLuint, types::GLenum, *mut types::GLint) -> ()>(self.GetActiveUniformsiv.f)(program, uniformCount, uniformIndices, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetAttachedShaders(&self, program: types::GLuint, maxCount: types::GLsizei, count: *mut types::GLsizei, shaders: *mut types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLsizei, *mut types::GLsizei, *mut types::GLuint) -> ()>(self.GetAttachedShaders.f)(program, maxCount, count, shaders) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetAttribLocation(&self, program: types::GLuint, name: *const types::GLchar) -> types::GLint { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, *const types::GLchar) -> types::GLint>(self.GetAttribLocation.f)(program, name) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetBooleanv(&self, pname: types::GLenum, data: *mut types::GLboolean) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, *mut types::GLboolean) -> ()>(self.GetBooleanv.f)(pname, data) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetBufferParameteri64v(&self, target: types::GLenum, pname: types::GLenum, params: *mut types::GLint64) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, *mut types::GLint64) -> ()>(self.GetBufferParameteri64v.f)(target, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetBufferParameteriv(&self, target: types::GLenum, pname: types::GLenum, params: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, *mut types::GLint) -> ()>(self.GetBufferParameteriv.f)(target, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetBufferPointerv(&self, target: types::GLenum, pname: types::GLenum, params: *const *mut __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, *const *mut __gl_imports::raw::c_void) -> ()>(self.GetBufferPointerv.f)(target, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetError(&self, ) -> types::GLenum { __gl_imports::mem::transmute::<_, extern "system" fn() -> types::GLenum>(self.GetError.f)() }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetFloatv(&self, pname: types::GLenum, data: *mut types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, *mut types::GLfloat) -> ()>(self.GetFloatv.f)(pname, data) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetFragDataLocation(&self, program: types::GLuint, name: *const types::GLchar) -> types::GLint { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, *const types::GLchar) -> types::GLint>(self.GetFragDataLocation.f)(program, name) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetFramebufferAttachmentParameteriv(&self, target: types::GLenum, attachment: types::GLenum, pname: types::GLenum, params: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, types::GLenum, *mut types::GLint) -> ()>(self.GetFramebufferAttachmentParameteriv.f)(target, attachment, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetInteger64i_v(&self, target: types::GLenum, index: types::GLuint, data: *mut types::GLint64) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLuint, *mut types::GLint64) -> ()>(self.GetInteger64i_v.f)(target, index, data) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetInteger64v(&self, pname: types::GLenum, data: *mut types::GLint64) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, *mut types::GLint64) -> ()>(self.GetInteger64v.f)(pname, data) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetIntegeri_v(&self, target: types::GLenum, index: types::GLuint, data: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLuint, *mut types::GLint) -> ()>(self.GetIntegeri_v.f)(target, index, data) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetIntegerv(&self, pname: types::GLenum, data: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, *mut types::GLint) -> ()>(self.GetIntegerv.f)(pname, data) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetInternalformativ(&self, target: types::GLenum, internalformat: types::GLenum, pname: types::GLenum, bufSize: types::GLsizei, params: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, types::GLenum, types::GLsizei, *mut types::GLint) -> ()>(self.GetInternalformativ.f)(target, internalformat, pname, bufSize, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetProgramBinary(&self, program: types::GLuint, bufSize: types::GLsizei, length: *mut types::GLsizei, binaryFormat: *mut types::GLenum, binary: *mut __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLsizei, *mut types::GLsizei, *mut types::GLenum, *mut __gl_imports::raw::c_void) -> ()>(self.GetProgramBinary.f)(program, bufSize, length, binaryFormat, binary) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetProgramInfoLog(&self, program: types::GLuint, bufSize: types::GLsizei, length: *mut types::GLsizei, infoLog: *mut types::GLchar) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLsizei, *mut types::GLsizei, *mut types::GLchar) -> ()>(self.GetProgramInfoLog.f)(program, bufSize, length, infoLog) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetProgramiv(&self, program: types::GLuint, pname: types::GLenum, params: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLenum, *mut types::GLint) -> ()>(self.GetProgramiv.f)(program, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetQueryObjectuiv(&self, id: types::GLuint, pname: types::GLenum, params: *mut types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLenum, *mut types::GLuint) -> ()>(self.GetQueryObjectuiv.f)(id, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetQueryiv(&self, target: types::GLenum, pname: types::GLenum, params: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, *mut types::GLint) -> ()>(self.GetQueryiv.f)(target, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetRenderbufferParameteriv(&self, target: types::GLenum, pname: types::GLenum, params: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, *mut types::GLint) -> ()>(self.GetRenderbufferParameteriv.f)(target, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetSamplerParameterfv(&self, sampler: types::GLuint, pname: types::GLenum, params: *mut types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLenum, *mut types::GLfloat) -> ()>(self.GetSamplerParameterfv.f)(sampler, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetSamplerParameteriv(&self, sampler: types::GLuint, pname: types::GLenum, params: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLenum, *mut types::GLint) -> ()>(self.GetSamplerParameteriv.f)(sampler, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetShaderInfoLog(&self, shader: types::GLuint, bufSize: types::GLsizei, length: *mut types::GLsizei, infoLog: *mut types::GLchar) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLsizei, *mut types::GLsizei, *mut types::GLchar) -> ()>(self.GetShaderInfoLog.f)(shader, bufSize, length, infoLog) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetShaderPrecisionFormat(&self, shadertype: types::GLenum, precisiontype: types::GLenum, range: *mut types::GLint, precision: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, *mut types::GLint, *mut types::GLint) -> ()>(self.GetShaderPrecisionFormat.f)(shadertype, precisiontype, range, precision) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetShaderSource(&self, shader: types::GLuint, bufSize: types::GLsizei, length: *mut types::GLsizei, source: *mut types::GLchar) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLsizei, *mut types::GLsizei, *mut types::GLchar) -> ()>(self.GetShaderSource.f)(shader, bufSize, length, source) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetShaderiv(&self, shader: types::GLuint, pname: types::GLenum, params: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLenum, *mut types::GLint) -> ()>(self.GetShaderiv.f)(shader, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetString(&self, name: types::GLenum) -> *const types::GLubyte { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum) -> *const types::GLubyte>(self.GetString.f)(name) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetStringi(&self, name: types::GLenum, index: types::GLuint) -> *const types::GLubyte { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLuint) -> *const types::GLubyte>(self.GetStringi.f)(name, index) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetSynciv(&self, sync: types::GLsync, pname: types::GLenum, bufSize: types::GLsizei, length: *mut types::GLsizei, values: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsync, types::GLenum, types::GLsizei, *mut types::GLsizei, *mut types::GLint) -> ()>(self.GetSynciv.f)(sync, pname, bufSize, length, values) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetTexParameterfv(&self, target: types::GLenum, pname: types::GLenum, params: *mut types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, *mut types::GLfloat) -> ()>(self.GetTexParameterfv.f)(target, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetTexParameteriv(&self, target: types::GLenum, pname: types::GLenum, params: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, *mut types::GLint) -> ()>(self.GetTexParameteriv.f)(target, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetTransformFeedbackVarying(&self, program: types::GLuint, index: types::GLuint, bufSize: types::GLsizei, length: *mut types::GLsizei, size: *mut types::GLsizei, type_: *mut types::GLenum, name: *mut types::GLchar) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLuint, types::GLsizei, *mut types::GLsizei, *mut types::GLsizei, *mut types::GLenum, *mut types::GLchar) -> ()>(self.GetTransformFeedbackVarying.f)(program, index, bufSize, length, size, type_, name) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetUniformBlockIndex(&self, program: types::GLuint, uniformBlockName: *const types::GLchar) -> types::GLuint { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, *const types::GLchar) -> types::GLuint>(self.GetUniformBlockIndex.f)(program, uniformBlockName) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetUniformIndices(&self, program: types::GLuint, uniformCount: types::GLsizei, uniformNames: *const *const types::GLchar, uniformIndices: *mut types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLsizei, *const *const types::GLchar, *mut types::GLuint) -> ()>(self.GetUniformIndices.f)(program, uniformCount, uniformNames, uniformIndices) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetUniformLocation(&self, program: types::GLuint, name: *const types::GLchar) -> types::GLint { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, *const types::GLchar) -> types::GLint>(self.GetUniformLocation.f)(program, name) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetUniformfv(&self, program: types::GLuint, location: types::GLint, params: *mut types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLint, *mut types::GLfloat) -> ()>(self.GetUniformfv.f)(program, location, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetUniformiv(&self, program: types::GLuint, location: types::GLint, params: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLint, *mut types::GLint) -> ()>(self.GetUniformiv.f)(program, location, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetUniformuiv(&self, program: types::GLuint, location: types::GLint, params: *mut types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLint, *mut types::GLuint) -> ()>(self.GetUniformuiv.f)(program, location, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetVertexAttribIiv(&self, index: types::GLuint, pname: types::GLenum, params: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLenum, *mut types::GLint) -> ()>(self.GetVertexAttribIiv.f)(index, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetVertexAttribIuiv(&self, index: types::GLuint, pname: types::GLenum, params: *mut types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLenum, *mut types::GLuint) -> ()>(self.GetVertexAttribIuiv.f)(index, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetVertexAttribPointerv(&self, index: types::GLuint, pname: types::GLenum, pointer: *const *mut __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLenum, *const *mut __gl_imports::raw::c_void) -> ()>(self.GetVertexAttribPointerv.f)(index, pname, pointer) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetVertexAttribfv(&self, index: types::GLuint, pname: types::GLenum, params: *mut types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLenum, *mut types::GLfloat) -> ()>(self.GetVertexAttribfv.f)(index, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn GetVertexAttribiv(&self, index: types::GLuint, pname: types::GLenum, params: *mut types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLenum, *mut types::GLint) -> ()>(self.GetVertexAttribiv.f)(index, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Hint(&self, target: types::GLenum, mode: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum) -> ()>(self.Hint.f)(target, mode) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn InvalidateFramebuffer(&self, target: types::GLenum, numAttachments: types::GLsizei, attachments: *const types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLsizei, *const types::GLenum) -> ()>(self.InvalidateFramebuffer.f)(target, numAttachments, attachments) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn InvalidateSubFramebuffer(&self, target: types::GLenum, numAttachments: types::GLsizei, attachments: *const types::GLenum, x: types::GLint, y: types::GLint, width: types::GLsizei, height: types::GLsizei) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLsizei, *const types::GLenum, types::GLint, types::GLint, types::GLsizei, types::GLsizei) -> ()>(self.InvalidateSubFramebuffer.f)(target, numAttachments, attachments, x, y, width, height) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn IsBuffer(&self, buffer: types::GLuint) -> types::GLboolean { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> types::GLboolean>(self.IsBuffer.f)(buffer) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn IsEnabled(&self, cap: types::GLenum) -> types::GLboolean { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum) -> types::GLboolean>(self.IsEnabled.f)(cap) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn IsFramebuffer(&self, framebuffer: types::GLuint) -> types::GLboolean { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> types::GLboolean>(self.IsFramebuffer.f)(framebuffer) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn IsProgram(&self, program: types::GLuint) -> types::GLboolean { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> types::GLboolean>(self.IsProgram.f)(program) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn IsQuery(&self, id: types::GLuint) -> types::GLboolean { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> types::GLboolean>(self.IsQuery.f)(id) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn IsRenderbuffer(&self, renderbuffer: types::GLuint) -> types::GLboolean { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> types::GLboolean>(self.IsRenderbuffer.f)(renderbuffer) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn IsSampler(&self, sampler: types::GLuint) -> types::GLboolean { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> types::GLboolean>(self.IsSampler.f)(sampler) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn IsShader(&self, shader: types::GLuint) -> types::GLboolean { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> types::GLboolean>(self.IsShader.f)(shader) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn IsSync(&self, sync: types::GLsync) -> types::GLboolean { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsync) -> types::GLboolean>(self.IsSync.f)(sync) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn IsTexture(&self, texture: types::GLuint) -> types::GLboolean { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> types::GLboolean>(self.IsTexture.f)(texture) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn IsTransformFeedback(&self, id: types::GLuint) -> types::GLboolean { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> types::GLboolean>(self.IsTransformFeedback.f)(id) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn IsVertexArray(&self, array: types::GLuint) -> types::GLboolean { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> types::GLboolean>(self.IsVertexArray.f)(array) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn LineWidth(&self, width: types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLfloat) -> ()>(self.LineWidth.f)(width) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn LinkProgram(&self, program: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> ()>(self.LinkProgram.f)(program) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn MapBufferRange(&self, target: types::GLenum, offset: types::GLintptr, length: types::GLsizeiptr, access: types::GLbitfield) -> *mut __gl_imports::raw::c_void { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLintptr, types::GLsizeiptr, types::GLbitfield) -> *mut __gl_imports::raw::c_void>(self.MapBufferRange.f)(target, offset, length, access) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn PauseTransformFeedback(&self, ) -> () { __gl_imports::mem::transmute::<_, extern "system" fn() -> ()>(self.PauseTransformFeedback.f)() }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn PixelStorei(&self, pname: types::GLenum, param: types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint) -> ()>(self.PixelStorei.f)(pname, param) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn PolygonOffset(&self, factor: types::GLfloat, units: types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLfloat, types::GLfloat) -> ()>(self.PolygonOffset.f)(factor, units) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ProgramBinary(&self, program: types::GLuint, binaryFormat: types::GLenum, binary: *const __gl_imports::raw::c_void, length: types::GLsizei) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLenum, *const __gl_imports::raw::c_void, types::GLsizei) -> ()>(self.ProgramBinary.f)(program, binaryFormat, binary, length) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ProgramParameteri(&self, program: types::GLuint, pname: types::GLenum, value: types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLenum, types::GLint) -> ()>(self.ProgramParameteri.f)(program, pname, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ReadBuffer(&self, src: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum) -> ()>(self.ReadBuffer.f)(src) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ReadPixels(&self, x: types::GLint, y: types::GLint, width: types::GLsizei, height: types::GLsizei, format: types::GLenum, type_: types::GLenum, pixels: *mut __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLint, types::GLsizei, types::GLsizei, types::GLenum, types::GLenum, *mut __gl_imports::raw::c_void) -> ()>(self.ReadPixels.f)(x, y, width, height, format, type_, pixels) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ReleaseShaderCompiler(&self, ) -> () { __gl_imports::mem::transmute::<_, extern "system" fn() -> ()>(self.ReleaseShaderCompiler.f)() }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn RenderbufferStorage(&self, target: types::GLenum, internalformat: types::GLenum, width: types::GLsizei, height: types::GLsizei) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, types::GLsizei, types::GLsizei) -> ()>(self.RenderbufferStorage.f)(target, internalformat, width, height) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn RenderbufferStorageMultisample(&self, target: types::GLenum, samples: types::GLsizei, internalformat: types::GLenum, width: types::GLsizei, height: types::GLsizei) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLsizei, types::GLenum, types::GLsizei, types::GLsizei) -> ()>(self.RenderbufferStorageMultisample.f)(target, samples, internalformat, width, height) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ResumeTransformFeedback(&self, ) -> () { __gl_imports::mem::transmute::<_, extern "system" fn() -> ()>(self.ResumeTransformFeedback.f)() }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn SampleCoverage(&self, value: types::GLfloat, invert: types::GLboolean) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLfloat, types::GLboolean) -> ()>(self.SampleCoverage.f)(value, invert) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn SamplerParameterf(&self, sampler: types::GLuint, pname: types::GLenum, param: types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLenum, types::GLfloat) -> ()>(self.SamplerParameterf.f)(sampler, pname, param) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn SamplerParameterfv(&self, sampler: types::GLuint, pname: types::GLenum, param: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLenum, *const types::GLfloat) -> ()>(self.SamplerParameterfv.f)(sampler, pname, param) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn SamplerParameteri(&self, sampler: types::GLuint, pname: types::GLenum, param: types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLenum, types::GLint) -> ()>(self.SamplerParameteri.f)(sampler, pname, param) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn SamplerParameteriv(&self, sampler: types::GLuint, pname: types::GLenum, param: *const types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLenum, *const types::GLint) -> ()>(self.SamplerParameteriv.f)(sampler, pname, param) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Scissor(&self, x: types::GLint, y: types::GLint, width: types::GLsizei, height: types::GLsizei) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLint, types::GLsizei, types::GLsizei) -> ()>(self.Scissor.f)(x, y, width, height) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ShaderBinary(&self, count: types::GLsizei, shaders: *const types::GLuint, binaryformat: types::GLenum, binary: *const __gl_imports::raw::c_void, length: types::GLsizei) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsizei, *const types::GLuint, types::GLenum, *const __gl_imports::raw::c_void, types::GLsizei) -> ()>(self.ShaderBinary.f)(count, shaders, binaryformat, binary, length) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ShaderSource(&self, shader: types::GLuint, count: types::GLsizei, string: *const *const types::GLchar, length: *const types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLsizei, *const *const types::GLchar, *const types::GLint) -> ()>(self.ShaderSource.f)(shader, count, string, length) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn StencilFunc(&self, func: types::GLenum, ref_: types::GLint, mask: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, types::GLuint) -> ()>(self.StencilFunc.f)(func, ref_, mask) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn StencilFuncSeparate(&self, face: types::GLenum, func: types::GLenum, ref_: types::GLint, mask: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, types::GLint, types::GLuint) -> ()>(self.StencilFuncSeparate.f)(face, func, ref_, mask) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn StencilMask(&self, mask: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> ()>(self.StencilMask.f)(mask) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn StencilMaskSeparate(&self, face: types::GLenum, mask: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLuint) -> ()>(self.StencilMaskSeparate.f)(face, mask) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn StencilOp(&self, fail: types::GLenum, zfail: types::GLenum, zpass: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, types::GLenum) -> ()>(self.StencilOp.f)(fail, zfail, zpass) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn StencilOpSeparate(&self, face: types::GLenum, sfail: types::GLenum, dpfail: types::GLenum, dppass: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, types::GLenum, types::GLenum) -> ()>(self.StencilOpSeparate.f)(face, sfail, dpfail, dppass) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn TexImage2D(&self, target: types::GLenum, level: types::GLint, internalformat: types::GLint, width: types::GLsizei, height: types::GLsizei, border: types::GLint, format: types::GLenum, type_: types::GLenum, pixels: *const __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, types::GLint, types::GLsizei, types::GLsizei, types::GLint, types::GLenum, types::GLenum, *const __gl_imports::raw::c_void) -> ()>(self.TexImage2D.f)(target, level, internalformat, width, height, border, format, type_, pixels) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn TexImage3D(&self, target: types::GLenum, level: types::GLint, internalformat: types::GLint, width: types::GLsizei, height: types::GLsizei, depth: types::GLsizei, border: types::GLint, format: types::GLenum, type_: types::GLenum, pixels: *const __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, types::GLint, types::GLsizei, types::GLsizei, types::GLsizei, types::GLint, types::GLenum, types::GLenum, *const __gl_imports::raw::c_void) -> ()>(self.TexImage3D.f)(target, level, internalformat, width, height, depth, border, format, type_, pixels) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn TexParameterf(&self, target: types::GLenum, pname: types::GLenum, param: types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, types::GLfloat) -> ()>(self.TexParameterf.f)(target, pname, param) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn TexParameterfv(&self, target: types::GLenum, pname: types::GLenum, params: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, *const types::GLfloat) -> ()>(self.TexParameterfv.f)(target, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn TexParameteri(&self, target: types::GLenum, pname: types::GLenum, param: types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, types::GLint) -> ()>(self.TexParameteri.f)(target, pname, param) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn TexParameteriv(&self, target: types::GLenum, pname: types::GLenum, params: *const types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLenum, *const types::GLint) -> ()>(self.TexParameteriv.f)(target, pname, params) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn TexStorage2D(&self, target: types::GLenum, levels: types::GLsizei, internalformat: types::GLenum, width: types::GLsizei, height: types::GLsizei) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLsizei, types::GLenum, types::GLsizei, types::GLsizei) -> ()>(self.TexStorage2D.f)(target, levels, internalformat, width, height) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn TexStorage3D(&self, target: types::GLenum, levels: types::GLsizei, internalformat: types::GLenum, width: types::GLsizei, height: types::GLsizei, depth: types::GLsizei) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLsizei, types::GLenum, types::GLsizei, types::GLsizei, types::GLsizei) -> ()>(self.TexStorage3D.f)(target, levels, internalformat, width, height, depth) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn TexSubImage2D(&self, target: types::GLenum, level: types::GLint, xoffset: types::GLint, yoffset: types::GLint, width: types::GLsizei, height: types::GLsizei, format: types::GLenum, type_: types::GLenum, pixels: *const __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, types::GLint, types::GLint, types::GLsizei, types::GLsizei, types::GLenum, types::GLenum, *const __gl_imports::raw::c_void) -> ()>(self.TexSubImage2D.f)(target, level, xoffset, yoffset, width, height, format, type_, pixels) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn TexSubImage3D(&self, target: types::GLenum, level: types::GLint, xoffset: types::GLint, yoffset: types::GLint, zoffset: types::GLint, width: types::GLsizei, height: types::GLsizei, depth: types::GLsizei, format: types::GLenum, type_: types::GLenum, pixels: *const __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum, types::GLint, types::GLint, types::GLint, types::GLint, types::GLsizei, types::GLsizei, types::GLsizei, types::GLenum, types::GLenum, *const __gl_imports::raw::c_void) -> ()>(self.TexSubImage3D.f)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type_, pixels) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn TransformFeedbackVaryings(&self, program: types::GLuint, count: types::GLsizei, varyings: *const *const types::GLchar, bufferMode: types::GLenum) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLsizei, *const *const types::GLchar, types::GLenum) -> ()>(self.TransformFeedbackVaryings.f)(program, count, varyings, bufferMode) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform1f(&self, location: types::GLint, v0: types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLfloat) -> ()>(self.Uniform1f.f)(location, v0) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform1fv(&self, location: types::GLint, count: types::GLsizei, value: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, *const types::GLfloat) -> ()>(self.Uniform1fv.f)(location, count, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform1i(&self, location: types::GLint, v0: types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLint) -> ()>(self.Uniform1i.f)(location, v0) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform1iv(&self, location: types::GLint, count: types::GLsizei, value: *const types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, *const types::GLint) -> ()>(self.Uniform1iv.f)(location, count, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform1ui(&self, location: types::GLint, v0: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLuint) -> ()>(self.Uniform1ui.f)(location, v0) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform1uiv(&self, location: types::GLint, count: types::GLsizei, value: *const types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, *const types::GLuint) -> ()>(self.Uniform1uiv.f)(location, count, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform2f(&self, location: types::GLint, v0: types::GLfloat, v1: types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLfloat, types::GLfloat) -> ()>(self.Uniform2f.f)(location, v0, v1) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform2fv(&self, location: types::GLint, count: types::GLsizei, value: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, *const types::GLfloat) -> ()>(self.Uniform2fv.f)(location, count, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform2i(&self, location: types::GLint, v0: types::GLint, v1: types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLint, types::GLint) -> ()>(self.Uniform2i.f)(location, v0, v1) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform2iv(&self, location: types::GLint, count: types::GLsizei, value: *const types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, *const types::GLint) -> ()>(self.Uniform2iv.f)(location, count, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform2ui(&self, location: types::GLint, v0: types::GLuint, v1: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLuint, types::GLuint) -> ()>(self.Uniform2ui.f)(location, v0, v1) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform2uiv(&self, location: types::GLint, count: types::GLsizei, value: *const types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, *const types::GLuint) -> ()>(self.Uniform2uiv.f)(location, count, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform3f(&self, location: types::GLint, v0: types::GLfloat, v1: types::GLfloat, v2: types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLfloat, types::GLfloat, types::GLfloat) -> ()>(self.Uniform3f.f)(location, v0, v1, v2) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform3fv(&self, location: types::GLint, count: types::GLsizei, value: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, *const types::GLfloat) -> ()>(self.Uniform3fv.f)(location, count, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform3i(&self, location: types::GLint, v0: types::GLint, v1: types::GLint, v2: types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLint, types::GLint, types::GLint) -> ()>(self.Uniform3i.f)(location, v0, v1, v2) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform3iv(&self, location: types::GLint, count: types::GLsizei, value: *const types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, *const types::GLint) -> ()>(self.Uniform3iv.f)(location, count, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform3ui(&self, location: types::GLint, v0: types::GLuint, v1: types::GLuint, v2: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLuint, types::GLuint, types::GLuint) -> ()>(self.Uniform3ui.f)(location, v0, v1, v2) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform3uiv(&self, location: types::GLint, count: types::GLsizei, value: *const types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, *const types::GLuint) -> ()>(self.Uniform3uiv.f)(location, count, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform4f(&self, location: types::GLint, v0: types::GLfloat, v1: types::GLfloat, v2: types::GLfloat, v3: types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLfloat, types::GLfloat, types::GLfloat, types::GLfloat) -> ()>(self.Uniform4f.f)(location, v0, v1, v2, v3) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform4fv(&self, location: types::GLint, count: types::GLsizei, value: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, *const types::GLfloat) -> ()>(self.Uniform4fv.f)(location, count, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform4i(&self, location: types::GLint, v0: types::GLint, v1: types::GLint, v2: types::GLint, v3: types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLint, types::GLint, types::GLint, types::GLint) -> ()>(self.Uniform4i.f)(location, v0, v1, v2, v3) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform4iv(&self, location: types::GLint, count: types::GLsizei, value: *const types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, *const types::GLint) -> ()>(self.Uniform4iv.f)(location, count, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform4ui(&self, location: types::GLint, v0: types::GLuint, v1: types::GLuint, v2: types::GLuint, v3: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLuint, types::GLuint, types::GLuint, types::GLuint) -> ()>(self.Uniform4ui.f)(location, v0, v1, v2, v3) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Uniform4uiv(&self, location: types::GLint, count: types::GLsizei, value: *const types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, *const types::GLuint) -> ()>(self.Uniform4uiv.f)(location, count, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn UniformBlockBinding(&self, program: types::GLuint, uniformBlockIndex: types::GLuint, uniformBlockBinding: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLuint, types::GLuint) -> ()>(self.UniformBlockBinding.f)(program, uniformBlockIndex, uniformBlockBinding) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn UniformMatrix2fv(&self, location: types::GLint, count: types::GLsizei, transpose: types::GLboolean, value: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, types::GLboolean, *const types::GLfloat) -> ()>(self.UniformMatrix2fv.f)(location, count, transpose, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn UniformMatrix2x3fv(&self, location: types::GLint, count: types::GLsizei, transpose: types::GLboolean, value: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, types::GLboolean, *const types::GLfloat) -> ()>(self.UniformMatrix2x3fv.f)(location, count, transpose, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn UniformMatrix2x4fv(&self, location: types::GLint, count: types::GLsizei, transpose: types::GLboolean, value: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, types::GLboolean, *const types::GLfloat) -> ()>(self.UniformMatrix2x4fv.f)(location, count, transpose, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn UniformMatrix3fv(&self, location: types::GLint, count: types::GLsizei, transpose: types::GLboolean, value: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, types::GLboolean, *const types::GLfloat) -> ()>(self.UniformMatrix3fv.f)(location, count, transpose, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn UniformMatrix3x2fv(&self, location: types::GLint, count: types::GLsizei, transpose: types::GLboolean, value: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, types::GLboolean, *const types::GLfloat) -> ()>(self.UniformMatrix3x2fv.f)(location, count, transpose, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn UniformMatrix3x4fv(&self, location: types::GLint, count: types::GLsizei, transpose: types::GLboolean, value: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, types::GLboolean, *const types::GLfloat) -> ()>(self.UniformMatrix3x4fv.f)(location, count, transpose, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn UniformMatrix4fv(&self, location: types::GLint, count: types::GLsizei, transpose: types::GLboolean, value: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, types::GLboolean, *const types::GLfloat) -> ()>(self.UniformMatrix4fv.f)(location, count, transpose, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn UniformMatrix4x2fv(&self, location: types::GLint, count: types::GLsizei, transpose: types::GLboolean, value: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, types::GLboolean, *const types::GLfloat) -> ()>(self.UniformMatrix4x2fv.f)(location, count, transpose, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn UniformMatrix4x3fv(&self, location: types::GLint, count: types::GLsizei, transpose: types::GLboolean, value: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLsizei, types::GLboolean, *const types::GLfloat) -> ()>(self.UniformMatrix4x3fv.f)(location, count, transpose, value) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn UnmapBuffer(&self, target: types::GLenum) -> types::GLboolean { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLenum) -> types::GLboolean>(self.UnmapBuffer.f)(target) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn UseProgram(&self, program: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> ()>(self.UseProgram.f)(program) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn ValidateProgram(&self, program: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint) -> ()>(self.ValidateProgram.f)(program) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn VertexAttrib1f(&self, index: types::GLuint, x: types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLfloat) -> ()>(self.VertexAttrib1f.f)(index, x) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn VertexAttrib1fv(&self, index: types::GLuint, v: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, *const types::GLfloat) -> ()>(self.VertexAttrib1fv.f)(index, v) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn VertexAttrib2f(&self, index: types::GLuint, x: types::GLfloat, y: types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLfloat, types::GLfloat) -> ()>(self.VertexAttrib2f.f)(index, x, y) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn VertexAttrib2fv(&self, index: types::GLuint, v: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, *const types::GLfloat) -> ()>(self.VertexAttrib2fv.f)(index, v) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn VertexAttrib3f(&self, index: types::GLuint, x: types::GLfloat, y: types::GLfloat, z: types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLfloat, types::GLfloat, types::GLfloat) -> ()>(self.VertexAttrib3f.f)(index, x, y, z) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn VertexAttrib3fv(&self, index: types::GLuint, v: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, *const types::GLfloat) -> ()>(self.VertexAttrib3fv.f)(index, v) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn VertexAttrib4f(&self, index: types::GLuint, x: types::GLfloat, y: types::GLfloat, z: types::GLfloat, w: types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLfloat, types::GLfloat, types::GLfloat, types::GLfloat) -> ()>(self.VertexAttrib4f.f)(index, x, y, z, w) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn VertexAttrib4fv(&self, index: types::GLuint, v: *const types::GLfloat) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, *const types::GLfloat) -> ()>(self.VertexAttrib4fv.f)(index, v) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn VertexAttribDivisor(&self, index: types::GLuint, divisor: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLuint) -> ()>(self.VertexAttribDivisor.f)(index, divisor) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn VertexAttribI4i(&self, index: types::GLuint, x: types::GLint, y: types::GLint, z: types::GLint, w: types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLint, types::GLint, types::GLint, types::GLint) -> ()>(self.VertexAttribI4i.f)(index, x, y, z, w) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn VertexAttribI4iv(&self, index: types::GLuint, v: *const types::GLint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, *const types::GLint) -> ()>(self.VertexAttribI4iv.f)(index, v) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn VertexAttribI4ui(&self, index: types::GLuint, x: types::GLuint, y: types::GLuint, z: types::GLuint, w: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLuint, types::GLuint, types::GLuint, types::GLuint) -> ()>(self.VertexAttribI4ui.f)(index, x, y, z, w) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn VertexAttribI4uiv(&self, index: types::GLuint, v: *const types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, *const types::GLuint) -> ()>(self.VertexAttribI4uiv.f)(index, v) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn VertexAttribIPointer(&self, index: types::GLuint, size: types::GLint, type_: types::GLenum, stride: types::GLsizei, pointer: *const __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLint, types::GLenum, types::GLsizei, *const __gl_imports::raw::c_void) -> ()>(self.VertexAttribIPointer.f)(index, size, type_, stride, pointer) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn VertexAttribPointer(&self, index: types::GLuint, size: types::GLint, type_: types::GLenum, normalized: types::GLboolean, stride: types::GLsizei, pointer: *const __gl_imports::raw::c_void) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLuint, types::GLint, types::GLenum, types::GLboolean, types::GLsizei, *const __gl_imports::raw::c_void) -> ()>(self.VertexAttribPointer.f)(index, size, type_, normalized, stride, pointer) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn Viewport(&self, x: types::GLint, y: types::GLint, width: types::GLsizei, height: types::GLsizei) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLint, types::GLsizei, types::GLsizei) -> ()>(self.Viewport.f)(x, y, width, height) }
+#[allow(non_snake_case, unused_variables, dead_code)]
+ #[inline] pub unsafe fn WaitSync(&self, sync: types::GLsync, flags: types::GLbitfield, timeout: types::GLuint64) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLsync, types::GLbitfield, types::GLuint64) -> ()>(self.WaitSync.f)(sync, flags, timeout) }
+}
+
+ unsafe impl __gl_imports::Send for Gles2 {}
diff --git a/src/framework/graphics.rs b/src/framework/graphics.rs
index 9dbd845..6e69c6c 100644
--- a/src/framework/graphics.rs
+++ b/src/framework/graphics.rs
@@ -60,6 +60,14 @@ pub fn screen_size(ctx: &mut Context) -> (f32, f32) {
ctx.screen_size
}
+pub fn screen_insets(ctx: &mut Context) -> (f32, f32, f32, f32) {
+ ctx.screen_insets
+}
+
+pub fn screen_insets_scaled(ctx: &mut Context, scale: f32) -> (f32, f32, f32, f32) {
+ (ctx.screen_insets.0 / scale, ctx.screen_insets.1 / scale, ctx.screen_insets.2 / scale, ctx.screen_insets.3 / scale)
+}
+
pub fn set_render_target(ctx: &mut Context, texture: Option<&Box>) -> GameResult {
if let Some(renderer) = ctx.renderer.as_mut() {
return renderer.set_render_target(texture);
@@ -108,9 +116,9 @@ pub fn render_imgui(ctx: &mut Context, draw_data: &imgui::DrawData) -> GameResul
Err(GameError::RenderError("Rendering backend hasn't been initialized yet.".to_string()))
}
-pub fn imgui_prepare_frame(ctx: &Context, ui: &imgui::Ui) -> GameResult {
- if let Some(renderer) = ctx.renderer.as_ref() {
- return renderer.prepare_frame(ui);
+pub fn prepare_draw(ctx: &mut Context) -> GameResult {
+ if let Some(renderer) = ctx.renderer.as_mut() {
+ return renderer.prepare_draw(ctx.screen_size.0, ctx.screen_size.1);
}
Err(GameError::RenderError("Rendering backend hasn't been initialized yet.".to_string()))
diff --git a/src/framework/keyboard.rs b/src/framework/keyboard.rs
index 432f4ef..24db967 100644
--- a/src/framework/keyboard.rs
+++ b/src/framework/keyboard.rs
@@ -165,6 +165,7 @@ pub enum ScanCode {
Mail,
MediaSelect,
MediaStop,
+ Menu,
Minus,
Mute,
MyComputer,
diff --git a/src/framework/mod.rs b/src/framework/mod.rs
index 78d67c8..1ae9e4e 100644
--- a/src/framework/mod.rs
+++ b/src/framework/mod.rs
@@ -1,7 +1,13 @@
pub mod backend;
-#[cfg(feature = "backend_sdl2")]
-pub mod backend_sdl2;
pub mod backend_null;
+#[cfg(feature = "backend-glutin")]
+pub mod backend_opengl;
+#[cfg(feature = "backend-glutin")]
+mod gl;
+#[cfg(feature = "backend-sdl")]
+pub mod backend_sdl2;
+#[cfg(feature = "backend-sokol")]
+pub mod backend_sokol;
pub mod context;
pub mod error;
pub mod filesystem;
diff --git a/src/input/touch_controls.rs b/src/input/touch_controls.rs
index b5dc2bc..585b888 100644
--- a/src/input/touch_controls.rs
+++ b/src/input/touch_controls.rs
@@ -1,8 +1,8 @@
-use crate::framework::context::Context;
-use crate::framework::error::GameResult;
-
use crate::common::Rect;
use crate::engine_constants::EngineConstants;
+use crate::framework::context::Context;
+use crate::framework::error::GameResult;
+use crate::framework::graphics::screen_insets_scaled;
use crate::texture_set::TextureSet;
#[derive(Copy, Clone, PartialEq, Eq)]
@@ -14,67 +14,38 @@ pub enum TouchControlType {
#[derive(Copy, Clone)]
pub struct TouchPoint {
- id: u64,
- touch_id: u64,
- position: (f64, f64),
- last_position: (f64, f64),
+ pub id: u64,
+ pub touch_id: u64,
+ pub position: (f64, f64),
+ pub last_position: (f64, f64),
}
pub struct TouchControls {
pub control_type: TouchControlType,
pub points: Vec,
pub interact_icon: bool,
- touch_id_counter: u64,
- clicks: Vec,
+ pub touch_id_counter: u64,
+ pub clicks: Vec,
}
impl TouchControls {
pub fn new() -> TouchControls {
TouchControls {
control_type: TouchControlType::None,
- touch_id_counter: 0,
- interact_icon: false,
points: Vec::with_capacity(8),
+ interact_icon: false,
+ touch_id_counter: 0,
clicks: Vec::with_capacity(8),
}
}
- /*
- pub fn process_winit_event(&mut self, scale: f32, touch: winit::event::Touch) {
- match touch.phase {
- TouchPhase::Started | TouchPhase::Moved => {
- if let Some(point) = self.points.iter_mut().find(|p| p.id == touch.id) {
- point.last_position = point.position;
- point.position = (touch.location.x / scale as f64, touch.location.y / scale as f64);
- } else {
- self.touch_id_counter = self.touch_id_counter.wrapping_add(1);
-
- let point = TouchPoint {
- id: touch.id,
- touch_id: self.touch_id_counter,
- position: (touch.location.x / scale as f64, touch.location.y / scale as f64),
- last_position: (0.0, 0.0),
- };
- self.points.push(point);
-
- if touch.phase == TouchPhase::Started {
- self.clicks.push(point);
- }
- }
- }
- TouchPhase::Ended | TouchPhase::Cancelled => {
- self.points.retain(|p| p.id != touch.id);
- self.clicks.retain(|p| p.id != touch.id);
- }
- }
- }*/
-
pub fn point_in(&self, bounds: Rect) -> Option {
for point in self.points.iter() {
if (point.position.0 as isize) > bounds.left
&& (point.position.0 as isize) < bounds.right
&& (point.position.1 as isize) > bounds.top
- && (point.position.1 as isize) < bounds.bottom {
+ && (point.position.1 as isize) < bounds.bottom
+ {
return Some(point.touch_id);
}
}
@@ -89,7 +60,8 @@ impl TouchControls {
if (point.position.0 as isize) > bounds.left
&& (point.position.0 as isize) < bounds.right
&& (point.position.1 as isize) > bounds.top
- && (point.position.1 as isize) < bounds.bottom {
+ && (point.position.1 as isize) < bounds.bottom
+ {
point.touch_id = 0;
return true;
@@ -99,11 +71,20 @@ impl TouchControls {
false
}
- pub fn draw(&self, canvas_size: (f32, f32), constants: &EngineConstants, texture_set: &mut TextureSet, ctx: &mut Context) -> GameResult {
+ pub fn draw(
+ &self,
+ canvas_size: (f32, f32),
+ scale: f32,
+ constants: &EngineConstants,
+ texture_set: &mut TextureSet,
+ ctx: &mut Context,
+ ) -> GameResult {
if self.control_type == TouchControlType::Controls {
let batch = texture_set.get_or_load_batch(ctx, constants, "builtin/touch")?;
let color = (255, 255, 255, 160);
+ let (left, _, right, bottom) = screen_insets_scaled(ctx, scale);
+
for x in 0..3 {
for y in 0..3 {
let mut icon_x = x;
@@ -113,21 +94,28 @@ impl TouchControls {
icon_x = 3;
}
- batch.add_rect_tinted(4.0 + 48.0 * x as f32 + 8.0,
- (canvas_size.1 - 4.0 - 48.0 * 3.0) + 48.0 * y as f32 + 8.0,
- color,
- &Rect::new_size(icon_x * 32, icon_y * 32, 32, 32));
+ batch.add_rect_tinted(
+ 4.0 + 48.0 * x as f32 + 8.0 + left,
+ (canvas_size.1 - 4.0 - 48.0 * 3.0) + 48.0 * y as f32 + 8.0 - bottom,
+ color,
+ &Rect::new_size(icon_x * 32, icon_y * 32, 32, 32),
+ );
}
}
+ batch.add_rect_tinted(
+ canvas_size.0 - (4.0 + 48.0) + 8.0 - right,
+ canvas_size.1 - (4.0 + 48.0) + 8.0 - bottom,
+ color,
+ &Rect::new_size(3 * 32, 32, 32, 32),
+ );
- batch.add_rect_tinted(canvas_size.0 - (4.0 + 48.0) + 8.0, canvas_size.1 - (4.0 + 48.0) + 8.0,
- color,
- &Rect::new_size(3 * 32, 32, 32, 32));
-
- batch.add_rect_tinted(canvas_size.0 - (4.0 + 48.0) + 8.0, canvas_size.1 - (4.0 + 48.0) * 2.0 + 8.0,
- color,
- &Rect::new_size(3 * 32, 0, 32, 32));
+ batch.add_rect_tinted(
+ canvas_size.0 - (4.0 + 48.0) + 8.0 - right,
+ canvas_size.1 - (4.0 + 48.0) * 2.0 + 8.0 - bottom,
+ color,
+ &Rect::new_size(3 * 32, 0, 32, 32),
+ );
batch.draw(ctx)?;
}
diff --git a/src/input/touch_player_controller.rs b/src/input/touch_player_controller.rs
index 04b026a..48719bd 100644
--- a/src/input/touch_player_controller.rs
+++ b/src/input/touch_player_controller.rs
@@ -1,9 +1,8 @@
-use crate::framework::context::Context;
-use crate::framework::error::GameResult;
-
-
use crate::bitfield;
use crate::common::Rect;
+use crate::framework::context::Context;
+use crate::framework::error::GameResult;
+use crate::framework::graphics::screen_insets_scaled;
use crate::input::player_controller::PlayerController;
use crate::input::touch_controls::TouchControlType;
use crate::shared_game_state::SharedGameState;
@@ -37,21 +36,21 @@ bitfield! {
impl TouchPlayerController {
pub fn new() -> TouchPlayerController {
- TouchPlayerController {
- state: KeyState(0),
- old_state: KeyState(0),
- trigger: KeyState(0),
- prev_touch_len: 0,
- }
+ TouchPlayerController { state: KeyState(0), old_state: KeyState(0), trigger: KeyState(0), prev_touch_len: 0 }
}
}
impl PlayerController for TouchPlayerController {
- fn update(&mut self, state: &mut SharedGameState, _ctx: &mut Context) -> GameResult {
+ fn update(&mut self, state: &mut SharedGameState, ctx: &mut Context) -> GameResult {
match state.touch_controls.control_type {
TouchControlType::None => {}
TouchControlType::Dialog => {
- self.state.set_jump(state.touch_controls.point_in(Rect::new_size(0, 0, state.canvas_size.0 as isize, state.canvas_size.1 as isize)).is_some());
+ self.state.set_jump(
+ state
+ .touch_controls
+ .point_in(Rect::new_size(0, 0, state.canvas_size.0 as isize, state.canvas_size.1 as isize))
+ .is_some(),
+ );
if state.touch_controls.points.len() > 1 && self.prev_touch_len != state.touch_controls.points.len() {
self.prev_touch_len = state.touch_controls.points.len();
@@ -59,37 +58,152 @@ impl PlayerController for TouchPlayerController {
}
}
TouchControlType::Controls => {
+ let (left, _, right, bottom) = screen_insets_scaled(ctx, state.scale);
+
+ let left = 4 + left as isize;
+ let bottom = 4 + bottom as isize;
+ let right = 4 + right as isize;
+
self.state.0 = 0;
// left
- self.state.set_left(self.state.left() || state.touch_controls.point_in(Rect::new_size(4, state.canvas_size.1 as isize - 4 - 48 * 2, 48, 48)).is_some());
+ self.state.set_left(
+ self.state.left()
+ || state
+ .touch_controls
+ .point_in(Rect::new_size(left, state.canvas_size.1 as isize - bottom - 48 * 2, 48, 48))
+ .is_some(),
+ );
// up
- self.state.set_up(self.state.up() || state.touch_controls.point_in(Rect::new_size(48 + 4, state.canvas_size.1 as isize - 4 - 48 * 3, 48, 48)).is_some());
+ self.state.set_up(
+ self.state.up()
+ || state
+ .touch_controls
+ .point_in(Rect::new_size(48 + left, state.canvas_size.1 as isize - bottom - 48 * 3, 48, 48))
+ .is_some(),
+ );
// right
- self.state.set_right(self.state.right() || state.touch_controls.point_in(Rect::new_size(4 + 48 * 2, state.canvas_size.1 as isize - 4 - 48 * 2, 48, 48)).is_some());
+ self.state.set_right(
+ self.state.right()
+ || state
+ .touch_controls
+ .point_in(Rect::new_size(
+ 48 * 2 + left,
+ state.canvas_size.1 as isize - bottom - 48 * 2,
+ 48,
+ 48,
+ ))
+ .is_some(),
+ );
// down
- self.state.set_down(self.state.down() || state.touch_controls.point_in(Rect::new_size(48 + 4, state.canvas_size.1 as isize - 4 - 48, 48, 48)).is_some());
+ self.state.set_down(
+ self.state.down()
+ || state
+ .touch_controls
+ .point_in(Rect::new_size(48 + left, state.canvas_size.1 as isize - bottom - 48, 48, 48))
+ .is_some(),
+ );
// left+up
- self.state.set_left(self.state.left() || state.touch_controls.point_in(Rect::new_size(4, state.canvas_size.1 as isize - 4 - 48 * 3, 48, 48)).is_some());
- self.state.set_up(self.state.up() || state.touch_controls.point_in(Rect::new_size(4, state.canvas_size.1 as isize - 4 - 48 * 3, 48, 48)).is_some());
+ self.state.set_left(
+ self.state.left()
+ || state
+ .touch_controls
+ .point_in(Rect::new_size(left, state.canvas_size.1 as isize - bottom - 48 * 3, 48, 48))
+ .is_some(),
+ );
+ self.state.set_up(
+ self.state.up()
+ || state
+ .touch_controls
+ .point_in(Rect::new_size(left, state.canvas_size.1 as isize - bottom - 48 * 3, 48, 48))
+ .is_some(),
+ );
// right+up
- self.state.set_right(self.state.right() || state.touch_controls.point_in(Rect::new_size(4 + 48 * 2, state.canvas_size.1 as isize - 4 - 48 * 3, 48, 48)).is_some());
- self.state.set_up(self.state.up() || state.touch_controls.point_in(Rect::new_size(4 + 48 * 2, state.canvas_size.1 as isize - 4 - 48 * 3, 48, 48)).is_some());
+ self.state.set_right(
+ self.state.right()
+ || state
+ .touch_controls
+ .point_in(Rect::new_size(
+ 48 * 2 + left,
+ state.canvas_size.1 as isize - bottom - 48 * 3,
+ 48,
+ 48,
+ ))
+ .is_some(),
+ );
+ self.state.set_up(
+ self.state.up()
+ || state
+ .touch_controls
+ .point_in(Rect::new_size(
+ 48 * 2 + left,
+ state.canvas_size.1 as isize - bottom - 48 * 3,
+ 48,
+ 48,
+ ))
+ .is_some(),
+ );
// left+down
- self.state.set_left(self.state.left() || state.touch_controls.point_in(Rect::new_size(4, state.canvas_size.1 as isize - 48 - 4, 48, 48)).is_some());
- self.state.set_down(self.state.down() || state.touch_controls.point_in(Rect::new_size(4, state.canvas_size.1 as isize - 48 - 4, 48, 48)).is_some());
+ self.state.set_left(
+ self.state.left()
+ || state
+ .touch_controls
+ .point_in(Rect::new_size(left, state.canvas_size.1 as isize - 48 - bottom, 48, 48))
+ .is_some(),
+ );
+ self.state.set_down(
+ self.state.down()
+ || state
+ .touch_controls
+ .point_in(Rect::new_size(left, state.canvas_size.1 as isize - 48 - bottom, 48, 48))
+ .is_some(),
+ );
// right+down
- self.state.set_right(self.state.right() || state.touch_controls.point_in(Rect::new_size(4 + 48 * 2, state.canvas_size.1 as isize - 48 - 4, 48, 48)).is_some());
- self.state.set_down(self.state.down() || state.touch_controls.point_in(Rect::new_size(4 + 48 * 2, state.canvas_size.1 as isize - 48 - 4, 48, 48)).is_some());
+ self.state.set_right(
+ self.state.right()
+ || state
+ .touch_controls
+ .point_in(Rect::new_size(48 * 2 + left, state.canvas_size.1 as isize - 48 - bottom, 48, 48))
+ .is_some(),
+ );
+ self.state.set_down(
+ self.state.down()
+ || state
+ .touch_controls
+ .point_in(Rect::new_size(48 * 2 + left, state.canvas_size.1 as isize - 48 - bottom, 48, 48))
+ .is_some(),
+ );
- self.state.set_jump(self.state.jump() || state.touch_controls.point_in(Rect::new_size(state.canvas_size.0 as isize - 48 - 4, state.canvas_size.1 as isize - 48 - 4, 48, 48)).is_some());
- self.state.set_shoot(self.state.shoot() || state.touch_controls.point_in(Rect::new_size(state.canvas_size.0 as isize - 48 - 4, state.canvas_size.1 as isize - (48 - 4) * 2, 48, 48)).is_some());
+ self.state.set_jump(
+ self.state.jump()
+ || state
+ .touch_controls
+ .point_in(Rect::new_size(
+ state.canvas_size.0 as isize - 48 - right,
+ state.canvas_size.1 as isize - (48 + 4) - bottom,
+ 48,
+ 48,
+ ))
+ .is_some(),
+ );
+ self.state.set_shoot(
+ self.state.shoot()
+ || state
+ .touch_controls
+ .point_in(Rect::new_size(
+ state.canvas_size.0 as isize - 48 - right,
+ state.canvas_size.1 as isize - (48 + 4) * 2 - bottom,
+ 48,
+ 48,
+ ))
+ .is_some(),
+ );
}
}
diff --git a/src/lib.rs b/src/lib.rs
index 4bb03f7..3f4e53d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -10,9 +10,11 @@ extern crate strum_macros;
use std::cell::UnsafeCell;
use std::env;
use std::path::PathBuf;
+use std::sync::Mutex;
use std::time::Instant;
use directories::ProjectDirs;
+use lazy_static::lazy_static;
use log::*;
use pretty_env_logger::env_logger::Env;
@@ -65,6 +67,10 @@ mod text_script;
mod texture_set;
mod weapon;
+lazy_static! {
+ pub static ref GAME_SUSPENDED: Mutex = Mutex::new(false);
+}
+
pub struct Game {
scene: Option>,
state: UnsafeCell,
@@ -98,14 +104,12 @@ impl Game {
TimingMode::_50Hz | TimingMode::_60Hz => {
let last_tick = self.next_tick;
- while self.start_time.elapsed().as_nanos() >= self.next_tick && self.loops < 10
- {
+ while self.start_time.elapsed().as_nanos() >= self.next_tick && self.loops < 10 {
if (state_ref.settings.speed - 1.0).abs() < 0.01 {
self.next_tick += state_ref.timing_mode.get_delta() as u128;
} else {
- self.next_tick += (state_ref.timing_mode.get_delta() as f64
- / state_ref.settings.speed)
- as u128;
+ self.next_tick +=
+ (state_ref.timing_mode.get_delta() as f64 / state_ref.settings.speed) as u128;
}
self.loops += 1;
}
@@ -114,8 +118,7 @@ impl Game {
log::warn!("Frame skip is way too high, a long system lag occurred?");
self.last_tick = self.start_time.elapsed().as_nanos();
self.next_tick = self.last_tick
- + (state_ref.timing_mode.get_delta() as f64 / state_ref.settings.speed)
- as u128;
+ + (state_ref.timing_mode.get_delta() as f64 / state_ref.settings.speed) as u128;
self.loops = 0;
}
@@ -141,152 +144,59 @@ impl Game {
if state_ref.timing_mode != TimingMode::FrameSynchronized {
let mut elapsed = self.start_time.elapsed().as_nanos();
- #[cfg(target_os = "windows")]
- {
- // Even with the non-monotonic Instant mitigation at the start of the event loop, there's still a chance of it not working.
- // This check here should trigger if that happens and makes sure there's no panic from an underflow.
- if elapsed < self.last_tick {
- elapsed = self.last_tick;
- }
+
+ // Even with the non-monotonic Instant mitigation at the start of the event loop, there's still a chance of it not working.
+ // This check here should trigger if that happens and makes sure there's no panic from an underflow.
+ if elapsed < self.last_tick {
+ elapsed = self.last_tick;
}
+
let n1 = (elapsed - self.last_tick) as f64;
let n2 = (self.next_tick - self.last_tick) as f64;
- state_ref.frame_time = if state_ref.settings.motion_interpolation {
- n1 / n2
- } else {
- 1.0
- };
+ state_ref.frame_time = if state_ref.settings.motion_interpolation { n1 / n2 } else { 1.0 };
}
unsafe {
- G_MAG = if state_ref.settings.subpixel_coords {
- state_ref.scale
- } else {
- 1.0
- };
+ G_MAG = if state_ref.settings.subpixel_coords { state_ref.scale } else { 1.0 };
I_MAG = state_ref.scale;
}
self.loops = 0;
+ graphics::prepare_draw(ctx)?;
graphics::clear(ctx, [0.0, 0.0, 0.0, 1.0].into());
- /*graphics::set_projection(ctx, DrawParam::new()
- .scale(Vec2::new(state_ref.scale, state_ref.scale))
- .to_matrix());*/
if let Some(scene) = self.scene.as_mut() {
scene.draw(state_ref, ctx)?;
if state_ref.settings.touch_controls {
state_ref.touch_controls.draw(
state_ref.canvas_size,
+ state_ref.scale,
&state_ref.constants,
&mut state_ref.texture_set,
ctx,
)?;
}
- //graphics::set_projection(ctx, self.def_matrix);
self.ui.draw(state_ref, ctx, scene)?;
}
graphics::present(ctx)?;
+
Ok(())
}
}
#[cfg(target_os = "android")]
-fn request_perms() -> GameResult {
- use jni::objects::JObject;
- use jni::objects::JValue;
-
- let native_activity = ndk_glue::native_activity();
- let vm_ptr = native_activity.vm();
- let vm = unsafe { jni::JavaVM::from_raw(vm_ptr) }?;
- let vm_env = vm.attach_current_thread()?;
-
- fn perm_name<'a, 'b, 'c>(
- vm_env: &'b jni::AttachGuard<'a>,
- name: &'c str,
- ) -> GameResult> {
- let class = vm_env.find_class("android/Manifest$permission")?;
- Ok(vm_env.get_static_field(class, name.to_owned(), "Ljava/lang/String;")?)
- }
-
- fn has_permission(
- vm_env: &jni::AttachGuard,
- activity: &jni::sys::jobject,
- name: &str,
- ) -> GameResult {
- let perm_granted = {
- let class = vm_env.find_class("android/content/pm/PackageManager")?;
- vm_env
- .get_static_field(class, "PERMISSION_GRANTED", "I")?
- .i()?
- };
-
- let perm = perm_name(vm_env, name)?;
- let activity_obj = JObject::from(*activity);
- let result = vm_env
- .call_method(
- activity_obj,
- "checkSelfPermission",
- "(Ljava/lang/String;)I",
- &[perm],
- )?
- .i()?;
- Ok(result == perm_granted)
- }
-
- let str_class = vm_env.find_class("java/lang/String")?;
- let array = vm_env.new_object_array(2, str_class, JObject::null())?;
- vm_env.set_object_array_element(array, 0, perm_name(&vm_env, "READ_EXTERNAL_STORAGE")?.l()?)?;
- vm_env.set_object_array_element(
- array,
- 1,
- perm_name(&vm_env, "WRITE_EXTERNAL_STORAGE")?.l()?,
- )?;
- let activity_obj = JObject::from(native_activity.activity());
-
- loop {
- if has_permission(
- &vm_env,
- &native_activity.activity(),
- "READ_EXTERNAL_STORAGE",
- )? && has_permission(
- &vm_env,
- &native_activity.activity(),
- "WRITE_EXTERNAL_STORAGE",
- )? {
- break;
- }
-
- vm_env.call_method(
- activity_obj,
- "requestPermissions",
- "([Ljava/lang/String;I)V",
- &[JValue::from(array), JValue::from(0)],
- )?;
- }
-
- Ok(())
-}
-
-#[cfg(target_os = "android")]
-#[cfg_attr(target_os = "android", ndk_glue::main(backtrace = "on"))]
+#[cfg_attr(target_os = "android", ndk_glue::main())]
pub fn android_main() {
- println!("main invoked.");
-
- request_perms().expect("Failed to attach to the JVM and request storage permissions.");
-
- env::set_var("CAVESTORY_DATA_DIR", "/sdcard/doukutsu");
-
- let _ = std::fs::create_dir("/sdcard/doukutsu/");
- let _ = std::fs::write("/sdcard/doukutsu/.nomedia", b"");
-
init().unwrap();
}
pub fn init() -> GameResult {
- pretty_env_logger::env_logger::from_env(Env::default().default_filter_or("info")).init();
+ pretty_env_logger::env_logger::from_env(Env::default().default_filter_or("info"))
+ //.filter(Some("ndk_glue"), LevelFilter::Trace)
+ .init();
+ #[cfg(not(target_os = "android"))]
let resource_dir = if let Ok(data_dir) = env::var("CAVESTORY_DATA_DIR") {
PathBuf::from(data_dir)
} else {
@@ -298,51 +208,53 @@ pub fn init() -> GameResult {
resource_dir
};
+ #[cfg(not(target_os = "android"))]
info!("Resource directory: {:?}", resource_dir);
info!("Initializing engine...");
let mut context = Context::new();
mount_vfs(&mut context, Box::new(BuiltinFS::new()));
+
+ #[cfg(not(target_os = "android"))]
mount_vfs(&mut context, Box::new(PhysicalFS::new(&resource_dir, true)));
#[cfg(not(target_os = "android"))]
let project_dirs = match ProjectDirs::from("", "", "doukutsu-rs") {
Some(dirs) => dirs,
None => {
- return Err(GameError::FilesystemError(String::from(
- "No valid home directory path could be retrieved.",
- )));
+ return Err(GameError::FilesystemError(String::from("No valid home directory path could be retrieved.")));
}
};
- mount_user_vfs(
- &mut context,
- Box::new(PhysicalFS::new(project_dirs.data_local_dir(), false)),
- );
-
#[cfg(target_os = "android")]
{
- loop {
- match ndk_glue::native_window().as_ref() {
- Some(_) => {
- println!("NativeScreen Found:{:?}", ndk_glue::native_window());
- break;
- }
- None => (),
- }
- }
+ let mut data_path =
+ PathBuf::from(ndk_glue::native_activity().internal_data_path().to_string_lossy().to_string());
+ let mut user_path = data_path.clone();
+
+ data_path.push("data");
+ user_path.push("saves");
+
+ let _ = std::fs::create_dir_all(&data_path);
+ let _ = std::fs::create_dir_all(&user_path);
+
+ log::info!("Android data directories: data_path={:?} user_path={:?}", &data_path, &user_path);
+
+ mount_vfs(&mut context, Box::new(PhysicalFS::new(&data_path, true)));
+ mount_user_vfs(&mut context, Box::new(PhysicalFS::new(&user_path, false)));
}
- let mut game = Game::new(&mut context)?;
- let state_ref = unsafe { &mut *game.state.get() };
+ #[cfg(not(target_os = "android"))]
+ mount_user_vfs(&mut context, Box::new(PhysicalFS::new(project_dirs.data_local_dir(), false)));
+
+ let game = UnsafeCell::new(Game::new(&mut context)?);
+ let state_ref = unsafe { &mut *((&mut *game.get()).state.get()) };
#[cfg(feature = "scripting")]
{
- state_ref
- .lua
- .update_refs(game.state.get(), &mut context as *mut Context);
+ state_ref.lua.update_refs(unsafe { (&*game.get()).state.get() }, &mut context as *mut Context);
}
state_ref.next_scene = Some(Box::new(LoadingScene::new()));
- context.run(&mut game)?;
+ context.run(unsafe { &mut *game.get() })?;
Ok(())
}
diff --git a/src/scene/loading_scene.rs b/src/scene/loading_scene.rs
index 575e19c..03df7cd 100644
--- a/src/scene/loading_scene.rs
+++ b/src/scene/loading_scene.rs
@@ -45,6 +45,7 @@ impl LoadingScene {
impl Scene for LoadingScene {
fn tick(&mut self, state: &mut SharedGameState, ctx: &mut Context) -> GameResult {
+ println!("**TICK**");
// deferred to let the loading image draw
if self.tick == 1 {
if let Err(err) = self.load_stuff(state, ctx) {
@@ -66,6 +67,8 @@ impl Scene for LoadingScene {
batch.draw(ctx)?;
}
Err(err) => {
+ log::error!("Failed to load game data: {}", err);
+
state.next_scene = Some(Box::new(NoDataScene::new(err)));
}
}
diff --git a/src/scene/title_scene.rs b/src/scene/title_scene.rs
index b5459c0..b054303 100644
--- a/src/scene/title_scene.rs
+++ b/src/scene/title_scene.rs
@@ -182,7 +182,7 @@ impl Scene for TitleScene {
TimingMode::_60Hz => state.timing_mode = TimingMode::_50Hz,
_ => {}
}
- state.settings.save(ctx);
+ let _ = state.settings.save(ctx);
*value = state.timing_mode == TimingMode::_50Hz;
}
@@ -190,7 +190,7 @@ impl Scene for TitleScene {
MenuSelectionResult::Selected(1, toggle) => {
if let MenuEntry::Toggle(_, value) = toggle {
state.settings.shader_effects = !state.settings.shader_effects;
- state.settings.save(ctx);
+ let _ = state.settings.save(ctx);
*value = state.settings.shader_effects;
}
@@ -199,7 +199,7 @@ impl Scene for TitleScene {
if let MenuEntry::Toggle(_, value) = toggle {
state.settings.original_textures = !state.settings.original_textures;
state.reload_textures();
- state.settings.save(ctx);
+ let _ = state.settings.save(ctx);
*value = state.settings.original_textures;
}
@@ -208,7 +208,7 @@ impl Scene for TitleScene {
if let MenuEntry::Toggle(_, value) = toggle {
state.settings.seasonal_textures = !state.settings.seasonal_textures;
state.reload_textures();
- state.settings.save(ctx);
+ let _ = state.settings.save(ctx);
*value = state.settings.seasonal_textures;
}
diff --git a/src/scripting/doukutsu.d.ts b/src/scripting/doukutsu.d.ts
index 60995ed..ccd0575 100644
--- a/src/scripting/doukutsu.d.ts
+++ b/src/scripting/doukutsu.d.ts
@@ -1,7 +1,7 @@
declare type EventHandler = (this: void, param: T) => void;
/**
- * Represents a
+ * Represents an in-game player.
*/
declare interface DoukutsuPlayer {
/**
@@ -28,28 +28,40 @@ declare interface DoukutsuPlayer {
* Current velocity of player in Y axis (as floating point, not internal fixed point representation).
*/
velY(): number;
+
+ /**
+ * Sets the position of player in X axis (as floating point, not internal fixed point representation).
+ */
+ setX(value: number): void;
+
+ /**
+ * Sets the position of player in Y axis (as floating point, not internal fixed point representation).
+ */
+ setY(value: number): void;
+
+ /**
+ * Sets the velocity of player in X axis (as floating point, not internal fixed point representation).
+ */
+ setVelX(value: number): void;
+
+ /**
+ * Sets the velocity of player in Y axis (as floating point, not internal fixed point representation).
+ */
+ setVelY(value: number): void;
+
+
}
-declare interface DoukutsuScene {
+declare interface DoukutsuStage {
/**
- * Returns the tick of current scene.
+ * Returns the tick of current stage.
*/
tick(): number;
- /**
- * Returns a list of players connected to current game.
- */
- onlinePlayers(): DoukutsuPlayer[];
-
/**
* Returns a list of players on current map.
*/
- mapPlayers(): DoukutsuPlayer[];
-
- /**
- * Returns the id of local player.
- */
- localPlayerId(): number;
+ players(): DoukutsuPlayer[];
/**
* Returns player with specified id.
@@ -69,6 +81,22 @@ declare namespace doukutsu {
*/
function playMusic(id: number): void;
+ /**
+ * Returns the value of a certain TSC flag.
+ * @param id the flag number
+ */
+ function getFlag(id: number): boolean;
+
+ /**
+ * Returns a list of players connected to current game.
+ */
+ function onlinePlayers(): DoukutsuPlayer[];
+
+ /**
+ * Returns the id of local player.
+ */
+ function localPlayerId(): number;
+
/**
* Sets an implementation-defined game setting.
* @param name
@@ -88,7 +116,7 @@ declare namespace doukutsu {
* @param event event name
* @param handler event handler procedure
*/
- function on(event: "tick", handler: EventHandler): EventHandler;
+ function on(event: "tick", handler: EventHandler): EventHandler;
function on(event: string, handler: EventHandler): EventHandler;
}
diff --git a/src/scripting/doukutsu.rs b/src/scripting/doukutsu.rs
index b757a11..6bc2f41 100644
--- a/src/scripting/doukutsu.rs
+++ b/src/scripting/doukutsu.rs
@@ -35,6 +35,18 @@ impl Doukutsu {
0
}
+ unsafe fn lua_set_setting(&self, state: &mut State) -> c_int {
+ if let Some(index) = state.to_int(2) {
+ let game_state = &mut (*(*self.ptr).state_ptr);
+
+ state.push(game_state.get_flag(index.max(0) as usize));
+ } else {
+ state.push_nil();
+ }
+
+ 1
+ }
+
unsafe fn lua_get_flag(&self, state: &mut State) -> c_int {
if let Some(index) = state.to_int(2) {
let game_state = &mut (*(*self.ptr).state_ptr);
@@ -55,9 +67,9 @@ impl LuaObject for Doukutsu {
fn lua_fns() -> Vec {
vec![
- lua_method!("play_sfx", Doukutsu, Doukutsu::lua_play_sfx),
- lua_method!("play_song", Doukutsu, Doukutsu::lua_play_song),
- lua_method!("get_flag", Doukutsu, Doukutsu::lua_get_flag),
+ lua_method!("playSfx", Doukutsu, Doukutsu::lua_play_sfx),
+ lua_method!("playSong", Doukutsu, Doukutsu::lua_play_song),
+ lua_method!("getFlag", Doukutsu, Doukutsu::lua_get_flag),
]
}
}
diff --git a/src/shared_game_state.rs b/src/shared_game_state.rs
index 9ead5f6..ca3c46f 100644
--- a/src/shared_game_state.rs
+++ b/src/shared_game_state.rs
@@ -222,6 +222,10 @@ impl SharedGameState {
self.texture_set = texture_set;
}
+ pub fn graphics_reset(&mut self) {
+ self.reload_textures();
+ }
+
pub fn start_new_game(&mut self, ctx: &mut Context) -> GameResult {
let mut next_scene = GameScene::new(self, ctx, 13)?;
next_scene.player1.cond.set_alive(true);
diff --git a/src/sound/mod.rs b/src/sound/mod.rs
index 0a35d52..0cfb1b8 100644
--- a/src/sound/mod.rs
+++ b/src/sound/mod.rs
@@ -526,9 +526,29 @@ where
},
err_fn,
)?;
+
stream.play()?;
+ let mut saved_state = true;
loop {
std::thread::sleep(Duration::from_millis(10));
+
+ {
+ let mutex = crate::GAME_SUSPENDED.lock().unwrap();
+ let state = *mutex;
+ if saved_state != state {
+ saved_state = state;
+
+ if state {
+ if let Err(e) = stream.pause() {
+ log::error!("Failed to pause the stream: {}", e);
+ }
+ } else {
+ if let Err(e) = stream.play() {
+ log::error!("Failed to unpause the stream: {}", e);
+ }
+ }
+ }
+ }
}
}
diff --git a/src/text_script.rs b/src/text_script.rs
index 5845dcf..3d16a44 100644
--- a/src/text_script.rs
+++ b/src/text_script.rs
@@ -729,7 +729,7 @@ impl TextScriptVM {
FromPrimitive::from_i32(read_cur_varint(&mut cursor).unwrap_or_else(|_| OpCode::END as i32));
if let Some(op) = op_maybe {
- println!("opcode: {:?}", op);
+ log::info!("opcode: {:?}", op);
match op {
OpCode::_NOP => {
exec_state = TextScriptExecutionState::Running(event, cursor.position() as u32);