https://github.com/wang-bin/ugs
universal graphics surface
https://github.com/wang-bin/ugs
Last synced: 9 months ago
JSON representation
universal graphics surface
- Host: GitHub
- URL: https://github.com/wang-bin/ugs
- Owner: wang-bin
- License: mpl-2.0
- Created: 2018-01-19T06:29:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-23T07:49:16.000Z (over 1 year ago)
- Last Synced: 2025-01-14T09:43:23.808Z (over 1 year ago)
- Language: C++
- Size: 256 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UGS: Universal Graphic Surface
### PlatformSurface
The layer between platform depended window/view/surface handle and GFX context. For example OpenGL context can be created via `nativeHandleForGL()` depending on `type()` and `nativeResource()` when necessary.
- A wrapper for platform dependent handle: macOS NSView, iOS UIView, android jni Surface object, win32 HWND
- Internally created handle: win32, x11, gbm, wayland, rpi dispmanx
### RenderLoop
It's an abstract class implements threaded rendering loop with any number of `PlatformSurface`.
A derived class only need to implement how to manage GFX context for a given surface, for example, create/destroy/active/swap OpenGL context.
Do your rendering jobs in `RenderLoop` callbacks.
### TODO
- platform surface wrapper around more native handle types: wayland, xlib, xcb, gbm
- internal created handles: macOS
> License: [MPL version 2.0](http://mozilla.org/MPL/2.0/). You can freely use it in your commercial or opensource software.
> Wang Bin, wbsecg1 at gmail.com, 2017~2020