Initial commit - some engine bugs stopping compiling

This commit is contained in:
Will
2026-03-29 15:52:42 +01:00
commit 3d573a200e
361 changed files with 332759 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
[package]
name = "compile-egl-default-001"
version = "0.1.0"
[[bin]]
path = "test.rs"
name = "test"
[dependencies]
glad-egl = { path = "./glad-egl/" }

View File

@@ -0,0 +1,16 @@
#![deny(warnings)]
/**
* Full EGL should compile
*
* GLAD: $GLAD --out-path=$tmp --api="egl=" rust
* COMPILE: cp -r $test_dir/. $tmp && cd $tmp && cargo build
* RUN: cargo run
*/
extern crate glad_egl;
use glad_egl::egl;
#[allow(path_statements)]
fn main() {
egl::GetProcAddress;
egl::SwapBuffersWithDamageEXT;
}

View File

@@ -0,0 +1,10 @@
[package]
name = "compile-gl-default-001"
version = "0.1.0"
[[bin]]
path = "test.rs"
name = "test"
[dependencies]
glad-gl = { path = "./glad-gl/" }

View File

@@ -0,0 +1,16 @@
#![deny(warnings)]
/**
* Full core GL, should compile
*
* GLAD: $GLAD --out-path=$tmp --api="gl:core=" rust
* COMPILE: cp -r $test_dir/. $tmp && cd $tmp && cargo build
* RUN: cargo run
*/
extern crate glad_gl;
use glad_gl::gl;
#[allow(path_statements)]
fn main() {
gl::Clear;
gl::MultiDrawElementsEXT;
}

View File

@@ -0,0 +1,10 @@
[package]
name = "compile-gl-default-002"
version = "0.1.0"
[[bin]]
path = "test.rs"
name = "test"
[dependencies]
glad-gl = { path = "./glad-gl/" }

View File

@@ -0,0 +1,17 @@
#![deny(warnings)]
/**
* Full compatibility GL, should compile
*
* GLAD: $GLAD --out-path=$tmp --api="gl:compatibility=" rust
* COMPILE: cp -r $test_dir/. $tmp && cd $tmp && cargo build
* RUN: cargo run
*/
extern crate glad_gl;
use glad_gl::gl;
#[allow(path_statements)]
fn main() {
gl::Begin;
gl::Clear;
gl::MultiDrawElementsEXT;
}

View File

@@ -0,0 +1,10 @@
[package]
name = "compile-gl-default-003"
version = "0.1.0"
[[bin]]
path = "test.rs"
name = "test"
[dependencies]
glad-gl = { path = "./glad-gl/" }

View File

@@ -0,0 +1,16 @@
#![deny(warnings)]
/**
* Enums / Constants should not be prefixed.
*
* GLAD: $GLAD --out-path=$tmp --api="gl:core=" rust
* COMPILE: cp -r $test_dir/. $tmp && cd $tmp && cargo build
* RUN: cargo run
*/
extern crate glad_gl;
use glad_gl::gl;
#[allow(path_statements)]
fn main() {
gl::_1PASS_EXT;
gl::ALPHA;
}

View File

@@ -0,0 +1,10 @@
[package]
name = "compile-glx-default-001"
version = "0.1.0"
[[bin]]
path = "test.rs"
name = "test"
[dependencies]
glad-glx = { path = "./glad-glx/" }

View File

@@ -0,0 +1,16 @@
#![deny(warnings)]
/**
* Full GLX, should compile
*
* GLAD: $GLAD --out-path=$tmp --api="glx=" rust
* COMPILE: cp -r $test_dir/. $tmp && cd $tmp && cargo build
* RUN: cargo run
*/
extern crate glad_glx;
use glad_glx::glx;
#[allow(path_statements)]
fn main() {
glx::GetProcAddress;
glx::FreeContextEXT;
}

View File

@@ -0,0 +1,10 @@
[package]
name = "compile-vulkan-default-001"
version = "0.1.0"
[[bin]]
path = "test.rs"
name = "test"
[dependencies]
glad-vulkan = { path = "./glad-vulkan/", features = ["xcb", "macos", "xlib_xrandr", "xlib", "ios", "win32", "wayland", "vi", "android"] }

View File

