Oxygen Basic

Programming => Example Code => Topic started by: Peter on February 01, 2011, 03:19:40 AM

Title: 3D Fun Test
Post by: Peter on February 01, 2011, 03:19:40 AM
Deleted

Title: Re: 3D Fun Test
Post by: Charles Pegge on February 01, 2011, 10:15:08 AM

Thanks Peter,

I've found a way to radically reduce the CPU load. See if it works okay on your system.

Code: [Select]
act=1

While WinExit =0
if act then
  ClearBuffer &hFF8400
  DrawText hdc,"3D Test",254,16,&hFFFF00
  DrawText hdc,"Use arrow keys and (a) for origin",20,40,&hFFFF00
  CalCulation()
  For pk =0 To ih
  For dp =0 To pk
  DrawText hdc,"<>",a2(dp)-60,b2(dp),&h00FF64
  Next: Next
  FlipBuffer
end if
DoEvents
act=0
iF Key(vk_right) Then gx = gx - 1 * pi / 360 : act=1
iF Key(vk_up)    Then ay = ay - 1 * pi / 360 : act=1
iF Key(vk_left)  Then gx = gx + 1 * pi / 360 : act=1
iF Key(vk_down)  Then ay = ay + 1 * pi / 360 : act=1
iF Key(vk_a)     Then Initial : act=1
sleep 5
Wend

Charles
Title: Re: 3D Fun Test
Post by: Charles Pegge on February 01, 2011, 10:52:37 AM
Could you try reducing the sleep period to 1. This is sufficient to prevent the CPU from maxing out.

Charles