GLBasic forum

Main forum => Bug Reports => Topic started by: Maximillien on 2023-May-20

Title: GLBasic failing to display sprites
Post by: Maximillien on 2023-May-20
Hi guys

i purchased Glbasic recently on steam. Great language.
I'm just a beginner , and i'm in the middle of the tutorial.But i wonder why it won't display sprites? i just have a black screen
I made sure to write the simplest program possible, but it still fail, i wonder why?  :O

LOADSPRITE "icon.bmp",0
DRAWSPRITE 0, 100,400
SHOWSCREEN
KEYWAIT

cheers  :booze:
Title: Re: GLBasic failing to display sprites
Post by: Qedo on 2023-May-22
if the "icon.bmp" file is present in the "Media" folder add at the beginning:
SETCURRENTDIR("Media")
Title: Re: GLBasic failing to display sprites
Post by: Maximillien on 2023-May-22
I already did that , still not working. :'(
The one thing that surprises me, is that, it is an image generated by GLBasic itself in the program
Title: Re: GLBasic failing to display sprites
Post by: Qedo on 2023-May-22
maybe I understood, try:
LOADSPRITE "..\icon.bmp",0
Title: Re: GLBasic failing to display sprites
Post by: Maximillien on 2023-May-22
This time, it fail to compile :(

This is what it says

compiling:
C:\Users\wyzhe\AppData\Local\Temp\glbasic\gpc_temp0.cpp: In function 'int __GLBASIC__::__MainGameSub_()':
C:\Users\wyzhe\AppData\Local\Temp\glbasic\gpc_temp0.cpp:22:19: error: incomplete universal character name \U
 LOADSPRITE( CGStr("C:\Users\wyzhe\Desktop\SPRITE\icon.bmp"),0);
                   ^
*** FATAL ERROR - Please post this output in the forum
Title: Re: GLBasic failing to display sprites
Post by: Qedo on 2023-May-22
Your source code?
Title: Re: GLBasic failing to display sprites
Post by: Qedo on 2023-May-22
sorry, i confused DOS with GLB command
instead of LOADSPRITE "..\icon.bmp",0
try
LOCAL ok = SETCURRENTDIR("..") // One up level
LOADSPRITE "icon.bmp",0

provided that the bmp file resides in the parent folder
Title: Re: GLBasic failing to display sprites
Post by: Maximillien on 2023-May-23
IT WORKSSSS  8)  8)  8)
Thank you for your patience with an annoying newbie like me, Qedo.  :)  :)