Solved!

The user `griffith1deady` on GitHub (not sure if this is user is from this 
forum) gave us the solution:

> you give pointer to sequence object, not sequence memory. this line:
    
    
    subimage: [ [ sg.Range(addr: addr data, size: width * height * 4) ] ]
    
    
    Run

> should be:
    
    
    subimage: [ [ sg.Range(addr: addr data[0], size: width * height * 4) ] ]
    
    
    Run

This leads me to a lot of questions about why is this, if anybody can point me 
to any resources that explains this it would be great:

> Would you happen to have any resources or information about why this is the 
> case? I am checking nim-by-example and other resources, and it seems that 
> data[0] should access the first element in the sequence, similar to array 
> behavior. So I am a bit lost in understanding why this is happening.
> 
> Also, this means that there is no way to pass an array and a sequence 
> interchangeably because we need to know the type to pass data or data[0]. 
> This also makes me wonder why it works with small images but not with "big" 
> images.

Thanks! 

Reply via email to