I was sitting here Experimenting...
Now the CPU cycles won't ramp up and it rotates on a timer now. On top of this you will get max frame rates.
Again WLGfx, thanks for the hard work my friend.
load dll "kernel32.dll", 1
set display mode 800, 600, 32
sync rate 0 : sync on : autocam off : BACKDROP ON : COLOR BACKDROP 0
global temphere as integer
image = generate_sphere_texture( 0, 512, 500 )
make object sphere 1, 10, 32, 32
texture object 1, image
position camera 0, 0, -12
do
temphere = getthetime()
if temphere = 1
yrotate object 1, object angle y(1) + 0.01
xrotate object 1, object angle x(1) + 0.005
temphere = 0
endif
SET TEXT SIZE 38
TEXT 10,10, "Frames Per Second : " + STR$(SCREEN FPS())
DLL_Sleeping(1)
sync
loop
function generate_sphere_texture( imageID, size, radius )
if imageID = 0
imageID = 1
while ( image exist( imageID ) )
inc imageID
endwhile
endif
` locate a temporary bitmap to work with
bitmapID = 1
while ( bitmap exist( bitmapID ) )
inc bitmapID
endwhile
create bitmap bitmapID, size, size
scale# = 1.0 / size
lock pixels
for x = 0 to size - 1
for y = 0 to size - 1
xang# = 360.0 / size * x
yang# = 180.0 / size * y
xpos# = sin( yang# ) * cos( xang# ) * radius
ypos# = sin( yang# ) * sin( xang# ) * radius
zpos# = cos( yang# ) * radius
noise# = simplex scaled 3d( 5, 0.9, scale#, -255.0, 255.0, xpos#, ypos#, zpos# )
col = noise# ` cast to integer
if col >= 0
dot x, y, rgb( col, col, 255 )
else
col = 255 - col
dot x, y, rgb( 50, col, col )
endif
next
next
unlock pixels
get image imageID, 0, 0, size-1, size-1
delete bitmap bitmapID
endfunction imageID
function DLL_Sleeping(howmanyseconds) // This helps keep the CPU speed low when not in use
call dll 1, "Sleep", howmanyseconds
endfunction
function getthetime() // A Timer function
returnthenumber = 0
Elapsed=(Timer()-T)/1000
if Elapsed => 1
returnthenumber = 1
T=Timer()
endif
ENDFUNCTION returnthenumber