Author Topic: Oxygen Update  (Read 24131 times)

0 Members and 3 Guests are viewing this topic.

Charles Pegge

  • Guest
Re: Oxygen Update (optional params)
« Reply #15 on: April 19, 2013, 11:22:44 AM »
Hi Halim

Well, I've thought about it and, yes I think it is a good idea to autoset the optional flag, whenever a default param value is detected.

This means you won't need the optional word when assigning default values

tests:

function f(sys a=1,b) 'a and b become optional automatically (1 0)
print  a "   " b
end function

#recordof f

f            ' 1 0
f 48         ' 48 0
f 48,96      ' 48 96
f a=12       ' 12 0
'f b=24      ' b error
'f a=6,b=12  ' b error


« Last Edit: April 25, 2013, 01:44:07 AM by Charles Pegge »

Emil_halim

  • Guest
Re: Oxygen Update
« Reply #16 on: April 19, 2013, 11:49:02 AM »
Hi Charles.

thank you very much.

Charles Pegge

  • Guest
Re: Oxygen Update
« Reply #17 on: April 25, 2013, 01:51:54 AM »
Improved float behaviour for Peter.

function f(float a,b,c,d),external
print a "  " b "  " c "  " d "  "
end function

sys g=@f

single d

d=4.5

call g 0.0, 1.0 ,3.5, d

« Last Edit: May 01, 2013, 02:57:01 PM by o2admin »

Peter

  • Guest
Re: Oxygen Update
« Reply #18 on: April 25, 2013, 03:08:24 AM »
Thanks Charles,

You were able to correct your flaws.  :D
Here is the proof.
Code: [Select]
include "sw.inc"
include "swgl.inc"

hwnd = Window 640,480,1  ' Or 0 for Fullscreen
hdc  = InitGl(hwnd)

single r  
img1= LoadImage "img/image1.bmp"
img2= LoadImage "img/image2.bmp"
img3= LoadImage "img/image3.bmp"

glClearColor  0, 0.5, 0, 1.0
    
While Key(27)=0
glClear GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT
glLoadIdentity

glBindTexture GL_TEXTURE_2D,img1
glTranslatef 0.0, 0.0, 0.0
glRotatef r, 0.0, 1.0, 0.0
glBegin GL_TRIANGLES    
  
  glTexCoord2f 1.0, 0.0: glVertex3f( 0.0, 0.5, 0.0)
  glTexCoord2f 1.0, 1.0: glVertex3f(-0.5,-0.5, 0.5)
  glTexCoord2f 0.0, 1.0: glVertex3f( 0.5,-0.5, 0.5)
  glTexCoord2f 0.0, 0.0: glVertex3f( 0.0, 0.5, 0.0)
  
  glTexCoord2f 1.0, 0.0: glVertex3f( 0.5,-0.5, 0.5)
  glTexCoord2f 1.0, 1.0: glVertex3f( 0.5,-0.5,-0.5)
  glTexCoord2f 0.0, 1.0: glVertex3f( 0.0, 0.5, 0.0)
  glTexCoord2f 0.0, 0.0: glVertex3f( 0.5,-0.5,-0.5)
  
  glTexCoord2f 1.0, 0.0: glVertex3f(-0.5,-0.5,-0.5)
  glTexCoord2f 1.0, 1.0: glVertex3f( 0.0, 0.5, 0.0)
  glTexCoord2f 0.0, 1.0 :glVertex3f(-0.5,-0.5,-0.5)
  glTexCoord2f 0.0, 0.0 :glVertex3f(-0.5,-0.5, 0.5)
glEnd

r += 1.0
DoEvents
SwapBuffers hdC
SetFps (60)
Wend

QuitGl
Quit
« Last Edit: May 01, 2013, 02:48:12 PM by o2admin »

Peter

  • Guest
