backbuffer bug (?)

BlitzPlus Forums/BlitzPlus Programming/backbuffer bug (?)

koekebakker(Posted 2004) [#1]
well, today i bought B+ and it realy kick butt. However I
still don't get this...

Quote :"if you set drawing operations to the BackBuffer() you will NOT see any of them until you call FLIP. "

UH-UH! in this code below I see everything before flipping
the whole buffer. I even turnd around my monitor several
times, but the backbuffer was still visible :)

Info : It is drawing a map for a run and jump game.


--- begin of code ---

Global block=32 ; tile hight and width in pixels
Dim wall(35) ; main wall tiles 32 x 32

Graphics 320,240,32

; setup background

SetBuffer BackBuffer()
bg1 = LoadImage("gfx\bg1.png")
DrawImage (bg1,0,0)
Color 0,0,0 Rect 0,224,320,16

For piece=0 To 35 ; load main walls
wall(piece) = LoadAnimImage("gfx\tiles.bmp",32,32,piece,1) ; assign bmp piece to wall dim
Next


; draw main walls

For y=0 To 6 For x=0 To 9

Read wallmap

For datavalue=0 To 35
If wallmap=datavalue Then wallnum=datavalue ; checks data and declare dim to wall
Next

MaskImage (wall(wallnum)),255,0,255 ; pick chroma key
DrawImage (wall(wallnum),x*block,y*block) ; draw wallpiece on grid

Next
Next
Restore wallmap

.wallmap
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Data 12, 0, 0, 0, 0, 0, 0, 0, 0,11
Data 16, 6, 6, 9, 5, 7, 6,10, 9,14


-- end of code ---

Errr.. help?


Ryan Moody(Posted 2004) [#2]
My guess is the graphics mode you've picked - Use 800,600 (leave out the ,32 at the end)

Ryan


koekebakker(Posted 2004) [#3]
Hehe, I was still dealing with 1.11
the 1.39 update works fine.

btw.. a run & jump game should always
be low-res :)

cheers,


Hotcakes(Posted 2004) [#4]
Yeh, well, then doublesize the graphics - 640x480 is the standard lowend PC resolution - you don't want to run the risk of blowing some peoples monitors up.

Also if you're in windowed mode (ie with the desktop in the b/g) there is no such thing as a backbuffer, all drawing operations are instantaneous. Altho I -think- it works differently in a canvas..?


koekebakker(Posted 2004) [#5]
You are saying 320 x 240 is killing monitors? :)
You _got_ to be kidding.

But how can I debug and test it if the windowed mode
and full screen mode are'nt compatible and bring up a whole
different result !?!

The default flag for the GRAPHICS command is "0" witch means windowed in debug mode and full screen in non-debug
mode.

Some games _need_ to be in 320 x 240 for the classic 486/
amiga feeling.


Hotcakes(Posted 2004) [#6]
You are saying 320 x 240 is killing monitors? :)

If the monitor doesn't support it (likely on an old monitor), and it doesn't have 'out of range' checking (much more likely on an old monitor), and the drivers windows are using are not adequate (incredibly likely on a standard 'plug and play monitor' driver), it will bust.

The default flag for the GRAPHICS command is "0" witch means windowed in debug mode and full screen in non-debug

The two modes shouldn't be so much different that it makes things completely different for each mode. But there are some things about windowed mode, mostly Windows limitations (ie the desktop is not double bufferred), that you may have to watch out for maybe.

Some games _need_ to be in 320 x 240 for the classic 486/

Again, if you want that so bad, use 640x480 and doublesize the graphics.


GrrBrr(Posted 2004) [#7]
offtopic:
320x240 was the standard resolution in games for years. i don't think it would kill an old monitor.

(think of zak-mc-kraken, indy500, stunts.. etc etc etc all 320x240 or 320x200 ;) )


koekebakker(Posted 2004) [#8]
Actuly I did stretch the images. I overlapped the graphics
with a scanline image (odd = 100% black, even = 100% transparent).
A VWait and whoopee!!! it gives the game the arcade feeling it needs.


Hotcakes(Posted 2004) [#9]
Maybe for an 8bit resolution, GrrBrr, but I think 16 or 24 bit would push a few older monitors over the edge. 8 bit mode isn't really usable in Blitz. 32 bit mode is very likely not to work on many older monitors, especially those that came out before 32 bit modes were used in gfx cards ;]


koekebakker(Posted 2004) [#10]
In my opinion, you should'nt be too friendly about
compatability with old systems. Wich one of you has a
monitor older then ten years?
Exactly, and for those with such monitor(one third percent)
bad luck. Those systems are probably too slow (486) for
B+ games.


Hotcakes(Posted 2004) [#11]
640x480 is the standard resolution. -THE- standard resolution. If you are targetting a lower resolution, that suggests you are targetting a lower spec audience. Going by your above post, that's not accurate, so you should code for 640x480 to maximize your audience.


Arem(Posted 2004) [#12]
Heck. Make it 160 by 120. My monitor can handle it. You could really blow some LCDs by making it 1600x1200. Yep. LCD's stink. I think it really stands for "Little Crappy Display."


Damien Sturdy(Posted 2004) [#13]
"If the monitor doesn't support it (likely on an old monitor), and it doesn't have 'out of range' checking (much more likely on an old monitor),"

umm, OLD monitors? old games ran at that resolution.... >.<

what about 320x200?

How can LCDs get blown? :S sounds odd to me considering theres no CRT in there to blow!

BTW, I have a monitor of 10 years old, and it actually displays 1280x1024 (yes, it does)! The new monitor that came with my (then new) 1.3ghz system, wouldnt go above 1024x768.... stupid things.....

Must say though, its getting on a bit and 1280x1024 is starting to blur out....