Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing glBlend*ARB functions #6

Closed
norru opened this issue Sep 29, 2018 · 1 comment · Fixed by #8
Closed

Missing glBlend*ARB functions #6

norru opened this issue Sep 29, 2018 · 1 comment · Fixed by #8

Comments

@norru
Copy link
Contributor

norru commented Sep 29, 2018

I'm using epoxy as the Gl loader for https://github.com/itadinanta/gfx-gtk.

gfx-rs attempts to load the following functions and fails:

glBlendEquationSeparateiARB
glBlendEquationiARB
glBlendFuncSeparateiARB
glBlendFunciARB

as a workaround I'm mapping them to their non-ARB counterparts as follows

pub fn epoxy_get_proc_addr(s: &str) -> *const std::ffi::c_void {
	// Workaround for missing functions in gfx-rs
	let s = match s {
		"glBlendEquationSeparateiARB" => "glBlendEquationSeparatei",
		"glBlendEquationiARB" => "glBlendEquationi",
		"glBlendFuncSeparateiARB" => "glBlendFuncSeparatei",
		"glBlendFunciARB" => "glBlendFunci",

		_ => s,
	};

	let v = epoxy::get_proc_addr(s);
	if v.is_null() {
		println!("Function {} is missing {:?}", s, v);
	}
	v
}

I have not seen an adverse effect yet but this is likely to bite me in the backside at some point if left untreated.

@norru
Copy link
Contributor Author

norru commented Oct 2, 2018

Hi, I've got a simple one-liner fix for this, will submit PR shortly.

norru added a commit to norru/epoxy-rs that referenced this issue Oct 2, 2018
@mjkoo mjkoo closed this as completed in #8 Oct 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant