CodeWalrus

Development => Calculators => Calc Projects, Programming & Tutorials => Topic started by: kotu on August 30, 2016, 11:27:05 AM

Title: Direct access to the pixel buffer - C Sdk
Post by: kotu on August 30, 2016, 11:27:05 AM
Does anyone here have experience of writing directly to the pixel buffer with the C Sdk?

I can't seem to get it to work - indeed, it doesn't seem to be properly catered for, as far as I can see. Hmm!

(you want this for super-fast custom drawing functions)
Title: Re: Direct access to the pixel buffer - C Sdk
Post by: Snektron on August 30, 2016, 12:00:04 PM
You mean for CE developement? you can just write to the VRAM and it will show up. You can see how i did it in my ray marcher here: https://github.com/Snektron/CERM/blob/master/graphics.h (keep in mind this uses an old version of the SDK, and i didnt bother using the gfx library since i wanted to get the full color)
Title: Re: Direct access to the pixel buffer - C Sdk
Post by: kotu on August 30, 2016, 12:09:37 PM
Ok - thanks - but looks like you are writing directly to the screen and not the back buffer. I want the back buffer.
Title: Re: Direct access to the pixel buffer - C Sdk
Post by: c4ooo on August 30, 2016, 12:58:15 PM
The back buffer is just VRAM+320*240.
Title: Re: Direct access to the pixel buffer - C Sdk
Post by: kotu on August 30, 2016, 01:47:40 PM
No problem, I got it now
Title: Re: Direct access to the pixel buffer - C Sdk
Post by: MateoConLechuga on August 30, 2016, 03:03:22 PM
Quote from: kotu on August 30, 2016, 11:27:05 AM(you want this for super-fast custom drawing functions)
False; the functions available in the graphx library are going to be faster than anything people can come up with in C.
Title: Re: Direct access to the pixel buffer - C Sdk
Post by: kotu on August 30, 2016, 04:14:39 PM
Possibly some custom routines image processing for example which aren't provided in the SDK.

Faster than multiple calls to GetPixel/SetPixel (or whatever the equivalent functions are called) is what I meant. :)
Title: Re: Direct access to the pixel buffer - C Sdk
Post by: Adriweb on August 30, 2016, 06:59:09 PM
You should take a look at the sprite functions, then :)

(BTW, the back buffer is only there/usable when you're in 8bpp, as this uses half the VRAM)
Title: Re: Direct access to the pixel buffer - C Sdk
Post by: kotu on August 30, 2016, 07:14:34 PM
Quote from: Adriweb on August 30, 2016, 06:59:09 PM
You should take a look at the sprite functions, then :)
For image processing?? lol, there is plenty of stuff in image processing thats complicated, trust me.

But also beyond computer vision there are plenty of graphic functions one might want to write which are not part of any SDK. Probably an infinite number  8)

Quote from: Adriweb on August 30, 2016, 06:59:09 PM
(BTW, the back buffer is only there/usable when you're in 8bpp, as this uses half the VRAM)
Yes I know.
Title: Re: Direct access to the pixel buffer - C Sdk
Post by: Adriweb on August 30, 2016, 07:21:06 PM
Quote from: kotu on August 30, 2016, 07:14:34 PM
Quote from: Adriweb on August 30, 2016, 06:59:09 PM
You should take a look at the sprite functions, then :)
For image processing?? lol, there is plenty of stuff in image processing thats complicated, trust me.
Well, I should know, my master thesis is about image processing ;)

But I believe at some point you were referring to handling things that I understand sprite functions would be helpful with.
But anyway, it's not going to be "feasible" to do complex things on this weak device :( (though it depends what you'd call complex - we've seen a 3d animations on the CE, running smoothly, for instance)
Title: Re: Direct access to the pixel buffer - C Sdk
Post by: kotu on August 30, 2016, 09:08:37 PM
Quote from: Adriweb on August 30, 2016, 07:21:06 PM
But I believe at some point you were referring to handling things that I understand sprite functions would be helpful with.

Are you sure you didn't see the sprites in my sig and get confused!!??? Lol  (-_(//));