Help

Blitz3D Forums/Blitz3D Programming/Help

asdfasdf(Posted 2004) [#1]
Global Airport

Function Main()

Airport = LoadImage("Data\Graphics\Airportwrld.gif")

What is wrong with this? It keeps on say 'Program has ended' and does not display anything.
MidHandle Airport

DebugLog "Airport: " + Airport

DrawImage Airport,GarphicsX / 2,GraphicsY / 2,0

RenderWorld
Flip

End Function

It also says 'Image Does not exist' but it does.
B:\
===

DATA DIR 3/11/2004 1:21:58 PM
Airport World.bb 1833 3/23/2004 7:23:00 PM
Airport World.exe 1245184 3/22/2004 11:09:27 AM
Menu.bb 279 3/23/2004 7:23:21 PM


B:\DATA
=======

GRAPHICS DIR 3/23/2004 7:24:03 PM
MOVIES DIR 3/21/2004 6:37:35 PM
MUSIC DIR 3/11/2004 1:21:58 PM
SOUNDS DIR 3/22/2004 11:04:28 AM


B:\DATA\GRAPHICS
================

Airportwrld.3ds 40115 3/7/2004 5:10:52 PM
Airportwrld.gif 7627 3/21/2004 6:39:24 PM
Boeing 747.3ds 169825 3/9/2004 6:06:50 PM

B:\DATA\MOVIES
==============

Credits.avi 123048448 3/12/2004 7:16:45 PM


B:\DATA\MUSIC
=============

Song01.wav 11925300 11/9/1999 4:47:36 PM


B:\DATA\SOUNDS
==============

atc0.wav 236376 1/11/2000 1:02:26 PM

I can prove it.


Paul "Taiphoz"(Posted 2004) [#2]
Try..

Function Main() 
while not keyhit(1)
cls

  Airport = LoadImage("Data\Graphics\Airport World.gif") 
  MidHandle Airport 
  DrawImage Airport,GarphicsX / 2,GraphicsY / 2,0 

Flip 
wend
End Function 


You dont need render world. thats for 3D.

Your code was ending because you had no iteration. or looping in place. So it run through the function once and then just ended.

I fink ;) .. hope it helps and good luck


soja(Posted 2004) [#3]
1) The entry point for Blitz programs is the top of the program (not the Main function, like in C). Consequently, Main() never gets called/executed.
2) Even if Main was called, it would only run through once before quitting. You need to have a loop. A very simple one is:
While Not KeyHit(1) ; Escape key
    ; Do main loop stuff
Wend

3) You want to keep your LoadImage OUT of your main loop. You only want to call it once, as opposed to something like Flip, which you want to call every frame.


Brendane(Posted 2004) [#4]
And don't forget to set up a graphics mode... See the Graphics3D command.


_PJ_(Posted 2004) [#5]
Can .GIF's be used as images?
I know if animated, they can be run with PlayMovie etc.


big10p(Posted 2004) [#6]
Blitz Programmer,

In you directory listings above the file is called 'Airportwrld.gif' in the GRAPHICS directory, not 'airport world.gif'.


electronin(Posted 2004) [#7]
GIF's don't work with LoadImage().