summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-03-07 22:04:32 +0100
committerHampusM <hampus@hampusmat.com>2023-03-07 22:04:32 +0100
commitc7efbb55f075748d88e25735c6d7e85ba768fd15 (patch)
tree07571447ff75fab8aa4a9710b098bbdf8676c6b2 /src/lib.rs
parent95ef9331e5dac2cd1d8dc2087c4535a87addb216 (diff)
refactor: use opengl-registry-macros 0.1.0
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 9568b6c..cd2e4d0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -4,15 +4,15 @@
use opengl_registry_macros::for_each_opengl_command;
for_each_opengl_command! {
- #[doc = stringify!(_gl_command_)]
+ #[doc = stringify!(#gl_command_name)]
#[allow(non_snake_case, clippy::too_many_arguments)]
- pub unsafe fn _gl_command_(_gl_command_args_) -> _gl_command_ret_type_ {
+ pub unsafe fn #gl_command_name_noprefix(#gl_command_args) -> #gl_command_ret_type {
type GLFunc =
- unsafe extern "C" fn(_gl_command_arg_types_) -> _gl_command_ret_type_;
+ unsafe extern "C" fn(#gl_command_arg_types) -> #gl_command_ret_type;
- let gl_func = std::mem::transmute::<_, GLFunc>(functions::_gl_command_);
+ let gl_func = std::mem::transmute::<_, GLFunc>(functions::#gl_command_name);
- gl_func(_gl_command_arg_names_)
+ gl_func(#gl_command_arg_names)
}
}
@@ -39,7 +39,7 @@ where
{
for_each_opengl_command! {
unsafe {
- functions::_gl_command_ = get_proc_addr(stringify!(_gl_command_));
+ functions::#gl_command_name = get_proc_addr(stringify!(#gl_command_name));
}
};
}
@@ -49,9 +49,9 @@ mod functions
use opengl_registry_macros::for_each_opengl_command;
for_each_opengl_command!(
- #[doc = stringify!(_gl_command_)]
+ #[doc = stringify!(#gl_command_name)]
#[allow(non_upper_case_globals)]
- pub static mut _gl_command_: unsafe extern "C" fn() = function_not_loaded;
+ pub static mut #gl_command_name: unsafe extern "C" fn() = function_not_loaded;
);
extern "C" fn function_not_loaded()