flashing screen?

Blitz3D Forums/Blitz3D Beginners Area/flashing screen?

mindstorms(Posted 2006) [#1]
I am using 2 dimensions in this screen, but when I run the program in full screen mode part of it flickers, and I can't figure out why. This has never been a problem for me before...

Global width = 1280
Global height = 960
Graphics width,height,0,1
SetBuffer BackBuffer()
SeedRnd MilliSecs()



map_image = LoadImage("graphics/map_background.jpg")
ResizeImage map_image,width,height

Repeat

cls

DrawImage map_image,0,0

Flip
Until KeyDown(1)
End



splinux(Posted 2006) [#2]
it's strange.. i tried the program and runs well.. maybe you have some problems with your graphics card, or you monitor..


mindstorms(Posted 2006) [#3]
There are bars that go across the screen, moving, and flickering. I am running on a slower computer, but this has never happened to me before.


mindstorms(Posted 2006) [#4]
I found out how to avoid the flickering. I used flip false instead of flip. Are ther any side effects of just using flip false that I should know about?


b32(Posted 2006) [#5]
"Flip False" copies the buffer to the screen without waiting for a VSync. The videocard constantly copies the buffer to the screen and with "Flip False" it could be halfway the process. That will cause the vertical interference.

I found out the best way to test this is to make the screen alternate between black and white:

I have seen people using VWait before calling Flip false, which accordingly to the Blitz Help should act differently.


mindstorms(Posted 2006) [#6]
When running your program, I got verticle bars on all four combinations of flipenable and vwaitable. I noticed alot more when they were both false, but (especially when I drew a rectangle on the screen) there was always lines or bars traveling up and down the screen. In the program I am working on now, by turning both to false I get a clear picture. I am now so confused, please help.


Happy Easter!


splinux(Posted 2006) [#7]
I've had that problem too.
Try to put "delay 100" just before flip.


splinux(Posted 2006) [#8]
PS: there are 2 splinux's, me and my brother.
The first answer was given by my brother, the last by me.


Sir Gak(Posted 2006) [#9]
Try seeing if your video card supports the screen resolution of 1280 x 960 that you are attempting:
(from the Blitz command help):
; ; CountGFXModes()/GfxModeWidth/GfxModeHeight/GfxModeDepth example 

intModes=CountGfxModes() 

Print "There are " + intModes + " graphic modes available:" 

; Display all modes including width, height, and color depth 
For t = 1 To intModes 
Print "Mode " + t + " Width"+GfxModeWidth(t)+" Height=" + GfxModeHeight(t) + " Height=" + GfxModeDepth(t) 
Next 
 
MouseWait()
End



mindstorms(Posted 2006) [#10]
Sorry for the long delay, I was away and could not get to my computer.

SpLinux: No, putting that in does not work, but it makes it better. However, putting it in slows down the program considerably.

Sir Gak: When I ran your program, it came up with 1280x960x32, which is what I am using. I have tried changing the resolution to "0" and "16" but that does not help.

I think these lines only appear in 2-d mode, because in 3-d mode everything works fine. The effect of the lines is almost as if it isn't quite done drawing that part of the picture when it flips, which makes no sense to me because when I try to do screenshots or screen capture, it comes out as a whole image.


Sir Gak(Posted 2006) [#11]
mindstorms:
I myself get 1280x960x16 and 1280x960x32 as two of the modes available on my vid card. Is there by some off chance a possibility that maybe your video card is not "gutsy" enough, or maybe is malfunctioning, the problem being just hardware? You did say it is a slower machine.

Hey, by chance, is the original image larger than the 1280x960 parameters? I understand that Blitz has problems with images larger than the graphics screen width and height. Also, since you are filling the entire screen with your image, does DrawBlock work for you (it doesn't require masking, and just throws everything up there, including the otherwise transparent default of "black".) I realize you are using ResizeImage, which does resizing to pixels rather than a percentage, but it never hurts to check your assumptions. After resizing, is the resized image actually at the width and height you set?


mindstorms(Posted 2006) [#12]
It was my computer. I got a new motherboard/processor and it works fine. Thanks everyone!

Is there any way to make sure that it will work on all computers, ones like mine and faster ones too?