Skip to content

Commit

Permalink
Simplify GL fn loading
Browse files Browse the repository at this point in the history
  • Loading branch information
17cupsofcoffee committed Dec 4, 2024
1 parent 8ebc47e commit a44ab86
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@ impl Window {

pub fn load_gl(&self) -> Context {
unsafe {
Context::from_loader_function(|s| {
let c_str = CString::new(s).unwrap();
if let Some(ptr) = SDL_GL_GetProcAddress(c_str.as_ptr()) {
Context::from_loader_function_cstr(|s| {
if let Some(ptr) = SDL_GL_GetProcAddress(s.as_ptr()) {
ptr as *mut _
} else {
std::ptr::null()
Expand Down

0 comments on commit a44ab86

Please sign in to comment.