8000 odin-miniui/plot at main · jay-j/odin-miniui · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History

plot

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Plot is a flexible and high performance plotting package in native Odin. It may be used independently of Miniui.

A Library, not an Engine

Plot doesn't take over! It is designed to be used within your application. As a consequence, Plot itself isn't standalone. See an minimal example application in plot/example/plot_demo.odin. I typically use a Miniui wrapper for Plot to add interactivity, see example/example.odin.

The fundamentals:

/* Caller: Setup OpenGL context */
plot_renderer = plt.render_init()
plot := plot_init(buff_Width=1920, buff_height=1080)
/* Caller: generate some []f32 data x and y */
sine := plt.dataset_add(&plot, x[:], y[:])
plt.draw(plot_renderer, &plot, view_width=512, view_height=512)
/* Caller: display the OpenGL framebuffer plot.framebuffer */

GPU Rendering

Plot provides its own shaders and textures, but expects the caller to setup an OpenGL context.

Framebuffer Ouput

Plot renders to a framebuffer(s), not directly to the screen.

  • The caller has all the control.
  • In a GUI application, the cached framebuffer may be displayed rather than re-rendering every frame.
  • A render resolution much larger than the available screen may be used if desired.

Text

I'm implementing text-related items at the higher microui/miniui level. So this is not as standalone as I hoped, but better for my sanity.

Critical To-Do

  • Mark plot style (instead of just lines)
0