Oxygen Basic

Programming => Example Code => Topic started by: Peter on February 05, 2013, 04:34:00 AM

Title: SimpleWindow Project
Post by: Peter on February 05, 2013, 04:34:00 AM
Deleted
Title: Re: SimpleWindow Project
Post by: Haim on February 05, 2013, 06:04:39 AM
Wonderful!!
So much to enjoy and study
Thanks!

Haim
Title: Re: SimpleWindow Project
Post by: Haim on February 08, 2013, 08:57:25 PM
Very impressive!
Thanks,
Haim
Title: Re: SimpleWindow Project
Post by: Frankolinox on February 09, 2013, 01:45:05 AM
@peter: "circles in fog" doesn't work here, there are several error messages while try to run the example. I have download the simple window zip file of your first example and add your circle in fog example there, but the problem starts with HLS(125,55,240) and much more. I think there's something missing (include file or other thing) I don't know.

best regards, frank
Title: Re: SimpleWindow Project
Post by: Aurel on February 09, 2013, 03:15:27 PM
Quote
I fear the  spys around here

haha..i already crack your dll... ;D
Title: Re: SimpleWindow Project
Post by: Haim on February 10, 2013, 08:44:28 PM
Thanks Peter for all your work
Haim
Title: Re: SimpleWindow Project
Post by: Haim on February 11, 2013, 08:43:11 PM
here is another stuff for Haim.
  :)
Thanks,
Nice animation.
Although both bass.dll and  tremx.s3m are in the simplewindow directory, I hear no sound.
I gather SetFps  () sets the speed of the animation (or delay) and sync swaps the buffers. Is there anywhere an explanation or definition for those functions?
Haim
Title: Re: SimpleWindow Project
Post by: Haim on February 12, 2013, 07:45:21 PM
Hello,
Thank you for your explanation, the demos  and your patience with me.
I now have sound (just a matter of misplaced sound files)
Should not have bothered you with this.  :-[
Haim
Title: Re: SimpleWindow Project
Post by: Frankolinox on February 13, 2013, 02:00:11 AM
hi peter, I've tried yesterday again to compile your example. So far as I assume I have the correct oxygen.dll from last download. but there are some problems too. my pic you can see as attachement. perhaps you can send your oxygen.dll and inc file and sw.dll here at board again for checking, thanks! best regards, frank

X
Title: Re: SimpleWindow Project
Post by: Charles Pegge on February 14, 2013, 03:12:17 PM
Hi John,

I think the problem is that CloseWindow takes no parameters, but your dyc call issues one. The solution is to make this call cdecl (not ms) then this parameter will be safely ignored without stack corruption. Under cdecl, DYC will disallocate the unused parameter from the stack.

Charles
Title: Re: SimpleWindow Project
Post by: Charles Pegge on February 16, 2013, 03:22:36 AM
This should be ready in a few days and gives more concise interfacing than DYC:

Code: OxygenBasic
  1. 'ScriptBasic
  2. 'proposed use of DLLC dll interface
  3. '11:07 16/02/2013 CP
  4.  
  5. 'DLLC MODULE HEADER
  6.  
  7. declare sub dllfile alias "dllfile" lib "dllc"
  8. declare sub dllproc alias "dllproc" lib "dllc"
  9. declare sub dllcall alias "dllcall" lib "dllc"
  10. declare sub dlltype alias "dlltype" lib "dllc"
  11. declare sub dlldimv alias "dlldimv" lib "dllc"
  12. declare sub dllfill alias "dllfill" lib "dllc"
  13. declare sub dllgetv alias "dllgetv" lib "dllc"
  14. declare sub dllputv alias "dllputv" lib "dllc"
  15.  
  16. 'PARTIAL SW DLL HEADER
  17.  
  18. sw=dllfile("sw.dll")
  19. Window      = dllproc( sw,"Window        (i,i,i)"       )
  20. SetCaption  = dllproc( sw,"SetCaption    (c*)"          )
  21. Cls         = dllproc( sw,"Cls           (i)"           )
  22. Key         = dllproc( sw,"Key         i=(i)"           )
  23. GetHeight   = dllproc( sw,"GetHeight   i=()"            )
  24. GetWidth    = dllproc( sw,"GetWidth    i=()"            )
  25. Box         = dllproc( sw,"Box           (i,i,i,i,i,i)" )
  26. DrawLine    = dllproc( sw,"DrawLine      (i,i,i,i,i,i)" )
  27. RGB         = dllproc( sw,"RGB           (i,i,i)"       )
  28. Rand        = dllproc( sw,"Rand          (i,i)"         )
  29. Sync        = dllproc( sw,"Sync          ()"            )
  30. CloseWindow = dllproc( sw,"CloseWindow   ()"            )
  31.  
  32. 'CODE
  33.  
  34. dllcall Window, 640, 480, 1
  35. dllcall SetCaption,"SB/SW - Morning Light"
  36.  
  37. WHILE dllcall(Key,27) = 0
  38. dllcall Cls,0
  39. FOR y = 0 TO dllcall(GetHeight) STEP 10
  40.   FOR x = 0 TO dllcall(GetWidth) STEP 10
  41.     dllcall Box, x, y, 8, 8, 1, 0xC0C0F8
  42.     dllcall DrawLine x, y, 240, 69, 2, dllcall (RGB,dllcall (Rand,64,255), dllcall(Rand,64,255), dllcall(Rand,64,255))
  43.   NEXT
  44. NEXT
  45. dllcall Sync
  46. WEND
  47. dllcall CloseWindow
  48. dllfile 0
  49.  

Charles