Skip to content

Commit

Permalink
gg: add a note that Context.new_streaming_image has to be called afte…
Browse files Browse the repository at this point in the history
…r Sokol's setup
  • Loading branch information
spytheman committed Jul 29, 2024
1 parent 104eb25 commit cadec97
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vlib/gg/image.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ pub fn (ctx &Context) draw_image(x f32, y f32, width f32, height f32, img_ &Imag
// can be updated *each frame* by calling: gg.update_pixel_data(image_idx, buf)
// ... where buf is a pointer to the actual pixel data for the image.
// Note: you still need to call app.gg.draw_image after that, to actually draw it.
// Note: Sokol needs to be setup, *before* calling this function. In practice,
// this often means, that you have to call it once in the `init_fn` callback of
// gg.new_context, or gg.start, and then store the result in your app instance.
pub fn (mut ctx Context) new_streaming_image(w int, h int, channels int, sicfg StreamingImageConfig) int {
mut img := Image{}
img.width = w
Expand Down

0 comments on commit cadec97

Please sign in to comment.