Author Topic: Rainbow Speed  (Read 4686 times)

0 Members and 1 Guest are viewing this topic.

Aurel

  • Guest
Re: Rainbow Speed
« Reply #15 on: December 18, 2013, 12:42:08 AM »
Quote
No panic Aurel.
Any 32-bit program will run on a 64 bit OS.

What kind of panic ;D
There is no panic at all because most well know WINDOWS programs ran on 32 bit systems.

JRS

  • Guest
Re: Rainbow Speed
« Reply #16 on: December 18, 2013, 11:22:37 AM »
Quote
There is no panic at all because most well know WINDOWS programs ran on 32 bit systems.

Maybe panic isn't the right word. You are still able to run DOS applications in DOSBox and DOSemu. You have the same option with Windows 32 bit applications on Windows 64 bit operating systems. It's called SysWOW64. (WinBox32) I see very little if any effort put in maintaining or enhancing 32 bit commercial applications. Why would anyone want to spend time or money  (other than a hobby/fun project) developing for a 32 bit OS?

FWIW I'm creating a ScriptBasic extension module for SDL_draw and it will be done with C BASIC to encourage expanding on the extension module with other direct SDL API calls. This will also give the Android version of ScriptBasic a GUI and taking advantage of the Android UI features and interfaces. (touch, orientation, ...)


 
« Last Edit: December 18, 2013, 12:20:42 PM by John »

JRS

  • Guest
Re: Rainbow Speed
« Reply #17 on: December 19, 2013, 07:07:11 PM »
I did a ScriptBasic SDL_Draw version of Peter Rainbow benchmark. I'm happy to report that Peter's Simple Window library (compiled with OxygenBasic) takes the same time as the SB version.  :o  (and a lot easier to use)



Code: [Select]
' ScriptBasic Rainbow

DECLARE SUB Window ALIAS "SB_Window" LIB "sdl"
DECLARE SUB RGB ALIAS "SB_RGB" LIB "sdl"
DECLARE SUB WaitKey ALIAS "SB_WaitKey" LIB "sdl"
DECLARE SUB Ticks ALIAS "SB_Ticks" LIB "sdl"
DECLARE SUB UpdateRect ALIAS "SB_UpdateRect" LIB "sdl"
DECLARE SUB CLS ALIAS "SB_CLS" LIB "sdl"
DECLARE SUB Draw_Pixel ALIAS "SB_Draw_Pixel" LIB "sdl"
DECLARE SUB Draw_Line ALIAS "SB_Draw_Line" LIB "sdl"
DECLARE SUB Draw_Circle ALIAS "SB_Draw_Circle" LIB "sdl"
DECLARE SUB Draw_FillCircle ALIAS "SB_Draw_FillCircle" LIB "sdl"
DECLARE SUB Draw_HLine ALIAS "SB_Draw_HLine" LIB "sdl"
DECLARE SUB Draw_VLine ALIAS "SB_Draw_VLine" LIB "sdl"
DECLARE SUB Draw_Rect ALIAS "SB_Draw_Rect" LIB "sdl"
DECLARE SUB Draw_FillRect ALIAS "SB_Draw_FillRect" LIB "sdl"
DECLARE SUB Draw_Ellipse ALIAS "SB_Draw_Ellipse" LIB "sdl"
DECLARE SUB Draw_FillEllipse ALIAS "SB_Draw_FillEllipse" LIB "sdl"
DECLARE SUB Draw_Round ALIAS "SB_Draw_Round" LIB "sdl"
DECLARE SUB Draw_FillRound ALIAS "SB_Draw_FillRound" LIB "sdl"

Window(300, 300, "ScriptBasic Rainbow")
CLS(RGB(255, 255, 255))
m = -1.57
x1 = 1
y1 = 301
q = 0.00101
gx = 0.15
gy = 0.3
t1 = Ticks()
FOR s = 1 TO 3107
  m = m + q
  x1=x1 + gx * cos(m)
  y1=y1 + gy * sin(m)
  x2 = (x1 + 150)/2
  y2 = (y1 + 300)/2
  x3 = (x1 + x2) /2
  y3 = (y1 + y2) /2
  x4 = (x2 + 150)/2
  y4 = (y2 + 300)/2
  x5 = (x1 + x3) /2
  y5 = (y1 + y3) /2
  x6 = (x2 + x3) /2
  y6 = (y2 + y3) /2
  x7 = (x2 + x4) /2
  y7 = (y2 + y4) /2
  x8 = (x4 + 150)/2
  y8 = (y4 + 300)/2
  Draw_Line(x1, y1, x5, y5, RGB(255, 0, 0))
  Draw_Line(x5, y5, x3, y3, RGB(255, 102, 0))
  Draw_Line(x3, y3, x6, y6, RGB(255, 255, 0))
  Draw_Line(x6, y6, x2, y2, RGB(0, 255, 0))
  Draw_Line(x2, y2, x7, y7, RGB(0 ,0, 255))
  Draw_Line(x7, y7, x4, y4, RGB(0, 0, 128))
  Draw_Line(x4, y4, x8, y8, RGB(128, 0, 128))
NEXT
UpdateRect()
t2 = Ticks()
t3 = (t2 - t1) / 1000
PRINT "Lines: ", s * 7,"\n"
PRINT "Time:  ",FORMAT("%.4f",t3)," seconds.\n"
WaitKey

jrs@laptop:~/sb/sb22/sdl$ scriba rainbow.sb
Lines: 21756
Time:  0.0650 seconds.
jrs@laptop:~/sb/sb22/sdl$
« Last Edit: December 19, 2013, 08:05:00 PM by John »