Sign in to follow this  

An array of calls?

This topic is 3488 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to create an array of say, SetPixel() each one containging its own coords (X, Y), and possibly an RGB value? Say you wanted to make an arrow of pixels that would be red, could you use an array to create the arrow, then just make calls to it to render it to the screen? Thanks, Matt

Share this post


Link to post
Share on other sites
That is pretty much how images are drawn, but on the hardware level and without deterministic logic like yours. On the hardware, all you have is a sprite (2D array) and the hardware just takes the block and BitBlts it onto something. what your asking is to just put one pixel down into a specific place. This forces the software to move pointers instead of just incrementing their position by 1.

Why not try making a mask?

Share this post


Link to post
Share on other sites
Quote:
Original post by Code Is Your Friend
Is it possible to create an array of say, SetPixel() each one containging its own coords (X, Y), and possibly an RGB value? Say you wanted to make an arrow of pixels that would be red, could you use an array to create the arrow, then just make calls to it to render it to the screen?

Thanks,
Matt


What language are you using?

You can, typically, make a structure that represents the arguments (parameters) to the function (one structure instance contains all the data needed to call), make an array of these structures, and then iterate over the array to make the call with each structure. You can, in many cases, make an array where each element is some kind of kind of representation of a function: a "function pointer", a name that is looked up in a table, a name that is looked up automatically by the language, etc.

But a "call" of a function is a transient thing, even if your language represents the functions themselves as objects. You can no more have an array of calls to a function than you can have a bucket of smiles.

Share this post


Link to post
Share on other sites

This topic is 3488 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this