Question about Image

Blitz3D Forums/Blitz3D Beginners Area/Question about Image

Gridian(Posted 2010) [#1]
Hello All,

I am learning about the Use of Images. I just solved the Problem, that my Image was not existing even though it was loaded correctly.
It did not exist because i loaded it before the Graphics command. Now i moved the LoadImage() 3 lines to the bottom in the source and it works perfectly.
Can anyone explain me why this image now works perfect, when i load it after the Graphics-Command instead of prior to it?

Thanks :)


GIB3D(Posted 2010) [#2]
The Graphics command deletes all media. Same for Graphics3D.

Here's a piece from the help file
"This command sets Blitz into 'graphics' mode with the specified width, height, and color depth (in bits). This command must be executed before any graphic related commands can be used. Every time this command is used, any images loaded will be lost, and all handles to images will become invalid."


Drak(Posted 2010) [#3]
Hi Gridian, I found this in the command reference:

From Blitz Docs:

Graphics width, height, color depth,[mode]

Parameters:
width = width of screen in pixels (640, 800, etc)
height = height of screen in pixels (480, 600, etc)
color depth = depth in bits (0, 16, 24, or 32 bit)
mode = Video mode (see description); Optional

Description
This command sets Blitz into 'graphics' mode with the specified width, height, and color depth (in bits). This command must be executed before any graphic related commands can be used. Every time this command is used, any images loaded will be lost, and all handles to images will become invalid.




Edit: Doh! Gib3D beat me to it!


Gridian(Posted 2010) [#4]
Well, I could be embarrassed by not having found out myself - i frequently use those Docs ^^

Thank you for your answers :-)


puki(Posted 2010) [#5]
Yeh, that additional info ('Every time this command is used, any images loaded will be lost, and all handles to images will become invalid') wasn't in the original printed manual/documentation (just in case "Gridian" has them).


GIB3D(Posted 2010) [#6]
What I found useful though was that Types aren't deleted and their values stay the same so you could just reload all the entities tied to it if you were to do something like changing the game's resolution.


Gridian(Posted 2010) [#7]
puki, my Docs say the same - i got V1.88.

I keep experimenting and just found out that on a Resolution which leads to 570'000 displayed pixels my program runs at 63+ FPS and with 580'000 Pixels the FPS drops to about 17. Do you guys happen to know why this small increase in resolution leads to that drastic drop in FPS? (its running in windowed btw)

Greetings, Gridian :)

EDIT:

I also just found out that on 800 by 500 it runs a lot smoother then on 500 by 800.


Ross C(Posted 2010) [#8]
This sounds like a v sync issue. Try Flip False to disable the code waiting for the monitor to draw the screen. you'll need to control your frame rate yourself though, and you could suffer from screen tearing.


Gridian(Posted 2010) [#9]
Oy - that makes things faster :)

With no action i get 170'000 FPS, with action i get 39 instead of 33 on 500 by 800.