Comments (3)
@bryphe I suspect the solution is to expose the SDL_WINDOWFLAGS to the Sdl2.Window.create call in Window.re
I'm happy to take this on, although I expect I'll need some help since there's some C plumbing I'm not immediately familiar with :)
from revery.
Thanks @bryphe!
My time contributing to OSS is very sporadic but let's see if I can get to this :) I'll drop a comment if I start digging into this.
If anyone else is reading this and is missing the functionality feel free to jump on this
from revery.
Hi @Ragnar-H ,
Thanks for logging the issue and all the details! This would certainly be a nice improvement - it can help reduce flicker when starting up apps to start them hidden, and then show them once everything has been loaded / setup.
The simplest fix would probably be to add a flag here:
revery/packages/reason-sdl2/src/sdl2_wrapper.cpp
Line 1574 in 9ec44ff
These places would also need to be updated:
revery/packages/reason-sdl2/src/sdl2_wrapper.cpp
Line 1667 in 9ec44ff
revery/packages/reason-sdl2/src/sdl2.re
Line 231 in 9ec44ff
(and then, validating that the window can be shown after being hidden is important - I think the current SDL_ShowWindow
is the right thing for that, though).
A larger, but more flexible, fix would be as you suggested - expose the SDL_WINDOWFLAGS as something we can build and pass from Reason to the C stubs. We have the flags hard-coded here:
revery/packages/reason-sdl2/src/sdl2_wrapper.cpp
Line 1641 in 9ec44ff
One idea would be to pass a uint
to our CreateWindow
API, and have a module like WindowFlags
that can be used with that API, like:
module WindowFlags: {
// Internally, this would be a uint
type t;
type flags =
| Hidden
| OpenGL
| Fullscreen
| ...;
// The default set of flags we use currently - OpenGL, HighDPI, Resizable
let default: t;
let make: list(flags) => t;
}
...
module Window: {
let create: (~flags=WindowFlags.default, ...);
}
Hope that helps give some ideas!
from revery.
Related Issues (20)
- Fail to build JS examples with esy '@js' run
- Ubuntu 20.10: revery-ui/esy-skia build failed HOT 3
- Ubuntu 18.10 / 19.04: @opam/ocamlfind@opam:1.8.1 build failed HOT 5
- esy '@examples' run output has no text (Revery.FontCache: Error loading typeface (skia)) HOT 4
- Uncaught Division_by_zero crash on window resize. (maxHeight vs flexGrow ?) HOT 1
- Revery roadmap in face of Reason->Rescript rebrand HOT 2
- Having problem with building revery-quick-start project on Mac HOT 7
- MacOS: Allow selective modifier key mapping
- esy install failing on Windows. HOT 3
- Build Revery is presenting failure in shell.c HOT 2
- ScrollView does not work if children are added after initial mount
- CI: esy-skia won't build on Linux HOT 1
- Update the build guide for Fedora HOT 4
- SVG drawing mangled if OS locale does use a different floating point presentation HOT 4
- Quickstart build step error HOT 1
- Windows10 esy is installed but revery-ui can not be installed
- Build revery with esy on mac failed HOT 9
- Can't build on Fedora 35 due to glibc bug HOT 4
- OCaml <=14.12 doesn't support glibc>=2.34 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from revery.