Yep, your code works fine. Problem is, as soon as a command like this:
d3d_font 1, "times new roman", 10, 0, 0, 0
appears anywhere in the code (even after the end or in a function) it causes the crash:
oTime=hitimer()
nTime=hitimer()
tFlag as boolean
tFlag=0
dFlag as boolean
dFlag=0
changeDisplay(800,600,32)
do
nTime=hitimer()
if (nTime-oTime)>10000
if tFlag=0
tFlag=1
dFlag=0
else
tFlag=0
dFlag=0
endif
oTime=hitimer()
endif
if tFlag=1 and dFlag=0
changeDisplay(1024,768,32)
dFlag=1
endif
if tFlag=0 and dFlag=0
changeDisplay(800,600,32)
dFlag=1
endif
set cursor 10,10
print "ScreenW:",screen width(),";","ScreenH:",screen height()
sync
loop
end
function changeDisplay(w as integer, h as integer, d as integer)
set display mode w,h,d
make object sphere 1,20
endfunction
d3d_font 1, "times new roman", 10, 0, 0, 0
Your code as above, but with the d3d_font included. This causes the program to crash, even though the d3d_font instruction never gets executed.
Hmm!