
Why do i have to use an absolute path to load a resource?
In the window version you can load an image or sound like this:
;
; ------------------------------------------------------------
;
; PureBasic - Keyboard example file
;
; (c) 2001 - Fantaisie Software
;
; ------------------------------------------------------------
;
; NOTE: This file doesn't compile with the demo version !
;
If InitKeyboard() = 0
MessageRequester("Error", "Can't open DirectX 7", 0)
End
EndIf
If InitSprite() = 0
MessageRequester("Error", "Can't open DirectX 7", 0)
End
EndIf
MessageRequester("Information", "This will test the fast keyboard access..."+Chr(10)+"Press 'ESC' to quit!", 0)
If OpenScreen(640, 480, 16, "Sprite")
x = 100
y = 100
Code: Select all
If LoadSprite(0, "data/Player_1.bmp", 0) = 0
MessageRequester("PureBasic", "Can't load the sprite file (data/Player_1.bmp)", 0)
End
EndIf
Repeat
FlipBuffers()
ClearScreen(0,0,0)
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
x-1
EndIf
If KeyboardPushed(#PB_Key_Right)
x+1
EndIf
If KeyboardPushed(#PB_Key_Up)
y-1
EndIf
If KeyboardPushed(#PB_Key_Down)
y+1
EndIf
DisplaySprite(0, x, y)
Delay+1
Until KeyboardPushed(#PB_Key_Escape) Or Delay > 5000
Else
MessageRequester("Error", "Impossible to open a 680*480 16 bit screen",0)
EndIf
End
--------------------------------------------------------------------------------
This is a PureBasic example, but if you try, this don't work, because the compiler can't find the path, like the Keyboard example like this.
Could anyone tell me if you have the same problem???


