Comments (3)
Looks nice :) I'll give it a try ASAP and try to give some feedback. One reason why I didn't do this right away was the overlap with GLFW, and I also didn't want to accidently limit sokol_gfx to a frame-callback model (but for a general entry-point lib this is the only way to go).
Oh and another thing: I was thinking that only the sokol_gfx header should use the sg_ prefix (for sokolgfx. Other headers would use something different, e.g. an sokol_input.h would use si_.
from sokol.
I think I finally made up my mind about an application wrapper sokol header... My main problem was what needs to be different from GLFW to justify the effort. I'll start sketching out a sokol_app.h header, this will be fairly low prio until I have finished the move of Oryol to sokol-gfx.
I hope you don't mind that I'm not forking sokol_entry.h ;)
Here's what I thought up so far:
- no support for multiple windows, at least in the beginning (mobile and web cannot support multiple windows anyway, this would be the 1st thing that's different from GLFW)
- likewise no multimonitor support (only the minimum needed for HighDPI)
- minimal HighDPI support like implemented in Oryol
- initial platform support same as Oryol: Win32+GL+D3D11, OSX+GL+Metal, iOS+GL+Metal, Linux+GL, emscripten+WebGL+WebGL2, Android+GLES2+GLES3, RaspberryPi+GLES2,
- must use a frame-callback function because of restrictions on some platforms (3nd thing that's different from GLFW)
- needs to completely hijack the main() function (since some platforms don't have a main function, another point that's different to GLFW)
- keep the API for input as small as possible (most likely only a single input event struct and event handler callback - have a separate sokol_input.h later with a more convenient input API)
- ...still have a SOKOL_GLFW define to fallback to GLFW (mainly for testing and robustness)
The main difference to sokol_entry.h would be that there will be less API functions for window control, basically I want to avoid functions that are not needed on mobile platforms as long as possible :)
from sokol.
I don't mind at all, its pretty sketchy in its current state anyways.
Reducing the input api sounds like a good idea to me. I was even thinking about delivering everything you need to do a frame update in a single big struct as a parameter of your frame update callback. (But this approach has some problems in some cases)
So I guess we can close this issue, looking forward to sokol_app.h :)
from sokol.
Related Issues (20)
- [sokol_imgui] Manage ImDrawCallback_ResetRenderState HOT 3
- [sokol_gfx] Array of struct uniform HOT 1
- WebGPU samples currently broken. HOT 1
- Regression: swapchains with depth (not depth/stencil) buffers currently broken in Metal. HOT 2
- [sokol_app] A call to GetIntegerv in _sapp_wgl_create_context leaves the stack corrupted HOT 8
- Sampling a depth texture using `SG_IMAGESAMPLETYPE_FLOAT` in order to copy it to the main framebuffer's depth buffer HOT 2
- Crash on validation error HOT 2
- sdhc + sokol_app.h: Uniform Arrays of smaller than vec4 type lead to validation errors or silently introduce buggy behaviour HOT 5
- Will you accept a PR that allows setting minimum width/height for resizable windows? HOT 3
- Apps showcase HOT 2
- Why isn't SOKOL_NO_ENTRY supported on android? Is it impossible or just not implemented yet? HOT 1
- How to fill the new sg_swapchain struct when using SDL2? HOT 1
- support arm64-v8a - INSTALL_FAILED_NO_MATCHING_ABIS HOT 4
- Load graphical dynamic libraries on demand with dlopen HOT 6
- sokol_gfx: warnings when compiling with mingw-w64 HOT 3
- sokol_app.h: request for show/hide/focus window functions HOT 1
- Request for Tagged Releases HOT 6
- README gives no indication of what this library does HOT 1
- [sokol_gfx] Any plans to support base vertex location? HOT 12
- error: expected '(' for function-style cast or type construction, while using SG_RANGE on MacOS using c++ HOT 6
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 sokol.