Languages & Coding > Blitz2D, BlitzPlus, Blitz3D

FLIP... FLIP...

(1/2) > >>

drfloyd:
Hello
Dr Floyd, french casual coder ! Sorry again for my english :/ I speak english like a spanish cow.

My last release in BLITZ 3D :
http://www.gamopat.com/2018/12/cosmos-the-secret-melody-v.10.html

All is ok in windowed mode, NO PROBLEMO, but when i come in fullscreen I have problem with FLIP. command.. Because I use sometimes 2 FLIPS in the same process.... because i add some images/animations in another loop

Exemple :

Graphics 320,240,32,1
setbuffer backbuffer()
do
   cls
   ;display images&animations
    gosub minigame                 ;or function minigame()   
    FLIP
loop


.minigame           ; or minigame() if function
do
    ;display additionnal images in a little part of the main image (a mini game)
    FLIP
    if keydown(28) then return
loop



So there is a FLIP into a FLIP... the result is bug display : vibrate image between 2 screens

how can i solve this ?

Thank you very much if you can help

Derron:
only flip in the "main loop" if you did not do this "gosub" ?


bye
Ron

Qube:
Do your main loop something easy like :


--- Code: BlitzBasic ---Graphics 320,240,32,1SetBuffer BackBuffer() Do   Cls    Animations()   MiniGame()    FlipLoop Function Animations()    ' draw cool stuffEnd Function Function MiniGame()   ' draw more cool stuffEnd Function 
That way you'll only get one FLIP command in your main loop :)

drfloyd:
yes,of course...

But I want to stop/freeze the animations/game when there is a windowed mini game.... the program is big (1000ko) and i don't want to recode lot of things.

There is no easy solution ? Like stopping the backbuffering when the function minigame start ?????

Derron:
You only need the flip once - as Qube already suggested.

If you want to stop animations/game then have


--- Code: ---if minigameActive
 DoMinigameStuff()
else
 DoNormalStuff()
endif

Flip

--- End code ---

Qube's proposal even allows for more sophisticated stuff: like having the main game rendering in the background with the mini game in the foreground. Of course the physics/logic of the maingame should be set to "paused" then.


This is the benefit of splitting Logic and Rendering into two parts - it allows to render stuff (like a static screen) or to just update the game without even having to render out something (think of a headless server).

1mb of source code is ... manageable as most of the code will NOT handle your "maingame + minigame"-split.

bye
Ron

Navigation

[0] Message Index

[#] Next page

Go to full version