Initial commit - some engine bugs stopping compiling
This commit is contained in:
10
third-party/glad/test/rust/compile/egl/default/001/Cargo.toml
vendored
Normal file
10
third-party/glad/test/rust/compile/egl/default/001/Cargo.toml
vendored
Normal 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/" }
|
||||
16
third-party/glad/test/rust/compile/egl/default/001/test.rs
vendored
Normal file
16
third-party/glad/test/rust/compile/egl/default/001/test.rs
vendored
Normal 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;
|
||||
}
|
||||
10
third-party/glad/test/rust/compile/gl/default/001/Cargo.toml
vendored
Normal file
10
third-party/glad/test/rust/compile/gl/default/001/Cargo.toml
vendored
Normal 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/" }
|
||||
16
third-party/glad/test/rust/compile/gl/default/001/test.rs
vendored
Normal file
16
third-party/glad/test/rust/compile/gl/default/001/test.rs
vendored
Normal 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;
|
||||
}
|
||||
10
third-party/glad/test/rust/compile/gl/default/002/Cargo.toml
vendored
Normal file
10
third-party/glad/test/rust/compile/gl/default/002/Cargo.toml
vendored
Normal 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/" }
|
||||
17
third-party/glad/test/rust/compile/gl/default/002/test.rs
vendored
Normal file
17
third-party/glad/test/rust/compile/gl/default/002/test.rs
vendored
Normal 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;
|
||||
}
|
||||
10
third-party/glad/test/rust/compile/gl/default/003/Cargo.toml
vendored
Normal file
10
third-party/glad/test/rust/compile/gl/default/003/Cargo.toml
vendored
Normal 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/" }
|
||||
16
third-party/glad/test/rust/compile/gl/default/003/test.rs
vendored
Normal file
16
third-party/glad/test/rust/compile/gl/default/003/test.rs
vendored
Normal 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;
|
||||
}
|
||||
10
third-party/glad/test/rust/compile/glx/default/001/Cargo.toml
vendored
Normal file
10
third-party/glad/test/rust/compile/glx/default/001/Cargo.toml
vendored
Normal 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/" }
|
||||
16
third-party/glad/test/rust/compile/glx/default/001/test.rs
vendored
Normal file
16
third-party/glad/test/rust/compile/glx/default/001/test.rs
vendored
Normal 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;
|
||||
}
|
||||
10
third-party/glad/test/rust/compile/vulkan/default/001/Cargo.toml
vendored
Normal file
10
third-party/glad/test/rust/compile/vulkan/default/001/Cargo.toml
vendored
Normal 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"] }
|
||||
25
third-party/glad/test/rust/compile/vulkan/default/001/test.rs
vendored
Normal file
25
third-party/glad/test/rust/compile/vulkan/default/001/test.rs
vendored
Normal 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;
|
||||
}
|
||||
10
third-party/glad/test/rust/compile/wgl/default/001/Cargo.toml
vendored
Normal file
10
third-party/glad/test/rust/compile/wgl/default/001/Cargo.toml
vendored
Normal 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/" }
|
||||
16
third-party/glad/test/rust/compile/wgl/default/001/test.rs
vendored
Normal file
16
third-party/glad/test/rust/compile/wgl/default/001/test.rs
vendored
Normal 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;
|
||||
}
|
||||
10
third-party/glad/test/rust/gen/mx/001/Cargo.toml
vendored
Normal file
10
third-party/glad/test/rust/gen/mx/001/Cargo.toml
vendored
Normal 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/" }
|
||||
23
third-party/glad/test/rust/gen/mx/001/test.rs
vendored
Normal file
23
third-party/glad/test/rust/gen/mx/001/test.rs
vendored
Normal 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);
|
||||
}
|
||||
11
third-party/glad/test/rust/run/gl/default/001/Cargo.toml
vendored
Normal file
11
third-party/glad/test/rust/run/gl/default/001/Cargo.toml
vendored
Normal 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 }
|
||||
36
third-party/glad/test/rust/run/gl/default/001/test.rs
vendored
Normal file
36
third-party/glad/test/rust/run/gl/default/001/test.rs
vendored
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user