Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
simple 2D vector graphics
#13
(10-28-2022, 05:32 PM)bplus Wrote:
(10-28-2022, 03:48 AM)madscijr Wrote:
(10-28-2022, 02:15 AM)vince Wrote: I like how you impose functionality on constants, truly a mad scientist

Do you mean the color values? I don't recall exactly why, I must have tried using constants and something didn't work for an unsigned long, or whatever type the rgb colors need, and it didn't work, and after deliberation, someone suggested just using a function, which worked fine. So in that case not so much a mad scientist as just needing to get it to work. But I've done much bigger kludges, the digital equivalent to duct tape & redneck tech, that would earn the title of mad scientist. These days I try to keep a low profile and stay out of trouble! ;-O

Yeah something got broke using color constants, now if you use the &H... way you need to suffix a number with _Unsigned long symbol.

eg 
const white = &Hffffffff  ' nope!
const white = &Hffffffff~& ' OK

Was this fixed? I just tested and point values matched
Code: (Select All)
Screen _NewImage(800, 600, 32)
Const white = &HFFFFFFFF ' nope!
Const white2 = &HFFFFFFFF~& ' OK
PSet (10, 10), white
PSet (20, 20), white2
Print Point(10, 10) = Point(20, 20)
Hmm... I am sure as soon as I need to depend on it in real app, it will screw up, unless someone can confirm it was fixed.

Aha, thanks. I do seem to vaguely recall seeing this being discussed a while back. 
Maybe I'll convert the color functions to constants eventually, for now it works so I'll leave it as functions! 
Would using constants instead of functions improve performance in QB64 or QB64PE?
Reply


Messages In This Thread
simple 2D vector graphics - by madscijr - 10-27-2022, 07:45 PM
RE: simple 2D vector graphics - by bplus - 10-27-2022, 08:02 PM
RE: simple 2D vector graphics - by madscijr - 10-27-2022, 11:11 PM
RE: simple 2D vector graphics - by Pete - 10-27-2022, 10:03 PM
RE: simple 2D vector graphics - by madscijr - 10-27-2022, 11:14 PM
RE: simple 2D vector graphics - by mnrvovrfc - 10-27-2022, 11:33 PM
RE: simple 2D vector graphics - by madscijr - 10-28-2022, 01:59 AM
RE: simple 2D vector graphics - by Pete - 10-27-2022, 11:38 PM
RE: simple 2D vector graphics - by madscijr - 10-28-2022, 02:02 AM
RE: simple 2D vector graphics - by vince - 10-28-2022, 02:15 AM
RE: simple 2D vector graphics - by madscijr - 10-28-2022, 03:48 AM
RE: simple 2D vector graphics - by bplus - 10-28-2022, 05:32 PM
RE: simple 2D vector graphics - by madscijr - 10-28-2022, 06:58 PM
RE: simple 2D vector graphics - by bplus - 10-28-2022, 09:26 PM
RE: simple 2D vector graphics - by madscijr - 10-28-2022, 09:50 PM
RE: simple 2D vector graphics - by mnrvovrfc - 11-04-2022, 11:59 PM
RE: simple 2D vector graphics - by madscijr - 11-05-2022, 02:09 AM
RE: simple 2D vector graphics - by TempodiBasic - 11-08-2022, 10:17 AM
RE: simple 2D vector graphics - by madscijr - 11-08-2022, 12:25 PM



Users browsing this thread: 19 Guest(s)