Skip to content

renlite/relbase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Proof of Concept: "Layer of stacks" - Group Rendering and Painting

This is an experiment and a try to create a base for Rendering and Drawing of Objects like Rectangle or Text in Nim.

The idea is to use Group Rendering for areas on a screen to reduce rendering and upload to the GPU.

There is no roadmap and no plan for development. It is a learning project to understand the complexity of an Retained UI Framework.

Tier 1 - Some aspects for Rendering/Drawing:

  • Use only primitive GPU-Objects (traingles) for Rectangle, Circle
  • Text/Fonts rendering (as Texture?) - Max texturebuffer GL=32, GLES=16 for one upload to GPU
  • Transfer as much as possible from CPU to GPU
  • Low CPU and GPU power consuming on runtime
    • Rectangle, Circle
    • Text/Fonsts
  • Small size of static compiled binary
  • Antialiazing of RenderObjects without hardware antialiazing (MSAA = MultiSampling Anti-Aliasing)
  • Reduce single Uploads from CPU to GPU. (Group Rendering/Drawing)
  • Simple and readable design and coding (no templates, no macros, no DSL)
  • Rendering of areas with caching
  • Event Loop on main thread / Rendering on separate thread
  • Stress test with many objects
  • Comparison with other lightweight vector graphics engines

Some ideas come from an earlier experiment about "Group Rendering": fyne-io/fyne#3412 (comment)

If the performance tests are successful Tier 2 (in another package) could follow.

Tier 2 - Some ideas for Retained-Mode UI FW:

  • Imperative design
  • Events with callbacks
  • Simple layout system. (only columns and rows)
  • Bare minimum Widgets/Controls
  • Check, if "Relays" fit for Retained-Mode (https://github.com/nim-lang/uirelays)
  • ...

Example

src/main.nim is an example or a test file.

  • Resizing window re-draws the screen (no re-rendering). See src/gl.nim proc renderTree(...)
  • Mouse-Click prints (echo) the coordinates

Example_Windy

Windy
nimble install https://github.com/treeform/windy
nim.exe c -d:WindyGl -d:release .\src\main.nim
GLFW
nimble install https://github.com/RowDaBoat/nglfw
nim.exe c -d:GlfwGL -d:release .\src\main.nim

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors