Hi all, for security reasons I want to make it harder to hack into my program, so I wish to call DarkCloud functions from the dll itself rather than just the function call.
Why is this crashing?
I put DarkCloud.dll in the same folder as my project because i want to use call dll.
Rem Project: DarkCLOUDSample
Rem Created: Sunday, June 28, 2009
load dll "DarkCLOUDS.dll",1
rem Please wait
set text font "verdana" : s$="generating clouds...please wait"
center text screen width()/2,screen height()/2,s$ : sync
rem init app at 60fps
sync on : sync rate 60
rem half-fill the sky with clouds
dccloudy(0.5)
rem clouds at 3 km
dccloudtall(3)
rem set sky brightness to 1
brightness#=1.0
dcbrightness(brightness#)
rem adjust brightness based on time of day
dcautobrightness(1)
rem set wind to 30 mph at 270 degrees (heading west)
dcwind(30,270)
rem init with texture number 1, and number of keyframes per day
dcinit(1,10)
rem put clouds at 3km altitude
dccloudtall(3.0)
rem starting at 7am
time#=7.0
rem the update command creates the cloud texture
dcupdate(time#)
rem show texture 1 as the backdrop
`texture backdrop 1
rem create a 3D object in the scene
load object "pelican.dbo",1
scale object 1,1000,1000,1000
set normalization on
rem place camera for best view
position camera 0,50,-200
rem Main loop
do
rem step through the day
time#=time#+100.0/(60.0*60.0*60.0)
rem update clouds
dcupdate(time#)
rem use mouselook on camera
mx#=mousemovex()/10.0;
my#=mousemovey()/10.0;
if MOUSECLICK()<>0
rotate camera camera angle x()+my#,camera angle y()+mx#,0
endif
if upkey()=1 then move camera 0,1.0
if downkey()=1 then move camera 0,-1.0
if leftkey()=1 then move camera 0,-1.0
if rightkey()=1 then move camera 0,1.0
rem rotate the object
yrotate object 1,a# : inc a#,0.1
rem apply a real-time clouds as a cube map on the object
cubemap(128,2,3,4,5,6,7)
` set cube mapping on 1,2,3,4,5,6,7
rem update screen
sync
rem end loop
loop
function cubemap(size as integer,img1 as integer,img2 as integer,img3 as integer,img4 as integer,img5 as integer,img6 as integer)
call dll 1,"?DCMakeCubemap@@YAXHHHHHHH@Z",size,img1,img2,img3,img4,img5,img6
endfunction
function dcupdate(hours# as float)
call dll 1,"?DCUpdate@@YAXM@Z",hours#
endfunction
function dcinit(img as integer,steps as integer)
call dll 1, "?DCInit@@YAXHH@Z",img,steps
endfunction
function dcautobrightness(brightness# as float)
call dll 1, "?DCSetAutoBrightness@@YAXE@Z", brightness#
endfunction
function dcbrightness(brightness# as float)
call dll 1, "?DCSetBrightness@@YAXM@Z%",brightness#
endfunction
function dccloudtall(height# as float)
call dll 1, "?DCSetCloudHeight@@YAXM@Z",height#
ENDFUNCTION
function dccloudy(cloudy# as float)
call dll 1, "?DCSetCloudy@@YAXM@Z",cloudy#
ENDFUNCTION
function dcwind(speed# as float,degrees as integer)
call dll 1, "?DCSetWind@@YAXMM@Z", speed#,degrees
ENDFUNCTION
thanks!