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.
Any way to detect if DoubleBuffer is on?
Re: Any way to detect if DoubleBuffer is on?
Would checking for #ERR_NODOUBLEBUFFER with GetLastError to continue execution or disable double buffering be a clean way?
PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
Re: Any way to detect if DoubleBuffer is on?
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.
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.
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Any way to detect if DoubleBuffer is on?
You can query #ATTRDOUBLEBUFFER for #DISPLAY.
Re: Any way to detect if DoubleBuffer is on?
OK, I understand what you mean.
PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
Re: Any way to detect if DoubleBuffer is on?
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.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
Re: Any way to detect if DoubleBuffer is on?
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.