GLBasic forum

Main forum => Bug Reports => Topic started by: Ian Price on 2012-Oct-21

Title: GETPIXEL on Pandora always returns zero
Post by: Ian Price on 2012-Oct-21
Hi Gernot

While porting Guru Logic to the Pandora I discovered that the GETPIXEL command (in GLB v10.283) always returned zero.

The code below works fine on pc (and Pandora), however pc version correctly returns different values when moving the cursor over different colours - the Pandora always returns zero.

Code (glbasic) Select

SETSCREEN 800,480,0

CREATESCREEN 1,999,800,480

USESCREEN 1

FOR n=0 TO 1000
DRAWRECT RND(800),RND(480),RND(64),RND(64),RGB(RND(255),RND(255),RND(255))
NEXT

USESCREEN -1

LOCAL mx,my,b1,b2, pixel

WHILE TRUE

MOUSESTATE mx,my,b1,b2

DRAWSPRITE 999,0,0

pixel=GETPIXEL (mx,my)

PRINT "PIXEL "+pixel,10,10

DRAWLINE mx-10,my,mx+10,my,RGB(255,255,255)
DRAWLINE mx,my-10,mx,my+10,RGB(255,255,255)

SHOWSCREEN

WEND
Title: Re: GETPIXEL on Pandora always returns zero
Post by: Ian Price on 2014-Aug-24
This is still true in GLB v12.096 two years later. :(

Other Pandora bugs include virtual screen not working (in fact using SETSCREEN XX to a virtual one crashes the app) and GRABSPRITE not grabbing anything. I believe from reports from erico that this is also true on the Mac.

[EDIT] It would appear that SPRITE2MEM is also borked. :(
Title: Re: GETPIXEL on Pandora always returns zero
Post by: S.O.P.M. on 2014-Aug-24
Gah! Fortunately I don't use the Open Pandora since a long time - the performance was never too good on this device. Please don't get me wrong but I'm absolute for it to cancel the support for some platforms to clean up GLBasic for the future. GLBasic is already quite overloaded and the more it supports the more sources of error are there. All these platforms can never be perfectly supported simultaneously. So keep Win, Linux, iOS, Android, HTML5 but throw out most of the rest.
Title: Re: GETPIXEL on Pandora always returns zero
Post by: Ian Price on 2014-Aug-24
QuoteSo keep Win, Linux, iOS, Android, HTML5 but throw out most of the rest.
Thankfully, it's not your decision.

Performance on the Pandora can be extremely good, as on the GP2x, Wiz and Caanoo - you've just got to work to there specs. I've released over 30 apps on these systems, and all have been very well received, proving GLB's strengths.

I have no interest in iOS, HTML and general Android devices (at this time), so should I suggest that Gernot drops these platforms?

The Pandora et al, might be in limited numbers and have very little support (from GLB users), but the problems affecting the Pandora are the same problems affecting other devices - eg Mac, which is not a limited device.

Most of these commands used to work, but now they don't. Something broke within the last couple of updates.
Title: Re: GETPIXEL on Pandora always returns zero
Post by: Kitty Hello on 2014-Aug-25
Or maybe the new pandora drivers? I will have to dig into this. And it sounds like a lot of work :(

Gesendet von meinem GT-N7100 mit Tapatalk

Title: Re: GETPIXEL on Pandora always returns zero
Post by: spacefractal on 2014-Aug-25
the most important bug, if you ask me is the virtual screen bug on the Mac (which also effect few other platforms as well). Propety its seen its a similar bug like this one. Im do newer have used extractly this command at all here.

Personal im do not have problems with those minor platforms at all, and for me no need to remove them at all, even some commands might been bugged out and even have found few issues my self, but herer im choiced to do workaround them instead as much as im can (im wont post them here to avoid offtype).

Also right now bug fixing is really more important adding other platforms for v13 (a major bug fixing release), if you ask me, inclusive this GETPIXEL issue (which also can effect some other platforms too, property on Mac too).
Title: Re: GETPIXEL on Pandora always returns zero
Post by: S.O.P.M. on 2014-Aug-26
Quote from: GernotOr maybe the new pandora drivers? I will have to dig into this. And it sounds like a lot of work :(

This is exactly what I'm afraid of...

Even these niches-platforms let GLBasic development become a running the gauntlet. Not that I wouldn't have confidence in Gernot's capability. It's just that I would love to see GLBasic's future to be ensured.

Please excuse myself for this, I simply couldn't resist to express discontent. Enough from my part here.
Title: Re: GETPIXEL on Pandora always returns zero
Post by: Ian Price on 2014-Aug-26
Indeed, it could be new Pandora drivers. And I've generally worked around issues on all platforms, but sometimes it's just not possible or practical or just plain time consuming to get the same results via alternative methods.

Obviously, I'm not expecting Gernot to waste his valuable time specifically on the Pandora, but when a couple of commands aren't working on a couple of platforms, there may well be some common ground which might have a positive outcome on all affected platforms.
Title: Re: GETPIXEL on Pandora always returns zero
Post by: erico on 2014-Aug-26
The virtual screen issue seema to spread through pandora mac and linux. I will be able to be sure about linux soon. Caanoo im not sure either but will test that as well.
Title: Re: GETPIXEL on Pandora always returns zero
Post by: Kitty Hello on 2014-Aug-29
CREATESCREEN does not work on the Mac you say? I do have to test that, but I'm almost certain that I used it.
Title: Re: GETPIXEL on Pandora always returns zero
Post by: erico on 2014-Aug-29
I use a combination of CREATESCREEN, SETSCREEN and USESCREEN. I think the problem is on the later command.
I don“t wanna hijack this thread, so I will make a newer one later with proper code.
Title: Re: GETPIXEL on Pandora always returns zero
Post by: Ian Price on 2014-Aug-29
Yep, it seems to be USESCREEN that's crashing the app on Pandora, so it's not possible to tell really if CREATESCREEN is working; it might be, but you can't access it :P
Title: Re: GETPIXEL on Pandora always returns zero
Post by: erico on 2014-Aug-29
Could the issues of GETPIXEL also be because it is trying to get pixels from a non existent screen from the buggy USESCREEN?
Title: Re: GETPIXEL on Pandora always returns zero
Post by: Ian Price on 2014-Aug-29
Nope, because you don't need to USESCREEN to use GETPIXEL; you can do that on the physical screen.