#How do you use context now vs the old way in the wgpu sdl example?
10 messages · Page 1 of 1 (latest)
naturally 0 answers lol
Your question isn't actually clear--what do you mean "the old way"? The callbacks are proc "c", so they don't have a context unless you assign one. This is still the case, and can't really change--the context is an implicit parameter that can't just be invisibly tacked on to a proc "c".
The example uses the state global to pass the context through to the callbacks. You can use runtime.default_context() if you want a default-initialized context (i.e. without any custom allocators, loggers, etc.), or any other method of doing so, but there's nothing really outdated here that I'm seeing.
So essentialy default_context is a stripped version with more performance?
No, it's just what you get upon entry into main, with no customizations applied. The default context
That sounds stripped to me, but idk
Stripped of any customizations you've made to it, I guess. It's not really going to affect performance, though--it's just a struct with a bunch of pointers
It's the same thing you have when you first enter main. Default allocator, default temp allocator, no logger, etc.
So every variable in the scope that the context is allocated to is available?