Author Topic: Debug - show frontbuffer and backbuffer keys  (Read 2313 times)

Offline FutureCow

  • HelpEditor
  • Prof. Inline
  • ******
  • Posts: 680
    • View Profile
I'd like to request that when stepping through code you have a key to show you what the current frontbuffer looks like, and another key to show you what is currently in the back buffer.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10675
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Debug - show frontbuffer and backbuffer keys
« Reply #1 on: 2009-Apr-03 »
The frontbuffer is visible. The backbuffer can be debugged with:

Code: GLBasic [Select]
GRABSPRITE 1000,0,0,1024,800
SAVESPRITE "tmp.png", 1000
GRABSPRITE 1000,0,0,0,0
// SHELLCMP "MSPaint"...
 

Offline FutureCow

  • HelpEditor
  • Prof. Inline
  • ******
  • Posts: 680
    • View Profile
Re: Debug - show frontbuffer and backbuffer keys
« Reply #2 on: 2009-Apr-06 »
I can't see the frontbuffer.
I compile in debug mode, pause the program and step through one line at a time. As soon as the program is paused, the button on my taskbar relating to the running program disappears - it only reappears for a split second when I run the "showscreen" line and disappears again straight away.
As the window isn't there, I can't alt-tab to it to see the current state of the front buffer.

The code for the backbuffer would work, but has some issues
(1) If I want to debug the back buffer after every line building the game screen then I'll have to insert those 3 lines / call them from a function after every line of code in my program. Stepping through my code one line at a time then becomes a nightmare
(2) It also involves constantly swapping into a drawing program and reloading the temporary image each time.

If I want to check the back buffer after each line of screen building code, over multiple game frames, this is not practical.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10675
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Debug - show frontbuffer and backbuffer keys
« Reply #3 on: 2009-Apr-06 »
Hm. I might think of a way to temporarily store both buffers in debug mode. Might take some time, though.

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1754
    • View Profile
    • Homepage
Re: Debug - show frontbuffer and backbuffer keys
« Reply #4 on: 2009-Apr-06 »
The ability to see the backbuffer while debugging is very useful while learning the language still, to see why things end up behind other objects or just disappear because you forgot that you paint the background last :-)

Offline FutureCow

  • HelpEditor
  • Prof. Inline
  • ******
  • Posts: 680
    • View Profile
Re: Debug - show frontbuffer and backbuffer keys
« Reply #5 on: 2009-Apr-06 »
The back buffer is probably the priority for me. As Moru said it would be great to be able to see how it builds the screen while you're stepping through the code to see what bit of your code is doing something wrong.