@@ -0,0 +1,25 @@
#![deny(warnings)]
/**
* Full VK should compile
*
* GLAD: $GLAD --out-path=$tmp --api="vulkan=" --extensions="VK_KHR_swapchain,VK_NV_external_memory_win32,VK_MVK_macos_surface,VK_KHR_wayland_surface,VK_NN_vi_surface,VK_MVK_ios_surface,VK_EXT_acquire_xlib_display,VK_KHR_xcb_surface,VK_ANDROID_external_memory_android_hardware_buffer" rust
* COMPILE: cp -r $test_dir/. $tmp && cd $tmp && cargo build
* RUN: cargo run
*/
extern crate glad_vulkan;
use glad_vulkan::vk;
#[allow(path_statements)]
fn main() {
vk::GetDeviceProcAddr;
vk::GetSwapchainImagesKHR;
vk::GetMemoryWin32HandleNV;
vk::CreateMacOSSurfaceMVK;
vk::CreateWaylandSurfaceKHR;
vk::CreateViSurfaceNN;
vk::CreateIOSSurfaceMVK;
vk::GetRandROutputDisplayEXT;
vk::GetPhysicalDeviceXcbPresentationSupportKHR;
vk::GetMemoryAndroidHardwareBufferANDROID;
}

View File

@@ -0,0 +1,10 @@
[package]
name = "compile-wgl-default-001"
version = "0.1.0"
[[bin]]
path = "test.rs"
name = "test"
[dependencies]
glad-wgl = { path = "./glad-wgl/" }

View File

@@ -0,0 +1,16 @@
#![deny(warnings)]
/**
* Full WGL should compile
*
* GLAD: $GLAD --out-path=$tmp --api="wgl=" rust
* COMPILE: cp -r $test_dir/. $tmp && cd $tmp && cargo build
* RUN: cargo run
*/
extern crate glad_wgl;
use glad_wgl::wgl;
#[allow(path_statements)]
fn main() {
wgl::GetProcAddress;
wgl::GetSwapIntervalEXT;
}

View File

@@ -0,0 +1,10 @@
[package]
name = "gen-mx-001"
version = "0.1.0"
[[bin]]
path = "test.rs"
name = "test"
[dependencies]
glad-gl = { path = "./glad-gl/" }

View File

@@ -0,0 +1,23 @@
#![deny(warnings)]
/**
* Make sure the generated context struct is Send + Sync
*
* GLAD: $GLAD --out-path=$tmp --api="gl:core=" rust --mx
* COMPILE: cp -r $test_dir/. $tmp && cd $tmp && cargo build
* RUN: cargo run
*/
extern crate glad_gl;
use glad_gl::gl;
use std::mem::MaybeUninit;
fn requires_sync<T: Sync>(_x: &T) {}
fn requires_send<T: Send>(_x: &T) {}
#[allow(path_statements)]
fn main() {
#[allow(invalid_value)]
let gl: gl::Gl = unsafe { MaybeUninit::uninit().assume_init() };
requires_send(&gl);
requires_sync(&gl);
}

View File

@@ -0,0 +1,11 @@
[package]
name = "run-gl-default-001"
version = "0.1.0"
[[bin]]
path = "test.rs"
name = "test"
[dependencies]
glad-gl = { path = "./glad-gl/" }
glfw = { version = "0.23.0", default-features = false }

View File

@@ -0,0 +1,36 @@
#![deny(warnings)]
/**
* Full core GL, should compile
*
* GLAD: $GLAD --out-path=$tmp --api="gl:core=" rust
* COMPILE: cp -r $test_dir/. $tmp && cd $tmp && cargo build
* RUN: cargo run
*/
extern crate glad_gl;
extern crate glfw;
use glad_gl::gl;
use glfw::Context;
fn main() {
let mut glfw = glfw::init(glfw::LOG_ERRORS).unwrap();
let (mut window, _events) =
glfw.create_window(300, 300, "[glad] Rust - OpenGL with GLFW", glfw::WindowMode::Windowed)
.expect("Failed to create GLFW window.");
window.set_key_polling(true);
window.make_current();
gl::load(|e| glfw.get_proc_address_raw(e) as *const std::os::raw::c_void);
glfw.poll_events();
unsafe {
gl::Viewport(0, 0, 300, 300);
gl::ClearColor(0.7, 0.9, 0.1, 1.0);
gl::Clear(gl::COLOR_BUFFER_BIT);
}
window.swap_buffers();
}