Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 18:47 28 Mar 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2 - Draw a Pixel

Author Message
mxck
Newbie

Joined: 30/07/2020
Location: New Zealand
Posts: 9
Posted: 11:13am 03 Aug 2020
Copy link to clipboard 
Print this post

Hi all,

I was reading through the manual and noticed the PIXEL command allows either a single value or arrays to be passed into it to draw pixels. Would it be fair to assume using the array version of it is faster than calling the command separately every time?

When trying to use it I wasn't quite sure how it would work. Here's a tiny program that I expected to work. Your help is much appreciated!

Mx.


mode 3, 16

dim integer x(1) = (0, 10)
dim integer y(1) = (20, 30)

color rgb(green)
pixel x, y

do
loop
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8516
Posted: 11:19am 03 Aug 2020
Copy link to clipboard 
Print this post

Like all commands when passing arrays you need brackets on the variable

mode 3, 16

dim integer x(1) = (0, 10)
dim integer y(1) = (20, 30)

color rgb(green)
pixel x(), y()

do
loop


  Quote  I was reading through the manual and noticed the PIXEL command allows either a single value or arrays to be passed into it to draw pixels. Would it be fair to assume using the array version of it is faster than calling the command separately every time?

Most drawing commands allow arrays and it can make a HUGE difference to performance
Edited 2020-08-03 21:19 by matherp
 
mxck
Newbie

Joined: 30/07/2020
Location: New Zealand
Posts: 9
Posted: 09:16pm 03 Aug 2020
Copy link to clipboard 
Print this post

Great, thanks for the tip!
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024