Re: Oxygen Update
« Reply #19 on: April 25, 2013, 03:47:16 AM »
Quad
Code: [Select]
include "sw.inc"
include "swgl.inc"

hwnd = Window 640,480,1
hdc  = InitGl(hwnd)

single x  

texture1 = Loadimage "img/angel.bmp"
texture2 = LoadImage "img/image4.bmp"
 
glClearColor 0.5, 0.5, 0.5, 1.0

while Key(27)=0
  glClear GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT
  glLoadIdentity
  
  glRotatef x,1.0,1.0,-1.0
  glBindTexture GL_Texture_2D, texture2
  glBegin(GL_QUADS)
    glTexCoord2f(0.0, 0.0): glVertex3f(-0.5, -0.5,  0.5)  
    glTexCoord2f(1.0, 0.0): glVertex3f( 0.5, -0.5,  0.5)  
    glTexCoord2f(1.0, 1.0): glVertex3f( 0.5,  0.5,  0.5)  
    glTexCoord2f(0.0, 1.0): glVertex3f(-0.5,  0.5,  0.5)  
    
    glTexCoord2f(1.0, 0.0): glVertex3f(-0.5, -0.5, -0.5)  
    glTexCoord2f(1.0, 1.0): glVertex3f(-0.5,  0.5, -0.5)  
    glTexCoord2f(0.0, 1.0): glVertex3f( 0.5,  0.5, -0.5)  
    glTexCoord2f(0.0, 0.0): glVertex3f( 0.5, -0.5, -0.5)

    glTexCoord2f(0.0, 1.0): glVertex3f(-0.5,  0.5, -0.5)  
    glTexCoord2f(0.0, 0.0): glVertex3f(-0.5,  0.5,  0.5)  
    glTexCoord2f(1.0, 0.0): glVertex3f( 0.5,  0.5,  0.5)  
    glTexCoord2f(1.0, 1.0): glVertex3f( 0.5,  0.5, -0.5)  
    
    glTexCoord2f(1.0, 1.0): glVertex3f(-0.5, -0.5, -0.5)  
    glTexCoord2f(0.0, 1.0): glVertex3f( 0.5, -0.5, -0.5)  
    glTexCoord2f(0.0, 0.0): glVertex3f( 0.5, -0.5,  0.5)  
    glTexCoord2f(1.0, 0.0): glVertex3f(-0.5, -0.5,  0.5)  
    
    glTexCoord2f(1.0, 0.0): glVertex3f( 0.5, -0.5, -0.5)  
    glTexCoord2f(1.0, 1.0): glVertex3f( 0.5,  0.5, -0.5)  
    glTexCoord2f(0.0, 1.0): glVertex3f( 0.5,  0.5,  0.5)  
    glTexCoord2f(0.0, 0.0): glVertex3f( 0.5, -0.5,  0.5)  
    
    glTexCoord2f(0.0, 0.0): glVertex3f(-0.5, -0.5, -0.5)
    glTexCoord2f(1.0, 0.0): glVertex3f(-0.5, -0.5,  0.5)  
    glTexCoord2f(1.0, 1.0): glVertex3f(-0.5,  0.5,  0.5)  
    glTexCoord2f(0.0, 1.0): glVertex3f(-0.5,  0.5, -0.5)  
glEnd()

  DoEvents
  SwapBuffers hdc
  SetFps (60)  
  
  x += 1.0  
  iF x >360 Then x =-x
  
wend
QuitGL
CloseWindow
« Last Edit: May 01, 2013, 02:48:39 PM by o2admin »

Charles Pegge

  • Guest
Re: Oxygen Update
« Reply #20 on: April 30, 2013, 04:05:00 AM »
Update:

declarations now support implicit alias (quoted name immediately after declared name)

operator overloading removed.
« Last Edit: May 14, 2013, 12:11:09 AM by Charles Pegge »

Emil_halim

  • Guest
Re: Oxygen Update
« Reply #21 on: April 30, 2013, 07:05:15 AM »

