GLBasic forum

Main forum => GLBasic - en => Topic started by: Mike_g on 2013-Oct-31

Title: Drawing direct to screen possible?
Post by: Mike_g on 2013-Oct-31
Is it possible NOT to draw to the back puffer but directly to the shown screen?
I wrote a simple fractal program and I want that the user can watch the fractal being drawed.

Thanks in advance for your help!

      - Mike -
Title: Re: Drawing direct to screen possible?
Post by: Schranz0r on 2013-Oct-31
Use a Array to draw?!
Or a Viewport and update every frame?
Title: Re: Drawing direct to screen possible?
Post by: Moru on 2013-Oct-31
USEASBMP should do what you want. Just before each showscreen you call this and it will not clear the background buffer from what you just drew on the backbuffer.

If you have other things like numbers or other text that you update, draw that after you call USEASBMP, then that will be erased before next update since USEASBMP saves what is on screen as a background picture and restores that every SHOWSCREEN, erasing the text you draw after USEASBMP.

If you want to clear the screen, use "BLACKSCREEN"
Title: Re: Drawing direct to screen possible?
Post by: spacefractal on 2013-Oct-31
Uses a off buffer (createscreen), and draw your fractals to that, then draw that buffer to the screen.
Title: Re: Drawing direct to screen possible?
Post by: kanonet on 2013-Oct-31
CLEARSCREEN -1 might be what you need.
Title: Re: Drawing direct to screen possible?
Post by: spacefractal on 2013-Nov-01
that will clear the buffer, which he is not intesered in. but you should draw your fractals to a offbuffer and then draw that buffer to the onscreen as sprite. Its property the best way.
Title: Re: Drawing direct to screen possible?
Post by: Qedo on 2013-Nov-01
like this?
ciao
Qedo
Title: Re: Drawing direct to screen possible?
Post by: Mike_g on 2013-Nov-01
Quote from: kanonet on 2013-Oct-31
CLEARSCREEN -1 might be what you need.

This works fine for Windows, but when I compile to MacosX or Android and run the app only crap and flickering  is displayed on the screen.

Is there another way to do this, working on all platforms (especially Android)

           - Mike -
Title: Re: Drawing direct to screen possible?
Post by: Mike_g on 2013-Nov-01
Quote from: spacefractal on 2013-Nov-01
that will clear the buffer, which he is not intesered in. but you should draw your fractals to a offbuffer and then draw that buffer to the onscreen as sprite. Its property the best way.

This is working well on all platforms - thank you!

         - Mike -
Title: Re: Drawing direct to screen possible?
Post by: kanonet on 2013-Nov-01
If you have problems with CLEARSCREEN -1 on some platforms, then this may be a bug in GLB? Im not sure about this, can someone help?