Any way to detect if DoubleBuffer is on?

Discuss any general programming issues here
Post Reply
Bugala
Posts: 915
Joined: Sun Feb 14, 2010 7:11 pm

Any way to detect if DoubleBuffer is on?

Post by Bugala »

Any way to detect if DoubleBuffer is on or off?

I am making this function that basically starts by turning doubebuffer off, but at beginning it is not on, and therefore comes error message.

I can get around this using dirty ways, but would prefer a clean way.

User avatar
emeck
Posts: 92
Joined: Fri Apr 03, 2015 3:17 pm

Re: Any way to detect if DoubleBuffer is on?

Post by emeck »

Would checking for #ERR_NODOUBLEBUFFER with GetLastError to continue execution or disable double buffering be a clean way?
PowerBook 5.2 MorphOS 3.13
PowerBook 5.8 MorphOS 3.13
Amiga 1200 BPPC/BVision AOS4.1 FE

Bugala
Posts: 915
Joined: Sun Feb 14, 2010 7:11 pm

Re: Any way to detect if DoubleBuffer is on?

Post by Bugala »

Disabling double buffer would be clean, but then I would lose the benefits of double buffer.

Error handling is not really a clean way, as a dirty trick I was thinking of disabling error messages and execute the command, then turn error handling back on, but would rather not do that.

Current solution I am thinking is simply taking care myself that doublebuffer is on when entering the function, since basically only time that is having that problem that comes to my mind is when it is called the first time, so I can first turn doublebuffering on before using it for the first time. It is bit of a hack, but if there is no way to check if double buffering is on, then I guess that is the closest to clean solution.

User avatar
airsoftsoftwair
Posts: 4207
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Any way to detect if DoubleBuffer is on?

Post by airsoftsoftwair »

You can query #ATTRDOUBLEBUFFER for #DISPLAY.

User avatar
emeck
Posts: 92
Joined: Fri Apr 03, 2015 3:17 pm

Re: Any way to detect if DoubleBuffer is on?

Post by emeck »

Bugala wrote:
Wed Sep 11, 2019 8:08 pm
Error handling is not really a clean way, as a dirty trick I was thinking of disabling error messages and execute the command, then turn error handling back on, but would rather not do that.
OK, I understand what you mean.
PowerBook 5.2 MorphOS 3.13
PowerBook 5.8 MorphOS 3.13
Amiga 1200 BPPC/BVision AOS4.1 FE

User avatar
emeck
Posts: 92
Joined: Fri Apr 03, 2015 3:17 pm

Re: Any way to detect if DoubleBuffer is on?

Post by emeck »

airsoftsoftwair wrote:
Wed Sep 11, 2019 8:31 pm
You can query #ATTRDOUBLEBUFFER for #DISPLAY.
So you can start double buffering when creating the display also or only with BeginDoubleBuffer and it is set to the current display?
PowerBook 5.2 MorphOS 3.13
PowerBook 5.8 MorphOS 3.13
Amiga 1200 BPPC/BVision AOS4.1 FE

Bugala
Posts: 915
Joined: Sun Feb 14, 2010 7:11 pm

Re: Any way to detect if DoubleBuffer is on?

Post by Bugala »

airsoftsoftwair wrote:
Wed Sep 11, 2019 8:31 pm
You can query #ATTRDOUBLEBUFFER for #DISPLAY.
Ah, great. Figured there might be something like that existing, just couldn't figure out where to look at, although, should have realized now that I see it.

Post Reply