Oxygen Basic

Information => Reference => Topic started by: JRS on April 09, 2018, 07:49:20 PM

Title: WoW
Post by: JRS on April 09, 2018, 07:49:20 PM
WoW Windows on Wine

Most of the members of this forum know my primary development environment is Linux. I have been using VirtualBox in the past to run a Windows environment and still remain in Linux. I installed the latest version of CrossOver . The problem with VirtualBox is it isn't the best environment for CPU intensive programs like graphics. CrossOver is suppose to run Windows programs at native speed on Linux. (Yet to be proven by me.)

Here is O2 running the Controls example under CrossOver on Linux 64 bit.

(http://scriptbasic.org/img/CO2.png)
Title: Re: WoW
Post by: JRS on April 09, 2018, 09:06:43 PM
O2 64 bit seems to be working under CrossOver as well.

The attachment just shows the 1st of the 3 message boxes the program created to display to results.
Title: Re: WoW
Post by: JRS on April 09, 2018, 10:14:37 PM
The O2 IUP 3D OpenGL example seems to run smoothly.

Is there an O2 example that would show FPS?
Title: Re: WoW
Post by: JRS on April 09, 2018, 11:38:13 PM
A few CO2 GDI examples.

Title: Re: WoW
Post by: JRS on April 10, 2018, 12:39:29 AM
I was able to get the Script BASIC Inno installer to work under CrossOver.  CodeWeavers indicated that the VB6 Runtime wasn't compatible with my Win7 bottle. I ignored the warning and it installed fine.

The attached image is the Script BASIC SDL_gfx extension module simple draw primitives demo running.

(http://scriptbasic.org/img/csb_iupdict.png)
Title: Re: WoW
Post by: jack on April 10, 2018, 03:35:51 AM
I had CrossOver for my Mac in the past but never used it because it did not have an easy right-click-run-in-CrossOver like wine does.
Title: Re: WoW
Post by: JRS on April 10, 2018, 03:48:09 AM
I can't seem to get theming working in CrossOver. When I did have Wine installed, XP style themes worked I believe.

Title: Re: WoW
Post by: JRS on April 10, 2018, 10:07:48 PM
I installed Wine 3.0 on my Ubuntu 64 bit laptop.

Here is the O2 OpenGL PineCone example. Movement is instant with no artifacts. Smooth as silk.

I'm convinced that Wine is a viable option for O2 32 or 64 bit on Linux. I would agree that Wine is running Windows programs at native speeds. The other advantage is Wine isn't running a VM and all its resources are directed at a Window program and not supporting an OS to run them.
Title: Re: WoW
Post by: Charles Pegge on April 10, 2018, 11:42:07 PM
Hi John,

Is it giving you the full 60 fps? When I tried Wine/Ubuntu a few years back, it would only do Opengl at 30 fps (Nvidia driver), which is quite noticeable on animations.

The pine cone was one of Robbek's creations :)
Title: Re: WoW
Post by: JRS on April 11, 2018, 12:37:04 AM
Here is my Wine vs. Linux speed test.

Linux Wine - 32 bit Windows Script BASIC

(http://scriptbasic.org/img/mandelbrot_wine.png)


Linux - 64 bit Script BASIC

(http://scriptbasic.org/img/mandelbrot_linux.png)


Title: Re: WoW
Post by: JRS on April 11, 2018, 08:13:50 AM
Quote
Is it giving you the full 60 fps?

There is no FPS feedback from Pine Cone.

The IUP OpenGL example ran as well as it did on Windows native.
Title: Re: WoW
Post by: Mike Lobanovsky on April 11, 2018, 09:32:32 AM
No John,

We're more interested in Wine 3.0 Windows OpenGL emulation than SDL or pure GDI, whose speeds are of lesser interest because they have been fast enough for a long time both natively and under Wine.

Windows OpenGL emulation used to be dependent on Linux' Mesa. Probably Wine 3.0 can get through to nVidia and ATi Linux drivers directly. It would be interesting to see how many FPS Oxygen's OpenGL scripts yield under modern Wine vs. native Windows.
Title: Re: WoW
Post by: JRS on April 11, 2018, 09:42:09 AM
Mike,

Please provide an OpenGL O2 example with FPS feedback you would like me to run under Wine (https://www.winehq.org/news/2018011801).
Title: Re: WoW
Post by: Mike Lobanovsky on April 11, 2018, 02:00:56 PM
John,

Here's PineCone augmented with an FPS counter in the window title. The screenshot below shows it verified against the industry standard Fraps FPS counter (yellow figures in the bottom right corner).
Code: OxygenBasic
  1.   #compact
  2.   % Title "PineCone"
  3.   % Animated
  4.   % ScaleUp
  5.  '% PlaceCentral
  6. '% AnchorCentral
  7. '% NoEscape
  8.  % ColorCodedPick
  9.   % MultiSamples 4
  10.  
  11.   includepath "$\inc\"
  12.   include "ConsoleG.inc"
  13.  
  14.  
  15.   function makelist() as sys
  16.   ==========================
  17.  
  18.   type coor float x,y,z
  19.  
  20.   static coor z
  21.   static float golden_angle = 137.508  
  22.   static float golden       = golden_angle*Pi/180
  23.                                      
  24.   macro floret(n, r,ang,xc,yc) 'inner procedure
  25.  ----------------------------
  26.   float r , ang , xc , yc
  27.   r =(5.3 * Sqr(n*golden))
  28.   ang = (n*golden)
  29.   xc = r*Cos(ang)/100
  30.   yc = r*Sin(ang)/100
  31.   z.x=xc : z.y=yc
  32.   end macro    
  33.  
  34.   sys i
  35.   static sys seeds
  36.   seeds=CompileList seeds
  37.   for i=1 to 140
  38.     floret(i)
  39.     glPushMatrix
  40.     glTranslatef z.x , z.y , i/100
  41.     scale 0.11+i/900
  42.     go sphere
  43.     glPopMatrix  
  44.   next  
  45.   for i=144 To 1 step -1
  46.     floret(i)  
  47.     glPushMatrix
  48.     glTranslatef -z.x , -z.y , 2.2-i/200
  49.     Scale  0.11+i/1000
  50.     go sphere
  51.     glPopMatrix  
  52.   next
  53.   glEndList
  54.   return seeds
  55.   end function
  56.  
  57.  
  58.  function main()
  59.   ===============
  60.   sys i,p
  61.   string s
  62.   float  a
  63.  
  64.   static quad t1,t2
  65.  
  66.   if opening then 'FIRST CALL ONLY
  67.    timemark t1
  68.   end if
  69.  
  70.   cls 0,0.1,0.2
  71.   '
  72.  shading
  73.   '
  74.  pushstate
  75.   move 15,-15,-20
  76.   static MoveableObject seeds
  77.   static sys            seedform
  78.   static sys            idf
  79.   if not idf
  80.     idf=100  
  81.     seeds.snap=.5
  82.     seeds.id=idf
  83.     seeds.mode=0x100 'keyboard & mouse (left button rotate)
  84.    SeedForm=MakeList()
  85.   end if
  86.   picked=idf 'always selected
  87.  seeds.act
  88.   scale 10
  89.   move 0,0,-1
  90.  'static float ay
  91. 'rotateY ay : ay+=.2
  92.  if not pick then
  93.     SilverMaterial.act
  94.     static tally
  95.     timemark t2
  96.     double td=timediff(t2,t1)
  97.     if td >= 1.0 then
  98.       title("PineCone  FPS:"+str(tally))
  99.       t1 = t2
  100.       tally = 0
  101.     end if
  102.     tally++
  103.   end if
  104.   go SeedForm
  105.   'go cylinder
  106.  popstate
  107.   '
  108.  'F1 HELP
  109.  '
  110.  if key[0x70]
  111.     flat
  112.     pushstate
  113.     move 20,0
  114.     color .9,.9,.9
  115.     scale  1.5,1.0
  116.     printl "Active Keys:"
  117.     printl
  118.     scale  1/1.5,1.0
  119.     printl "Esc"    tab "Exit"
  120.     printl "Ctrl-P" tab "Take snapshot"
  121.     printl "F1 This help panel"
  122.     printl "Arrow keys PgUp PgDn to move"
  123.     printl "Ctrl Arrow keys PgUp PgDn to rotate"
  124.     printl "+ - keys to scale up and scale down"
  125.     printl "Ctrl Home to reset rotation"
  126.     printl "Shift for faster movement"
  127.     printl
  128.     scale 1.5,1.0
  129.     printl "Mouse:"
  130.     printl             
  131.     scale 1/1.5,1.0
  132.     printl "Point to Object, then"
  133.     printl "Left button to move"
  134.     printl "Middle button to scale"
  135.     printl "Right button to rotate"
  136.     printl "Wheel to move in Z direction"
  137.     popstate
  138.   end if
  139.   picklabel 0
  140.   lastkey=0
  141.   lastchar=0
  142.   end function
  143.  
  144.   EndScript
Title: Re: WoW
Post by: JRS on April 11, 2018, 02:14:57 PM
Mike,

When I compile your O2 script the PineCone is non-moving and no FPS display when I move the PineCone with my mouse.

Can you send me your .exe?

My window hasn't any titlebar or frame.  :o
Title: Re: WoW
Post by: Mike Lobanovsky on April 11, 2018, 05:05:56 PM
Yes John, here are the two 32- and 64-bit binaries.

As always, false AV positives are possible.
Title: Re: WoW
Post by: JRS on April 12, 2018, 12:27:18 AM
Thanks for these tests programs Mike!

It seems the 64 bit version loads and runs faster in Wine than its 32 bit counterpart.

Having a real window rather than a static canvas on the screen was also a plus.

Title: Re: WoW
Post by: jack on April 12, 2018, 01:45:27 AM
I managed to get Wine-3.0 installed on my Ubuntu VM, here are my results
pine64: the fps range from 69 to 300 but mostly in the 100+ range
pine32: very stable fps, about 300 to 315
Title: Re: WoW
Post by: JRS on April 12, 2018, 02:39:13 AM
Thanks Jack for running Mike's tests on a real computer. My old POS is considered low end for graphics support.
Title: Re: WoW
Post by: JRS on April 12, 2018, 04:06:30 AM
I managed to get Wine-3.0 installed on my Ubuntu VM, here are my results
pine64: the fps range from 69 to 300 but mostly in the 100+ range
pine32: very stable fps, about 300 to 315

I would be interested in your CPU consumption in both 32 and 64 bits.
Title: Re: WoW
Post by: Mike Lobanovsky on April 12, 2018, 04:09:55 AM
pine64: the fps range from 69 to 300 but mostly in the 100+ range
pine32: very stable fps, about 300 to 315

Hi Jack,

That's nice to see Wine OpenGL can run fast in a macOS VM but strictly speaking, Oxygen's ConsoleG should yield exactly 60FPS on a fast computer because the OpenGL window created in OpenglSceneFrame that's included in ConsoleG is sync'ed with the monitor vertical retrace signal at 60Hz via a call to Windows-specific wglSwapIntervalEXT(1).

Seeing higher FPS rates on your computer may mean that either the VM driver or macOS itself doesn't support the VSYNC feature MS Windows OpenGL provides in order to eliminate picture "tear" noticeable when OpenGL renders the scene faster than the monitor is able to refresh itself.
Title: Re: WoW
Post by: jack on April 12, 2018, 04:18:34 AM
That's nice to see Wine OpenGL can run fast in a macOS VM but strictly speaking, Oxygen's ConsoleG should yield exactly 60FPS on a fast computer because the OpenGL window created in OpenglSceneFrame that's included in ConsoleG is sync'ed with the monitor vertical retrace signal at 60Hz via a call to Windows-specific wglSwapIntervalEXT(1).

Seeing higher FPS rates on your computer may mean that either the VM driver or macOS itself doesn't support the VSYNC feature MS Windows OpenGL provides in order to eliminate picture "tear" noticeable when OpenGL renders the scene faster than the monitor is able to refresh itself.
I noticed that the fps for ShaderToy examples tend to be 60 when run native on macOS but vary greatly on VM's
Title: Re: WoW
Post by: JRS on April 12, 2018, 04:47:39 AM
On my box, CPU usage is between 40% to 45% evenly between the 4 cores for both 32 and 64 PineCone tests.

BTW: I changed the topic thread title from CO2 to WoW. (Windows on Wine)
Title: Re: WoW
Post by: JRS on April 12, 2018, 03:41:40 PM
I'm making progress at getting Windows theming working in Wine. This is my first attempt at a Win7 looking theme.

I hope to get a better theme set going but this will do for now.



Title: Re: WoW
Post by: JRS on April 12, 2018, 08:04:44 PM
I found that the Luna theme seems to work best.
Title: Re: WoW
Post by: Mike Lobanovsky on April 13, 2018, 12:00:29 AM
Yes, Luna looks great, exactly as it would in Win XP where it was the default theme.

If OxIde (see wow_theme_01.png above) had an embedded manifest resource, its scrollbars would be themed as well.
Title: Re: WoW
Post by: JRS on April 13, 2018, 03:07:43 PM
Our BASIC transportation has power Windows.
Title: Re: WoW
Post by: JRS on April 14, 2018, 02:51:19 AM
One side benefit of running on Wine is I can use the Windows Script BASIC IDE/Debugger under Linux. SB scripts for the most part are write once, run anywhere.