Hi Charles,

thanks you very much.

Charles Pegge

  • Guest
Re: Oxygen Update
« Reply #22 on: May 14, 2013, 12:31:50 AM »
This version allows unsigned value comparisons with these operators: (>= <= < >). The operands should also be unsigned ie: dword / unsigned int / unsigned long. thus:

dword a,b
...
if a<b
  ...
end if


Fortunately these are rare, since they are a potential programming hazard. Unsigned comparisons are usually for equivalence (= == <>) or zero/non zero and these do not suffer the same overflow/underflow problems.

Also, I have modified Classes to support arrays of member objects and UDTs:

class CA
...
end class

class CB
CA a[100]
...
end class


Charles

New permanent Location:
http://www.oxygenbasic.org/forum/index.php?topic=749
« Last Edit: May 14, 2013, 01:07:29 AM by Charles Pegge »

Aurel

  • Guest
Re: Oxygen Update
« Reply #23 on: May 14, 2013, 12:53:53 AM »
Thanks Charles..
I will test it right now with my programs.. ;)

Charles Pegge

  • Guest
Re: Oxygen Update
« Reply #24 on: May 29, 2013, 01:51:55 AM »

Further update arising from work on DLLC:

Librarypath now working. It works like includepath, but specifies the location of dlls

Quote
13:34 28/05/2013  Fix LibraryPath (SB embed LibScriba.dll)
05:41 28/05/2013  Move all SB extension DLLs to /SB/modules
23:49 27/05/2013  Fix a[].b[] subarrays offset (DLLC SB)
18:19 25/05/2013  Endline checks for chr 10 (linux text)
18:16 25/05/2013  Support extern declarations (japi.h)
18:17 25/05/2013  Support declaration prototypes without param names (japi.h)

http://www.oxygenbasic.org/forum/index.php?topic=749.0

Aurel

  • Guest
Re: Oxygen Update
« Reply #25 on: May 29, 2013, 04:18:54 AM »
Charles
I would like to know ...
what is this ?
is this addition to oxygen core or you made some changes to core ?

Charles Pegge

  • Guest
Re: Oxygen Update
« Reply #26 on: May 29, 2013, 05:58:46 AM »
Librarypath has been on the core list for a long time, but not working until now.

Charles Pegge

  • Guest
Re: Oxygen Update
« Reply #27 on: June 20, 2013, 02:56:55 AM »
Minor update:

Fixed: the 'not' bitwise operator now works without brackets: a=not b

some assembly code words have been removed from the reserved list, so they can be used as Basic names, as long as they are not used as assembly code within the same scope (function etc)
db dw dd dq mov lea add sub mul div jz jnz shl sal sar

http://www.oxygenbasic.org/forum/index.php?topic=749

Charles Pegge

  • Guest
Re: Oxygen Update
« Reply #28 on: July 15, 2013, 12:39:32 AM »
Minor update:

Including #autodim (off)  fix to require iterators to to be defined before use.

Also improved optional params & default params behaviour.

http://www.oxygenbasic.org/forum/index.php?topic=749

Quote
18:42 12/07/2013  Fix Autodim 'off' for iterators
08:27 12/07/2013  Allow MultiAssign closing bracket to be on separate line.
13:23 11/07/2013  Extend support merging optional params and default params.
12:17 11/07/2013  Fix mixed number / string expression, starting with number: s = 42 s1
06:26 09/07/2013  Allow autotyped expression line break after '='
12:39 27/06/2013  Fix class factory : direct class method call without instantiating
--
09:30 25/06/2013  Fix 'Version' string
17:42 21/06/2013  new <<< rol >>> ror integer rotation operators

JRS

  • Guest
Re: Oxygen Update
« Reply #29 on: July 15, 2013, 03:22:19 AM »
Thanks Charles for your relentless efforts in making OxygenBasic the best BASIC compiler by far.