English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 21 December 2014, 12:09   #1
Sparticle
Registered User
 
Join Date: May 2009
Location: Leicester/U.K
Posts: 36
Flickering problem

Hi all,

I'm trying to do a Flappy bird clone on classic amiga. I want the game to be played inside a moveable window attatched to a custom screen. For the bird Im using a simple hardware sprite. the background is using an Image structure and the floor which is drawn on top of the background is also an Image struture. I wanted to use an Image instead of sprites for simplicity. Everything is working ok except the floor flickers as its being drawn.

Is there an easy way to do a double buffer using intuition usig the DrawImage() method?

p.s. here's a version I wrote in js http://natashaz-place.bugs3.com
Just wanted to see if I can do similar on amiga
Thanks
Sparticle is offline  
Old 21 December 2014, 14:37   #2
Hewitson
Registered User
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 38
Posts: 3,747
Not able to offer much advice regarding the programming but why would you use a moveable window instead of having the game fullscreen?
Hewitson is offline  
Old 22 December 2014, 09:07   #3
Sparticle
Registered User
 
Join Date: May 2009
Location: Leicester/U.K
Posts: 36
Quote:
Originally Posted by Hewitson View Post
Not able to offer much advice regarding the programming but why would you use a moveable window instead of having the game fullscreen?
I just wanted to do it differently. Most games don't use a window so I thought it would be good if you can have the game running and still do other tasks at the same time.
Sparticle is offline  
Old 22 December 2014, 16:07   #4
Hewitson
Registered User
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 38
Posts: 3,747
Quote:
Originally Posted by Sparticle View Post
I just wanted to do it differently. Most games don't use a window so I thought it would be good if you can have the game running and still do other tasks at the same time.
But if you're running the game on it's own screen you can do that anyway. The window serves no purpose.
Hewitson is offline  
Old 22 December 2014, 16:49   #5
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,352
Quote:
Originally Posted by Sparticle View Post
Is there an easy way to do a double buffer using intuition usig the DrawImage() method?
Set up a temporary bitmap using AllocBitMap, InitRastPort. Then draw into this temp bitmap/rastport and when you are done, blit it into the window using BltBitMapRastPort.

Be warned that an off-screen rastport does not do automatic clipping, so make sure that you don't draw outside of the bitmap's storage.
thomas is offline  
Old 23 December 2014, 04:12   #6
Sparticle
Registered User
 
Join Date: May 2009
Location: Leicester/U.K
Posts: 36
Quote:
Originally Posted by Hewitson View Post
But if you're running the game on it's own screen you can do that anyway. The window serves no purpose.
Yes true, but you wouldn't be able to position the game where you like on the screen.
Sparticle is offline  
Old 23 December 2014, 04:19   #7
Sparticle
Registered User
 
Join Date: May 2009
Location: Leicester/U.K
Posts: 36
Quote:
Originally Posted by thomas View Post
Set up a temporary bitmap using AllocBitMap, InitRastPort. Then draw into this temp bitmap/rastport and when you are done, blit it into the window using BltBitMapRastPort.

Be warned that an off-screen rastport does not do automatic clipping, so make sure that you don't draw outside of the bitmap's storage.
Thanks for that its now working nicely
Had me baffled for a while though as it was just painting a blank window
This was down to the last parameter of the BltBitMapRastPort method as I was just passing it a 0 instead of 0xC0 for a straight copy.

Thanks
Sparticle is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Color and flickering problem when toggling menu mode on OS X? _ThEcRoW support.FS-UAE 1 22 March 2014 23:38
Flickering Striations AshtonPete support.Other 4 28 October 2013 17:03
Kick off 2 flickering msayed1977 support.WinUAE 24 05 April 2013 20:42
IK+ flickering problem with WHDLoad 17.0.5124 alkis21 project.WHDLoad 4 16 October 2011 16:44
hires flickering... sometimes Tony Landais support.WinUAE 11 17 July 2006 16:10

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:01.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.08968 seconds with 15 queries