declantsien / emacs-ng

Emacs Webrender front
https://github.com/declantsien/emacs-webrender
GNU General Public License v3.0
8 stars 0 forks source link

Abstract surfman and implement glutin #3

Closed 2e0byo closed 1 year ago

2e0byo commented 1 year ago

Unfortunately I need to rebase this against tao: used feature/tao by mistake.

This PR:

Glutin runs on my machine, although there is still work to do. Surfman still crashes, but compiles.

I'll rebase this against tao shortly.

I'm learning rust and feel the use of cfg all over the place here is ugly. I'd appreciate advice on how to tidy it up.

declantsien commented 1 year ago

My apologies. I force push my changes a lot. Didn't expect PRs. There would be some work rebasing against tao branch.

I've think about this for GTK glarea too. Now you made it happen first. BTW, Glutin works on my machine, while surfman is flicking a lot (see video).

https://i.imgur.com/Qy9X3ih.mp4

Why are you working against my branch instead of emacs-ng repo? What changes need to be upstream to make you workflow smoother? I would do that.

You got me thinking. Maybe we can do something like this

windowing
windowing_impl

like folders

platform
platform_impl

in winit repo ?

declantsien commented 1 year ago

This fixes surfman flicking while keeping glutin works too. 0001-fix-surfman.patch.txt

2e0byo commented 1 year ago

Thanks!

I've not based on this on upstream as the winit/webrender decouple hasn't landed yet. Additionally Tao is probably the way to go over winit, at least on linux, but I could redo the other PR against upstream if more people want to play with that.

Incidentally I get GL errors when opening a new frame, so that's the next thing to dig into on this fussy machine.

2e0byo commented 1 year ago

folders

Yes, I think something like that is the way to go, with just one cfg() to include the right file in lib.rs (since this is a compile-time pick, not runtime).