소스 검색

Added API docs.
Updated to docusaurus 1.5.0.

woollybah 6 년 전
부모
커밋
3fb229494e
100개의 변경된 파일9996개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      .gitignore
  2. 80 0
      docs/api/brl/brl.audio/tchannel.md
  3. 57 0
      docs/api/brl/brl.audio/tsound.md
  4. 69 0
      docs/api/brl/brl.audiosample/taudiosample.md
  5. 26 0
      docs/api/brl/brl.audiosample/taudiosampleloader.md
  6. 208 0
      docs/api/brl/brl.bank/tbank.md
  7. 23 0
      docs/api/brl/brl.bankstream/tbankstream.md
  8. 10 0
      docs/api/brl/brl.blitz/tarrayboundsexception.md
  9. 10 0
      docs/api/brl/brl.blitz/tblitzexception.md
  10. 10 0
      docs/api/brl/brl.blitz/tnullfunctionexception.md
  11. 10 0
      docs/api/brl/brl.blitz/tnullmethodexception.md
  12. 10 0
      docs/api/brl/brl.blitz/tnullobjectexception.md
  13. 10 0
      docs/api/brl/brl.blitz/toutofdataexception.md
  14. 10 0
      docs/api/brl/brl.blitz/truntimeexception.md
  15. 85 0
      docs/api/brl/brl.event/tevent.md
  16. 29 0
      docs/api/brl/brl.linkedlist/tlink.md
  17. 183 0
      docs/api/brl/brl.linkedlist/tlist.md
  18. 7 0
      docs/api/brl/brl.linkedlist/tlistenum.md
  19. 7 0
      docs/api/brl/brl.map/tintkey.md
  20. 7 0
      docs/api/brl/brl.map/tptrkey.md
  21. 7 0
      docs/api/brl/brl.max2d/timage.md
  22. 56 0
      docs/api/brl/brl.maxlua/tluaclass.md
  23. 42 0
      docs/api/brl/brl.maxlua/tluaobject.md
  24. 121 0
      docs/api/brl/brl.pixmap/tpixmap.md
  25. 23 0
      docs/api/brl/brl.pixmap/tpixmaploader.md
  26. 44 0
      docs/api/brl/brl.reflection/tconstant.md
  27. 74 0
      docs/api/brl/brl.reflection/tfield.md
  28. 29 0
      docs/api/brl/brl.reflection/tfunction.md
  29. 79 0
      docs/api/brl/brl.reflection/tglobal.md
  30. 24 0
      docs/api/brl/brl.reflection/tmember.md
  31. 19 0
      docs/api/brl/brl.reflection/tmethod.md
  32. 246 0
      docs/api/brl/brl.reflection/ttypeid.md
  33. 22 0
      docs/api/brl/brl.stream/tcstream.md
  34. 113 0
      docs/api/brl/brl.stream/tio.md
  35. 236 0
      docs/api/brl/brl.stream/tstream.md
  36. 7 0
      docs/api/brl/brl.stream/tstreamexception.md
  37. 42 0
      docs/api/brl/brl.stream/tstreamfactory.md
  38. 13 0
      docs/api/brl/brl.stream/tstreamreadexception.md
  39. 30 0
      docs/api/brl/brl.stream/tstreamwrapper.md
  40. 13 0
      docs/api/brl/brl.stream/tstreamwriteexception.md
  41. 28 0
      docs/api/brl/brl.stringbuilder/tsplitbuffer.md
  42. 274 0
      docs/api/brl/brl.stringbuilder/tstringbuilder.md
  43. 14 0
      docs/api/brl/brl.threadpool/trunnable.md
  44. 35 0
      docs/api/brl/brl.threadpool/tthreadpoolexecutor.md
  45. 36 0
      docs/api/brl/brl.threads/tcondvar.md
  46. 40 0
      docs/api/brl/brl.threads/tmutex.md
  47. 31 0
      docs/api/brl/brl.threads/tsemaphore.md
  48. 53 0
      docs/api/brl/brl.threads/tthread.md
  49. 26 0
      docs/api/brl/brl.threads/tthreaddata.md
  50. 371 0
      docs/api/brl/brl_audio.md
  51. 83 0
      docs/api/brl/brl_audiosample.md
  52. 316 0
      docs/api/brl/brl_bank.md
  53. 36 0
      docs/api/brl/brl_bankstream.md
  54. 381 0
      docs/api/brl/brl_blitz.md
  55. 11 0
      docs/api/brl/brl_bmploader.md
  56. 22 0
      docs/api/brl/brl_d3d7max2d.md
  57. 22 0
      docs/api/brl/brl_d3d9max2d.md
  58. 11 0
      docs/api/brl/brl_directsoundaudio.md
  59. 50 0
      docs/api/brl/brl_endianstream.md
  60. 17 0
      docs/api/brl/brl_event.md
  61. 170 0
      docs/api/brl/brl_eventqueue.md
  62. 511 0
      docs/api/brl/brl_filesystem.md
  63. 11 0
      docs/api/brl/brl_freeaudioaudio.md
  64. 100 0
      docs/api/brl/brl_glgraphics.md
  65. 23 0
      docs/api/brl/brl_glmax2d.md
  66. 255 0
      docs/api/brl/brl_gnet.md
  67. 342 0
      docs/api/brl/brl_graphics.md
  68. 102 0
      docs/api/brl/brl_hook.md
  69. 37 0
      docs/api/brl/brl_jpgloader.md
  70. 19 0
      docs/api/brl/brl_keycodes.md
  71. 167 0
      docs/api/brl/brl_linkedlist.md
  72. 115 0
      docs/api/brl/brl_map.md
  73. 107 0
      docs/api/brl/brl_math.md
  74. 1076 0
      docs/api/brl/brl_max2d.md
  75. 77 0
      docs/api/brl/brl_maxlua.md
  76. 11 0
      docs/api/brl/brl_oggloader.md
  77. 27 0
      docs/api/brl/brl_openalaudio.md
  78. 251 0
      docs/api/brl/brl_pixmap.md
  79. 37 0
      docs/api/brl/brl_pngloader.md
  80. 360 0
      docs/api/brl/brl_polledinput.md
  81. 25 0
      docs/api/brl/brl_ramstream.md
  82. 234 0
      docs/api/brl/brl_random.md
  83. 139 0
      docs/api/brl/brl_reflection.md
  84. 185 0
      docs/api/brl/brl_retro.md
  85. 203 0
      docs/api/brl/brl_socket.md
  86. 35 0
      docs/api/brl/brl_socketstream.md
  87. 57 0
      docs/api/brl/brl_standardio.md
  88. 12 0
      docs/api/brl/brl_stbimageloader.md
  89. 465 0
      docs/api/brl/brl_stream.md
  90. 13 0
      docs/api/brl/brl_stringbuilder.md
  91. 305 0
      docs/api/brl/brl_system.md
  92. 17 0
      docs/api/brl/brl_systemdefault.md
  93. 57 0
      docs/api/brl/brl_textstream.md
  94. 11 0
      docs/api/brl/brl_tgaloader.md
  95. 13 0
      docs/api/brl/brl_threadpool.md
  96. 391 0
      docs/api/brl/brl_threads.md
  97. 61 0
      docs/api/brl/brl_timer.md
  98. 7 0
      docs/api/brl/brl_timerdefault.md
  99. 10 0
      docs/api/brl/brl_wavloader.md
  100. 7 0
      docs/api/intro.md

+ 3 - 0
.gitignore

@@ -11,3 +11,6 @@ website/yarn.lock
 website/node_modules
 website/i18n/*
 .idea/
+*.bmx
+*.exe
+docs/api/maxgui/*.png

+ 80 - 0
docs/api/brl/brl.audio/tchannel.md

@@ -0,0 +1,80 @@
+---
+id: tchannel
+title: TChannel
+sidebar_label: TChannel
+---
+
+
+## Methods
+
+### `Method Stop()`
+
+Stop audio channel playback
+
+
+Shuts down the audio channel. Further commands on this audio channel will have no effect.
+
+
+
+### `Method SetPaused( paused:Int )`
+
+Pause or unpause audio channel playback
+
+
+If <b>paused</b> is True, the audio channel is paused. Otherwise, the audio channel is unpaused.
+
+
+
+### `Method SetVolume( volume# )`
+
+Set audio channel volume
+
+
+<b>volume</b> should be in the range 0 (silence) to 1 (full volume).
+
+
+
+### `Method SetPan( pan# )`
+
+Set audio channel stereo pan
+
+
+<b>pan</b> should be in the range -1 (full left) to 1 (full right).
+
+
+
+### `Method SetDepth( depth# )`
+
+Set audio channel depth
+
+
+<b>depth</b> should be in the range -1 (back) to 1 (front).
+
+
+
+### `Method SetRate( rate# )`
+
+Set audio channel playback rate
+
+
+<b>rate</b> is a multiplier used to modify the audio channel's frequency.
+For example, a rate of .5 will cause the audio channel
+to play at half speed (ie: an octave down) while a rate of 2 will
+cause the audio channel to play at double speed (ie: an octave up).
+
+
+
+### `Method Playing:Int()`
+
+Determine whether audio channel is playing
+
+
+[Playing](../../brl/brl.audio/#method-playing-int) will return False if the audio channel is either paused, or has been stopped
+using [Stop](../../brl/brl.audio/#method-stop).
+
+
+#### Returns
+True if <b>channel</b> is currently playing
+
+
+

+ 57 - 0
docs/api/brl/brl.audio/tsound.md

@@ -0,0 +1,57 @@
+---
+id: tsound
+title: TSound
+sidebar_label: TSound
+---
+
+
+## Methods
+
+### `Method Play:TChannel( alloced_channel:TChannel=Null )`
+
+Play the sound
+
+
+Starts a sound playing through an audio channel.
+If no channel is specified, [Play](../../brl/brl.audio/#method-play-tchannel-alloced-channel-tchannel-null) automatically allocates a channel for you.
+
+
+#### Returns
+An audio channel object
+
+
+
+### `Method Cue:TChannel( alloced_channel:TChannel=Null )`
+
+Cue the sound for playback
+
+
+Prepares an audio channel for playback of a sound.
+To actually start the sound, you must use the channel's [SetPaused](../../brl/brl.audio/#method-setpaused-paused-int) method.
+If no channel is specified, [Cue](../../brl/brl.audio/#method-cue-tchannel-alloced-channel-tchannel-null) automatically allocates a channel for you.
+
+[Cue](../../brl/brl.audio/#method-cue-tchannel-alloced-channel-tchannel-null) allows you to setup various audio channel states such as volume, pan, depth and rate before a sound
+actually starts playing.
+
+
+#### Returns
+An audio channel object
+
+
+
+## Functions
+
+### `Function Load:TSound( url:Object,loop_flag:Int )`
+
+Load sound
+
+
+<b>url</b> can be either a string, a stream or an audio sample object.
+The returned sound object can be played using [Play](../../brl/brl.audio/#method-play-tchannel-alloced-channel-tchannel-null) or [Cue](../../brl/brl.audio/#method-cue-tchannel-alloced-channel-tchannel-null).
+
+
+#### Returns
+A sound object
+
+
+

+ 69 - 0
docs/api/brl/brl.audiosample/taudiosample.md

@@ -0,0 +1,69 @@
+---
+id: taudiosample
+title: TAudioSample
+sidebar_label: TAudioSample
+---
+
+
+## Fields
+
+### `Field samples:Byte Ptr`
+
+Byte pointer to sample data
+
+
+### `Field length`
+
+Length, in samples, of the sample data
+
+
+### `Field hertz`
+
+Sample rate
+
+
+### `Field format`
+
+Sample format
+
+
+## Methods
+
+### `Method Copy:TAudioSample()`
+
+Copy audio sample
+
+#### Returns
+A new audio sample object
+
+
+
+### `Method Convert:TAudioSample( to_format )`
+
+Convert audio sample
+
+#### Returns
+A new audio sample object in the specified format
+
+
+
+## Functions
+
+### `Function Create:TAudioSample( length,hertz,format )`
+
+Create an audio sample
+
+#### Returns
+A new audio sample object
+
+
+
+### `Function CreateStatic:TAudioSample( samples:Byte Ptr,length,hertz,format )`
+
+Create a static audio sample
+
+#### Returns
+A new audio sample object that references an existing block of memory
+
+
+

+ 26 - 0
docs/api/brl/brl.audiosample/taudiosampleloader.md

@@ -0,0 +1,26 @@
+---
+id: taudiosampleloader
+title: TAudioSampleLoader
+sidebar_label: TAudioSampleLoader
+---
+
+
+To create your own audio sample loaders, you should extend this type and
+provide a <b>LoadAudioSample</b> method. To add your audio sample loader to the system,
+simply create an instance of it using <b>New</b>.
+
+
+## Methods
+
+### `Method LoadAudioSample:TAudioSample( stream:TStream ) Abstract`
+
+Load an audio sample
+
+Extending types must implement this method.
+
+
+#### Returns
+A new audio sample object, or Null if sample could not be loaded
+
+
+

+ 208 - 0
docs/api/brl/brl.bank/tbank.md

@@ -0,0 +1,208 @@
+---
+id: tbank
+title: TBank
+sidebar_label: TBank
+---
+
+
+## Methods
+
+### `Method Buf:Byte Ptr()`
+
+Get a bank's memory pointer
+
+
+Please use [Lock](../../brl/brl.bank/#method-lock-byte-ptr) and [Unlock](../../brl/brl.bank/#method-unlock) instead of this method.
+
+
+#### Returns
+A byte pointer to the memory block controlled by the bank
+
+
+
+### `Method Lock:Byte Ptr()`
+
+Lock a bank's memory block
+
+
+While locked, a bank cannot be resized.
+
+After you have finished with a bank's memory block, you must use [Unlock](../../brl/brl.bank/#method-unlock)
+to return it to the bank.
+
+
+#### Returns
+A byte pointer to the memory block controlled by the bank
+
+
+
+### `Method Unlock()`
+
+Unlock a bank's memory pointer
+
+
+After you have finished with a bank's memory block, you must use [Unlock](../../brl/brl.bank/#method-unlock)
+to return it to the bank.
+
+
+
+### `Method Size:Size_T()`
+
+Get a bank's size
+
+#### Returns
+The size, in bytes, of the memory block controlled by the bank
+
+
+
+### `Method Capacity:Size_T()`
+
+Get capacity of bank
+
+#### Returns
+The capacity, in bytes, of the bank's internal memory buffer
+
+
+
+### `Method IsStatic:Int()`
+
+Returns True if the bank is static.
+
+
+### `Method Resize( size:Size_T )`
+
+Resize a bank
+
+
+### `Method Read:Long( stream:TStream,offset:Long,count:Long )`
+
+Read bytes from a stream into a bank
+
+
+### `Method Write:Long( stream:TStream,offset:Long,count:Long )`
+
+Write bytes in a bank to a stream
+
+
+### `Method PeekByte( offset:Size_T )`
+
+Peek a byte from a bank
+
+#### Returns
+The byte value at the specified byte offset within the bank
+
+
+
+### `Method PokeByte( offset:Size_T,value )`
+
+Poke a byte into a bank
+
+
+### `Method PeekShort( offset:Size_T )`
+
+Peek a short from a bank
+
+#### Returns
+The short value at the specified byte offset within the bank
+
+
+
+### `Method PokeShort( offset:Size_T,value )`
+
+Poke a short into a bank
+
+
+### `Method PeekInt( offset:Size_T )`
+
+Peek an int from a bank
+
+#### Returns
+The int value at the specified byte offset within the bank
+
+
+
+### `Method PokeInt( offset:Size_T,value )`
+
+Poke an int into a bank
+
+
+### `Method PeekLong:Long( offset:Size_T )`
+
+Peek a long from a bank
+
+#### Returns
+The long value at the specified byte offset within the bank
+
+
+
+### `Method PokeLong( offset:Size_T,value:Long )`
+
+Poke a long value into a bank
+
+
+### `Method PeekFloat#( offset:Size_T )`
+
+Peek a float from a bank
+
+#### Returns
+The float value at the specified byte offset within the bank
+
+
+
+### `Method PokeFloat( offset:Size_T,value# )`
+
+Poke a float value into a bank
+
+
+### `Method PeekDouble!( offset:Size_T )`
+
+Peek a double from a bank
+
+#### Returns
+The double value at the specified byte offset within the bank
+
+
+
+### `Method PokeDouble( offset:Size_T,value! )`
+
+Poke a double value into a bank
+
+
+### `Method Save( url:Object )`
+
+Save a bank to a stream
+
+
+Return True if successful, otherwise False.
+
+
+
+## Functions
+
+### `Function Load:TBank( url:Object )`
+
+Load a bank from a stream
+
+
+Returns a new TBank object if successfull, otherwise Null.
+
+
+#### Returns
+A new TBank object
+
+
+
+### `Function Create:TBank( size:Int )`
+
+Create a bank
+
+#### Returns
+A new TBank object with an initial size of <b>size</b>
+
+
+
+### `Function CreateStatic:TBank( buf:Byte Ptr,size:Int )`
+
+Create a bank from an existing block of memory
+
+

+ 23 - 0
docs/api/brl/brl.bankstream/tbankstream.md

@@ -0,0 +1,23 @@
+---
+id: tbankstream
+title: TBankStream
+sidebar_label: TBankStream
+---
+
+
+## Functions
+
+### `Function Create:TBankStream( bank:TBank )`
+
+Create a bank stream
+
+
+A bank stream allows you to read data into or out of a bank. A bank stream extends a stream so
+can be used in place of a stream.
+
+
+#### Returns
+A bank stream object
+
+
+

+ 10 - 0
docs/api/brl/brl.blitz/tarrayboundsexception.md

@@ -0,0 +1,10 @@
+---
+id: tarrayboundsexception
+title: TArrayBoundsException
+sidebar_label: TArrayBoundsException
+---
+
+
+Thrown when an array element with an index outside the valid range of the array (0 to array.length-1) is accessed. (only in debug mode)
+
+

+ 10 - 0
docs/api/brl/brl.blitz/tblitzexception.md

@@ -0,0 +1,10 @@
+---
+id: tblitzexception
+title: TBlitzException
+sidebar_label: TBlitzException
+---
+
+
+Common base class of the built-in exceptions of the language.
+
+

+ 10 - 0
docs/api/brl/brl.blitz/tnullfunctionexception.md

@@ -0,0 +1,10 @@
+---
+id: tnullfunctionexception
+title: TNullFunctionException
+sidebar_label: TNullFunctionException
+---
+
+
+Thrown when an uninitialized function pointer is called.
+
+

+ 10 - 0
docs/api/brl/brl.blitz/tnullmethodexception.md

@@ -0,0 +1,10 @@
+---
+id: tnullmethodexception
+title: TNullMethodException
+sidebar_label: TNullMethodException
+---
+
+
+Thrown when an abstract method is called.
+
+

+ 10 - 0
docs/api/brl/brl.blitz/tnullobjectexception.md

@@ -0,0 +1,10 @@
+---
+id: tnullobjectexception
+title: TNullObjectException
+sidebar_label: TNullObjectException
+---
+
+
+Thrown when a field or method of a Null object is accessed. (only in debug mode)
+
+

+ 10 - 0
docs/api/brl/brl.blitz/toutofdataexception.md

@@ -0,0 +1,10 @@
+---
+id: toutofdataexception
+title: TOutOfDataException
+sidebar_label: TOutOfDataException
+---
+
+
+Thrown when [ReadData](../../brl/brl.blitz/#readdata) is used but not enough data is left to read. (only in debug mode)
+
+

+ 10 - 0
docs/api/brl/brl.blitz/truntimeexception.md

@@ -0,0 +1,10 @@
+---
+id: truntimeexception
+title: TRuntimeException
+sidebar_label: TRuntimeException
+---
+
+
+Thrown by [RuntimeError](../../brl/brl.blitz/#function-runtimeerror-message).
+
+

+ 85 - 0
docs/api/brl/brl.event/tevent.md

@@ -0,0 +1,85 @@
+---
+id: tevent
+title: TEvent
+sidebar_label: TEvent
+---
+
+
+## Fields
+
+### `Field id:Int`
+
+Event identifier
+
+
+### `Field source:Object`
+
+Event source object
+
+
+### `Field data:Int`
+
+Event specific data
+
+
+### `Field mods:Int`
+
+Event specific modifiers
+
+
+### `Field x:Int`
+
+Event specific position data
+
+
+### `Field y:Int`
+
+Event specific position data
+
+
+### `Field extra:Object`
+
+Event specific extra information
+
+
+## Methods
+
+### `Method Emit()`
+
+Emit this event
+
+
+This method runs all [EmitEventHook](../../brl/brl.event/#global-emiteventhook-int-allochookid) hook function, passing <b>Self</b> as
+the hook data.
+
+
+
+### `Method ToString$()`
+
+Convert event to a string
+
+
+This method is mainly useful for debugging purposes.
+
+
+
+## Functions
+
+### `Function Create:TEvent( id:Int,source:Object=Null,data:Int=0,mods:Int=0,x:Int=0,y:Int=0,extra:Object=Null)`
+
+Create an event object
+
+#### Returns
+A new event object
+
+
+
+### `Function AllocUserId:Int()`
+
+Allocate a user event id
+
+#### Returns
+A new user event id
+
+
+

+ 29 - 0
docs/api/brl/brl.linkedlist/tlink.md

@@ -0,0 +1,29 @@
+---
+id: tlink
+title: TLink
+sidebar_label: TLink
+---
+
+
+## Methods
+
+### `Method Value:Object()`
+
+Returns the Object associated with this Link.
+
+
+### `Method NextLink:TLink()`
+
+Returns the next link in the List.
+
+
+### `Method PrevLink:TLink()`
+
+Returns the previous link in the List.
+
+
+### `Method Remove()`
+
+Removes the link from the List.
+
+

+ 183 - 0
docs/api/brl/brl.linkedlist/tlist.md

@@ -0,0 +1,183 @@
+---
+id: tlist
+title: TList
+sidebar_label: TList
+---
+
+
+## Methods
+
+### `Method Clear()`
+
+Clear a linked list
+
+Removes all objects from <b>list</b>.
+
+
+
+### `Method IsEmpty()`
+
+Check if list is empty
+
+#### Returns
+True if list is empty, else false
+
+
+
+### `Method Contains( value:Object )`
+
+Check if list contains a value
+
+#### Returns
+True if list contains <b>value</b>, else false
+
+
+
+### `Method AddFirst:TLink( value:Object )`
+
+Add an object to the start of the list
+
+#### Returns
+A link object
+
+
+
+### `Method AddLast:TLink( value:Object )`
+
+Add an object to the end of the list
+
+#### Returns
+A link object
+
+
+
+### `Method First:Object()`
+
+Returns the first object in the list
+
+Returns Null if the list is empty.
+
+
+
+### `Method Last:Object()`
+
+Returns the last object in the list
+
+Returns Null if the list is empty.
+
+
+
+### `Method RemoveFirst:Object()`
+
+Removes and returns the first object in the list.
+
+Returns Null if the list is empty.
+
+
+
+### `Method RemoveLast:Object()`
+
+Removes and returns the last object in the list.
+
+Returns Null if the list is empty.
+
+
+
+### `Method FirstLink:TLink()`
+
+Returns the first link the list or null if the list is empty.
+
+
+### `Method LastLink:TLink()`
+
+Returns the last link the list or null if the list is empty.
+
+
+### `Method InsertBeforeLink:TLink( value:Object,succ:TLink )`
+
+Inserts an object before the specified list link.
+
+
+### `Method InsertAfterLink:TLink( value:Object,pred:TLink )`
+
+Inserts an object after the specified list link.
+
+
+### `Method FindLink:TLink( value:Object )`
+
+Returns the first link in the list with the given value, or null if none found.
+
+
+### `Method ValueAtIndex:Object( index )`
+
+Returns the value of the link at the given index.
+
+Throws an exception if the index is out of range (must be 0..list.Count()-1 inclusive).
+
+
+
+### `Method Count()`
+
+Count list length
+
+#### Returns
+The numbers of objects in <b>list</b>.
+
+
+
+### `Method Remove( value:Object )`
+
+Remove an object from a linked list
+
+Remove scans a list for the specified value and removes its link.
+
+
+
+### `Method Swap( list:TList )`
+
+Swap contents with the list specified.
+
+
+### `Method Copy:TList()`
+
+Creates an identical copy of the list.
+
+
+### `Method Reverse()`
+
+Reverse the order of the list.
+
+
+### `Method Reversed:TList()`
+
+Creates a new list that is the reversed version of this list.
+
+
+### `Method Sort( ascending=True,compareFunc( o1:Object,o2:Object ) )`
+
+Sort a list in either ascending (default) or decending order.
+
+User types should implement a Compare method in order to be sorted.
+
+
+
+### `Method ToArray:Object[]()`
+
+convert a list to an array
+
+#### Returns
+An array of objects
+
+
+
+## Functions
+
+### `Function FromArray:TList( arr:Object[] )`
+
+Create a list from an array
+
+#### Returns
+A new linked list
+
+
+

+ 7 - 0
docs/api/brl/brl.linkedlist/tlistenum.md

@@ -0,0 +1,7 @@
+---
+id: tlistenum
+title: TListEnum
+sidebar_label: TListEnum
+---
+
+

+ 7 - 0
docs/api/brl/brl.map/tintkey.md

@@ -0,0 +1,7 @@
+---
+id: tintkey
+title: TIntKey
+sidebar_label: TIntKey
+---
+
+

+ 7 - 0
docs/api/brl/brl.map/tptrkey.md

@@ -0,0 +1,7 @@
+---
+id: tptrkey
+title: TPtrKey
+sidebar_label: TPtrKey
+---
+
+

+ 7 - 0
docs/api/brl/brl.max2d/timage.md

@@ -0,0 +1,7 @@
+---
+id: timage
+title: TImage
+sidebar_label: TImage
+---
+
+

+ 56 - 0
docs/api/brl/brl.maxlua/tluaclass.md

@@ -0,0 +1,56 @@
+---
+id: tluaclass
+title: TLuaClass
+sidebar_label: TLuaClass
+---
+
+
+
+The TLuaClass type is used to contain lua source code.
+
+The source code should consist of a series of one or more lua functions.
+
+To actually invoke these functions a lua object must first be created - see [TLuaObject](../../brl/brl.maxlua/tluaobject).
+
+
+## Methods
+
+### `Method SourceCode$()`
+
+Get source code
+
+#### Returns
+The lua source code for the class.
+
+
+
+### `Method SetSourceCode:TLuaClass( source$ )`
+
+Set source code
+
+
+Sets the class source code.
+
+If the class was created with the TLuaClass.Create function, you do not need to call this
+method.
+
+
+
+## Functions
+
+### `Function Create:TLuaClass( source$ )`
+
+Create a lua class
+
+
+The <b>source</b> parameter must be valid Lua source code, and should contain a series of one or
+more lua function definitions.
+
+These functions can later be invoked by using the TLuaObject.Invoke method.
+
+
+#### Returns
+A new lua class object.
+
+
+

+ 42 - 0
docs/api/brl/brl.maxlua/tluaobject.md

@@ -0,0 +1,42 @@
+---
+id: tluaobject
+title: TLuaObject
+sidebar_label: TLuaObject
+---
+
+
+## Methods
+
+### `Method Init:TLuaObject( class:TLuaClass,supr:Object )`
+
+Initialize the lua object
+
+
+Sets the object's class and super object.
+
+If the object was created with the TLuaObject.Create function, you do not need to call
+this method.
+
+
+
+### `Method Invoke:Object( name$,args:Object[] )`
+
+Invoke an object method
+
+
+<b>name</b> should refer to a function within the object's classes' source code.
+
+
+
+## Functions
+
+### `Function Create:TLuaObject( class:TLuaClass,supr:Object )`
+
+Create a lua object
+
+
+Once a lua object has been created, object methods (actually lua functions defined in the
+class) can be invoked using the [Invoke](../../brl/brl.maxlua/#method-invoke-object-name-args-object) method.
+
+
+

+ 121 - 0
docs/api/brl/brl.pixmap/tpixmap.md

@@ -0,0 +1,121 @@
+---
+id: tpixmap
+title: TPixmap
+sidebar_label: TPixmap
+---
+
+
+## Fields
+
+### `Field pixels:Byte Ptr`
+
+A byte pointer to the pixmap's pixels
+
+
+### `Field width`
+
+The width, in pixels, of the pixmap
+
+
+### `Field height`
+
+The height, in pixels, of the pixmap
+
+
+### `Field pitch`
+
+The pitch, in bytes, of the pixmap
+
+
+### `Field format`
+
+The pixel format of the pixmap
+
+
+### `Field capacity`
+
+The capacity, in bytes, of the pixmap, or -1 for a static pixmap
+
+
+## Methods
+
+### `Method PixelPtr:Byte Ptr( x,y )`
+
+Get memory address of a pixel
+
+#### Returns
+A byte pointer to the pixel at coordinates <b>x</b>, <b>y</b>
+
+
+
+### `Method Window:TPixmap( x,y,width,height )`
+
+Create a virtual window into a pixmap
+
+#### Returns
+A static pixmap that references the specified rectangle.
+
+
+
+### `Method Copy:TPixmap()`
+
+Duplicate a pixmap
+
+#### Returns
+A new TPixmap object.
+
+
+
+### `Method Paste( source:TPixmap,x,y )`
+
+Paste a pixmap
+
+
+### `Method Convert:TPixmap( format )`
+
+Convert a pixmap
+
+#### Returns
+A new TPixmap object in the specified format
+
+
+
+### `Method ReadPixel( x,y )`
+
+Read a pixel from a pixmap
+
+#### Returns
+The pixel at the specified coordinates packed into an integer
+
+
+
+### `Method WritePixel( x,y,argb )`
+
+Write a pixel to a pixmap
+
+
+### `Method ClearPixels( argb )`
+
+Clear a pixmap
+
+
+## Functions
+
+### `Function Create:TPixmap( width,height,format,align=4 )`
+
+Create a pixmap
+
+#### Returns
+A new TPixmap object
+
+
+
+### `Function CreateStatic:TPixmap( pixels:Byte Ptr,width,height,pitch,format )`
+
+Create a static pixmap
+
+#### Returns
+A new TPixmap object
+
+
+

+ 23 - 0
docs/api/brl/brl.pixmap/tpixmaploader.md

@@ -0,0 +1,23 @@
+---
+id: tpixmaploader
+title: TPixmapLoader
+sidebar_label: TPixmapLoader
+---
+
+
+
+To create a new pixmap loader, you should extend TPixmapLoader and implement the [LoadPixmap](../../brl/brl.pixmap/#method-loadpixmap-tpixmap-stream-tstream-abstract) method.
+
+To install your pixmap loader, simply create an instance of it using [New](../../brl/brl.blitz/#new)</font>.
+
+
+## Methods
+
+### `Method LoadPixmap:TPixmap( stream:TStream ) Abstract`
+
+Load a pixmap
+
+This method must be implemented by extending types.
+
+
+

+ 44 - 0
docs/api/brl/brl.reflection/tconstant.md

@@ -0,0 +1,44 @@
+---
+id: tconstant
+title: TConstant
+sidebar_label: TConstant
+---
+
+
+## Methods
+
+### `Method GetString:String()`
+
+Get constant value
+
+
+### `Method GetInt:Int()`
+
+Get constant value as <b>Int</b>
+
+
+### `Method GetFloat:Int()`
+
+Get constant value as <b>Float</b>
+
+
+### `Method GetLong:Long()`
+
+Get constant value as <b>Long</b>
+
+
+### `Method GetSizet:Size_T()`
+
+Get constant value as <b>size_t</b>
+
+
+### `Method GetDouble:Int()`
+
+Get constant value as <b>Double</b>
+
+
+### `Method GetPointer:Byte Ptr()`
+
+Get constant value as <b>Byte Ptr</b>
+
+

+ 74 - 0
docs/api/brl/brl.reflection/tfield.md

@@ -0,0 +1,74 @@
+---
+id: tfield
+title: TField
+sidebar_label: TField
+---
+
+
+## Methods
+
+### `Method Get:Object( obj:Object )`
+
+Get field value
+
+
+### `Method GetInt:Int( obj:Object )`
+
+Get int field value
+
+
+### `Method GetLong:Long( obj:Object )`
+
+Get long field value
+
+
+### `Method GetSizet:Size_T( obj:Object )`
+
+Get size_t field value
+
+
+### `Method GetFloat:Float( obj:Object )`
+
+Get float field value
+
+
+### `Method GetDouble:Double( obj:Object )`
+
+Get double field value
+
+
+### `Method GetString$( obj:Object )`
+
+Get string field value
+
+
+### `Method Set( obj:Object,value:Object )`
+
+Set field value
+
+
+### `Method SetInt( obj:Object,value:Int )`
+
+Set int field value
+
+
+### `Method SetLong( obj:Object,value:Long )`
+
+Set long field value
+
+
+### `Method SetFloat( obj:Object,value:Float )`
+
+Set float field value
+
+
+### `Method SetDouble( obj:Object,value:Double )`
+
+Set double field value
+
+
+### `Method SetString( obj:Object,value$ )`
+
+Set string field value
+
+

+ 29 - 0
docs/api/brl/brl.reflection/tfunction.md

@@ -0,0 +1,29 @@
+---
+id: tfunction
+title: TFunction
+sidebar_label: TFunction
+---
+
+
+## Methods
+
+### `Method ArgTypes:TTypeId[]()`
+
+Get function arg types
+
+
+### `Method ReturnType:TTypeId()`
+
+Get function return type
+
+
+### `Method FunctionPtr:Byte Ptr()`
+
+Get function pointer.
+
+
+### `Method Invoke:Object(args:Object[] = Null)`
+
+Invoke type function
+
+

+ 79 - 0
docs/api/brl/brl.reflection/tglobal.md

@@ -0,0 +1,79 @@
+---
+id: tglobal
+title: TGlobal
+sidebar_label: TGlobal
+---
+
+
+## Methods
+
+### `Method Get:Object()`
+
+Get global value
+
+
+### `Method GetInt:Int( )`
+
+Get int global value
+
+
+### `Method GetLong:Long()`
+
+Get long global value
+
+
+### `Method GetSizet:Size_T()`
+
+Get size_t global value
+
+
+### `Method GetFloat:Float()`
+
+Get float global value
+
+
+### `Method GetDouble:Double()`
+
+Get double global value
+
+
+### `Method GetString$()`
+
+Get string global value
+
+
+### `Method Set(value:Object )`
+
+Set global value
+
+
+### `Method SetInt(value:Int )`
+
+Set int global value
+
+
+### `Method SetLong(value:Long )`
+
+Set long global value
+
+
+### `Method SetSizet(value:Size_T )`
+
+Set size_t global value
+
+
+### `Method SetFloat(value:Float )`
+
+Set float global value
+
+
+### `Method SetDouble(value:Double )`
+
+Set double global value
+
+
+### `Method SetString(value$ )`
+
+Set string global value
+
+

+ 24 - 0
docs/api/brl/brl.reflection/tmember.md

@@ -0,0 +1,24 @@
+---
+id: tmember
+title: TMember
+sidebar_label: TMember
+---
+
+
+## Methods
+
+### `Method Name$()`
+
+Get member name
+
+
+### `Method TypeId:TTypeId()`
+
+Get member type
+
+
+### `Method MetaData$( key$="" )`
+
+Get member meta data
+
+

+ 19 - 0
docs/api/brl/brl.reflection/tmethod.md

@@ -0,0 +1,19 @@
+---
+id: tmethod
+title: TMethod
+sidebar_label: TMethod
+---
+
+
+## Methods
+
+### `Method ArgTypes:TTypeId[]()`
+
+Get method arg types
+
+
+### `Method Invoke:Object( obj:Object,args:Object[] = Null)`
+
+Invoke method
+
+

+ 246 - 0
docs/api/brl/brl.reflection/ttypeid.md

@@ -0,0 +1,246 @@
+---
+id: ttypeid
+title: TTypeId
+sidebar_label: TTypeId
+---
+
+
+## Methods
+
+### `Method Name$()`
+
+Get name of type
+
+
+### `Method MetaData$( key$="" )`
+
+Get type meta data
+
+
+### `Method SuperType:TTypeId()`
+
+Get super type
+
+
+### `Method ArrayType:TTypeId(dims:Int = 1)`
+
+Get array type
+
+
+### `Method ElementType:TTypeId()`
+
+Get element type
+
+
+### `Method PointerType:TTypeId()`
+
+Get pointer type
+
+
+### `Method FunctionType:TTypeId( args:TTypeId[]=Null)`
+
+Get function pointer type
+
+
+### `Method ReturnType:TTypeId()`
+
+Get function return type
+
+
+### `Method ArgTypes:TTypeId[]()`
+
+Get function argument types
+
+
+### `Method ExtendsType( typeId:TTypeId )`
+
+Determine if type extends a type
+
+
+### `Method DerivedTypes:TList()`
+
+Get list of derived types
+
+
+### `Method NewObject:Object()`
+
+Create a new object
+
+
+### `Method IsInterface:Int()`
+
+Returns True if this TypeId is an interface.
+
+
+### `Method Constants:TStringMap()`
+
+Get list of constants
+
+Only returns constants declared in this type, not in super types.
+
+
+
+### `Method Fields:TStringMap()`
+
+Get list of fields
+
+Only returns fields declared in this type, not in super types.
+
+
+
+### `Method Globals:TStringMap()`
+
+Get list of globals
+
+Only returns globals declared in this type, not in super types.
+
+
+
+### `Method Functions:TStringMap()`
+
+Get list of functions
+
+Only returns functions declared in this type, not in super types.
+
+
+
+### `Method Methods:TStringMap()`
+
+Get list of methods
+
+Only returns methods declared in this type, not in super types.
+
+
+
+### `Method Interfaces:TList()`
+
+Get list of implemented interfaces.
+
+
+### `Method FindConstant:TConstant( name$ )`
+
+Find a constant by name
+
+Searchs type hierarchy for constant called <b>name</b>.
+
+
+
+### `Method FindField:TField( name$ )`
+
+Find a field by name
+
+Searchs type hierarchy for field called <b>name</b>.
+
+
+
+### `Method FindGlobal:TGlobal( name$ )`
+
+Find a global by name
+
+Searchs type hierarchy for global called <b>name</b>.
+
+
+
+### `Method FindFunction:TFunction(name:String)`
+
+Find a function by name
+
+Searches type heirarchy for function called <b>name</b>
+
+
+
+### `Method FindMethod:TMethod( name$ )`
+
+Find a method by name
+
+Searchs type hierarchy for method called <b>name</b>.
+
+
+
+### `Method EnumConstants:TList( list:TList=Null )`
+
+Enumerate all constants
+
+Returns a list of all constants in type hierarchy
+
+
+
+### `Method EnumFields:TList( list:TList=Null )`
+
+Enumerate all fields
+
+Returns a list of all fields in type hierarchy
+
+
+
+### `Method EnumGlobals:TList( list:TList=Null )`
+
+Enumerate all globals
+
+Returns a list of all globals in type hierarchy
+
+
+
+### `Method EnumFunctions:TList( list:TList=Null )`
+
+Enumerate all functions
+
+Returns a list of all functions in type hierarchy
+
+
+
+### `Method EnumMethods:TList( list:TList=Null )`
+
+Enumerate all methods
+
+Returns a list of all methods in type hierarchy - TO DO: handle overrides!
+
+
+
+### `Method NewArray:Object( length, dims:Int[] = Null )`
+
+Create a new array
+
+
+### `Method ArrayLength( _array:Object, dim:Int = 0 )`
+
+Get array length
+
+
+### `Method ArrayDimensions:Int( _array:Object )`
+
+Get the number of dimensions
+
+
+### `Method GetArrayElement:Object( _array:Object,index )`
+
+Get an array element
+
+
+### `Method SetArrayElement( _array:Object,index,value:Object )`
+
+Set an array element
+
+
+## Functions
+
+### `Function ForName:TTypeId( name$ )`
+
+Get Type by name
+
+
+### `Function ForObject:TTypeId( obj:Object )`
+
+Get Type by object
+
+
+### `Function EnumTypes:TList()`
+
+Get list of all types
+
+
+### `Function EnumInterfaces:TList()`
+
+Gets a list of all interfaces
+
+

+ 22 - 0
docs/api/brl/brl.stream/tcstream.md

@@ -0,0 +1,22 @@
+---
+id: tcstream
+title: TCStream
+sidebar_label: TCStream
+---
+
+
+
+
+
+## Functions
+
+### `Function OpenFile:TCStream( path$,readable:Int,writeable:Int )`
+
+Create a TCStream from a 'C' filename
+
+
+### `Function CreateWithCStream:TCStream( cstream:Byte Ptr,Mode:Int )`
+
+Create a TCStream from a 'C' stream handle
+
+

+ 113 - 0
docs/api/brl/brl.stream/tio.md

@@ -0,0 +1,113 @@
+---
+id: tio
+title: TIO
+sidebar_label: TIO
+---
+
+
+
+To create your own stream types, you should extend TStream and implement
+at least these methods.
+
+You should also make sure your stream can handle multiple calls to the Close method.
+
+
+## Methods
+
+### `Method Eof:Int()`
+
+Get stream end of file status
+
+
+For seekable streams such as file streams, Eof generally returns True if the file
+position equals the file size. This means that no more bytes can be read from the
+stream. However, it may still be possible to write bytes, in which case the file will
+'grow'.
+
+For communication type streams such as socket streams, Eof returns True if the stream
+has been shut down for some reason - either locally or by the remote host. In this case,
+no more bytes can be read from or written to the stream.
+
+
+#### Returns
+True for end of file reached, otherwise False
+
+
+
+### `Method Pos:Long()`
+
+Get position of seekable stream
+
+#### Returns
+Stream position as a byte offset, or -1 if stream is not seekable
+
+
+
+### `Method Size:Long()`
+
+Get size of seekable stream
+
+#### Returns
+Size, in bytes, of seekable stream, or 0 if stream is not seekable
+
+
+
+### `Method Seek:Long( pos:Long, whence:Int = SEEK_SET_ )`
+
+Seek to position in seekable stream
+
+#### Returns
+New stream position, or -1 if stream is not seekable
+
+
+
+### `Method Flush()`
+
+Flush stream
+
+
+Flushes any internal stream buffers.
+
+
+
+### `Method Close()`
+
+Close stream
+
+
+Closes the stream after flushing any internal stream buffers.
+
+
+
+### `Method Read:Long( buf:Byte Ptr,count:Long )`
+
+Read at least 1 byte from a stream
+
+
+This method may 'block' if it is not possible to read at least one byte due to IO
+buffering.
+
+If this method returns 0, the stream has reached end of file.
+
+
+#### Returns
+Number of bytes successfully read
+
+
+
+### `Method Write:Long( buf:Byte Ptr,count:Long )`
+
+Write at least 1 byte to a stream
+
+
+This method may 'block' if it is not possible to write at least one byte due to IO
+buffering.
+
+If this method returns 0, the stream has reached end of file.
+
+
+#### Returns
+Number of bytes successfully written
+
+
+

+ 236 - 0
docs/api/brl/brl.stream/tstream.md

@@ -0,0 +1,236 @@
+---
+id: tstream
+title: TStream
+sidebar_label: TStream
+---
+
+
+
+[TStream](../../brl/brl.stream/tstream) extends [TIO](../../brl/brl.stream/tio) to provide methods for reading and writing various types of values
+to and from a stream.
+
+Note that methods dealing with strings - ReadLine, WriteLine, ReadString and WriteString -
+assume that strings are represented by bytes in the stream. In future, a more powerful
+TextStream type will be added capable of decoding text streams in multiple formats.
+
+
+## Methods
+
+### `Method ReadBytes:Long( buf:Byte Ptr,count:Long )`
+
+Reads bytes from a stream
+
+
+[ReadBytes](../../brl/brl.stream/#method-readbytes-long-buf-byte-ptr-count-long) reads <b>count</b> bytes from the stream into the memory block specified by <b>buf</b>.
+
+If <b>count</b> bytes were not successfully read, a [TStreamReadException](../../brl/brl.stream/tstreamreadexception) is thrown. This typically
+occurs due to end of file.
+
+
+
+### `Method WriteBytes:Long( buf:Byte Ptr,count:Long )`
+
+Writes bytes to a stream
+
+
+[WriteBytes](../../brl/brl.stream/#method-writebytes-long-buf-byte-ptr-count-long) writes <b>count</b> bytes from the memory block specified by <b>buf</b> to the stream.
+
+If <b>count</b> bytes were not successfully written, a [TStreamWriteException](../../brl/brl.stream/tstreamwriteexception) is thrown. This typically
+occurs due to end of file.
+
+
+
+### `Method SkipBytes:Long( count:Long )`
+
+Skip bytes in a stream
+
+
+[SkipBytes](../../brl/brl.stream/#method-skipbytes-long-count-long) read <b>count</b> bytes from the stream and throws them away.
+
+If <b>count</b> bytes were not successfully read, a [TStreamReadException](../../brl/brl.stream/tstreamreadexception) is thrown. This typically
+occurs due to end of file.
+
+
+
+### `Method ReadByte:Int()`
+
+Read a byte from the stream
+
+
+If a value could not be read (possibly due to end of file), a [TStreamReadException](../../brl/brl.stream/tstreamreadexception) is thrown.
+
+
+#### Returns
+The read value
+
+
+
+### `Method WriteByte( n:Int )`
+
+Write a byte to the stream
+
+
+If the value could not be written (possibly due to end of file), a [TStreamWriteException](../../brl/brl.stream/tstreamwriteexception) is thrown.
+
+
+
+### `Method ReadShort:Int()`
+
+Read a short (two bytes) from the stream
+
+
+If a value could not be read (possibly due to end of file), a [TStreamReadException](../../brl/brl.stream/tstreamreadexception) is thrown.
+
+
+#### Returns
+The read value
+
+
+
+### `Method WriteShort( n:Int )`
+
+Write a short (two bytes) to the stream
+
+
+If the value could not be written (possibly due to end of file), a [TStreamWriteException](../../brl/brl.stream/tstreamwriteexception) is thrown.
+
+
+
+### `Method ReadInt:Int()`
+
+Read an int (four bytes) from the stream
+
+
+If a value could not be read (possibly due to end of file), a [TStreamReadException](../../brl/brl.stream/tstreamreadexception) is thrown.
+
+
+#### Returns
+The read value
+
+
+
+### `Method WriteInt( n:Int )`
+
+Write an int (four bytes) to the stream
+
+
+If the value could not be written (possibly due to end of file), a [TStreamWriteException](../../brl/brl.stream/tstreamwriteexception) is thrown.
+
+
+
+### `Method ReadLong:Long()`
+
+Read a long (eight bytes) from the stream
+
+
+If a value could not be read (possibly due to end of file), a [TStreamReadException](../../brl/brl.stream/tstreamreadexception) is thrown.
+
+
+#### Returns
+The read value
+
+
+
+### `Method WriteLong( n:Long )`
+
+Write a long (eight bytes) to the stream
+
+
+If the value could not be written (possibly due to end of file), a [TStreamWriteException](../../brl/brl.stream/tstreamwriteexception) is thrown.
+
+
+
+### `Method ReadFloat#()`
+
+Read a float (four bytes) from the stream
+
+
+If a value could not be read (possibly due to end of file), a [TStreamReadException](../../brl/brl.stream/tstreamreadexception) is thrown.
+
+
+#### Returns
+The read value
+
+
+
+### `Method WriteFloat( n# )`
+
+Write a float (four bytes) to the stream
+
+
+If the value could not be written (possibly due to end of file), a [TStreamWriteException](../../brl/brl.stream/tstreamwriteexception) is thrown.
+
+
+
+### `Method ReadDouble!()`
+
+Read a double (eight bytes) from the stream
+
+
+If a value could not be read (possibly due to end of file), a [TStreamReadException](../../brl/brl.stream/tstreamreadexception) is thrown.
+
+
+#### Returns
+The read value
+
+
+
+### `Method WriteDouble( n! )`
+
+Write a double (eight bytes) to the stream
+
+
+If the value could not be written (possibly due to end of file), a [TStreamWriteException](../../brl/brl.stream/tstreamwriteexception) is thrown.
+
+
+
+### `Method ReadLine$()`
+
+Read a line of text from the stream
+
+
+Bytes are read from the stream until a newline character (ascii code 10) or null
+character (ascii code 0) is read, or end of file is detected.
+
+Carriage return characters (ascii code 13) are silently ignored.
+
+The bytes read are returned in the form of a string, excluding any terminating newline
+or null character.
+
+
+
+### `Method WriteLine:Int( str$ )`
+
+Write a line of text to the stream
+
+A sequence of bytes is written to the stream (one for each character in <b>str</b>)
+followed by the line terminating sequence "rn".
+
+
+#### Returns
+True if line successfully written, else False
+
+
+
+### `Method ReadString$( length:Int )`
+
+Read characters from the stream
+
+
+A [TStreamReadException](../../brl/brl.stream/tstreamreadexception) is thrown if not all bytes could be read.
+
+
+#### Returns
+A string composed of <b>length</b> bytes read from the stream
+
+
+
+### `Method WriteString( str$ )`
+
+Write characters to the stream
+
+
+A [TStreamWriteException](../../brl/brl.stream/tstreamwriteexception) is thrown if not all bytes could be written.
+
+
+

+ 7 - 0
docs/api/brl/brl.stream/tstreamexception.md

@@ -0,0 +1,7 @@
+---
+id: tstreamexception
+title: TStreamException
+sidebar_label: TStreamException
+---
+
+

+ 42 - 0
docs/api/brl/brl.stream/tstreamfactory.md

@@ -0,0 +1,42 @@
+---
+id: tstreamfactory
+title: TStreamFactory
+sidebar_label: TStreamFactory
+---
+
+
+
+Stream factories are used by the [OpenStream](../../brl/brl.stream/#function-openstream-tstream-url-object-readable-int-true-writeable-int-true), [ReadStream](../../brl/brl.stream/#function-readstream-tstream-url-object) and [WriteStream](../../brl/brl.stream/#function-writestream-tstream-url-object) functions
+to create streams based on a 'url object'.
+
+Url objects are usually strings, in which case the url is divided into 2 parts - a
+protocol and a path. These are separated by a double colon string - "::".
+
+To create your own stream factories, you should extend the TStreamFactory type and
+implement the CreateStream method.
+
+To install your stream factory, simply create an instance of it using 'New'.
+
+
+## Methods
+
+### `Method CreateStream:TStream( url:Object,proto$,path$,readable:Int,writeable:Int ) Abstract`
+
+Create a stream based on a url object
+
+
+Types which extends TStreamFactory must implement this method.
+
+<b>url</b> contains the original url object as supplied to [OpenStream](../../brl/brl.stream/#function-openstream-tstream-url-object-readable-int-true-writeable-int-true), [ReadStream](../../brl/brl.stream/#function-readstream-tstream-url-object) or
+[WriteStream](../../brl/brl.stream/#function-writestream-tstream-url-object).
+
+If <b>url</b> is a string, <b>proto</b> contains the url protocol - for example, the "incbin" part
+of "incbin::myfile".
+
+If <b>url</b> is a string, <b>path</b> contains the remainder of the url - for example, the "myfile"
+part of "incbin::myfile".
+
+If <b>url</b> is not a string, both <b>proto</b> and <b>path</b> will be Null.
+
+
+

+ 13 - 0
docs/api/brl/brl.stream/tstreamreadexception.md

@@ -0,0 +1,13 @@
+---
+id: tstreamreadexception
+title: TStreamReadException
+sidebar_label: TStreamReadException
+---
+
+
+
+[TStreamReadException](../../brl/brl.stream/tstreamreadexception) is usually thrown when a stream operation failed to read enough
+bytes. For example, if the stream ReadInt method fails to read 4 bytes, it will throw
+a [TStreamReadException](../../brl/brl.stream/tstreamreadexception).
+
+

+ 30 - 0
docs/api/brl/brl.stream/tstreamwrapper.md

@@ -0,0 +1,30 @@
+---
+id: tstreamwrapper
+title: TStreamWrapper
+sidebar_label: TStreamWrapper
+---
+
+
+
+[TStreamWrapper](../../brl/brl.stream/tstreamwrapper) 'wraps' an existing stream, redirecting all TIO method calls to the wrapped
+stream.
+
+This can be useful for writing stream 'filters' that modify the behaviour of existing
+streams.
+
+Note that the Close method causes the underlying stream to be closed, which may not always
+be desirable. If necessary, you should override Close with a NOP version.
+
+
+## Methods
+
+### `Method SetStream( stream:TStream )`
+
+Set underlying stream
+
+
+Sets the stream to be 'wrapped'. All calls to TIO methods of this stream will be
+redirected to <b>stream</b>.
+
+
+

+ 13 - 0
docs/api/brl/brl.stream/tstreamwriteexception.md

@@ -0,0 +1,13 @@
+---
+id: tstreamwriteexception
+title: TStreamWriteException
+sidebar_label: TStreamWriteException
+---
+
+
+
+[TStreamWriteException](../../brl/brl.stream/tstreamwriteexception) is usually thrown when a stream operation failed to write enough
+bytes. For example, if the stream WriteInt method fails to write 4 bytes, it will throw
+a [TStreamWriteException](../../brl/brl.stream/tstreamwriteexception).
+
+

+ 28 - 0
docs/api/brl/brl.stringbuilder/tsplitbuffer.md

@@ -0,0 +1,28 @@
+---
+id: tsplitbuffer
+title: TSplitBuffer
+sidebar_label: TSplitBuffer
+---
+
+
+Note that the TSplitBuffer is only valid while its parent TStringBuilder is unchanged.
+Once you modify the TStringBuffer you should call Split() again.
+
+
+## Methods
+
+### `Method Length:Int()`
+
+The number of split elements.
+
+
+### `Method Text:String(index:Int)`
+
+Returns the text for the given index in the split buffer.
+
+
+### `Method ToArray:String[]()`
+
+Creates a new string array of all the split elements.
+
+

+ 274 - 0
docs/api/brl/brl.stringbuilder/tstringbuilder.md

@@ -0,0 +1,274 @@
+---
+id: tstringbuilder
+title: TStringBuilder
+sidebar_label: TStringBuilder
+---
+
+
+A string builder provides functionality to efficiently insert, replace, remove, append and reverse.
+It is an order of magnitude faster to append Strings to a TStringBuilder than it is to append Strings to Strings.
+
+
+## Methods
+
+### `Method Length:Int()`
+
+Returns the length of the string the string builder would create.
+
+
+### `Method Capacity:Int()`
+
+Returns the total number of characters that the string builder can accommodate before needing to grow.
+
+
+### `Method SetLength(length:Int)`
+
+Sets the length of the string builder.
+
+If the length is less than the current length, the current text will be truncated. Otherwise,
+the capacity will be increased as necessary, although the actual length of text will remain the same.
+
+
+
+### `Method Append:TStringBuilder(value:String)`
+
+Appends the text onto the string builder.
+
+
+### `Method AppendByte:TStringBuilder(value:Byte)`
+
+Appends a byte value to the string builder.
+
+
+### `Method AppendObject:TStringBuilder(obj:Object)`
+
+Appends an object onto the string builder.
+
+This generally calls the object's ToString() method.
+TStringBuilder objects are simply mem-copied.
+
+
+
+### `Method AppendCString:TStringBuilder(chars:Byte Ptr)`
+
+Appends a null-terminated C string onto the string builder.
+
+
+### `Method AppendDouble:TStringBuilder(value:Double)`
+
+Appends a double value to the string builder.
+
+
+### `Method AppendFloat:TStringBuilder(value:Float)`
+
+Appends a float value to the string builder.
+
+
+### `Method AppendInt:TStringBuilder(value:Int)`
+
+Appends a int value to the string builder.
+
+
+### `Method AppendLong:TStringBuilder(value:Long)`
+
+Appends a Long value to the string builder.
+
+
+### `Method AppendNewLine:TStringBuilder()`
+
+Appends the new line string to the string builder.
+
+The new line string can be altered using [SetNewLineText](../../brl/brl.stringbuilder/#method-setnewlinetext-tstringbuilder-newline-string). This might be used to force the output to always use Unix line endings even when on Windows.
+
+
+
+### `Method AppendNull:TStringBuilder()`
+
+Appends the text representing null to the string builder.
+
+
+### `Method AppendShort:TStringBuilder(value:Short)`
+
+Appends a Short value to the string builder.
+
+
+### `Method AppendUInt:TStringBuilder(value:UInt)`
+
+Appends a UInt value to the string builder.
+
+
+### `Method AppendULong:TStringBuilder(value:ULong)`
+
+Appends a Ulong value to the string builder.
+
+
+### `Method AppendSizet:TStringBuilder(value:Size_T)`
+
+Appends a Size_T value to the string builder.
+
+
+### `Method AppendUTF8String:TStringBuilder(chars:Byte Ptr)`
+
+Appends a null-terminated UTF-8 string onto the string builder.
+
+
+### `Method AppendShorts:TStringBuilder(shorts:Short Ptr, length:Int)`
+
+Appends an array of shorts onto the string builder.
+
+
+### `Method Find:Int(subString:String, startIndex:Int = 0)`
+
+Finds first occurance of a sub string.
+
+#### Returns
+-1 if <b>subString</b> not found.
+
+
+
+### `Method FindLast:Int(subString:String, startIndex:Int = 0)`
+
+Finds last occurance of a sub string.
+
+#### Returns
+-1 if <b>subString</b> not found.
+
+
+
+### `Method Left:String(length:Int)`
+
+Extracts the leftmost characters from the string builder.
+
+This method extracts the left <b>length</b> characters from the builder. If this many characters are not available, the whole builder is returned.
+Thus the returned string may be shorter than the length requested.
+
+
+
+### `Method Trim:TStringBuilder()`
+
+Removes leading and trailing non-printable characters from the string builder.
+
+
+### `Method Replace:TStringBuilder(subString:String, withString:String)`
+
+Replaces all occurances of <b>subString</b> with <b>withString</b>.
+
+
+### `Method StartsWith:Int(subString:String)`
+
+Returns true if string starts with <b>subString</b>.
+
+
+### `Method EndsWith:Int(subString:String)`
+
+Returns true if string ends with <b>subString</b>.
+
+
+### `Method CharAt:Int(index:Int)`
+
+Returns the char value in the buffer at the specified index.
+
+The first char value is at index 0, the next at index 1, and so on, as in array indexing.
+<b>index</b> must be greater than or equal to 0, and less than the length of the buffer.
+
+
+
+### `Method Contains:Int(subString:String)`
+
+Returns true if string contains <b>subString</b>.
+
+
+### `Method Join:TStringBuilder(bits:String[])`
+
+Joins <b>bits</b> together by inserting this string builder between each bit.
+
+#### Returns
+A new TStringBuilder object.
+
+
+
+### `Method ToLower:TStringBuilder()`
+
+Converts all of the characters in the buffer to lower case.
+
+
+### `Method ToUpper:TStringBuilder()`
+
+Converts all of the characters in the buffer to upper case.
+
+
+### `Method Remove:TStringBuilder(startIndex:Int, endIndex:Int)`
+
+Removes a range of characters from the string builder.
+
+<b>startIndex</b> is the first character to remove. <b>endIndex</b> is the index after the last character to remove.
+
+
+
+### `Method RemoveCharAt:TStringBuilder(index:Int)`
+
+Removes the character at the specified position in the buffer.
+
+The buffer is shortened by one character.
+
+
+
+### `Method Insert:TStringBuilder(offset:Int, value:String)`
+
+Inserts text into the string builder at the specified offset.
+
+
+### `Method Reverse:TStringBuilder()`
+
+Reverses the characters of the string builder.
+
+
+### `Method Right:String(length:Int)`
+
+Extracts the rightmost characters from the string builder.
+
+This method extracts the right <b>length</b> characters from the builder. If this many characters are not available, the whole builder is returned.
+Thus the returned string may be shorter than the length requested.
+
+
+
+### `Method SetCharAt(index:Int, char:Int)`
+
+The character at the specified index is set to <b>char</b>.
+
+<b>index</b> must be greater than or equal to 0, and less than the length of the buffer.
+
+
+
+### `Method SetNewLineText:TStringBuilder(newLine:String)`
+
+Sets the text to be appended when a new line is added.
+
+
+### `Method SetNullText:TStringBuilder(nullText:String)`
+
+Sets the text to be appended when null is added.
+
+
+### `Method Substring:String(beginIndex:Int, endIndex:Int = 0)`
+
+Returns a substring of the string builder given the specified indexes.
+
+<b>beginIndex</b> is the first character of the substring.
+<b>endIndex</b> is the index after the last character of the substring. If <b>endIndex</b> is zero,
+will return everything from <b>beginIndex</b> until the end of the string builder.
+
+
+
+### `Method ToString:String()`
+
+Converts the string builder to a String.
+
+
+## Functions
+
+### `Function Create:TStringBuilder(Text:String)`
+
+Constructs a string builder initialized to the contents of the specified string.
+
+

+ 14 - 0
docs/api/brl/brl.threadpool/trunnable.md

@@ -0,0 +1,14 @@
+---
+id: trunnable
+title: TRunnable
+sidebar_label: TRunnable
+---
+
+
+## Methods
+
+### `Method run() Abstract`
+
+Called when the object is executed by the thread pool.
+
+

+ 35 - 0
docs/api/brl/brl.threadpool/tthreadpoolexecutor.md

@@ -0,0 +1,35 @@
+---
+id: tthreadpoolexecutor
+title: TThreadPoolExecutor
+sidebar_label: TThreadPoolExecutor
+---
+
+
+## Methods
+
+### `Method execute(command:TRunnable)`
+
+Executes the given command at some time in the future.
+
+
+### `Method shutdown()`
+
+Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.
+
+
+## Functions
+
+### `Function newSingleThreadExecutor:TThreadPoolExecutor()`
+
+Creates an executor that uses a single worker thread operating off an unbounded queue.
+
+
+### `Function newFixedThreadPool:TThreadPoolExecutor(threads:Int)`
+
+Creates a thread pool that reuses a fixed number of threads operating off a shared unbounded queue.
+
+At any point, at most <b>threads</b> threads will be active processing tasks. If additional tasks are
+submitted when all threads are active, they will wait in the queue until a thread is available.
+
+
+

+ 36 - 0
docs/api/brl/brl.threads/tcondvar.md

@@ -0,0 +1,36 @@
+---
+id: tcondvar
+title: TCondVar
+sidebar_label: TCondVar
+---
+
+
+## Methods
+
+### `Method Close()`
+
+Close the condvar
+
+
+### `Method Wait( mutex:TMutex )`
+
+Wait for the condvar
+
+
+### `Method Signal()`
+
+Signal the condvar
+
+
+### `Method Broadcast()`
+
+Broadcast the condvar
+
+
+## Functions
+
+### `Function Create:TCondVar()`
+
+Create a new condvar
+
+

+ 40 - 0
docs/api/brl/brl.threads/tmutex.md

@@ -0,0 +1,40 @@
+---
+id: tmutex
+title: TMutex
+sidebar_label: TMutex
+---
+
+
+## Methods
+
+### `Method Close()`
+
+Close the mutex
+
+
+### `Method Lock()`
+
+Lock the mutex
+
+
+### `Method TryLock:Int()`
+
+Try to lock the mutex
+
+#### Returns
+[True](../../brl/brl.blitz/#true) if mutex was successfully locked; [False](../../brl/brl.blitz/#false) if mutex was already locked by another thread.
+
+
+
+### `Method Unlock()`
+
+Unlock the mutex
+
+
+## Functions
+
+### `Function Create:TMutex()`
+
+Create a new mutex
+
+

+ 31 - 0
docs/api/brl/brl.threads/tsemaphore.md

@@ -0,0 +1,31 @@
+---
+id: tsemaphore
+title: TSemaphore
+sidebar_label: TSemaphore
+---
+
+
+## Methods
+
+### `Method Close()`
+
+Close the semaphore
+
+
+### `Method Wait()`
+
+Wait for the semaphore
+
+
+### `Method Post()`
+
+Post the semaphore
+
+
+## Functions
+
+### `Function Create:TSemaphore( count:Int )`
+
+Create a new semaphore
+
+

+ 53 - 0
docs/api/brl/brl.threads/tthread.md

@@ -0,0 +1,53 @@
+---
+id: tthread
+title: TThread
+sidebar_label: TThread
+---
+
+
+## Methods
+
+### `Method Detach()`
+
+Detach this thread
+
+
+### `Method Wait:Object()`
+
+Wait for this thread to finish
+
+#### Returns
+The object returned by the thread.
+
+
+
+### `Method Running:Int()`
+
+Check if this thread is running
+
+
+## Functions
+
+### `Function Create:TThread( entry:Object( data:Object),data:Object )`
+
+Create a new thread
+
+
+### `Function Main:TThread()`
+
+Get main thread
+
+#### Returns
+A thread object representing the main application thread.
+
+
+
+### `Function Current:TThread()`
+
+Get current thread
+
+#### Returns
+A thread object representing the current thread.
+
+
+

+ 26 - 0
docs/api/brl/brl.threads/tthreaddata.md

@@ -0,0 +1,26 @@
+---
+id: tthreaddata
+title: TThreadData
+sidebar_label: TThreadData
+---
+
+
+## Methods
+
+### `Method SetValue( value:Object )`
+
+Set thread data value
+
+
+### `Method GetValue:Object()`
+
+Get thread data value
+
+
+## Functions
+
+### `Function Create:TThreadData()`
+
+Create thread data
+
+

+ 371 - 0
docs/api/brl/brl_audio.md

@@ -0,0 +1,371 @@
+---
+id: brl.audio
+title: BRL.Audio
+sidebar_label: BRL.Audio
+---
+
+
+
+The BlitzMax audio module contains commands to load and play sounds.
+
+A sound file can be played in BlitzMax with a combination of [LoadSound](../../brl/brl.audio/#function-loadsound-tsound-url-object-flags-int-0) that loads a sound file
+and [PlaySound](../../brl/brl.audio/#function-playsound-tchannel-sound-tsound-channel-tchannel-null) which plays the sound through the systems audio system if available.
+
+BlitzMax contains native support for sound files in both .wav (uncompressed)
+and .ogg (compressed) file formats.
+
+Playback of sounds can be controlled with various audio channel
+operators including [SetChannelVolume](../../brl/brl.audio/#function-setchannelvolume-channel-tchannel-volume), [SetChannelPan](../../brl/brl.audio/#function-setchannelpan-channel-tchannel-pan), [SetChannelDepth](../../brl/brl.audio/#function-setchanneldepth-channel-tchannel-depth) and [SetChannelRate](../../brl/brl.audio/#function-setchannelrate-channel-tchannel-rate).
+
+A channel handle is obtained from either the return value of [PlaySound](../../brl/brl.audio/#function-playsound-tchannel-sound-tsound-channel-tchannel-null) and [CueSound](../../brl/brl.audio/#function-cuesound-tchannel-sound-tsound-channel-tchannel-null) or from
+reserving a channel with [AllocChannel](../../brl/brl.audio/#function-allocchannel-tchannel).
+
+
+## Types
+| Type | Description |
+|---|---|
+| [TSound](../../brl/brl.audio/tsound) | Audio sound type |
+| [TChannel](../../brl/brl.audio/tchannel) | Audio channel Type |
+
+## Functions
+
+### `Function LoadSound:TSound( url:Object,flags:Int=0 )`
+
+Load a sound
+
+
+<b>url</b> can be either a string, a stream or a [TAudioSample](../../brl/brl.audiosample/taudiosample) object.
+The returned sound can be played using [PlaySound](../../brl/brl.audio/#function-playsound-tchannel-sound-tsound-channel-tchannel-null) or [CueSound](../../brl/brl.audio/#function-cuesound-tchannel-sound-tsound-channel-tchannel-null).
+
+The <b>flags</b> parameter can be any combination of:
+
+<table><tr><td> <b>Flag value</b></td><td><b>Effect</b></td></tr><tr><td>  SOUND_LOOP</td><td>The sound should loop when played back.</td></tr><tr><td>  SOUND_HARDWARE</td><td>The sound should be placed in onboard soundcard memory if possible.</table>
+
+
+To combine flags, use the binary 'or' operator: '|'.
+
+
+#### Returns
+A sound object
+
+
+#### Example
+```blitzmax
+Rem
+Load and Play a small example wav file.
+End Rem
+
+sound=LoadSound("shoot.wav")
+PlaySound sound
+
+Input "Press any key to continue"
+```
+
+### `Function PlaySound:TChannel( sound:TSound,channel:TChannel=Null )`
+
+Play a sound
+
+
+[PlaySound](../../brl/brl.audio/#function-playsound-tchannel-sound-tsound-channel-tchannel-null) starts a sound playing through an audio channel.
+If no <b>channel</b> is specified, [PlaySound](../../brl/brl.audio/#function-playsound-tchannel-sound-tsound-channel-tchannel-null) automatically allocates a channel for you.
+
+
+#### Returns
+An audio channel object
+
+
+#### Example
+```blitzmax
+Rem
+Load and Play a small example wav file with looping.
+End Rem
+
+sound=LoadSound("shoot.wav",true)
+PlaySound sound
+
+Input "Press any key to continue"
+```
+
+### `Function CueSound:TChannel( sound:TSound,channel:TChannel=Null )`
+
+Cue a sound
+
+
+Prepares a sound for playback through an audio channel.
+To actually start the sound, you must use [ResumeChannel](../../brl/brl.audio/#function-resumechannel-channel-tchannel).
+If no <b>channel</b> is specified, [CueSound](../../brl/brl.audio/#function-cuesound-tchannel-sound-tsound-channel-tchannel-null) automatically allocates a channel for you.
+
+[CueSound](../../brl/brl.audio/#function-cuesound-tchannel-sound-tsound-channel-tchannel-null) allows you to setup various audio channel states such as volume, pan, depth
+and rate before a sound actually starts playing.
+
+
+#### Returns
+An audio channel object
+
+
+#### Example
+```blitzmax
+Rem
+CueSound example
+End Rem
+
+sound=LoadSound("shoot.wav")
+channel=CueSound(sound)
+
+Input "Press return key to play cued sound"
+
+ResumeChannel channel
+
+Input "Press return key to quit"
+```
+
+### `Function AllocChannel:TChannel()`
+
+Allocate audio channel
+
+
+Allocates an audio channel for use with [PlaySound](../../brl/brl.audio/#function-playsound-tchannel-sound-tsound-channel-tchannel-null) and [CueSound](../../brl/brl.audio/#function-cuesound-tchannel-sound-tsound-channel-tchannel-null).
+Once you are finished with an audio channel, you should use [StopChannel](../../brl/brl.audio/#function-stopchannel-channel-tchannel).
+
+
+#### Returns
+An audio channel object
+
+
+#### Example
+```blitzmax
+'AllocChannel.bmx
+
+timer=createtimer(20)
+
+sound=LoadSound ("shoot.wav")
+channel=AllocChannel()
+
+for i=1 to 20
+	waittimer timer
+	playsound sound,channel
+next
+```
+
+### `Function StopChannel( channel:TChannel )`
+
+Stop an audio channel
+
+
+Shuts down an audio channel. Further commands using this channel will have no effect.
+
+
+#### Example
+```blitzmax
+Rem
+StopChannel example
+End Rem
+
+sound=LoadSound("shoot.wav",true)
+channel=PlaySound(sound)
+
+print "channel="+channel
+
+Input "Press return key to stop sound"
+
+StopChannel channel
+
+Input "Press return key to quit"
+```
+
+### `Function ChannelPlaying:Int( channel:TChannel )`
+
+Determine whether an audio channel is playing
+
+
+[ChannelPlaying](../../brl/brl.audio/#function-channelplaying-int-channel-tchannel) will return [False](../../brl/brl.blitz/#false) if either the channel has been paused using [PauseChannel](../../brl/brl.audio/#function-pausechannel-channel-tchannel),
+or stopped using [StopChannel](../../brl/brl.audio/#function-stopchannel-channel-tchannel).
+
+
+#### Returns
+[True](../../brl/brl.blitz/#true) if <b>channel</b> is currently playing
+
+
+#### Example
+```blitzmax
+' channelplaying.bmx
+
+sound = LoadSound ("shoot.wav")
+
+Input "Hit return to begin channelplaying test, use ctrl-C to exit"
+
+channel=playsound (sound)
+while true
+	print "ChannelPlaying(channel)="+ChannelPlaying(channel)
+wend
+```
+
+### `Function SetChannelVolume( channel:TChannel,volume# )`
+
+Set playback volume of an audio channel
+
+
+<b>volume</b> should be in the range 0 (silent) to 1 (full volume)
+
+
+#### Example
+```blitzmax
+' setchannelvolume.bmx
+
+timer=CreateTimer(20)
+
+sound = LoadSound ("shoot.wav")
+
+For volume#=.1 To 2 Step .05
+	WaitTimer timer
+	channel=CueSound(sound)
+	SetChannelVolume channel,volume
+	ResumeChannel channel
+Next
+```
+
+### `Function SetChannelPan( channel:TChannel,pan# )`
+
+Set stereo balance of an audio channel
+
+
+<b>pan</b> should be in the range -1 (left) to 1 (right)
+
+
+#### Example
+```blitzmax
+' setchannelpan.bmx
+
+Graphics 640, 480
+
+channel = AllocChannel ()
+sound = LoadSound ("shoot.wav") ' Use a short sample...
+
+Repeat
+	If MouseHit(1) PlaySound sound,channel
+	
+	pan# = MouseX () / (GraphicsWidth () / 2.0) - 1
+	vol# = 1 - MouseY () / 480.0
+	SetChannelPan channel, pan
+	SetChannelVolume channel, vol*2
+
+	Cls
+	DrawText "Click to play...", 240, 200
+	DrawText "Pan   : " + pan, 240, 220
+	DrawText "Volume: " + vol, 240, 240
+
+	Flip
+Until KeyHit (KEY_ESCAPE)
+
+End
+```
+
+### `Function SetChannelDepth( channel:TChannel,depth# )`
+
+Set surround sound depth of an audio channel
+
+
+<b>depth</b> should be in the range -1 (back) to 1 (front)
+
+
+#### Example
+```blitzmax
+' setchanneldepth.bmx
+
+Graphics 640, 480
+
+channel = AllocChannel ()
+sound = LoadSound ("shoot.wav") ' Use a short sample...
+
+Repeat
+	If MouseHit(1) PlaySound sound,channel
+	
+	pan# = MouseX () / (640 / 2.0) - 1
+	depth# = MouseY () / (480 /2.0) -1
+	
+	SetChannelPan channel,pan
+	SetChannelDepth channel,depth
+
+	Cls
+	DrawText "Click to play...", 240, 200
+	DrawText "Pan   : " + pan, 240, 220
+	DrawText "Depth : " + depth, 240, 240
+
+	Flip
+Until KeyHit (KEY_ESCAPE)
+
+End
+```
+
+### `Function SetChannelRate( channel:TChannel,rate# )`
+
+Set playback rate of an audio channel
+
+
+<b>rate</b> is a multiplier used to modify the audio channel's frequency.
+For example, a rate of .5 will cause the audio channel
+to play at half speed (ie: an octave down) while a rate of 2 will
+cause the audio channel to play at double speed (ie: an octave up).
+
+
+#### Example
+```blitzmax
+' setchannelrate.bmx
+
+timer=CreateTimer(20)
+
+sound = LoadSound ("shoot.wav",True)
+channel=CueSound(sound)
+ResumeChannel channel
+
+For rate#=1.0 To 4 Step 0.01
+	WaitTimer timer
+	SetChannelRate channel,rate
+Next
+```
+
+### `Function PauseChannel( channel:TChannel )`
+
+Pause audio channel playback
+
+
+Pauses audio channel playback.
+
+
+
+### `Function ResumeChannel( channel:TChannel )`
+
+Resume audio channel playback
+
+
+Resumes audio channel playback after it has been paused by [CueSound](../../brl/brl.audio/#function-cuesound-tchannel-sound-tsound-channel-tchannel-null) or [PauseChannel](../../brl/brl.audio/#function-pausechannel-channel-tchannel).
+
+
+
+### `Function AudioDrivers$[]()`
+
+Get audio drivers
+
+
+Returns an array of strings, where each string describes an audio driver.
+
+
+
+### `Function AudioDriverExists:Int( name$ )`
+
+Determine if an audio driver exists
+
+
+Returns True if the audio drvier specified by <b>driver</b> exists.
+
+
+
+### `Function SetAudioDriver:Int( name$ )`
+
+Set current audio driver
+
+
+Returns true if the audio driver was successfully set.
+
+
+

+ 83 - 0
docs/api/brl/brl_audiosample.md

@@ -0,0 +1,83 @@
+---
+id: brl.audiosample
+title: BRL.AudioSample
+sidebar_label: BRL.AudioSample
+---
+
+
+The BlitzMax audiosample module contains commands to create and load audio samples for
+use with the BlitzMax [BRL.Audio](../../brl/brl_audio.md) module.
+
+
+## Types
+| Type | Description |
+|---|---|
+| [TAudioSample](../../brl/brl.audiosample/taudiosample) | Audio sample type |
+| [TAudioSampleLoader](../../brl/brl.audiosample/taudiosampleloader) | Audio sample loader type |
+
+## Functions
+
+### `Function CreateAudioSample:TAudioSample( length,hertz,format )`
+
+Create an audio sample
+
+
+<b>length</b> is the number of samples to allocate for the sample. <b>hertz</b> is the frequency in samples per second (hz)
+the audio sample will be played. <b>format</b> should be one of:
+
+<table><tr><td> <b>Format</b></td><td><b>Description</b>
+</td></tr><tr><td>  &SF_MONO8</td><td>Mono unsigned 8 bit
+</td></tr><tr><td>  &SF_MONO16LE</td><td>Mono signed 16 bit little endian
+</td></tr><tr><td>  &SF_MONO16BE</td><td>Mono signed 16 bit big endian
+</td></tr><tr><td>  &SF_STEREO8</td><td>Stereo unsigned 8 bit
+</td></tr><tr><td>  &SF_STEREO16LE</td><td>Stereo signed 16 bit little endian
+</td></tr><tr><td>  &SF_STEREO16BE</td><td>Stereo signed 16 bit big endian</table>
+
+
+
+#### Returns
+An audio sample object
+
+
+#### Example
+```blitzmax
+' createaudiosample.bmx
+
+Local sample:TAudioSample=CreateAudioSample( 32,11025,SF_MONO8 )
+
+For Local k=0 Until 32
+        sample.samples[k]=Sin(k*360/32)*127.5+127.5
+Next
+
+Local sound:TSound=LoadSound( sample,True )
+
+PlaySound(sound)
+
+Input
+```
+
+### `Function CreateStaticAudioSample:TAudioSample( samples:Byte Ptr,length,hertz,format )`
+
+Create an audio sample with existing data
+
+
+The memory referenced by a static audio sample is not released when the audio sample is
+deleted.
+
+See [CreateAudioSample](../../brl/brl.audiosample/#function-createaudiosample-taudiosample-length-hertz-format) for possile <b>format</b> values.
+
+
+#### Returns
+An audio sample object that references an existing block of memory
+
+
+
+### `Function LoadAudioSample:TAudioSample( url:Object )`
+
+Load an audio sample
+
+#### Returns
+An audio sample object
+
+
+

+ 316 - 0
docs/api/brl/brl_bank.md

@@ -0,0 +1,316 @@
+---
+id: brl.bank
+title: BRL.Bank
+sidebar_label: BRL.Bank
+---
+
+
+A bank object encapsulates a block of memory you can use to store arbitrary data.
+
+Banks are useful for storing data that is of no fixed type - for example, the contents
+of a binary file.
+
+To create a bank, use the [CreateBank](../../brl/brl.bank/#function-createbank-tbank-size-int-0) command.
+
+To write data to a bank, use one of 'Poke' style commands, such as [PokeByte](../../brl/brl.bank/#method-pokebyte-offset-size-t-value).
+
+To read data from a bank, use one of the 'Peek' style commands, such as [PeekByte](../../brl/brl.bank/#method-peekbyte-offset-size-t).
+
+In addition, banks can be loaded or saved using [LoadBank](../../brl/brl.bank/#function-loadbank-tbank-url-object) or [SaveBank](../../brl/brl.bank/#function-savebank-bank-tbank-url-object).
+
+
+## Types
+| Type | Description |
+|---|---|
+| [TBank](../../brl/brl.bank/tbank) | Memory bank |
+
+## Functions
+
+### `Function CreateBank:TBank( size:Int=0 )`
+
+Create a bank
+
+
+[CreateBank](../../brl/brl.bank/#function-createbank-tbank-size-int-0) creates a Bank allocating a specified amount of memory that
+can be used for storage of binary data using the various Poke and
+Peek commands.
+
+
+#### Returns
+A bank object with an initial size of <b>size</b> bytes
+
+
+
+### `Function CreateStaticBank:TBank( buf:Byte Ptr,size:Int )`
+
+Create a bank with existing data
+
+
+The memory referenced by a static bank is not released when the bank is deleted.
+A static bank cannot be resized.
+
+
+#### Returns
+A bank object that references an existing block of memory
+
+
+
+### `Function LoadBank:TBank( url:Object )`
+
+Load a bank
+
+
+[LoadBank](../../brl/brl.bank/#function-loadbank-tbank-url-object) reads the entire contents of a binary file from a specified <b>url</b> into a newly
+created bank with a size matching that of the file.
+
+
+#### Returns
+A bank containing the binary contents of <b>url</b>, or null if <b>url</b> could not be opened
+
+
+
+### `Function SaveBank( bank:TBank,url:Object )`
+
+Save a bank
+
+
+[SaveBank](../../brl/brl.bank/#function-savebank-bank-tbank-url-object) writes it's entire contents to a <b>url</b>. If the <b>url</b> is a file path a new
+file is created.
+
+
+#### Returns
+True if successful.
+
+
+
+### `Function BankBuf:Byte Ptr( bank:TBank )`
+
+Get bank's memory buffer
+
+
+Please use [LockBank](../../brl/brl.bank/#function-lockbank-byte-ptr-bank-tbank) and [UnlockBank](../../brl/brl.bank/#function-unlockbank-bank-tbank) instead of this method.
+
+
+#### Returns
+A byte pointer to the bank's internal memory buffer
+
+
+
+### `Function LockBank:Byte Ptr( bank:TBank )`
+
+Lock a bank's memory block
+
+
+While locked, a bank cannot be resized.
+
+After you have finished with a bank's memory block, you must use [UnlockBank](../../brl/brl.bank/#function-unlockbank-bank-tbank)
+to return it to the bank.
+
+
+#### Returns
+A byte pointer to the memory block controlled by the bank.
+
+
+
+### `Function UnlockBank( bank:TBank )`
+
+Unlock a bank's memory block
+
+
+After you have finished with a bank's memory block, you must use [UnlockBank](../../brl/brl.bank/#function-unlockbank-bank-tbank)
+to return it to the bank.
+
+
+
+### `Function BankSize:Long( bank:TBank )`
+
+Get size of bank
+
+#### Returns
+The size, in bytes, of the bank's internal memory buffer
+
+
+
+### `Function BankCapacity:Long( bank:TBank )`
+
+Get capacity of bank
+
+
+The capacity of a bank is the size limit before a bank must allocate
+more memory due to a resize. Bank capacity may be increased due to a call
+to [ResizeBank](../../brl/brl.bank/#function-resizebank-bank-tbank-size-size-t) by either 50% or the requested amount, whichever is greater.
+Capacity never decreases.
+
+
+#### Returns
+The capacity, in bytes, of the bank's internal memory buffer
+
+
+
+### `Function ResizeBank( bank:TBank,size:Size_T )`
+
+Resize a bank
+
+
+[ResizeBank](../../brl/brl.bank/#function-resizebank-bank-tbank-size-size-t) modifies the size limit of a bank. This may cause memory to be
+allocated if the requested size is greater than the bank's current capacity,
+see [BankCapacity](../../brl/brl.bank/#function-bankcapacity-long-bank-tbank) for more information.
+
+
+
+### `Function CopyBank( src_bank:TBank,src_offset:Size_T,dst_bank:TBank,dst_offset:Size_T,count:Size_T )`
+
+Copy bank contents
+
+
+[CopyBank](../../brl/brl.bank/#function-copybank-src-bank-tbank-src-offset-size-t-dst-bank-tbank-dst-offset-size-t-count-size-t) copies <b>count</b> bytes from <b>src_offset</b> in <b>src_bank</b> to <b>dst_offset</b>
+in <b>dst_bank</b>.
+
+
+
+### `Function PeekByte( bank:TBank,offset:Size_T )`
+
+Peek a byte from a bank
+
+
+A byte is an unsigned 8 bit value with a range of 0..255.
+
+
+#### Returns
+The byte value at the specified byte offset within the bank
+
+
+
+### `Function PokeByte( bank:TBank,offset:Size_T,value )`
+
+Poke a byte into a bank
+
+
+### `Function PeekShort( bank:TBank,offset:Size_T )`
+
+Peek a short from a bank
+
+
+A short is an unsigned 16 bit (2 bytes) value with a range of 0..65535.
+
+
+#### Returns
+The short value at the specified byte offset within the bank
+
+
+
+### `Function PokeShort( bank:TBank,offset:Size_T,value )`
+
+Poke a short into a bank
+
+
+An short is an unsigned 16 bit value that requires 2 bytes of storage.
+
+
+
+### `Function PeekInt( bank:TBank,offset:Size_T )`
+
+Peek an int from a bank
+
+
+An int is a signed 32 bit value (4 bytes).
+
+
+#### Returns
+The int value at the specified byte offset within the bank
+
+
+
+### `Function PokeInt( bank:TBank,offset:Size_T,value )`
+
+Poke an int into a bank
+
+
+An int is a signed 32 bit value that requires 4 bytes of storage.
+
+
+
+### `Function PeekLong:Long( bank:TBank,offset:Size_T )`
+
+Peek a long integer from a bank
+
+
+A long is a 64 bit integer that requires 8 bytes of memory.
+
+
+#### Returns
+The long integer value at the specified byte offset within the bank
+
+
+
+### `Function PokeLong( bank:TBank,offset:Size_T,value:Long )`
+
+Poke a long integer int into a bank
+
+
+A long is a 64 bit integer that requires 8 bytes of storage.
+
+
+
+### `Function PeekFloat#( bank:TBank,offset:Size_T )`
+
+Peek a float from a bank
+
+
+A float requires 4 bytes of storage
+
+
+#### Returns
+The float value at the specified byte offset within the bank
+
+
+
+### `Function PokeFloat( bank:TBank,offset:Size_T,value# )`
+
+Poke a float into a bank
+
+
+A float requires 4 bytes of storage
+
+
+
+### `Function PeekDouble!( bank:TBank,offset:Size_T )`
+
+Peek a double from a bank
+
+
+A double requires 8 bytes of storage
+
+
+#### Returns
+The double value at the specified byte offset within the bank
+
+
+
+### `Function PokeDouble( bank:TBank,offset:Size_T,value! )`
+
+Poke a double into a bank
+
+
+A double requires 8 bytes of storage
+
+
+
+### `Function ReadBank:Long( bank:TBank,stream:TStream,offset:Size_T,count:Long )`
+
+Read bytes from a Stream to a Bank
+
+#### Returns
+The number of bytes successfully read from the Stream
+
+
+
+### `Function WriteBank:Long( bank:TBank,stream:TStream,offset:Size_T,count:Long )`
+
+Write bytes from a Bank to a Stream
+
+#### Returns
+The number of bytes successfully written to the Stream
+
+
+

+ 36 - 0
docs/api/brl/brl_bankstream.md

@@ -0,0 +1,36 @@
+---
+id: brl.bankstream
+title: BRL.BankStream
+sidebar_label: BRL.BankStream
+---
+
+
+A bank stream allows you to read data into or out of a bank. A bank stream can be used with
+any of the stream commands, or anywhere a [TStream](../../brl/brl.stream/tstream) object is expected.
+
+To create a bank stream, use the [CreateBankStream](../../brl/brl.bankstream/#function-createbankstream-tbankstream-bank-tbank) command.
+
+As with all streams, you should use [CloseStream](../../brl/brl.stream/#function-closestream-stream-tstream) when you are finished with the bank stream.
+
+
+## Types
+| Type | Description |
+|---|---|
+| [TBankStream](../../brl/brl.bankstream/tbankstream) | BankStream Object |
+
+## Functions
+
+### `Function CreateBankStream:TBankStream( bank:TBank )`
+
+Create a bank stream
+
+
+A bank stream allows you to read data into or out of a bank. A bank stream extends a stream so
+can be used in place of a stream.
+
+
+#### Returns
+A bank stream object
+
+
+

+ 381 - 0
docs/api/brl/brl_blitz.md

@@ -0,0 +1,381 @@
+---
+id: brl.blitz
+title: BRL.Blitz
+sidebar_label: BRL.Blitz
+---
+
+
+The Blitz runtime module provides low level functionality required by  BlitzMax applications when they are running. This includes things like memory management, exception handling and string and array operations.<br>
+<br>
+Much of the functionality provided by this module is hidden from application programmers, but is instead used 'behind the scenes' by the compiler. However, there are some very useful commands for debugging, memory management and simple standard IO.
+
+
+## Types
+| Type | Description |
+|---|---|
+| [TBlitzException](../../brl/brl.blitz/tblitzexception) | Exception |
+| [TNullObjectException](../../brl/brl.blitz/tnullobjectexception) | Null object exception |
+| [TNullMethodException](../../brl/brl.blitz/tnullmethodexception) | Null method exception |
+| [TNullFunctionException](../../brl/brl.blitz/tnullfunctionexception) | Null function exception |
+| [TArrayBoundsException](../../brl/brl.blitz/tarrayboundsexception) | Null method exception |
+| [TOutOfDataException](../../brl/brl.blitz/toutofdataexception) | Out of data exception |
+| [TRuntimeException](../../brl/brl.blitz/truntimeexception) | Runtime exception |
+
+## Functions
+
+### `Function RuntimeError( message$ )`
+
+Generate a runtime error
+
+Throws a [TRuntimeException](../../brl/brl.blitz/truntimeexception).
+
+
+#### Example
+```blitzmax
+' runtimeerror.bmx
+
+If a=0 RuntimeError "This program has failed badly."
+```
+
+### `Function DebugStop()`
+
+Stop program execution and enter debugger
+
+If there is no debugger present, this command is ignored.
+
+
+
+### `Function DebugLog( message$ )`
+
+Write a string to debug log
+
+If there is no debugger present, this command is ignored.
+
+
+
+### `Function OnEnd( fun() )`
+
+Add a function to be called when the program ends
+
+[OnEnd](../../brl/brl.blitz/#function-onend-fun) allows you to specify a function to be called when the program ends. OnEnd functions are called
+in the reverse order to that in which they were added.
+
+
+#### Example
+```blitzmax
+' onend.bmx
+
+Function cleanup()
+Print "cleaning up"
+End Function
+
+OnEnd cleanup
+Print "program running"
+End	'the cleanup function will be called at this time
+```
+
+### `Function ReadStdin$()`
+
+Read a string from stdin
+
+#### Returns
+A string read from stdin. The newline terminator, if any, is included in the returned string.
+
+
+
+### `Function WriteStdout( str$ )`
+
+Write a string to stdout
+
+Writes <b>str</b> to stdout and flushes stdout.
+
+
+
+### `Function WriteStderr( str$ )`
+
+Write a string to stderr
+
+Writes <b>str</b> to stderr and flushes stderr.
+
+
+
+### `Function Delay( millis:Int )`
+
+Wait for a given number of milliseconds
+
+
+[Delay](../../brl/brl.blitz/#function-delay-millis-int) suspends program execution for at least <b>millis</b> milliseconds.<br>
+<br>
+A millisecond is one thousandth of a second.
+
+
+
+### `Function MilliSecs:Int()`
+
+Get millisecond counter
+
+
+[MilliSecs](../../brl/brl.blitz/#function-millisecs-int) returns the number of milliseconds elapsed since the computer
+was turned on.<br>
+<br>
+A millisecond is one thousandth of a second.
+
+
+#### Returns
+Milliseconds since computer turned on.
+
+
+
+### `Function MemAlloc:Byte Ptr( size:Size_T )`
+
+Allocate memory
+
+#### Returns
+A new block of memory <b>size</b> bytes long
+
+
+
+### `Function MemFree( mem:Byte Ptr )`
+
+Free allocated memory
+
+The memory specified by <b>mem</b> must have been previously allocated by [MemAlloc](../../brl/brl.blitz/#function-memalloc-byte-ptr-size-size-t) or [MemExtend](../../brl/brl.blitz/#function-memextend-byte-ptr-mem-byte-ptr-size-size-t-new-size-size-t).
+
+
+
+### `Function MemExtend:Byte Ptr( mem:Byte Ptr,size:Size_T,new_size:Size_T )`
+
+Extend a block of memory
+
+An existing block of memory specified by <b>mem</b> and <b>size</b> is copied into a new block
+of memory <b>new_size</b> bytes long. The existing block is released and the new block is returned.
+
+
+#### Returns
+A new block of memory <b>new_size</b> bytes long
+
+
+
+### `Function MemClear( mem:Byte Ptr,size:Size_T )`
+
+Clear a block of memory to 0
+
+
+### `Function MemCopy( dst:Byte Ptr,src:Byte Ptr,size:Size_T )`
+
+Copy a non-overlapping block of memory
+
+
+### `Function MemMove( dst:Byte Ptr,src:Byte Ptr,size:Size_T )`
+
+Copy a potentially overlapping block of memory
+
+
+### `Function GCSetMode( Mode:Int )`
+
+Set garbage collector mode
+
+
+<b>mode</b> can be one of the following:<br>
+1 : automatic GC - memory will be automatically garbage collected<br>
+2 : manual GC - no memory will be collected until a call to GCCollect is made<br>
+<br>
+The default GC mode is automatic GC.
+
+
+
+### `Function GCSuspend()`
+
+Suspend garbage collector
+
+
+[GCSuspend](../../brl/brl.blitz/#function-gcsuspend) temporarily suspends the garbage collector. No garbage
+collection will be performed following a call to [GCSuspend](../../brl/brl.blitz/#function-gcsuspend).<br>
+<br>
+Use [GCResume](../../brl/brl.blitz/#function-gcresume) to resume the garbage collector. Note that [GCSuspend](../../brl/brl.blitz/#function-gcsuspend)
+and [GCResume](../../brl/brl.blitz/#function-gcresume) 'nest', meaning that each call to [GCSuspend](../../brl/brl.blitz/#function-gcsuspend) must be
+matched by a call to [GCResume](../../brl/brl.blitz/#function-gcresume).
+
+
+
+### `Function GCResume()`
+
+Resume garbage collector
+
+
+[GCResume](../../brl/brl.blitz/#function-gcresume) resumes garbage collection following a call to [GCSuspend](../../brl/brl.blitz/#function-gcsuspend).<br>
+<br>
+See [GCSuspend](../../brl/brl.blitz/#function-gcsuspend) for more details.
+
+
+
+### `Function GCCollect:Int()`
+
+Run garbage collector
+
+
+This function will have no effect if the garbage collector has been
+suspended due to [GCSuspend](../../brl/brl.blitz/#function-gcsuspend).
+
+
+#### Returns
+The amount of memory, in bytes, collected.
+
+
+
+### `Function GCCollectALittle:Int()`
+
+Run garbage collector, collecting a little
+
+
+This function will have no effect if the garbage collector has been
+suspended due to [GCSuspend](../../brl/brl.blitz/#function-gcsuspend).
+
+
+#### Returns
+Returns 0 if there is no more to collect.
+
+
+
+### `Function GCMemAlloced:Int()`
+
+Memory allocated by application
+
+
+This function only returns 'managed memory'. This includes all objects, strings and
+arrays in use by the application.
+
+
+#### Returns
+The amount of memory, in bytes, currently allocated by the application
+
+
+
+### `Function GCEnter()`
+
+Private: do not use
+
+
+### `Function GCLeave()`
+
+Private: do not use
+
+
+### `Function HandleFromObject:Size_T( obj:Object )`
+
+Convert object to integer handle
+
+
+After converting an object to an integer handle, you must later
+release it using the [Release](../../brl/brl.blitz/#release) command.
+
+
+#### Returns
+An integer object handle
+
+
+
+### `Function HandleToObject:Object( handle:Size_T )`
+
+Convert integer handle to object
+
+#### Returns
+The object associated with the integer handle
+
+
+
+### `Function ArrayCopy(src:Object, srcPos:Int, dst:Object, dstPos:Int, length:Int)`
+
+Copies an array from the specified <b>src</b> array, starting at the position <b>srcPos</b>, to the position <b>dstPos</b> of the destination array.
+
+
+## Globals
+
+### `Global AppDir$="bbAppDir"`
+
+Application directory
+
+The [AppDir](../../brl/brl.blitz/#global-appdir-bbappdir) global variable contains the fully qualified directory of the currently
+executing application. An application's initial current directory is also set to [AppDir](../../brl/brl.blitz/#global-appdir-bbappdir)
+when an application starts.
+
+
+#### Example
+```blitzmax
+' appdir.bmx
+' requests the user to select a file from the application's directory
+
+Print "Application Directory="+AppDir$
+
+file$=RequestFile("Select File to Open","",False,AppDir$)
+
+Print "file selected was :"+file
+```
+
+### `Global AppFile$="bbAppFile"`
+
+Application file name
+
+The [AppFile](../../brl/brl.blitz/#global-appfile-bbappfile) global variable contains the fully qualified file name of the currently
+executing application.
+
+
+#### Example
+```blitzmax
+' appfile.bmx
+
+Print "This program's executable is located at "+AppFile$
+```
+
+### `Global AppTitle$="bbAppTitle"`
+
+Application title
+
+The [AppTitle](../../brl/brl.blitz/#global-apptitle-bbapptitle) global variable is used by various commands when a
+default application title is required - for example, when opening simple
+windows or requesters.<br>
+<br>
+Initially, [AppTitle](../../brl/brl.blitz/#global-apptitle-bbapptitle) is set to the value "BlitzMax Application". However, you may change
+[AppTitle](../../brl/brl.blitz/#global-apptitle-bbapptitle) at any time with a simple assignment.
+
+
+
+### `Global AppArgs$[]="bbAppArgs"`
+
+Arguments passed to the application at startup
+
+The [AppArgs](../../brl/brl.blitz/#global-appargs-bbappargs) global array contains the command line parameters sent to an application
+when it was started. The first element of [AppArgs](../../brl/brl.blitz/#global-appargs-bbappargs) always contains the name of the
+application. However, the format of the name may change depending on how the application
+was launched. Use [AppDir](../../brl/brl.blitz/#global-appdir-bbappdir) or [AppFile](../../brl/brl.blitz/#global-appfile-bbappfile) for consistent information about the applications name
+or directory.
+
+
+#### Example
+```blitzmax
+' appargs.bmx
+' print the command line arguments passed to the program at runtime
+
+Print "Number of arguments = "+AppArgs.length
+
+For a$=EachIn AppArgs
+Print a$
+Next
+```
+
+### `Global LaunchDir$="bbLaunchDir"`
+
+Directory from which application was launched
+
+The [LaunchDir](../../brl/brl.blitz/#global-launchdir-bblaunchdir) global variable contains the current directory at the time the
+application was launched. This is mostly of use to command line tools which may need to
+access the 'shell' current directory as opposed to the application directory.
+
+
+#### Example
+```blitzmax
+' launchdir.bmx
+
+Print "This program was launched from "+LaunchDir$
+```
+

+ 11 - 0
docs/api/brl/brl_bmploader.md

@@ -0,0 +1,11 @@
+---
+id: brl.bmploader
+title: BRL.BMPLoader
+sidebar_label: BRL.BMPLoader
+---
+
+
+
+The BMP loader module provides the ability to load BMP format pixmaps.
+
+

+ 22 - 0
docs/api/brl/brl_d3d7max2d.md

@@ -0,0 +1,22 @@
+---
+id: brl.d3d7max2d
+title: BRL.D3D7Max2D
+sidebar_label: BRL.D3D7Max2D
+---
+
+
+
+The Direct3D7 Max2D module provides a Direct3D7 driver for Max2D.
+
+
+## Functions
+
+### `Function D3D7Max2DDriver:TD3D7Max2DDriver()`
+
+Get Direct3D7 Max2D Driver
+
+
+The returned driver can be used with [SetGraphicsDriver](../../brl/brl.graphics/#function-setgraphicsdriver-driver-tgraphicsdriver-defaultflags-graphics-backbuffer) to enable Direct3D Max2D rendering.
+
+
+

+ 22 - 0
docs/api/brl/brl_d3d9max2d.md

@@ -0,0 +1,22 @@
+---
+id: brl.d3d9max2d
+title: BRL.D3D9Max2D
+sidebar_label: BRL.D3D9Max2D
+---
+
+
+
+The Direct3D9 Max2D module provides a Direct3D9 driver for Max2D.
+
+
+## Functions
+
+### `Function D3D9Max2DDriver:TD3D9Max2DDriver()`
+
+Get Direct3D9 Max2D Driver
+
+
+The returned driver can be used with [SetGraphicsDriver](../../brl/brl.graphics/#function-setgraphicsdriver-driver-tgraphicsdriver-defaultflags-graphics-backbuffer) to enable Direct3D9 Max2D rendering.
+
+
+

+ 11 - 0
docs/api/brl/brl_directsoundaudio.md

@@ -0,0 +1,11 @@
+---
+id: brl.directsoundaudio
+title: BRL.DirectSoundAudio
+sidebar_label: BRL.DirectSoundAudio
+---
+
+
+
+The DirectSound audio module provides DirectSound drivers for use with the audio module.
+
+

+ 50 - 0
docs/api/brl/brl_endianstream.md

@@ -0,0 +1,50 @@
+---
+id: brl.endianstream
+title: BRL.EndianStream
+sidebar_label: BRL.EndianStream
+---
+
+
+Endian streams allow you to swap the byte order of stream data.<br>
+<br>
+This can be useful for reading or writing binary streams which are in a fixed endian format on multiple platforms.<br>
+<br>
+Endian format refers to the order multi-byte values are stored. For example, an integer is four bytes long, but in what order should each byte be stored? Low byte first or high byte first?<br>
+<br>
+This choice is generally dictated by the CPU. For example, Intel CPU's such as the pentium store multi-byte values 'low byte first' which is known as <i>little endian</i>. On the other hand, PowerPC CPU's store multi-byte values 'high byte first' which is known as <i>big endian</i>.<br>
+<br>
+Most of the time, you don't have to worry about endian issues. As long as the same endian format is being used to read and write data, there is no problem. However, endian issues do need to be taken into account when reading or writing binary files. For example, writing a binary file on a PC  (which is little endian) and reading it back on a Mac (which is big endian) may produce odd results if the file contains multibyte values.<br>
+<br>
+Endian streams help solve this problem by modifying the behaviour of stream commands that read or write multi-byte values. These commands are:
+<font class=token>ReadShort</font>,
+<font class=token>ReadInt</font>,
+<font class=token>ReadLong</font>,
+<font class=token>ReadFloat</font>,
+<font class=token>ReadDouble</font>,
+<font class=token>WriteShort</font>,
+<font class=token>WriteInt</font>,
+<font class=token>WriteLong</font>,
+<font class=token>WriteFloat</font> and
+<font class=token>WriteDouble</font>.
+
+
+## Functions
+
+### `Function BigEndianStream:TStream( stream:TStream )`
+
+BigEndianStream
+
+#### Returns
+A big endian stream
+
+
+
+### `Function LittleEndianStream:TStream( stream:TStream )`
+
+LittleEndianStream
+
+#### Returns
+A little endian stream
+
+
+

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 17 - 0
docs/api/brl/brl_event.md


+ 170 - 0
docs/api/brl/brl_eventqueue.md

@@ -0,0 +1,170 @@
+---
+id: brl.eventqueue
+title: BRL.EventQueue
+sidebar_label: BRL.EventQueue
+---
+
+
+
+The event queue is a simple first-in, first-out queue that is used to collect 
+[TEvent](../../brl/brl.event/tevent) objects emitted by your application.
+
+The [PollEvent](../../brl/brl.eventqueue/#function-pollevent-int) and [WaitEvent](../../brl/brl.eventqueue/#function-waitevent-int) commands can be used to receive the next event from the event
+queue, while the [PeekEvent](../../brl/brl.eventqueue/#function-peekevent-tevent) command can be used to check if the event queue is empty.
+
+Events are added to the event queue using [PostEvent](../../brl/brl.eventqueue/#function-postevent-event-tevent-update-int-false).
+
+
+## Functions
+
+### `Function PeekEvent:TEvent()`
+
+Examine the next event in the event queue
+
+
+[PeekEvent](../../brl/brl.eventqueue/#function-peekevent-tevent) examines the next event in the event queue, without removing it from the
+event queue or modifying the [CurrentEvent](../../brl/brl.eventqueue/#global-currentevent-tevent-nullevent) global variable.
+
+If there are no events in the event queue, [PeekEvent](../../brl/brl.eventqueue/#function-peekevent-tevent) returns [Null](../../brl/brl.blitz/#null).
+
+
+
+### `Function PollEvent:Int()`
+
+Get the next event from the event queue
+
+
+[PollEvent](../../brl/brl.eventqueue/#function-pollevent-int) removes an event from the event queue and updates the [CurrentEvent](../../brl/brl.eventqueue/#global-currentevent-tevent-nullevent)
+global variable.
+
+If there are no events in the event queue, [PollEvent](../../brl/brl.eventqueue/#function-pollevent-int) returns 0.
+
+
+#### Returns
+The id of the next event in the event queue, or 0 if the event queue is empty
+
+
+
+### `Function WaitEvent:Int()`
+
+Get the next event from the event queue, waiting if necessary
+
+
+[WaitEvent](../../brl/brl.eventqueue/#function-waitevent-int) removes an event from the event queue and updates the [CurrentEvent](../../brl/brl.eventqueue/#global-currentevent-tevent-nullevent)
+global variable.
+
+If there are no events in the event queue, [WaitEvent](../../brl/brl.eventqueue/#function-waitevent-int) halts program execution until
+an event is available.
+
+
+#### Returns
+The id of the next event in the event queue
+
+
+
+### `Function PostEvent( event:TEvent,update:Int=False )`
+
+Post an event to the event queue
+
+[PostEvent](../../brl/brl.eventqueue/#function-postevent-event-tevent-update-int-false) adds an event to the end of the event queue.
+
+The <b>update</b> flag can be used to update an existing event. If <b>update</b> is True
+and an event with the same <b>id</b> and <b>source</b> is found in the event
+queue, the existing event will be updated instead of <b>event</b>
+being added to the event queue. This can be useful to prevent high frequency
+events such as timer events from flooding the event queue.
+
+
+
+### `Function EventID:Int()`
+
+Get current event id
+
+#### Returns
+The <b>id</b> field of the [CurrentEvent](../../brl/brl.eventqueue/#global-currentevent-tevent-nullevent) global variable
+
+
+
+### `Function EventData:Int()`
+
+Get current event data
+
+#### Returns
+The <b>data</b> field of the [CurrentEvent](../../brl/brl.eventqueue/#global-currentevent-tevent-nullevent) global variable
+
+
+
+### `Function EventMods:Int()`
+
+Get current event modifiers
+
+#### Returns
+The <b>mods</b> field of the [CurrentEvent](../../brl/brl.eventqueue/#global-currentevent-tevent-nullevent) global variable
+
+
+
+### `Function EventX:Int()`
+
+Get current event x value
+
+#### Returns
+The <b>x</b> field of the [CurrentEvent](../../brl/brl.eventqueue/#global-currentevent-tevent-nullevent) global variable
+
+
+
+### `Function EventY:Int()`
+
+Get current event y value
+
+#### Returns
+The <b>y</b> field of the [CurrentEvent](../../brl/brl.eventqueue/#global-currentevent-tevent-nullevent) global variable
+
+
+
+### `Function EventExtra:Object()`
+
+Get current event extra value
+
+#### Returns
+The <b>extra</b> field of the [CurrentEvent](../../brl/brl.eventqueue/#global-currentevent-tevent-nullevent) global variable
+
+
+
+### `Function EventText$()`
+
+Get current event extra value converted to a string
+
+#### Returns
+The <b>extra</b> field of the [CurrentEvent](../../brl/brl.eventqueue/#global-currentevent-tevent-nullevent) global variable converted to a string
+
+
+
+### `Function EventSource:Object()`
+
+Get current event source object
+
+#### Returns
+The <b>source</b> field of the [CurrentEvent](../../brl/brl.eventqueue/#global-currentevent-tevent-nullevent) global variable
+
+
+
+### `Function EventSourceHandle:Size_T()`
+
+Get current event source object handle
+
+#### Returns
+The <b>source</b> field of the [CurrentEvent](../../brl/brl.eventqueue/#global-currentevent-tevent-nullevent) global variable converted to an integer handle
+
+
+
+## Globals
+
+### `Global CurrentEvent:TEvent=NullEvent`
+
+Current Event
+
+The [CurrentEvent](../../brl/brl.eventqueue/#global-currentevent-tevent-nullevent) global variable contains the event most recently returned by
+[PollEvent](../../brl/brl.eventqueue/#function-pollevent-int) or [WaitEvent](../../brl/brl.eventqueue/#function-waitevent-int).
+
+
+

+ 511 - 0
docs/api/brl/brl_filesystem.md

@@ -0,0 +1,511 @@
+---
+id: brl.filesystem
+title: BRL.FileSystem
+sidebar_label: BRL.FileSystem
+---
+
+
+
+The BlitzMax filesystem module contains commands to perform operations on the computer's
+files and directories.
+
+[OpenFile](../../brl/brl.filesystem/#function-openfile-tstream-url-object-readable-int-true-writeable-int-true), [ReadFile](../../brl/brl.filesystem/#function-readfile-tstream-url-object) and [WriteFile](../../brl/brl.filesystem/#function-writefile-tstream-url-object) return a stream object for reading and or writing data
+to files.
+
+Directories can be examined file by file using a combination of the
+[ReadDir](../../brl/brl.filesystem/#function-readdir-byte-ptr-path), [NextFile](../../brl/brl.filesystem/#function-nextfile-dir-byte-ptr) and [CloseDir](../../brl/brl.filesystem/#function-closedir-dir-byte-ptr) commands, or [LoadDir](../../brl/brl.filesystem/#function-loaddir-dir-skip-dots-int-true) can be used to read the file names
+of a directory into a string array.
+
+File properties can be examined with the [FileType](../../brl/brl.filesystem/#function-filetype-int-path), [FileTime](../../brl/brl.filesystem/#function-filetime-int-path-timetype-int-filetime-modified), [FileSize](../../brl/brl.filesystem/#function-filesize-long-path) and [FileMode](../../brl/brl.filesystem/#function-filemode-int-path) commands.
+
+Files and directories (folders) can be created and deleted with the [CreateFile](../../brl/brl.filesystem/#function-createfile-int-path), [CreateDir](../../brl/brl.filesystem/#function-createdir-int-path-recurse-int-false)
+[DeleteFile](../../brl/brl.filesystem/#function-deletefile-int-path) and [DeleteDir](../../brl/brl.filesystem/#function-deletedir-int-path-recurse-int-false) commands.
+
+Finally, the FileSystem module contains various utility functions for handling file paths
+in a system independent manner. These commands include [RealPath](../../brl/brl.filesystem/#function-realpath-path), [StripDir](../../brl/brl.filesystem/#function-stripdir-path), [StripExt](../../brl/brl.filesystem/#function-stripext-path),
+[StripAll](../../brl/brl.filesystem/#function-stripall-path), [ExtractDir](../../brl/brl.filesystem/#function-extractdir-path) and [ExtractExt](../../brl/brl.filesystem/#function-extractext-path).
+
+
+## Functions
+
+### `Function StripDir$( path$ )`
+
+Strip directory from a file path
+
+#### Example
+```blitzmax
+' stripdir.bmx
+
+print stripdir("mypath/myfile.bmx")	'prints myfile.bmx
+```
+
+### `Function StripExt$( path$ )`
+
+Strip extension from a file path
+
+#### Example
+```blitzmax
+' stripext.bmx
+
+print stripext("mypath/myfile.bmx")	'prints mypath/myfile
+```
+
+### `Function StripAll$( path$ )`
+
+Strip directory and extension from a file path
+
+#### Example
+```blitzmax
+' stripall.bmx
+
+print stripall("mypath/myfile.bmx")	'prints myfile
+```
+
+### `Function StripSlash$( path$ )`
+
+Strip trailing slash from a file path
+
+
+[StripSlash](../../brl/brl.filesystem/#function-stripslash-path) will not remove the trailing slash from a 'root' path. For example, "/"
+or (on Win32 only) "C:/".
+
+
+#### Example
+```blitzmax
+' stripslash.bmx
+
+print stripslash("mypath/")	'prints mypath
+```
+
+### `Function ExtractDir$( path$ )`
+
+Extract directory from a file path
+
+#### Example
+```blitzmax
+' extractdir.bmx
+
+print extractdir("mypath/myfile.bmx")	'prints mypath
+```
+
+### `Function ExtractExt$( path$ )`
+
+Extract extension from a file path
+
+#### Example
+```blitzmax
+' extractext.bmx
+
+print extractext("mypath/myfile.bmx")	'prints bmx
+```
+
+### `Function CurrentDir$()`
+
+Get Current Directory
+
+#### Returns
+The current directory
+
+
+#### Example
+```blitzmax
+' currentdir.bmx
+
+cd$=currentdir()
+print "CurrentDir()="+cd$
+```
+
+### `Function RealPath$( path$ )`
+
+Get real, absolute path of a file path
+
+#### Example
+```blitzmax
+' realpath.bmx
+
+print realpath("realpath.bmx")	'prints full path of this source
+
+print realpath("..") 'prints full path of parent directory
+```
+
+### `Function FileType:Int( path$ )`
+
+Get file type
+
+#### Returns
+0 if file at <b>path</b> doesn't exist, FILETYPE_FILE (1) if the file is a plain file or FILETYPE_DIR (2) if the file is a directory
+
+
+#### Example
+```blitzmax
+' filetype.bmx
+
+print filetype(".")		'prints 2 for directory type
+print filetype("filetype.bmx")	'prints 1 for file type
+print filetype("notfound.file")	'prints 0 for doesn't exist
+```
+
+### `Function FileTime:Int( path$, timetype:Int=FILETIME_MODIFIED )`
+
+Get file time
+
+#### Returns
+The time the file at <b>path</b> was last modified
+
+
+#### Example
+```blitzmax
+' filetime.bmx
+
+print filetime("filetime.bmx")
+```
+
+### `Function FileSize:Long( path$ )`
+
+Get file size
+
+#### Returns
+Size, in bytes, of the file at <b>path</b>, or -1 if the file does not exist
+
+
+#### Example
+```blitzmax
+' filesize.bmx
+
+' the following prints the size of this source file in bytes
+
+print filesize("filesize.bmx")
+```
+
+### `Function FileMode:Int( path$ )`
+
+Get file mode
+
+#### Returns
+file mode flags
+
+
+#### Example
+```blitzmax
+' filemode.bmx
+
+' the following function converts the file mode to 
+' the standard unix permission bits string
+
+Function Permissions$(mode)
+	local	testbit,pos
+	local	p$="rwxrwxrwx"
+	testbit=%100000000
+	pos=1
+	while (testbit)
+		if mode & testbit res$:+mid$(p$,pos,1) else res$:+"-"
+		testbit=testbit shr 1
+		pos:+1	
+	wend
+	return res
+End Function
+
+print Permissions$(filemode("filemode.bmx"))
+```
+
+### `Function SetFileMode( path$,Mode:Int )`
+
+Set file mode
+
+#### Example
+```blitzmax
+' setfilemode.bmx
+
+' the following makes this source file readonly
+
+writebits=%010010010
+
+' read the file mode
+
+mode=filemode("setfilemode.bmx")
+
+'mask out the write bits to make readonly
+
+mode=mode & writebits
+
+'set the new file mode
+
+setfilemode("setfilemode.bmx",mode)
+```
+
+### `Function CreateFile:Int( path$ )`
+
+Create a file
+
+#### Returns
+True if successful
+
+
+#### Example
+```blitzmax
+' createfile.bmx
+
+success=createfile("myfile")
+if not success runtimeerror "error creating file"
+```
+
+### `Function CreateDir:Int( path$,recurse:Int=False )`
+
+Create a directory
+
+
+If <b>recurse</b> is true, any required subdirectories are also created.
+
+
+#### Returns
+True if successful
+
+
+#### Example
+```blitzmax
+' createdir.bmx
+
+success=createdir("myfolder")
+if not success runtimeerror "error creating directory"
+```
+
+### `Function DeleteFile:Int( path$ )`
+
+Delete a file
+
+#### Returns
+True if successful
+
+
+#### Example
+```blitzmax
+' deletefile.bmx
+
+success=deletefile("myfile")
+if not success runtimeerror "error deleting file"
+```
+
+### `Function RenameFile:Int( oldpath$,newpath$ )`
+
+Renames a file
+
+#### Returns
+True if successful
+
+
+
+### `Function CopyFile:Int( src$,dst$ )`
+
+Copy a file
+
+#### Returns
+True if successful
+
+
+
+### `Function CopyDir:Int( src$,dst$ )`
+
+Copy a directory
+
+#### Returns
+True if successful
+
+
+
+### `Function DeleteDir:Int( path$,recurse:Int=False )`
+
+Delete a directory
+
+Set <b>recurse</b> to true to delete all subdirectories and files recursively -
+but be careful!
+
+
+#### Returns
+True if successful
+
+
+#### Example
+```blitzmax
+' deletedir.bmx
+
+success=deletedir("myfolder")
+if not success runtimeerror "error deleting directory"
+```
+
+### `Function ChangeDir:Int( path$ )`
+
+Change current directory
+
+#### Returns
+True if successful
+
+
+#### Example
+```blitzmax
+' changedir.bmx
+
+print "CurrentDir()="+currentdir()
+
+' change current folder to the parent folder
+
+changedir ".."
+
+' print new CurrentDir()
+
+print "CurrentDir()="+currentdir()
+```
+
+### `Function ReadDir:Byte Ptr( path$ )`
+
+Open a directory
+
+#### Returns
+A directory handle, or 0 if the directory does not exist
+
+
+#### Example
+```blitzmax
+' readdir.bmx
+
+dir=ReadDir(CurrentDir())
+
+If Not dir RuntimeError "failed to read current directory"
+
+Repeat
+	t$=NextFile( dir )
+	If t="" Exit
+	If t="." Or t=".." Continue
+	Print t	
+Forever
+
+CloseDir dir
+```
+
+### `Function NextFile$( dir:Byte Ptr )`
+
+Return next file in a directory
+
+#### Returns
+File name of next file in directory opened using [ReadDir](../../brl/brl.filesystem/#function-readdir-byte-ptr-path), or an empty string if there are no more files to read.
+
+
+
+### `Function CloseDir( dir:Byte Ptr )`
+
+Close a directory
+
+
+### `Function LoadDir$[]( dir$,skip_dots:Int=True )`
+
+Load a directory
+
+The <b>skip_dots</b> parameter, if true, removes the '.' (current) and '..'
+(parent) directories from the returned array.
+
+
+#### Returns
+A string array containing contents of <b>dir</b>
+
+
+#### Example
+```blitzmax
+' loaddir.bmx
+
+' declare a string array
+
+local files$[]
+
+files=loaddir(currentdir())
+
+for t$=eachin files
+	print t	
+next
+```
+
+### `Function OpenFile:TStream( url:Object,readable:Int=True,writeable:Int=True )`
+
+Open a file for input and/or output.
+
+
+This command is similar to the [OpenStream](../../brl/brl.stream/#function-openstream-tstream-url-object-readable-int-true-writeable-int-true) command but will attempt
+to cache the contents of the file to ensure serial streams such as
+http: based url's are seekable. Use the [CloseStream](../../brl/brl.stream/#function-closestream-stream-tstream) command when
+finished reading and or writing to a Stream returned by [OpenFile](../../brl/brl.filesystem/#function-openfile-tstream-url-object-readable-int-true-writeable-int-true).
+
+
+#### Example
+```blitzmax
+' openfile.bmx
+
+' the following prints the contents of this source file 
+
+file=openfile("openfile.bmx")
+
+if not file runtimeerror "could not open file openfile.bmx"
+
+while not eof(file)
+	print readline(file)
+wend
+closestream file
+```
+
+### `Function ReadFile:TStream( url:Object )`
+
+Open a file For Input.
+
+
+This command is similar to the [ReadStream](../../brl/brl.stream/#function-readstream-tstream-url-object) command but will attempt
+to cache the contents of the file to ensure serial streams such as
+http: based url's are seekable. Use the [CloseStream](../../brl/brl.stream/#function-closestream-stream-tstream) command when
+finished reading and or writing to a Stream returned by [OpenFile](../../brl/brl.filesystem/#function-openfile-tstream-url-object-readable-int-true-writeable-int-true).
+
+
+#### Example
+```blitzmax
+' readfile.bmx
+
+' the following prints the contents of this source file 
+
+file=readfile("readfile.bmx")
+
+if not file runtimeerror "could not open file openfile.bmx"
+
+while not eof(file)
+	print readline(file)
+wend
+
+closestream file
+```
+
+### `Function WriteFile:TStream( url:Object )`
+
+Open a file for output.
+
+
+This command is identical to the [WriteStream](../../brl/brl.stream/#function-writestream-tstream-url-object) command.
+
+
+#### Example
+```blitzmax
+' writefile.bmx
+
+file=writefile("test.txt")
+
+if not file runtimeerror "failed to open test.txt file" 
+
+writeline file,"hello world"
+
+closestream file
+```
+
+### `Function CloseFile( stream:TStream )`
+
+Closes a file stream.
+
+
+After performing file operations on an open file make sure to
+close the file stream with either [CloseFile](../../brl/brl.filesystem/#function-closefile-stream-tstream) or the identical
+[CloseStream](../../brl/brl.stream/#function-closestream-stream-tstream) command.
+
+
+

+ 11 - 0
docs/api/brl/brl_freeaudioaudio.md

@@ -0,0 +1,11 @@
+---
+id: brl.freeaudioaudio
+title: BRL.FreeAudioAudio
+sidebar_label: BRL.FreeAudioAudio
+---
+
+
+
+The FreeAudio audio module provides FreeAudio drivers for use with the audio module.
+
+

+ 100 - 0
docs/api/brl/brl_glgraphics.md

@@ -0,0 +1,100 @@
+---
+id: brl.glgraphics
+title: BRL.GLGraphics
+sidebar_label: BRL.GLGraphics
+---
+
+
+## Functions
+
+### `Function GLGraphicsDriver:TGLGraphicsDriver()`
+
+Get OpenGL graphics driver
+
+
+The returned driver can be used with [SetGraphicsDriver](../../brl/brl.graphics/#function-setgraphicsdriver-driver-tgraphicsdriver-defaultflags-graphics-backbuffer)
+
+
+#### Returns
+An OpenGL graphics driver
+
+
+
+### `Function GLGraphics:TGraphics( width,height,depth=0,hertz=60,flags=GRAPHICS_BACKBUFFER|GRAPHICS_DEPTHBUFFER )`
+
+Create OpenGL graphics
+
+
+This is a convenience function that allows you to easily create an OpenGL graphics context.
+
+
+#### Returns
+An OpenGL graphics object
+
+
+
+### `Function GLAdjustTexSize( width Var,height Var )`
+
+Helper function to calculate nearest valid texture size
+
+This functions rounds <b>width</b> and <b>height</b> up to the nearest valid texture size
+
+
+
+### `Function GLTexFromPixmap( pixmap:TPixmap,mipmap=True )`
+
+Helper function to create a texture from a pixmap
+
+<b>pixmap</b> is resized to a valid texture size before conversion.
+
+
+#### Returns
+Integer GL Texture name
+
+
+
+### `Function GLDrawRect( x,y,width,height )`
+
+Helper function to output a simple rectangle
+
+
+Draws a rectangle relative to top-left of current viewport.
+
+
+
+### `Function GLDrawText( text$,x,y )`
+
+Helper function to output some simple 8x16 font text
+
+
+Draws text relative to top-left of current viewport.<br>
+<br>
+The font used is an internal fixed point 8x16 font.<br>
+<br>
+This function is intended for debugging purposes only - performance is unlikely to be stellar.
+
+
+
+### `Function GLDrawPixmap( pixmap:TPixmap,x,y )`
+
+Helper function to draw a pixmap to a gl context
+
+
+Draws the pixmap relative to top-left of current viewport.<br>
+<br>
+This function is intended for debugging purposes only - performance is unlikely to be stellar.
+
+
+
+### `Function GLShareContexts()`
+
+Enable OpenGL context sharing
+
+
+Calling [GLShareContexts](../../brl/brl.glgraphics/#function-glsharecontexts) will cause all opengl graphics contexts created to
+shared displaylists, textures, shaders etc.
+
+This should be called before any opengl contexts are created.
+
+
+

+ 23 - 0
docs/api/brl/brl_glmax2d.md

@@ -0,0 +1,23 @@
+---
+id: brl.glmax2d
+title: BRL.GLMax2D
+sidebar_label: BRL.GLMax2D
+---
+
+
+
+The OpenGL Max2D module provides an OpenGL driver for Max2D.
+
+
+## Functions
+
+### `Function GLMax2DDriver:TGLMax2DDriver()`
+
+Get OpenGL Max2D Driver
+
+
+The returned driver can be used with [SetGraphicsDriver](../../brl/brl.graphics/#function-setgraphicsdriver-driver-tgraphicsdriver-defaultflags-graphics-backbuffer) to enable OpenGL Max2D
+rendering.
+
+
+

+ 255 - 0
docs/api/brl/brl_gnet.md

@@ -0,0 +1,255 @@
+---
+id: brl.gnet
+title: BRL.GNet
+sidebar_label: BRL.GNet
+---
+
+
+<h1>GameNet</h1>
+
+The GameNet module (GNet for short) provides a set of commands for creating and managing multiplayer network 
+games.
+
+GNet works a little differently than other networking libraries. Instead of being primarily 'message based', GNet
+works by synchronizing a collection of GNet <i>objects</i> over a network.
+
+Each GNet object contains 32 &slots which are similar in nature to the fields of BlitzMax objects. You can write to these slots using the [SetGNetInt](../../brl/brl.gnet/#function-setgnetint-obj-tgnetobject-index-value), [SetGNetFloat](../../brl/brl.gnet/#function-setgnetfloat-obj-tgnetobject-index-value) and [SetGNetString](../../brl/brl.gnet/#function-setgnetstring-obj-tgnetobject-index-value) commands, and read from these slots using the [GetGNetInt](../../brl/brl.gnet/#function-getgnetint-obj-tgnetobject-index), [GetGNetFloat](../../brl/brl.gnet/#function-getgnetfloat-obj-tgnetobject-index) and [GetGNetString](../../brl/brl.gnet/#function-getgnetstring-obj-tgnetobject-index) commands. The actual meaning of the data contained in these slots is completely up to you, but will typically include such information as player position, score, hitpoints and so on.
+
+Note that you can only modify GNet objects that you have yourself created. Such objects are known as <i>local</i> objects, while objects created elsewhere are known as <i>remote</i> objects.
+
+To start using GNet, you must first create a GNet <i>host</i> with the [CreateGNetHost](../../brl/brl.gnet/#function-creategnethost-tgnethost) command. Once you have created a host, you can either connect to other GNet hosts using [GNetConnect](../../brl/brl.gnet/#function-gnetconnect-host-tgnethost-address-port-timeout-ms-10000), or prepare to accept connections from other hosts using [GNetListen](../../brl/brl.gnet/#function-gnetlisten-host-tgnethost-port).
+
+The [GNetSync](../../brl/brl.gnet/#function-gnetsync-host-tgnethost) command brings all GNet objects up to date. This involves notifying other hosts about any modifications you have made to local GNet objects, and processing notifications from other hosts about any modifications to remote GNet objects.
+
+Following a [GNetSync](../../brl/brl.gnet/#function-gnetsync-host-tgnethost), you can check which objects have been modified, created or closed using the [GnetObjects](../../brl/brl.gnet/#function-gnetobjects-tlist-host-tgnethost-state-gnet-all) command. This returns a linked list of GNet objects in a particular state.
+
+GNet also provides a simple messaging system. A GNet message is actually just a special type of GNet object, so you initialize messages using the standard GNet commands for writing slots. Once created and initialized, a message can be sent to a remote object using the [SendGNetMessage](../../brl/brl.gnet/#function-sendgnetmessage-msg-tgnetobject-toobject-tgnetobject) command.
+
+Incoming messages can be processed using the [GNetMessages](../../brl/brl.gnet/#function-gnetmessages-tlist-host-tgnethost) command after a [GNetSync](../../brl/brl.gnet/#function-gnetsync-host-tgnethost). This function returns a linked
+list of messages objects which can be examined using the standard GNet commands for reading slots. In addition, the [GNetMessageObject](../../brl/brl.gnet/#function-gnetmessageobject-tgnetobject-msg-tgnetobject) command can be used to determine which local object a message was intended for.
+
+
+## Functions
+
+### `Function CreateGNetHost:TGNetHost()`
+
+Create GNet host
+
+
+Once you have created a GNet host, you can use it to create objects with [CreateGNetObject](../../brl/brl.gnet/#function-creategnetobject-tgnetobject-host-tgnethost),
+connect to other hosts with [GNetConnect](../../brl/brl.gnet/#function-gnetconnect-host-tgnethost-address-port-timeout-ms-10000) and listen for connections from other hosts with
+[GNetListen](../../brl/brl.gnet/#function-gnetlisten-host-tgnethost-port).
+
+
+#### Returns
+A new GNet host
+
+
+
+### `Function CloseGNetHost( host:TGNetHost )`
+
+Close a GNet host
+
+
+Once closed, a GNet host cannot be reopened.
+
+
+
+### `Function GNetSync( host:TGNetHost )`
+
+Synchronize GNet host
+
+
+[GNetSync](../../brl/brl.gnet/#function-gnetsync-host-tgnethost) will update the state of all GNet objects. Once you have used this command,
+use the [GNetObjects](../../brl/brl.gnet/#function-gnetobjects-tlist-host-tgnethost-state-gnet-all) function to determine which objects have been remotely created, modified
+or closed.
+
+
+
+### `Function GNetListen( host:TGNetHost,port )`
+
+Listen for connections
+
+
+Causes <b>host</b> to start listening for connection attempts on the specified <b>port</b>.
+Once a host is listening, hosts on other machines can connect using [GNetConnect](../../brl/brl.gnet/#function-gnetconnect-host-tgnethost-address-port-timeout-ms-10000).
+
+[GNetListen](../../brl/brl.gnet/#function-gnetlisten-host-tgnethost-port) may fail if <b>port</b> is already in use by another application, or if <b>host</b>
+is already listening or has already connected to a remote host using [GNetConnect](../../brl/brl.gnet/#function-gnetconnect-host-tgnethost-address-port-timeout-ms-10000).
+
+
+#### Returns
+True if successful, otherwise false
+
+
+
+### `Function GNetConnect( host:TGNetHost,address$,port,timeout_ms=10000 )`
+
+Connect to a remote GNet host
+
+
+Attempts to connect <b>host</b> to the specified remote address and port.
+
+A GNet host must be listening (see [GNetListen](../../brl/brl.gnet/#function-gnetlisten-host-tgnethost-port)) at the specified address and port for the
+connection to succeed.
+
+
+#### Returns
+True if connection successful, otherwise false
+
+
+
+### `Function GNetObjects:TList( host:TGNetHost,state=GNET_ALL )`
+
+Get a list of GNet objects
+
+
+[GNetObjects](../../brl/brl.gnet/#function-gnetobjects-tlist-host-tgnethost-state-gnet-all) returns a list of GNet objects in a certain state.
+
+The <b>state</b> parameter controls which objects are listed, and can be one of &GNET_ALL,
+&GNET_CREATED, &GNET_MODIFIED or &GNET_CLOSED.
+
+Note that with the exception of &GNET_ALL, the returned lists will only ever contain remote objects.
+
+
+#### Returns
+A linked list
+
+
+
+### `Function GNetMessages:TList( host:TGNetHost )`
+
+Get a list of GNet messages sent to local objects
+
+#### Returns
+A linked list
+
+
+
+### `Function CreateGNetObject:TGNetObject( host:TGNetHost )`
+
+Create a GNet object
+
+#### Returns
+A new GNet object
+
+
+
+### `Function CreateGNetMessage:TGNetObject( host:TGNetHost )`
+
+Create a GNet message object
+
+#### Returns
+A new GNet object
+
+
+
+### `Function SendGNetMessage( msg:TGNetObject,toObject:TGNetObject )`
+
+Send a GNet message to a remote object
+
+
+### `Function GNetMessageObject:TGNetObject( msg:TGNetObject )`
+
+Get message target object
+
+#### Returns
+The object that <b>msg</b> was sent to
+
+
+
+### `Function GNetObjectState( obj:TGNetObject )`
+
+Get state of a GNet object
+
+The returned value can be one of the following:
+<table>
+<tr><th>Object State</th><td>Meaning</td></tr>
+<tr><td>GNET_CREATED</td><td>Object has been created</td></tr>
+<tr><td>GNET_SYNCED</td><td>Object is in sync</td><tr>
+<tr><td>GNET_MODIFIED</td><td>Object has been modified</td></tr>
+<tr><td>GNET_CLOSED</td><td>Object has been closed</td></tr>
+<tr><td>GNET_ZOMBIE</td><td>Object is a zombie</td></tr>
+<tr><td>GNET_MESSAGE</td><td>Object is a message object</td></tr>
+</table>
+Zombie objects are objects that have been successfully closed and will never again be used
+by GameNet. Therefore, such objects will never appear in any list returned by the
+[GNetObjects](../../brl/brl.gnet/#function-gnetobjects-tlist-host-tgnethost-state-gnet-all) function.
+
+
+#### Returns
+An integer state
+
+
+
+### `Function GNetObjectLocal( obj:TGNetObject )`
+
+Determine whether a GNet object is local
+
+#### Returns
+True if object is a local object
+
+
+
+### `Function GNetObjectRemote( obj:TGNetObject )`
+
+Determine whether a GNet object is remote
+
+#### Returns
+True if object is a remote object
+
+
+
+### `Function SetGNetInt( obj:TGNetObject,index,value )`
+
+Set GNet object int data
+
+
+### `Function SetGNetFloat( obj:TGNetObject,index,value# )`
+
+Set GNet object float data
+
+
+### `Function SetGNetString( obj:TGNetObject,index,value$ )`
+
+Set GNet object string data
+
+
+### `Function GetGNetInt( obj:TGNetObject,index )`
+
+Get GNet object int data
+
+
+### `Function GetGNetFloat#( obj:TGNetObject,index )`
+
+Get GNet object float data
+
+
+### `Function GetGNetString$( obj:TGNetObject,index )`
+
+Get GNet object string data
+
+
+### `Function SetGNetTarget( obj:TGNetObject,target:Object )`
+
+Set a GNet object's target object
+
+
+This command allows you to bind an abitrary object to a GNet object.
+
+
+
+### `Function GetGNetTarget:Object( obj:TGNetObject )`
+
+Get a GNet object's target object
+
+#### Returns
+The currently bound target object
+
+
+
+### `Function CloseGNetObject( obj:TGNetObject )`
+
+Close a GNet object
+
+

+ 342 - 0
docs/api/brl/brl_graphics.md

@@ -0,0 +1,342 @@
+---
+id: brl.graphics
+title: BRL.Graphics
+sidebar_label: BRL.Graphics
+---
+
+
+
+The graphics module provides the ability to create and 'flip' graphics objects.
+
+A graphics object represents a rectangular area you can render to. However, the graphics module
+does not provide any commands for actual rendering - this is left to other modules such as 
+max2D to implement.
+
+The graphics module maintains 2 'current' objects - the current graphics driver and the currect
+graphics object. To change the current graphics driver, use [SetGraphicsDriver](../../brl/brl.graphics/#function-setgraphicsdriver-driver-tgraphicsdriver-defaultflags-graphics-backbuffer). To change the
+current graphics object, use [SetGraphics](../../brl/brl.graphics/#function-setgraphics-g-tgraphics).
+
+To create a graphics object, use either [Graphics](../../brl/brl.graphics/#function-graphics-tgraphics-width-height-depth-0-hertz-60-flags-0) or [CreateGraphics](../../brl/brl.graphics/#function-creategraphics-tgraphics-width-height-depth-hertz-flags). The kind of graphics 
+object created will depend upon the current graphics driver. For example, the following code:
+```
+SetGraphicsDriver GLGraphicsDriver()
+Local g:TGraphics=CreateGraphics( 640,480,32,60,GRAPHICS_BACKBUFFER )
+````
+
+Will create an OpenGL graphics object.
+
+You can 'select' this object for rendering using:
+```
+SetGraphics g			'we can now execute OpenGL code
+glClearColor .5,0,1,1		'tada!
+glClear				'yes!
+Flip				'must do this as the graphics is double buffered
+````
+
+One you have finished with a graphics object, use [CloseGraphics](../../brl/brl.graphics/#function-closegraphics-g-tgraphics) to close it.
+
+[Graphics](../../brl/brl.graphics/#function-graphics-tgraphics-width-height-depth-0-hertz-60-flags-0) and [CreateGraphics](../../brl/brl.graphics/#function-creategraphics-tgraphics-width-height-depth-hertz-flags) both accept the following parameters: <b>width</b>, <b>height</b>, <b>depth</b>,
+<b>hertz</b> and <b>flags</b>.
+
+The <b>width</b> and <b>height</b> parameters specify the dimensions of the graphics, in pixels.
+
+The <b>depth</b> parameter selects a pixel bit depth. This value can be 0, 16, 24 or 32 depending 
+on the graphics modes available. A depth of 0 can be used to select 'windowed mode' graphics,
+while non-0 depths select 'fullscreen' graphics.
+
+The <b>hertz</b> parameter selects a refresh rate, which refers to the number of times the screen
+refreshes per second. The refresh rates available depend on the graphics modes available, 
+which differ from graphics card to graphics card. Note that creating graphics with an 
+unsupported refresh rate will not fail - instead, a default refresh rate will be used.
+
+The [Graphics](../../brl/brl.graphics/#function-graphics-tgraphics-width-height-depth-0-hertz-60-flags-0) command can be used to achieve a fixed refresh rate. When using [Flip](../../brl/brl.graphics/#function-flip-sync-1) to 
+present such graphics, BlitzMax will guarantee the desired refresh rate is honored regardless
+of the available hardware's capabilities. This is achieved by using software timing 
+techniques when necessary.
+
+The <b>flags</b> parameter can be any combination of the following:
+<table><tr><td> <b>Flags</b></td><td><b>Meaning</b></td></tr><tr><td>  GRAPHICS_BACKBUFFER</td><td>Create graphics with a back buffer</td></tr><tr><td>  GRAPHICS_ALPHABUFFER</td><td>Create graphics with an alpha buffer</td></tr><tr><td>  GRAPHICS_DEPTHBUFFER</td><td>Create graphics with a depth buffer</td></tr><tr><td>  GRAPHICS_STENCILBUFFER</td><td>Create graphics with a stencil buffer</td></tr><tr><td>  GRAPHICS_ACCUMBUFFER</td><td>Create graphics with an accumulation buffer</table>
+
+Flags can be combined with the | (or) operator. For example, GRAPHICS_BACKBUFFER|GRAPHICS_DEPTHBUFFER
+can be used to create graphics which has both a back buffer and a depth buffer.
+
+Graphics created with the GRAPHICS_BACKBUFFER flag must be 'flipped' after you have finished
+rendering using [Flip](../../brl/brl.graphics/#function-flip-sync-1).
+
+
+## Functions
+
+### `Function SetGraphicsDriver( driver:TGraphicsDriver,defaultFlags=GRAPHICS_BACKBUFFER )`
+
+Set current graphics driver
+
+
+The current graphics driver determines what kind of graphics are created when you use
+the [CreateGraphics](../../brl/brl.graphics/#function-creategraphics-tgraphics-width-height-depth-hertz-flags) or [Graphics](../../brl/brl.graphics/#function-graphics-tgraphics-width-height-depth-0-hertz-60-flags-0) functions, as well as the graphics modes available.
+
+The [GLGraphicsDriver](../../brl/brl.glgraphics/#function-glgraphicsdriver-tglgraphicsdriver), [GLMax2DDriver](../../brl/brl.glmax2d/#function-glmax2ddriver-tglmax2ddriver), [D3D7Max2DDriver](../../brl/brl.d3d7max2d/#function-d3d7max2ddriver-td3d7max2ddriver) and [D3D9Max2DDriver](../../brl/brl.d3d9max2d/#function-d3d9max2ddriver-td3d9max2ddriver) functions can all be
+used to obtain a graphics driver.
+
+The <b>defaultFlags</b> parameter allows you to specify graphics flags that will be applied to any
+graphics created with [CreateGraphics](../../brl/brl.graphics/#function-creategraphics-tgraphics-width-height-depth-hertz-flags) or [Graphics](../../brl/brl.graphics/#function-graphics-tgraphics-width-height-depth-0-hertz-60-flags-0).
+
+
+#### Example
+```blitzmax
+SetGraphicsDriver GLMax2DDriver()
+
+Graphics 640,480
+DrawText "OpenGL Max2D Graphics! Hit any key (next to the whatever key)...",0,0
+Flip
+WaitKey
+EndGraphics
+
+SetGraphicsDriver GLGraphicsDriver()
+
+Graphics 640,480
+glClear GL_COLOR_BUFFER_BIT
+GLDrawText "'Raw' OpenGL Graphics! Hit any key...",0,0
+Flip
+WaitKey
+```
+
+### `Function GetGraphicsDriver:TGraphicsDriver()`
+
+Get current graphics driver
+
+
+Returns the current graphics driver as selected by [SetGraphicsDriver](../../brl/brl.graphics/#function-setgraphicsdriver-driver-tgraphicsdriver-defaultflags-graphics-backbuffer)
+
+
+
+### `Function DefaultGraphicsFlags()`
+
+Get current default graphics flags
+
+
+### `Function GraphicsModes:TGraphicsMode[]()`
+
+Get graphics modes available under the current graphics driver
+
+
+A TGraphicsMode object contains the following fields: <b>width</b>, <b>height</b>, <b>depth</b> and <b>hertz</b>
+
+
+#### Returns
+An array of TGraphicsMode objects
+
+
+#### Example
+```blitzmax
+Print "Available graphics modes:"
+
+For mode:TGraphicsMode=EachIn GraphicsModes()
+
+	Print mode.width+","+mode.height+","+mode.depth+","+mode.hertz
+
+Next
+```
+
+### `Function CountGraphicsModes()`
+
+Get number of graphics modes available under the current graphics driver
+
+
+Use [GetGraphicsMode](../../brl/brl.graphics/#function-getgraphicsmode-index-width-var-height-var-depth-var-hertz-var) To obtain information about an individual Graphics mode
+
+
+#### Returns
+Number of available Graphics modes
+
+
+
+### `Function GetGraphicsMode( index,width Var,height Var,depth Var,hertz Var )`
+
+Get information about a graphics mode
+
+
+[GetGraphicsMode](../../brl/brl.graphics/#function-getgraphicsmode-index-width-var-height-var-depth-var-hertz-var) returns information about a specific graphics mode. <b>mode</b> should be
+in the range 0 (inclusive) to the value returned by [CountGraphicsModes](../../brl/brl.graphics/#function-countgraphicsmodes) (exclusive).
+
+
+
+### `Function GraphicsModeExists( width,height,depth=0,hertz=0 )`
+
+Determine if a graphics mode exists
+
+
+A value of 0 for any of <b>width</b>, <b>height</b>, <b>depth</b> or <b>hertz</b> will cause that
+parameter to be ignored.
+
+
+#### Returns
+True if a matching graphics mode is found
+
+
+
+### `Function CreateGraphics:TGraphics( width,height,depth,hertz,flags )`
+
+Create a graphics object
+
+
+[CreateGraphics](../../brl/brl.graphics/#function-creategraphics-tgraphics-width-height-depth-hertz-flags) creates a graphics object. To use this object for rendering, you will
+first have to select it using [SetGraphics](../../brl/brl.graphics/#function-setgraphics-g-tgraphics).
+
+The kind of graphics object returned depends upon the current graphics driver as set by
+[SetGraphicsDriver](../../brl/brl.graphics/#function-setgraphicsdriver-driver-tgraphicsdriver-defaultflags-graphics-backbuffer).
+
+
+#### Returns
+A graphics object
+
+
+
+### `Function CloseGraphics( g:TGraphics )`
+
+Close a graphics object
+
+
+Once closed, a graphics object can no longer be used.
+
+
+
+### `Function SetGraphics( g:TGraphics )`
+
+Set current graphics object
+
+
+[SetGraphics](../../brl/brl.graphics/#function-setgraphics-g-tgraphics) will also change the current graphics driver if <b>g</b> uses a different driver
+than the current driver.
+
+
+
+### `Function GraphicsResize( width:Int, height:Int )`
+
+Resize the current graphics object to <b>width</b>, <b>height</b>.
+
+
+### `Function GraphicsWidth()`
+
+Get width of current graphics object
+
+
+The current graphics object can be changed using [SetGraphics](../../brl/brl.graphics/#function-setgraphics-g-tgraphics).
+
+
+#### Returns
+The width, in pixels, of the current graphics object
+
+
+
+### `Function GraphicsHeight()`
+
+Get height of current graphics object
+
+
+The current graphics object can be changed using [SetGraphics](../../brl/brl.graphics/#function-setgraphics-g-tgraphics).
+
+
+#### Returns
+The height, in pixels, of the current graphics object
+
+
+
+### `Function GraphicsDepth()`
+
+Get depth of current graphics object
+
+
+The current graphics object can be changed using [SetGraphics](../../brl/brl.graphics/#function-setgraphics-g-tgraphics).
+
+
+#### Returns
+The depth, in bits, of the current graphics object
+
+
+
+### `Function GraphicsHertz()`
+
+Get refresh rate of current graphics object
+
+
+The current graphics object can be changed using [SetGraphics](../../brl/brl.graphics/#function-setgraphics-g-tgraphics).
+
+
+#### Returns
+The refresh rate, in frames per second, of the current graphics object
+
+
+
+### `Function GraphicsFlags()`
+
+Get flags of current graphics object
+
+
+The current graphics object can be changed using [SetGraphics](../../brl/brl.graphics/#function-setgraphics-g-tgraphics).
+
+
+#### Returns
+The flags of the current graphics object
+
+
+
+### `Function Flip( sync=-1 )`
+
+Flip current graphics object
+
+
+[Flip](../../brl/brl.graphics/#function-flip-sync-1) swap the front and back buffers of the current graphics objects.
+
+If <b>sync</b> is 0, then the flip occurs as soon as possible. If <b>sync</b> is 1, then the flip occurs
+on the next vertical blank.
+
+If <b>sync</b> is -1 and the current graphics object was created with the [Graphics](../../brl/brl.graphics/#function-graphics-tgraphics-width-height-depth-0-hertz-60-flags-0) command,
+then flips will occur at the graphics object's refresh rate, unless the graphics object was
+created with a refresh rate of 0 in which case flip occurs immediately.
+
+If <b>sync</b> is -1 and the current graphics object was NOT created with the [Graphics](../../brl/brl.graphics/#function-graphics-tgraphics-width-height-depth-0-hertz-60-flags-0) command,
+then the flip will occur on the next vertical blank.
+
+
+
+### `Function Graphics:TGraphics( width,height,depth=0,hertz=60,flags=0 )`
+
+Begin graphics
+
+
+[Graphics](../../brl/brl.graphics/#function-graphics-tgraphics-width-height-depth-0-hertz-60-flags-0) is a convenience function that simplifies the process of creating a graphics
+object.
+
+Once [Graphics](../../brl/brl.graphics/#function-graphics-tgraphics-width-height-depth-0-hertz-60-flags-0) has executed, you can begin rendering immediately without any need for
+[SetGraphics](../../brl/brl.graphics/#function-setgraphics-g-tgraphics).
+
+[Graphics](../../brl/brl.graphics/#function-graphics-tgraphics-width-height-depth-0-hertz-60-flags-0) also enables polled input mode, providing a simple way to monitor the keyboard
+and mouse.
+
+
+#### Returns
+A graphics object
+
+
+
+### `Function EndGraphics()`
+
+End graphics
+
+
+[EndGraphics](../../brl/brl.graphics/#function-endgraphics) closes the graphics object returned by [Graphics](../../brl/brl.graphics/#function-graphics-tgraphics-width-height-depth-0-hertz-60-flags-0).
+
+
+
+## Globals
+
+### `Global FlipHook=AllocHookId()`
+
+Flip Hook id
+
+
+Use this id with [AddHook](../../brl/brl.hook/#function-addhook-id-func-object-id-data-object-context-object-context-object-null-priority-0) to register a function that
+is called every [Flip](../../brl/brl.graphics/#function-flip-sync-1).
+
+
+

+ 102 - 0
docs/api/brl/brl_hook.md

@@ -0,0 +1,102 @@
+---
+id: brl.hook
+title: BRL.Hook
+sidebar_label: BRL.Hook
+---
+
+
+
+This module provides a generic way to hook into various BlitzMax commands, and to add support for 
+hooks into your own code.
+
+The following hook ids are currently used by BlitzMax modules:
+
+<table><tr><td> <b>Hook id</b></td><td><b>Description</b></td><td><b>Data</b></td></tr><tr><td>  FlipHook</td><td>A Max2D [Flip](../../brl/brl.graphics/#function-flip-sync-1) is about to occur</td><td>Null</td></tr><tr><td>  EmitEventHook</td><td>An event has been emitted by a call to [EmitEvent](../../brl/brl.event/#function-emitevent-event-tevent)</td><td>A [TEvent](../../brl/brl.event/tevent) object</table>
+
+To hook into any of these functions, use [AddHook](../../brl/brl.hook/#function-addhook-id-func-object-id-data-object-context-object-context-object-null-priority-0) with the specified hook id and your hook function.
+
+To provide hook support for your own code, use [AllocHookId](../../brl/brl.hook/#function-allochookid) to generate a valid integer hook id 
+somewhere in your program's startup code. Then, when the section of code you would like to be 
+'hookable' is about to execute, simply call [RunHooks](../../brl/brl.hook/#function-runhooks-object-id-data-object) with the previously generated hook id and your
+own custom 'data' object. 
+
+
+## Functions
+
+### `Function AllocHookId()`
+
+Allocate a hook id
+
+
+The returned hook id can be used with [AddHook](../../brl/brl.hook/#function-addhook-id-func-object-id-data-object-context-object-context-object-null-priority-0), [RunHooks](../../brl/brl.hook/#function-runhooks-object-id-data-object) and [RemoveHook](../../brl/brl.hook/#function-removehook-id-func-object-id-data-object-context-object-context-object-null).
+
+
+#### Returns
+An integer hook id
+
+
+
+### `Function AddHook( id,func:Object( id,data:Object,context:Object ),context:Object=Null,priority=0 )`
+
+Add a hook function
+
+
+Add a hook function to be executed when [RunHooks](../../brl/brl.hook/#function-runhooks-object-id-data-object) is called with the specified hook <b>id</b>.
+
+
+#### Returns
+A hook object that can be used with the [RemoveHook](../../brl/brl.hook/#function-removehook-id-func-object-id-data-object-context-object-context-object-null) command.
+
+
+#### Example
+```blitzmax
+'This function will be automagically called every Flip
+Function MyHook:Object( id,data:Object,context:Object )
+	Global count
+	
+	count:+1
+	If count Mod 10=0 Print "Flips="+count
+	
+End Function
+
+'Add our hook to the system
+AddHook FlipHook,MyHook
+
+'Some simple graphics
+Graphics 640,480,0
+
+While Not KeyHit( KEY_ESCAPE )
+
+	Cls
+	DrawText MouseX()+","+MouseY(),0,0
+	Flip
+
+Wend
+```
+
+### `Function RunHooks:Object( id,data:Object )`
+
+Run hook functions
+
+
+[RunHooks](../../brl/brl.hook/#function-runhooks-object-id-data-object) runs all hook functions that have been added for the specified hook <b>id</b>.
+
+The first hook function is called with the provided <b>data</b> object. The object returned by
+this function is then passed as the <b>data</b> parameter to the next hook function and so on.
+Therefore, hook functions should generally return the <b>data</b> parameter when finished.
+
+
+#### Returns
+The data produced by the last hook function
+
+
+
+### `Function RemoveHook( id,func:Object( id,data:Object,context:Object ),context:Object=Null )`
+
+Remove a hook function
+
+
+Removes the hook function specified by <b>id</b>, <b>func</b> and <b>context</b>.
+
+
+

+ 37 - 0
docs/api/brl/brl_jpgloader.md

@@ -0,0 +1,37 @@
+---
+id: brl.jpgloader
+title: BRL.JPGLoader
+sidebar_label: BRL.JPGLoader
+---
+
+
+
+The JPG loader module provides the ability to load JPG format pixmaps.
+
+
+## Functions
+
+### `Function LoadPixmapJPeg:TPixmap( url:Object )`
+
+Load a Pixmap in JPeg format
+
+
+[LoadPixmapJPeg](../../brl/brl.jpgloader/#function-loadpixmapjpeg-tpixmap-url-object) loads a pixmap from <b>url</b> in JPeg format.
+
+If the pixmap cannot be loaded, Null is returned.
+
+
+
+### `Function SavePixmapJPeg( pixmap:TPixmap,url:Object,quality=75 )`
+
+Save a Pixmap in JPeg format
+
+
+Saves <b>pixmap</b> to <b>url</b> in JPeg format. If successful, [SavePixmapJPeg](../../brl/brl.jpgloader/#function-savepixmapjpeg-pixmap-tpixmap-url-object-quality-75) returns
+True, otherwise False.
+
+The optional <b>quality</b> parameter should be in the range 0 to 100, where
+0 indicates poor quality (smallest) and 100 indicates best quality (largest).
+
+
+

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 19 - 0
docs/api/brl/brl_keycodes.md


+ 167 - 0
docs/api/brl/brl_linkedlist.md

@@ -0,0 +1,167 @@
+---
+id: brl.linkedlist
+title: BRL.LinkedList
+sidebar_label: BRL.LinkedList
+---
+
+
+<h1>Linked lists</h1>
+
+A linked list allows you to efficiently add and remove objects to and from a collection of objects.
+
+To create a linked list, use the [CreateList](../../brl/brl.linkedlist/#function-createlist-tlist) command.
+
+Add objects to a linked list using [ListAddFirst](../../brl/brl.linkedlist/#function-listaddfirst-tlink-list-tlist-value-object) or [ListAddLast](../../brl/brl.linkedlist/#function-listaddlast-tlink-list-tlist-value-object). Both commands return a link object which can be used to later remove the object with the [RemoveLink](../../brl/brl.linkedlist/#function-removelink-link-tlink) command. You can also remove objects with the [ListRemove](../../brl/brl.linkedlist/#function-listremove-list-tlist-value-object) command. However this is not as efficient as using [RemoveLink](../../brl/brl.linkedlist/#function-removelink-link-tlink) because the list must first be searched for the object to be removed.
+
+To visit all the objects in a linked list, you can use an [EachIn](../../brl/brl.blitz/#eachin) loop.
+
+
+## Types
+| Type | Description |
+|---|---|
+| [TLink](../../brl/brl.linkedlist/tlink) | Link Object used by TList |
+| [TListEnum](../../brl/brl.linkedlist/tlistenum) | Enumerator Object use by TList in order to implement Eachin support. |
+| [TList](../../brl/brl.linkedlist/tlist) | Linked List |
+
+## Functions
+
+### `Function CreateList:TList()`
+
+Create a linked list
+
+#### Returns
+A new linked list object
+
+
+#### Example
+```blitzmax
+' createlist.bmx
+
+' create a list to hold some objects
+
+list:TList=createlist()
+
+' add some string objects to the list
+
+listaddlast list,"one"
+listaddlast list,"two"
+listaddlast list,"three"
+
+' enumerate all the strings in the list
+
+for a$=eachin list
+	print a$
+next
+```
+
+### `Function ClearList( list:TList )`
+
+Clear a linked list
+
+Removes all objects from <b>list</b>.
+
+
+
+### `Function CountList( list:TList )`
+
+Count list length
+
+#### Returns
+The numbers of objects in <b>list</b>.
+
+
+
+### `Function ListIsEmpty( list:TList )`
+
+Check if list is empty
+
+#### Returns
+True if list is empty, else false
+
+
+
+### `Function ListContains( list:TList,value:Object )`
+
+Check if list contains a value
+
+#### Returns
+True if list contains <b>value</b>, else false
+
+
+
+### `Function SortList( list:TList,ascending=True,compareFunc( o1:Object,o2:Object ) )`
+
+Sort a list
+
+
+### `Function ListFromArray:TList( arr:Object[] )`
+
+Create a list from an array
+
+#### Returns
+A new linked list
+
+
+
+### `Function ListToArray:Object[]( list:TList )`
+
+convert a list to an array
+
+#### Returns
+An array of objects
+
+
+
+### `Function SwapLists( list_x:TList,list_y:TList )`
+
+Swap the contents of 2 lists
+
+
+### `Function ReverseList( list:TList )`
+
+Reverse the order of elements of a list
+
+
+### `Function ListFindLink:TLink( list:TList,value:Object )`
+
+Find a link in a list
+
+#### Returns
+The link containting <b>value</b>
+
+
+
+### `Function ListAddLast:TLink( list:TList,value:Object )`
+
+Add an object to a linked list
+
+#### Returns
+A link object
+
+
+
+### `Function ListAddFirst:TLink( list:TList,value:Object )`
+
+Add an object to a linked list
+
+#### Returns
+A link object
+
+
+
+### `Function ListRemove( list:TList,value:Object )`
+
+Remove an object from a linked list
+
+[ListRemove](../../brl/brl.linkedlist/#function-listremove-list-tlist-value-object) scans a list for the specified value and removes its link.
+
+
+
+### `Function RemoveLink( link:TLink )`
+
+Remove an object from a linked list
+
+[RemoveLink](../../brl/brl.linkedlist/#function-removelink-link-tlink) is more efficient than [ListRemove](../../brl/brl.linkedlist/#function-listremove-list-tlist-value-object).
+
+
+

+ 115 - 0
docs/api/brl/brl_map.md

@@ -0,0 +1,115 @@
+---
+id: brl.map
+title: BRL.Map
+sidebar_label: BRL.Map
+---
+
+
+## Types
+| Type | Description |
+|---|---|
+| [TIntKey](../../brl/brl.map/tintkey) | Int holder for key returned by TIntMap.Keys() enumerator. |
+| [TPtrKey](../../brl/brl.map/tptrkey) | Byte Ptr holder for key returned by TPtrMap.Keys() enumerator. |
+
+## Functions
+
+### `Function CreateMap:TMap()`
+
+Create a map
+
+#### Returns
+A new map object
+
+
+
+### `Function ClearMap( map:TMap )`
+
+Clear a map
+
+
+[ClearMap](../../brl/brl.map/#function-clearmap-map-tmap) removes all keys and values from <b>map</b>
+
+
+
+### `Function MapIsEmpty( map:TMap )`
+
+Check if a map is empty
+
+#### Returns
+True if <b>map</b> is empty, otherwise false
+
+
+
+### `Function MapInsert( map:TMap,key:Object,value:Object )`
+
+Insert a key/value pair into a map
+
+
+If <b>map</b> already contained <b>key</b>, it's value is overwritten with <b>value</b>.
+
+
+
+### `Function MapValueForKey:Object( map:TMap,key:Object )`
+
+Find a value given a key
+
+
+If <b>map</b> does not contain <b>key</b>, a [Null](../../brl/brl.blitz/#null) object is returned.
+
+
+#### Returns
+The value associated with <b>key</b>
+
+
+
+### `Function MapContains( map:TMap,key:Object )`
+
+Check if a map contains a key
+
+#### Returns
+True if <b>map</b> contains <b>key</b>
+
+
+
+### `Function MapRemove( map:TMap,key:Object )`
+
+Remove a key/value pair from a map
+
+
+### `Function MapKeys:TMapEnumerator( map:TMap )`
+
+Get map keys
+
+
+The object returned by [MapKeys](../../brl/brl.map/#function-mapkeys-tmapenumerator-map-tmap) can be used with [EachIn](../../brl/brl.blitz/#eachin) to iterate through
+the keys in <b>map</b>.
+
+
+#### Returns
+An iterator object
+
+
+
+### `Function MapValues:TMapEnumerator( map:TMap )`
+
+Get map values
+
+
+The object returned by [MapValues](../../brl/brl.map/#function-mapvalues-tmapenumerator-map-tmap) can be used with [EachIn](../../brl/brl.blitz/#eachin) to iterate through
+the values in <b>map</b>.
+
+
+#### Returns
+An iterator object
+
+
+
+### `Function CopyMap:TMap( map:TMap )`
+
+Copy a map
+
+#### Returns
+A copy of <b>map</b>
+
+
+

+ 107 - 0
docs/api/brl/brl_math.md

@@ -0,0 +1,107 @@
+---
+id: brl.math
+title: BRL.Math
+sidebar_label: BRL.Math
+---
+
+
+## Functions
+
+### `Function IsNan( x:Double )`
+
+Check if a value is NAN
+
+#### Returns
+True if <b>x</b> is 'not a number' (eg: Sqr(-1))
+
+
+
+### `Function IsInf( x:Double )`
+
+Check if a value is infinite (eg: 1.0/0.0)
+
+#### Returns
+True if <b>x</b> is infinite
+
+
+
+### `Function Sqr:Double( x:Double )`
+
+Square root of <b>x</b>
+
+
+### `Function Sin:Double( x:Double )`
+
+Sine of <b>x</b> degrees
+
+
+### `Function Cos:Double( x:Double )`
+
+Cosine of <b>x</b> degrees
+
+
+### `Function Tan:Double( x:Double )`
+
+Tangent of <b>x</b> degrees
+
+
+### `Function ASin:Double( x:Double )`
+
+Inverse Sine of <b>x</b>
+
+
+### `Function ACos:Double( x:Double )`
+
+Inverse Cosine of <b>x</b>
+
+
+### `Function ATan:Double( x:Double )`
+
+Inverse Tangent of <b>x</b>
+
+
+### `Function ATan2:Double( y:Double,x:Double )`
+
+Inverse Tangent of two variables <b>x</b> , <b>y</b>
+
+
+### `Function Sinh:Double( x:Double )`
+
+Hyperbolic sine of <b>x</b>
+
+
+### `Function Cosh:Double( x:Double )`
+
+Hyperbolic cosine of <b>x</b>
+
+
+### `Function Tanh:Double( x:Double )`
+
+Hyperbolic tangent of <b>x</b>
+
+
+### `Function Exp:Double( x:Double )`
+
+Exponential function
+
+
+### `Function Log:Double( x:Double )`
+
+Natural logarithm
+
+
+### `Function Log10:Double( x:Double )`
+
+Base 10 logarithm
+
+
+### `Function Ceil:Double( x:Double )`
+
+Smallest integral value not less than <b>x</b>
+
+
+### `Function Floor:Double( x:Double )`
+
+Largest integral value not greater than <b>x</b>
+
+

+ 1076 - 0
docs/api/brl/brl_max2d.md

@@ -0,0 +1,1076 @@
+---
+id: brl.max2d
+title: BRL.Max2D
+sidebar_label: BRL.Max2D
+---
+
+
+
+The Max2D module provides a set of commands for drawing 2D graphics.<br>
+<br>
+Before using any of the Max2D commands, you must first create a Max2D graphics
+object. The easiest way to do this is using the [Graphics](../../brl/brl.graphics/#function-graphics-tgraphics-width-height-depth-0-hertz-60-flags-0) command.<br>
+<br>
+By default, Max2D is double buffered which means you will have to use 
+[Flip](../../brl/brl.graphics/#function-flip-sync-1) once you have finished drawing each frame of graphics.<br>
+<br>
+<h2>Drawing</h2>
+Max2D provides support for the following drawing commands:<br>
+<br>
+<table>
+<tr><th>Drawing command</th><th>Action</th></tr>
+<tr><td><a href=#Cls class=token>Cls</a></td><td>Clears the viewport</td></tr>
+<tr><td><a href=#Plot class=token>Plot</a></td><td>Draws a single pixel</td></tr>
+<tr><td><a href=#DrawLine class=token>DrawLine</a></td><td>Draws a line</td></tr>
+<tr><td><a href=#DrawRect class=token>DrawRect</a></td><td>Draws a rectangle</td></tr>
+<tr><td><a href=#DrawOval class=token>DrawOval</a></td><td>Draws an oval</td></tr>
+<tr><td><a href=#DrawPoly class=token>DrawPoly</a></td><td>Draws a polygon</td></tr>
+<tr><td><a href=#DrawText class=token>DrawText</a></td><td>Draws some text</td></tr>
+<tr><td><a href=#DrawImage class=token>DrawImage</a></td><td>Draws an image</td></tr>
+<tr><td><a href=#DrawPixmap class=token>DrawPixmap</a></td><td>Draws a pixmap</td></tr>
+</table>
+<br>
+<h2>Viewport, origin and handle</h2>
+Drawing commands are clipped to a rectangular area known as the <i>viewport</i>. Only the area within the viewport is ever modified, and attempting to draw outside the viewport will result in the drawing command being clipped or <i>chopped</i> to the viewport. To set the viewport, use the <a href=#SetViewport class=token>SetViewport</a> command.<br>
+<br>
+Drawing commands are also offset by the current <i>origin</i> and <i>handle</i>. To set these properties, use the <a href=#SetOrigin class=token>SetOrigin</a> and <a href=#SetHandle class=token>SetHandle</a> commands.<br>
+<br>
+The current handle is an x,y coordinate subtracted from all drawing x,y coordinates <i>before</i> any rotation or scaling occurs. This allows you to provide a local 'center' for drawing. On the other hand, the current origin is an x,y coordinate added to all drawing x,y coordinates <i>after</i> any rotation or scaling.<br>
+<br>
+<h2>Color, alpha and blend mode</h2>
+Drawing commands are affected by the current color, alpha and blend mode. You can set these properties by using the <a href=#SetColor class=token>SetColor</a>, <a href=#SetAlpha class=token>SetAlpha</a> and <a href=#SetBlend class=token>SetBlend</a> commands.<br>
+<br>
+The current alpha value controls the transparency level when using the ALPHABLEND blend mode.<br>
+<br>
+The current blend mode controls how pixels are combined with existing pixels in the back buffer and can be one of the following:<br>
+<br>
+<table>
+<tr><th>Blend mode</th><th>Effect</th></tr>
+<tr><td>SOLIDBLEND</td><td>Pixels overwrite existing backbuffer pixels</td></tr>
+<tr><td>MASKBLEND</td><td>Pixels are drawn only if their alpha component is greater than .5</td></tr>
+<tr><td>ALPHABLEND</td><td>Pixels are alpha blended with existing backbuffer pixels</td></tr>
+<tr><td>LIGHTBLEND</td><td>Pixel colors are added to backbuffer pixel colors, giving a 'lighting' effect</td></tr>
+<tr><td>SHADEBLEND</td><td>Pixel colors are multiplied with backbuffer pixel colors, giving a 'shading' effect</td></tr>
+</table>
+<br>
+<h2>Rotation and scale</h2>
+Drawing commands can be scaled and rotated using the <a href=#SetScale class=token>SetScale</a> and <a href=#SetRotation class=token>SetRotation</a> commands. Rotation and scaling occur relative to the current handle.<br>
+<br>
+<h2>Images</h2>
+Images are pre-rendered chunks of graphics that can be efficiently drawn using a single <a href=#DrawImage class=token>DrawImage</a> command. Images are typically stored in png, bmp or jpg format, and can be loaded using the <a href=#LoadImage class=token>LoadImage</a> command.<br>
+<br>
+Image drawing is also affected by color, alpha, blend, rotation and scale. The current color is multiplied with each pixel color before the image is drawn to the backbuffer, allowing you to <i>tint</i> images. To disable this effect, you should set the current color to white.<br>
+<br>
+Images can also have a mask color. This is the color that represents transparency when an image is drawn using the MASKBLEND blend mode. To set the mask color, use the <a href=#SetMaskColor class=token>SetMaskColor</a> command.<br>
+<br>
+Images can be created by snapshotting regions of the back buffer using the <a href=#GrabImage class=token>GrabImage</a> command.
+<h2>Pixmaps</h2>
+Pixmaps are used to manipulate images at a pixel level, see the pixmaps module for details.<p>
+
+<a href=#LockImage class=token>LockImage</a> allows for direct Image pixel access and requires a corresponding call to
+<a href=#UnlockImage class=token>UnlockImage</a> when you have have finished reading or modifying the pixels. 
+The <a href=#DrawPixmap class=token>DrawPixmap</a> and <a href=#GrabPixmap class=token>GrabPixmap</a>
+commands allow you to move pixels to and from the current graphic display's backbuffer.
+<h2>Collisions</h2>
+Max2D features a multilayered pixel perfect collision system.
+The <a href=#CollideRect class=token>CollideRect</a> and 
+<a href=#CollideImage class=token>CollideImage</a> commands
+provide a dual function allowing the drawing and hit testing of Rects and 
+Images with any combination of 32 collision layers.<p>
+The current Scale, Rotation, Origin and Handle settings are taken into account 
+so coordinates for the collision commands acurately match their drawing counterparts 
+<a href=#DrawRect class=token>DrawRect</a> and <a href=#DrawImage class=token>DrawImage</a>.<p>
+<a href=#ResetCollisions class=token>ResetCollisions</a> is used
+to clear any or all of the 32 collision layers provided.<br>
+<br>
+
+
+
+## Types
+| Type | Description |
+|---|---|
+| [TImage](../../brl/brl.max2d/timage) | Max2D Image type |
+
+## Functions
+
+### `Function Cls()`
+
+Clear graphics buffer
+
+
+Clears the graphics buffer to the current cls color as determined by [SetClsColor](../../brl/brl.max2d/#function-setclscolor-red-green-blue).
+
+
+#### Example
+```blitzmax
+' cls.bmx
+
+' a spinning text message
+' remove the call to cls to illustrate the
+' need for clearing the screen every frame
+
+Graphics 640,480
+SetOrigin 320,240
+While Not KeyHit(KEY_ESCAPE)
+	Cls 
+	SetRotation frame
+	DrawText "Press Escape To Exit",0,0
+	Flip
+	frame:+1
+Wend
+```
+
+### `Function SetClsColor( red,green,blue )`
+
+Set current [Cls](../../brl/brl.max2d/#function-cls) color
+
+
+The <b>red</b>, <b>green</b> and <b>blue</b> parameters should be in the range of 0 to 255.
+
+The default cls color is black.
+
+
+
+### `Function GetClsColor( red Var,green Var,blue Var )`
+
+Get red, green and blue component of current cls color.
+
+#### Returns
+Red, green and blue values in the range 0..255 in the variables supplied.
+
+
+
+### `Function Plot( x#,y# )`
+
+Plot a pixel
+
+
+Sets the color of a single pixel on the back buffer to the current drawing color
+defined with the [SetColor](../../brl/brl.max2d/#function-setcolor-red-green-blue) command. Other commands that affect the operation of
+[Plot](../../brl/brl.max2d/#function-plot-x-y) include [SetOrigin](../../brl/brl.max2d/#function-setorigin-x-y), [SetViewPort](../../brl/brl.max2d/#function-setviewport-x-y-width-height), [SetBlend](../../brl/brl.max2d/#function-setblend-blend) and [SetAlpha](../../brl/brl.max2d/#function-setalpha-alpha).
+
+
+#### Example
+```blitzmax
+' plot.bmx
+
+' plots a cosine graph
+' scrolls along the graph using an incrementing frame variable 
+
+Graphics 640,480
+
+While Not KeyHit(KEY_ESCAPE)
+	Cls
+	For x=0 To 640
+		theta=x+frame
+		y=240-Cos(theta)*240
+		Plot x,y
+	Next
+	frame=frame+1
+	Flip
+Wend
+```
+
+### `Function DrawRect( x#,y#,width#,height# )`
+
+Draw a rectangle
+
+
+Sets the color of a rectangular area of pixels using the current drawing color
+defined with the [SetColor](../../brl/brl.max2d/#function-setcolor-red-green-blue) command.
+
+Other commands that affect the operation of [DrawRect](../../brl/brl.max2d/#function-drawrect-x-y-width-height) include [SetHandle](../../brl/brl.max2d/#function-sethandle-x-y), [SetScale](../../brl/brl.max2d/#function-setscale-scale-x-scale-y),
+[SetRotation](../../brl/brl.max2d/#function-setrotation-rotation), [SetOrigin](../../brl/brl.max2d/#function-setorigin-x-y), [SetViewPort](../../brl/brl.max2d/#function-setviewport-x-y-width-height), [SetBlend](../../brl/brl.max2d/#function-setblend-blend) and [SetAlpha](../../brl/brl.max2d/#function-setalpha-alpha).
+
+
+#### Example
+```blitzmax
+' drawrect.bmx
+
+' draws a sequence of rectangles across the screen with
+' increasing rotation and scale
+
+' uses the frame variable to cycle through the values 0..9 for
+' an animation effect between frames 
+
+Graphics 640,480
+
+SetBlend ALPHABLEND
+SetAlpha 0.2
+
+While Not KeyHit(KEY_ESCAPE)
+	Cls
+	DrawText "DrawRect Example",0,0
+	For r=t To t+500 Step 10
+		SetRotation r
+		SetScale r/5,r/5
+		DrawRect r,r,2,2
+	Next
+	t=t+1
+	If t=10 t=0
+	Flip	
+Wend
+```
+
+### `Function DrawLine( x#,y#,x2#,y2#,draw_last_pixel=True )`
+
+Draw a line
+
+
+[DrawLine](../../brl/brl.max2d/#function-drawline-x-y-x2-y2-draw-last-pixel-true) draws a line from <b>x</b>, <b>y</b> to <b>x2</b>, <b>y2</b> with the current drawing color.
+
+BlitzMax commands that affect the drawing of lines include [SetLineWidth](../../brl/brl.max2d/#function-setlinewidth-width), [SetColor](../../brl/brl.max2d/#function-setcolor-red-green-blue), [SetHandle](../../brl/brl.max2d/#function-sethandle-x-y),
+[SetScale](../../brl/brl.max2d/#function-setscale-scale-x-scale-y), [SetRotation](../../brl/brl.max2d/#function-setrotation-rotation), [SetOrigin](../../brl/brl.max2d/#function-setorigin-x-y), [SetViewPort](../../brl/brl.max2d/#function-setviewport-x-y-width-height), [SetBlend](../../brl/brl.max2d/#function-setblend-blend) and [SetAlpha](../../brl/brl.max2d/#function-setalpha-alpha).
+The optional <b>draw_last_pixel</b> parameter can be used to control whether the last pixel of the line is drawn or not.
+Not drawing the last pixel can be useful if you are using certain blending modes.
+
+
+#### Example
+```blitzmax
+' drawline.bmx
+
+' draws a cross hair at the mouse position using DrawLine
+
+Graphics 640,480
+
+HideMouse 
+
+While Not KeyHit(KEY_ESCAPE)
+	Cls
+	x=MouseX()
+	y=MouseY()
+	DrawLine 320,240,x,y
+	DrawLine x-2,y,x-10,y
+	DrawLine x+2,y,x+10,y
+	DrawLine x,y-2,x,y-10
+	DrawLine x,y+2,x,y+10
+	Flip
+Wend
+```
+
+### `Function DrawOval( x#,y#,width#,height# )`
+
+Draw an oval
+
+
+[DrawOval](../../brl/brl.max2d/#function-drawoval-x-y-width-height) draws an oval that fits in the rectangular area defined by <b>x</b>, <b>y</b>, <b>width</b>
+and <b>height</b> parameters.
+
+BlitzMax commands that affect the drawing of ovals include [SetColor](../../brl/brl.max2d/#function-setcolor-red-green-blue), [SetHandle](../../brl/brl.max2d/#function-sethandle-x-y),
+[SetScale](../../brl/brl.max2d/#function-setscale-scale-x-scale-y), [SetRotation](../../brl/brl.max2d/#function-setrotation-rotation), [SetOrigin](../../brl/brl.max2d/#function-setorigin-x-y), [SetViewPort](../../brl/brl.max2d/#function-setviewport-x-y-width-height), [SetBlend](../../brl/brl.max2d/#function-setblend-blend) and [SetAlpha](../../brl/brl.max2d/#function-setalpha-alpha).
+
+
+#### Example
+```blitzmax
+' drawoval.bmx
+
+' draws a pair of eyes using 4 DrawOval commands, 2 white, 2 blue
+' positions the blue ovals so the eyes track the mouse
+
+Graphics 640,480
+While Not KeyHit(KEY_ESCAPE)
+	Cls
+	SetColor 255,255,255
+	DrawOval 0,0,320,200
+	DrawOval 320,0,320,200
+	SetColor 0,0,255
+	x=(MouseX()-320)/10
+	y=(MouseY()-240)/10
+	DrawOval 220-32+x,100+y,64,40
+	DrawOval 420-32+x,100+y,64,40
+	Flip
+Wend
+```
+
+### `Function DrawPoly( xy#[] )`
+
+Draw a polygon
+
+
+[DrawPoly](../../brl/brl.max2d/#function-drawpoly-xy) draws a polygon with corners defined by an array of x#,y# coordinate pairs.
+
+BlitzMax commands that affect the drawing of polygons include [SetColor](../../brl/brl.max2d/#function-setcolor-red-green-blue), [SetHandle](../../brl/brl.max2d/#function-sethandle-x-y),
+[SetScale](../../brl/brl.max2d/#function-setscale-scale-x-scale-y), [SetRotation](../../brl/brl.max2d/#function-setrotation-rotation), [SetOrigin](../../brl/brl.max2d/#function-setorigin-x-y), [SetViewPort](../../brl/brl.max2d/#function-setviewport-x-y-width-height), [SetBlend](../../brl/brl.max2d/#function-setblend-blend) and [SetAlpha](../../brl/brl.max2d/#function-setalpha-alpha).
+
+
+#### Example
+```blitzmax
+' drawpoly.bmx
+
+' draws a simple triangle using the
+' DrawPoly command and an array of
+' floats listed as 3 pairs of x,y
+' coordinates
+
+Local tri#[]=[0.0,0.0,100.0,100.0,0.0,100.0]
+
+Graphics 640,480
+While Not KeyHit(KEY_ESCAPE)
+	Cls
+	DrawPoly tri
+	Flip
+Wend
+```
+
+### `Function DrawText( t$,x#,y# )`
+
+Draw text
+
+
+[DrawText](../../brl/brl.max2d/#function-drawtext-t-x-y) prints strings at position <b>x</b>,@y of the graphics display using
+the current image font specified by the [SetImageFont](../../brl/brl.max2d/#function-setimagefont-font-timagefont) command.
+
+Other commands that affect [DrawText](../../brl/brl.max2d/#function-drawtext-t-x-y) include [SetColor](../../brl/brl.max2d/#function-setcolor-red-green-blue), [SetHandle](../../brl/brl.max2d/#function-sethandle-x-y),
+[SetScale](../../brl/brl.max2d/#function-setscale-scale-x-scale-y), [SetRotation](../../brl/brl.max2d/#function-setrotation-rotation), [SetOrigin](../../brl/brl.max2d/#function-setorigin-x-y), [SetViewPort](../../brl/brl.max2d/#function-setviewport-x-y-width-height), [SetBlend](../../brl/brl.max2d/#function-setblend-blend) and [SetAlpha](../../brl/brl.max2d/#function-setalpha-alpha).
+
+It is recomended that the blend mode be set to ALPHABLEND using the [SetBlend](../../brl/brl.max2d/#function-setblend-blend)
+command for non jagged antialiased text. Text that will be drawn at a smaller
+size using the [SetScale](../../brl/brl.max2d/#function-setscale-scale-x-scale-y) command should use fonts loaded with the SMOOTHFONT
+style to benefit from mip-mapped filtering, see [LoadImageFont](../../brl/brl.max2d/#function-loadimagefont-timagefont-url-object-size-style-smoothfont) for more information.
+
+
+#### Example
+```blitzmax
+' drawtext.bmx
+
+' scrolls a large text string across the screen by decrementing the tickerx variable
+
+Graphics 640,480
+
+Local tickerx#=640
+
+text$="Yo to all the Apple, Windows and Linux BlitzMax programmers in the house! "
+text:+"Game development is the most fun, most advanced and definitely most cool "
+text:+"software programming there is!"
+
+While Not KeyHit(KEY_ESCAPE)
+	Cls
+	DrawText "Scrolling Text Demo",0,0
+	DrawText text,tickerx#,400
+	tickerx=tickerx-1
+	If tickerx<-TextWidth(text) tickerx=640
+	Flip	
+Wend
+
+End
+```
+
+### `Function DrawImage( image:TImage,x#,y#,frame=0 )`
+
+Draw an image to the back buffer
+
+
+Drawing is affected by the current blend mode, color, scale and rotation.
+
+If the blend mode is ALPHABLEND the image is affected by the current alpha value
+and images with alpha channels are blended correctly with the background.
+
+
+
+### `Function DrawImageRect( image:TImage,x#,y#,w#,h#,frame=0 )`
+
+Draw an image to a rectangular area of the back buffer
+
+
+<b>x</b>, <b>y</b>, <b>w</b> and <b>h</b> specify the destination rectangle to draw to.
+
+<b>frame</b> is the image frame to draw.
+
+Drawing is affected by the current blend mode, color, scale and rotation.
+
+If the blend mode is ALPHABLEND, then the image is also affected by the current alpha value.
+
+
+
+### `Function DrawSubImageRect( image:TImage,x#,y#,w#,h#,sx#,sy#,sw#,sh#,hx#=0,hy#=0,frame=0 )`
+
+Draw a sub rectangle of an image to a rectangular area of the back buffer
+
+
+<b>x</b>, <b>y</b>, <b>w</b> and <b>h</b> specify the destination rectangle to draw to.
+
+<b>sx</b>, <b>sy</b>, <b>sw</b> and <b>sh</b> specify the source rectangle within the image to draw from.
+
+<b>hx</b> and <b>hy</b> specify a handle offset within the source rectangle.
+
+<b>frame</b> is the image frame to draw.
+
+Drawing is affected by the current blend mode, color, scale and rotation.
+
+If the blend mode is ALPHABLEND, then the image is also affected by the current alpha value.
+
+
+
+### `Function TileImage( image:TImage,x#=0#,y#=0#,frame=0 )`
+
+Draw an image in a tiled pattern
+
+
+[TileImage](../../brl/brl.max2d/#function-tileimage-image-timage-x-0-y-0-frame-0) draws an image in a repeating, tiled pattern, filling the current viewport.
+
+
+
+### `Function SetColor( red,green,blue )`
+
+Set current color
+
+
+The [SetColor](../../brl/brl.max2d/#function-setcolor-red-green-blue) command affects the color of [Plot](../../brl/brl.max2d/#function-plot-x-y), [DrawRect](../../brl/brl.max2d/#function-drawrect-x-y-width-height), [DrawLine](../../brl/brl.max2d/#function-drawline-x-y-x2-y2-draw-last-pixel-true), [DrawText](../../brl/brl.max2d/#function-drawtext-t-x-y),
+[DrawImage](../../brl/brl.max2d/#function-drawimage-image-timage-x-y-frame-0) and [DrawPoly](../../brl/brl.max2d/#function-drawpoly-xy).
+
+The <b>red</b>, <b>green</b> and <b>blue</b> parameters should be in the range of 0 to 255.
+
+
+
+### `Function GetColor( red Var,green Var,blue Var )`
+
+Get red, green and blue component of current color.
+
+#### Returns
+Red, green and blue values in the range 0..255 in the variables supplied.
+
+
+
+### `Function SetBlend( blend )`
+
+Set current blend mode
+
+
+SetBlend controls how pixels are combined with existing pixels in the back buffer when drawing
+commands are used in BlitzMax.
+
+<b>blend</b> should be one of:
+
+<table><tr><td> <b>Blend mode</b></td><td><b>Effect</b></td></tr><tr><td>  MASKBLEND</td><td>Pixels are drawn only if their alpha component is greater than .5</td></tr><tr><td>  SOLIDBLEND</td><td>Pixels overwrite existing backbuffer pixels</td></tr><tr><td>  ALPHABLEND</td><td>Pixels are alpha blended with existing backbuffer pixels</td></tr><tr><td>  LIGHTBLEND</td><td>Pixel colors are added to backbuffer pixel colors, giving a 'lighting' effect</td></tr><tr><td>  SHADEBLEND</td><td>Pixel colors are multiplied with backbuffer pixel colors, giving a 'shading' effect</table>
+
+
+
+
+### `Function GetBlend()`
+
+Get current blend mode
+
+
+See [SetBlend](../../brl/brl.max2d/#function-setblend-blend) for possible return values.
+
+
+#### Returns
+The current blend mode.
+
+
+
+### `Function SetAlpha( alpha# )`
+
+Set current alpha level
+
+
+<b>alpha</b> should be in the range 0 to 1.
+
+<b>alpha</b> controls the transparancy level when the ALPHABLEND blend mode is in effect.
+The range from 0.0 to 1.0 allows a range of transparancy from completely transparent
+to completely solid.
+
+
+
+### `Function GetAlpha#()`
+
+Get current alpha setting.
+
+#### Returns
+the current alpha value in the range 0..1.0
+
+
+
+### `Function SetLineWidth( width# )`
+
+Sets pixel width of lines drawn with the [DrawLine](../../brl/brl.max2d/#function-drawline-x-y-x2-y2-draw-last-pixel-true) command
+
+
+### `Function GetLineWidth#()`
+
+Get line width
+
+#### Returns
+Current line width, in pixels
+
+
+
+### `Function SetMaskColor( red,green,blue )`
+
+Set current mask color
+
+
+The current mask color is used to build an alpha mask when images are loaded or modified.
+The <b>red</b>, <b>green</b> and <b>blue</b> parameters should be in the range of 0 to 255.
+
+
+
+### `Function GetMaskColor( red Var,green Var,blue Var )`
+
+Get red, green and blue component of current mask color
+
+#### Returns
+Red, green and blue values in the range 0..255
+
+
+
+### `Function SetVirtualResolution( width#,height# )`
+
+Set virtual graphics resolution
+
+
+SetResolution allows you to set a 'virtual' resolution independent of the graphics resolution.
+
+This allows you to design an application to work at a fixed resolution, say 640 by 480, and run it
+at any graphics resolution.
+
+
+
+### `Function VirtualResolutionWidth#()`
+
+Get virtual graphics resolution width
+
+
+### `Function VirtualResolutionHeight#()`
+
+Get virtual graphics resolution height
+
+
+### `Function VirtualMouseX#()`
+
+Get virtual mouse X coordinate
+
+
+### `Function VirtualMouseY#()`
+
+Get virtual mouse Y coordinate
+
+
+### `Function VirtualMouseXSpeed#()`
+
+Get virtual mouse X speed
+
+
+### `Function VirtualMouseYSpeed#()`
+
+Get virtual mouse Y speed
+
+
+### `Function MoveVirtualMouse( x#,y# )`
+
+Move virtual mouse
+
+
+### `Function SetViewport( x,y,width,height )`
+
+Set drawing viewport
+
+
+The current ViewPort defines an area within the back buffer that all drawing is clipped to. Any
+regions of a DrawCommand that fall outside the current ViewPort are not drawn.
+
+
+
+### `Function GetViewport( x Var,y Var,width Var,height Var )`
+
+Get dimensions of current Viewport.
+
+#### Returns
+The horizontal, vertical, width and height values of the current Viewport in the variables supplied.
+
+
+
+### `Function SetOrigin( x#,y# )`
+
+Set drawing origin
+
+
+The current Origin is an x,y coordinate added to all drawing x,y coordinates after any rotation or scaling.
+
+
+
+### `Function GetOrigin( x# Var,y# Var )`
+
+Get current origin position.
+
+#### Returns
+The horizontal and vertical position of the current origin.
+
+
+
+### `Function SetHandle( x#,y# )`
+
+Set drawing handle
+
+
+The drawing handle is a 2D offset subtracted from the x,y location of all
+drawing commands except [DrawImage](../../brl/brl.max2d/#function-drawimage-image-timage-x-y-frame-0) as Images have their own unique handles.
+
+Unlike [SetOrigin](../../brl/brl.max2d/#function-setorigin-x-y) the drawing handle is subtracted before rotation and scale
+are applied providing a 'local' origin.
+
+
+
+### `Function GetHandle( x# Var,y# Var )`
+
+Get current drawing handle.
+
+#### Returns
+The horizontal and vertical position of the current drawing handle.
+
+
+
+### `Function SetRotation( rotation# )`
+
+Set current rotation
+
+
+<b>rotation</b> is given in degrees and should be in the range 0 to 360.
+
+
+
+### `Function GetRotation#()`
+
+Get current Max2D rotation setting.
+
+#### Returns
+The rotation in degrees.
+
+
+
+### `Function SetScale( scale_x#,scale_y# )`
+
+Set current scale
+
+
+<b>scale_x</b> and <b>scale_y</b> multiply the width and height of drawing
+commands where 0.5 will half the size of the drawing and 2.0 is equivalent
+to doubling the size.
+
+
+
+### `Function GetScale( scale_x# Var,scale_y# Var )`
+
+Get current Max2D scale settings.
+
+#### Returns
+The current x and y scale values in the variables supplied.
+
+
+
+### `Function SetTransform( rotation#=0,scale_x#=1,scale_y#=1 )`
+
+Set current rotation and scale
+
+
+SetTransform is a shortcut for setting both the rotation and
+scale parameters in Max2D with a single function call.
+
+
+
+### `Function LoadImageFont:TImageFont( url:Object,size,style=SMOOTHFONT )`
+
+Load an image font
+
+
+<b>style</b> can be a combination of BOLDFONT, ITALICFONT and SMOOTHFONT
+flags. Use the SMOOTHFONT flag for improved filtering if the font is to be rotated or
+scaled.
+
+
+#### Returns
+An image font object
+
+
+
+### `Function SetImageFont( font:TImageFont )`
+
+Set current image font
+
+
+In order to [DrawText](../../brl/brl.max2d/#function-drawtext-t-x-y) in fonts other than the default system font use the [SetImageFont](../../brl/brl.max2d/#function-setimagefont-font-timagefont)
+command with a font handle returned by the [LoadImageFont](../../brl/brl.max2d/#function-loadimagefont-timagefont-url-object-size-style-smoothfont) command.
+
+Use &{SetImageFont Null} to select the default, built-in font.
+
+
+
+### `Function GetImageFont:TImageFont()`
+
+Get current image font.
+
+#### Returns
+The current image font.
+
+
+
+### `Function TextWidth( Text$ )`
+
+Get width of text
+
+
+This command is useful for calculating horizontal alignment of text when using
+the [DrawText](../../brl/brl.max2d/#function-drawtext-t-x-y) command.
+
+
+#### Returns
+the width, in pixels, of <b>text</b> based on the current image font.
+
+
+
+### `Function TextHeight( Text$ )`
+
+Get height of text
+
+
+This command is useful for calculating vertical alignment of text when using
+the [DrawText](../../brl/brl.max2d/#function-drawtext-t-x-y) command.
+
+
+#### Returns
+the height, in pixels, of <b>text</b> based on the current image font.
+
+
+
+### `Function LoadImage:TImage( url:Object,flags=-1 )`
+
+Load an image
+
+
+<b>url</b> can be either a string or an existing pixmap.
+
+<b>flags</b> can be 0, -1 or any combination of:
+
+<table><tr><td> <b>Flags value</b></td><td><b>Effect</b>
+</td></tr><tr><td>  MASKEDIMAGE</td><td>The image is masked with the current mask color.
+</td></tr><tr><td>  FILTEREDIMAGE</td><td>The image is smoothed when scaled up to greater than its original
+size, when rotated, or when drawn at fractional pixel coordinates.
+</td></tr><tr><td>  MIPMAPPEDIMAGE</td><td>The image is smoothed when scaled down to less than its original size.
+</td></tr><tr><td>  DYNAMICIMAGE</td><td>The image can be modified using [LockImage](../../brl/brl.max2d/#function-lockimage-tpixmap-image-timage-frame-0-read-lock-true-write-lock-true) or [GrabImage](../../brl/brl.max2d/#function-grabimage-image-timage-x-y-frame-0).</table>
+
+
+
+Note MIPMAPPEDIMAGE images consume extra video memory, so this flag should only be used
+when really necessary.
+
+If flags is -1, the auto image flags are used: See [AutoImageFlags](../../brl/brl.max2d/#function-autoimageflags-flags).
+
+To combine flags, use the | (boolean OR) operator.
+
+
+#### Returns
+A new image object
+
+
+
+### `Function LoadAnimImage:TImage( url:Object,cell_width,cell_height,first_cell,cell_count,flags=-1 )`
+
+Load a multi-frame image
+
+
+[LoadAnimImage](../../brl/brl.max2d/#function-loadanimimage-timage-url-object-cell-width-cell-height-first-cell-cell-count-flags-1) extracts multiple image frames from a single, larger image. <b>url</b> can be either a string or an
+existing pixmap.
+
+See [LoadImage](../../brl/brl.max2d/#function-loadimage-timage-url-object-flags-1) for valid <b>flags</b> values.
+
+
+#### Returns
+An image object
+
+
+
+### `Function SetImageHandle( image:TImage,x#,y# )`
+
+Set an image's handle to an arbitrary point
+
+
+An image's handle is subtracted from the coordinates of [DrawImage](../../brl/brl.max2d/#function-drawimage-image-timage-x-y-frame-0) before
+rotation and scale are applied.
+
+
+
+### `Function AutoMidHandle( enable )`
+
+Enable or disable auto midhandle mode
+
+
+When auto midhandle mode is enabled, all images are automatically 'midhandled' (see [MidHandleImage](../../brl/brl.max2d/#function-midhandleimage-image-timage))
+when they are created. If auto midhandle mode is disabled, images are handled by their top left corner.
+
+AutoMidHandle defaults to False after calling [Graphics](../../brl/brl.graphics/#function-graphics-tgraphics-width-height-depth-0-hertz-60-flags-0).
+
+
+
+### `Function AutoImageFlags( flags )`
+
+Set auto image flags
+
+
+The auto image flags are used by [LoadImage](../../brl/brl.max2d/#function-loadimage-timage-url-object-flags-1) and [CreateImage](../../brl/brl.max2d/#function-createimage-timage-width-height-frames-1-flags-1) when no image
+flags are specified. See [LoadImage](../../brl/brl.max2d/#function-loadimage-timage-url-object-flags-1) for a full list of valid image flags.
+AutoImageFlags defaults to MASKEDIMAGE | FILTEREDIMAGE.
+
+
+
+### `Function MidHandleImage( image:TImage )`
+
+Set an image's handle to its center
+
+
+### `Function ImageWidth( image:TImage )`
+
+Get width of an image
+
+#### Returns
+The width, in pixels, of <b>image</b>
+
+
+
+### `Function ImageHeight( image:TImage )`
+
+Get height of an image
+
+#### Returns
+The height, in pixels, of <b>image</b>
+
+
+
+### `Function CreateImage:TImage( width,height,frames=1,flags=-1 )`
+
+Create an empty image
+
+
+[CreateImage](../../brl/brl.max2d/#function-createimage-timage-width-height-frames-1-flags-1) creates an 'empty' image, which should be initialized using either [GrabImage](../../brl/brl.max2d/#function-grabimage-image-timage-x-y-frame-0) or [LockImage](../../brl/brl.max2d/#function-lockimage-tpixmap-image-timage-frame-0-read-lock-true-write-lock-true)
+before being drawn.
+
+Please refer to [LoadImage](../../brl/brl.max2d/#function-loadimage-timage-url-object-flags-1) for valid <b>flags</b> values. The <b>flags</b> value is always combined with DYNAMICIMAGE.
+
+
+#### Returns
+A new image object
+
+
+#### Example
+```blitzmax
+' createimage.bmx
+
+' creates a 256x1 image with a black to blue color gradient
+
+Const ALPHABITS=$ff000000
+
+Graphics 640,480,32
+
+image=CreateImage(256,1)
+map=LockImage(image)
+For i=0 To 255
+	WritePixel(map,i,0,ALPHABITS|i)
+Next
+UnlockImage(image)
+
+DrawImageRect image,0,0,640,480
+DrawText "Blue Color Gradient",0,0
+
+Flip
+
+WaitKey
+```
+
+### `Function LockImage:TPixmap( image:TImage,frame=0,read_lock=True,write_lock=True )`
+
+Lock an image for direct access
+
+
+Locking an image allows you to directly access an image's pixels.
+
+Only images created with the DYNAMICIMAGE flag can be locked.
+
+Locked images must eventually be unlocked with [UnlockImage](../../brl/brl.max2d/#function-unlockimage-image-timage-frame-0) before they can be drawn.
+
+
+#### Returns
+A pixmap representing the image contents
+
+
+
+### `Function UnlockImage( image:TImage,frame=0 )`
+
+Unlock an image
+
+
+Unlocks an image previously locked with [LockImage](../../brl/brl.max2d/#function-lockimage-tpixmap-image-timage-frame-0-read-lock-true-write-lock-true).
+
+
+
+### `Function GrabImage( image:TImage,x,y,frame=0 )`
+
+Grab an image from the back buffer
+
+
+Copies pixels from the back buffer to an image frame.
+
+Only images created with the DYNAMICIMAGE flag can be grabbed.
+
+
+#### Example
+```blitzmax
+' grabimage.bmx
+
+' draws a small graphic then uses grabimage to make an image
+
+' as mask color and cls color both default to black a mask is 
+' created for the grabbed where any pixels unset on the backbuffer
+' become transparent in the grabbed image
+
+Graphics 640,480
+
+Cls
+
+DrawLine 0,0,32,32
+DrawLine 32,0,0,32
+DrawOval 0,0,32,32
+
+Local image=CreateImage(640,480,1,DYNAMICIMAGE|MASKEDIMAGE)
+GrabImage image,0,0
+
+Cls
+For i=1 To 100
+	DrawImage image,Rnd(640),Rnd(480)
+Next
+Flip
+
+WaitKey
+```
+
+### `Function DrawPixmap( pixmap:TPixmap,x,y )`
+
+Draw pixmap
+
+
+### `Function GrabPixmap:TPixmap( x,y,width,height )`
+
+Grab pixmap
+
+
+### `Function ImagesCollide(image1:TImage,x1,y1,frame1,image2:TImage,x2,y2,frame2)`
+
+Tests if two images collide
+
+
+[ImagesCollide](../../brl/brl.max2d/#function-imagescollide-image1-timage-x1-y1-frame1-image2-timage-x2-y2-frame2) uses the current Rotation and Scale factors from the most previous
+call to [SetScale](../../brl/brl.max2d/#function-setscale-scale-x-scale-y) and [SetRotation](../../brl/brl.max2d/#function-setrotation-rotation) to calculate at a pixel level if the two images collide.
+
+
+#### Returns
+True if any pixels of the two images specified at the given location overlap.
+
+
+
+### `Function ImagesCollide2(image1:TImage,x1,y1,frame1,rot1#,scalex1#,scaley1#,image2:TImage,x2,y2,frame2,rot2#,scalex2#,scaley2#)`
+
+Tests if two images with arbitrary Rotation and Scales collide
+
+
+[ImagesCollide2](../../brl/brl.max2d/#function-imagescollide2-image1-timage-x1-y1-frame1-rot1-scalex1-scaley1-image2-timage-x2-y2-frame2-rot2-scalex2-scaley2) uses the specified Rotation and Scale paramteters
+to calculate at a pixel level if the two images collide (overlap).
+
+
+#### Returns
+True if any pixels of the two images specified at the given location overlap.
+
+
+
+### `Function ResetCollisions(mask%=0)`
+
+Clears collision layers specified by the value of <b>mask</b>, mask=0 for all layers.
+
+
+The BlitzMax 2D collision system manages 32 layers, the <b>mask</b> parameter can
+be a combination of the following values or the special value COLLISION_LAYER_ALL in order
+to perform collision operations on multiple layers.
+
+Note: COLLISION_LAYER_32 is used by the [ImagesCollide](../../brl/brl.max2d/#function-imagescollide-image1-timage-x1-y1-frame1-image2-timage-x2-y2-frame2) and [ImagesCollide2](../../brl/brl.max2d/#function-imagescollide2-image1-timage-x1-y1-frame1-rot1-scalex1-scaley1-image2-timage-x2-y2-frame2-rot2-scalex2-scaley2) commands.
+
+<table><tr><td> <b>Layer</b></td><td><b>Mask value</b></td></tr><tr><td>  COLLISION_LAYER_ALL</td><td>0</td></tr><tr><td>  COLLISION_LAYER_1</td><td>$0001</td></tr><tr><td>  COLLISION_LAYER_2</td><td>$0002</td></tr><tr><td>  COLLISION_LAYER_3</td><td>$0004</td></tr><tr><td>  COLLISION_LAYER_4</td><td>$0008</td></tr><tr><td>  COLLISION_LAYER_5</td><td>$0010</td></tr><tr><td>  COLLISION_LAYER_6</td><td>$0020</td></tr><tr><td>  COLLISION_LAYER_7</td><td>$0040</td></tr><tr><td>  COLLISION_LAYER_8</td><td>$0080</td></tr><tr><td>  COLLISION_LAYER_9</td><td>$0100</td></tr><tr><td>  COLLISION_LAYER_10</td><td>$0200</td></tr><tr><td>  COLLISION_LAYER_11</td><td>$0400</td></tr><tr><td>  COLLISION_LAYER_12</td><td>$0800</td></tr><tr><td>  COLLISION_LAYER_13</td><td>$1000</td></tr><tr><td>  COLLISION_LAYER_14</td><td>$2000</td></tr><tr><td>  COLLISION_LAYER_15</td><td>$4000</td></tr><tr><td>  COLLISION_LAYER_16</td><td>$8000</table>
+
+
+
+
+### `Function CollideImage:Object[](image:TImage,x,y,frame,collidemask%,writemask%,id:Object=Null)`
+
+Pixel accurate collision testing between transformed Images.
+
+
+The <b>collidemask</b> specifies any layers to test for collision with.
+
+The <b>writemask</b> specifies which if any collision layers the <b>image</b> is added to in it's currently transformed state.
+
+The id specifies an object to be returned to future [CollideImage](../../brl/brl.max2d/#function-collideimage-object-image-timage-x-y-frame-collidemask-writemask-id-object-null) calls when collisions occur.
+
+
+#### Example
+```blitzmax
+Strict
+
+Local rot,x,y
+
+Graphics 640,480
+
+AutoMidHandle True	'image will rotate around it's center
+
+Local image:TImage=LoadImage("bullet.png")
+
+While Not KeyHit(KEY_ESCAPE)
+	Cls
+	ResetCollisions
+
+' draw the first image at 5 times the size and on an arbitrary angle
+	
+	SetScale 5,5
+	SetRotation 125
+
+	DrawImage image,200,200
+
+' add the first image to the first collision layer at same postion, rotation 
+' and scale as it has just been drawn
+
+	CollideImage image,200,200,0,0,1
+
+' move the other image relative to the mouse and rotate it continuously
+
+	x=MouseX()
+	y=MouseY()-20
+	rot:+1
+
+	SetRotation rot
+	DrawImage image,x,y
+
+' test the image at it's current rotation, scale and position with images
+' that have been added to the first collision layer
+
+	If CollideImage(image,x,y,0,1,0)
+
+' reset scale and rotation states so our text is drawn correctly		
+
+		SetScale 1,1
+		SetRotation 0
+		DrawText "COLLISION!",20,20
+
+	EndIf
+
+	Flip
+Wend
+```
+
+### `Function CollideRect:Object[](x,y,w,h,collidemask%,writemask%,id:Object=Null)`
+
+Pixel accurate collision testing between image layers
+
+
+The <b>collidemask</b> specifies any layers to test for collision with.
+
+The <b>writemask</b> specifies which if any collision layers the <b>image</b> is added to in it's currently transformed state.
+
+The <b>id</b> specifies an object to be returned to future [CollideImage](../../brl/brl.max2d/#function-collideimage-object-image-timage-x-y-frame-collidemask-writemask-id-object-null) calls when collisions occur.
+
+
+

+ 77 - 0
docs/api/brl/brl_maxlua.md

@@ -0,0 +1,77 @@
+---
+id: brl.maxlua
+title: BRL.MaxLua
+sidebar_label: BRL.MaxLua
+---
+
+
+
+The MaxLua module provides a way to use the Lua scripting language from within Blitzmax programs.
+
+Lua is a simple but fast and powerful scripting language. For more information on programming in Lua, please visit the official Lua site at http://www.lua.org
+
+Here is an example of the MaxLua module in action:
+
+```
+Strict
+
+'Our TDemo type...
+'
+Type TDemo
+
+	Method SayHello$( name$ )
+		Return "Hello "+name+"! Peace be with you..."
+	End Method
+
+End Type
+
+'Register a demo object with Lua.
+'
+'Lua code can now access the object using the identifier "Demo".
+'
+Local demo:TDemo=New TDemo
+LuaRegisterObject demo,"Demo"
+
+'source code to our little Lua program...
+'
+Local source$=..
+"function hello()~n"+..
+"print( Demo.SayHello( 'Fredborg' ) )~n"+..
+"end~n"+..
+"function goodbye()~n"+..
+"print( Demo.SayHello( 'CandyMan' ) )~n"+..
+"end~n"
+
+'create a Lua 'class' and set it's source code...
+'
+Local class:TLuaClass=TLuaClass.Create( source )
+
+'Now, create an instance of the class.
+'
+Local instance:TLuaObject=TLuaObject.Create( class,Null )
+
+'We can no invoke methods of the class.
+'
+instance.Invoke "hello",Null
+instance.Invoke "goodbye",Null
+````
+
+
+
+## Types
+| Type | Description |
+|---|---|
+| [TLuaObject](../../brl/brl.maxlua/tluaobject) | A Lua 'object' |
+| [TLuaClass](../../brl/brl.maxlua/tluaclass) | A Lua 'class' |
+
+## Functions
+
+### `Function LuaRegisterObject( obj:Object,name$ )`
+
+Register a global object with Lua
+
+
+Once registered, the object can be accessed from within Lua scripts using the <b>name</b> identifer.
+
+
+

+ 11 - 0
docs/api/brl/brl_oggloader.md

@@ -0,0 +1,11 @@
+---
+id: brl.oggloader
+title: BRL.OGGLoader
+sidebar_label: BRL.OGGLoader
+---
+
+
+
+The OGG loader module provides the ability to load OGG format audio samples.
+
+

+ 27 - 0
docs/api/brl/brl_openalaudio.md

@@ -0,0 +1,27 @@
+---
+id: brl.openalaudio
+title: BRL.OpenALAudio
+sidebar_label: BRL.OpenALAudio
+---
+
+
+
+The OpenAL audio module provide OpenAL drivers for use with the audio module.
+
+
+## Functions
+
+### `Function EnableOpenALAudio:Int()`
+
+Enable OpenAL Audio
+
+
+After successfully executing this command, OpenAL audio drivers will be added
+to the array of drivers returned by [AudioDrivers](../../brl/brl.audio/#function-audiodrivers).
+
+
+#### Returns
+True if successful
+
+
+

+ 251 - 0
docs/api/brl/brl_pixmap.md

@@ -0,0 +1,251 @@
+---
+id: brl.pixmap
+title: BRL.Pixmap
+sidebar_label: BRL.Pixmap
+---
+
+
+
+Pixmaps provide storage for rectangular regions of pixels.
+
+You can create a new pixmap using the [CreatePixmap](../../brl/brl.pixmap/#function-createpixmap-tpixmap-width-height-format-align-bytes-4) command, or load a pixmap 
+using [LoadPixmap](../../brl/brl.pixmap/#method-loadpixmap-tpixmap-stream-tstream-abstract).
+
+Pixmaps have 5 properties: width, height, a byte pointer to the pixmap's pixels, pitch and
+format.
+
+You can retrieve a pointer to a pixmap's pixels using the [PixmapPixelPtr](../../brl/brl.pixmap/#function-pixmappixelptr-byte-ptr-pixmap-tpixmap-x-0-y-0) command.
+
+A pixmap's pitch refers to the number of bytes between one row of pixels in the pixmap
+and the next. To retrieve a pixmap's pitch, use the [PixmapPitch](../../brl/brl.pixmap/#function-pixmappitch-pixmap-tpixmap) command.
+
+A pixmap's pixel format determines how the pixels within a pixmap are stored in memory. This 
+must be taken into account if you want to access pixels directly via a pixmap's pixel pointer.
+You can retrieve the format of a pixmap using the [PixmapFormat](../../brl/brl.pixmap/#function-pixmapformat-pixmap-tpixmap) command, and convert pixmaps
+from one format to another using [ConvertPixmap](../../brl/brl.pixmap/#function-convertpixmap-tpixmap-pixmap-tpixmap-format).
+
+You can also use [ResizePixmap](../../brl/brl.pixmap/#function-resizepixmap-tpixmap-pixmap-tpixmap-width-height-nodebug) to resize a pixmap and flip a pixmap horizontally or vertically
+with [XFlipPixmap](../../brl/brl.pixmap/#function-xflippixmap-tpixmap-pixmap-tpixmap-nodebug) and [YFlipPixmap](../../brl/brl.pixmap/#function-yflippixmap-tpixmap-pixmap-tpixmap-nodebug).
+
+
+## Types
+| Type | Description |
+|---|---|
+| [TPixmap](../../brl/brl.pixmap/tpixmap) | The Pixmap type |
+| [TPixmapLoader](../../brl/brl.pixmap/tpixmaploader) | Abstract base type for pixmap loaders |
+
+## Functions
+
+### `Function CreatePixmap:TPixmap( width,height,format,align_bytes=4 )`
+
+Create a pixmap
+
+
+<b>format</b> should be one of the following:
+
+<table><tr><td> <b>Format</b></td><td><b>Description</b></td></tr><tr><td>  PF_A8</td><td>8 bit alpha</td></tr><tr><td>  PF_I8</td><td>8 bit intensity</td></tr><tr><td>  PF_RGB888</td><td>24 bit big endian RGB</td></tr><tr><td>  PF_BGR888</td><td>24 bit little endian RGB</td></tr><tr><td>  PF_RGBA8888</td><td>32 bit big endian RGB with alpha</td></tr><tr><td>  PF_BGRA8888</td><td>32 bit little endian RGB with alpha</table>
+
+
+Note that the newly created pixmap will contain random data. [ClearPixels](../../brl/brl.pixmap/#method-clearpixels-argb) can
+be used to set all pixels to a known value prior to use.
+
+
+#### Returns
+A new pixmap object of the specified <b>width</b> and <b>height</b>
+
+
+
+### `Function CreateStaticPixmap:TPixmap( pixels:Byte Ptr,width,height,pitch,format )`
+
+Create a pixmap with existing pixel data
+
+
+The memory referenced by a static pixmap is not released when the pixmap is deleted.
+
+See [CreatePixmap](../../brl/brl.pixmap/#function-createpixmap-tpixmap-width-height-format-align-bytes-4) for valid pixmap formats.
+
+
+#### Returns
+A new pixmap object that references an existing block of memory
+
+
+
+### `Function CopyPixmap:TPixmap( pixmap:TPixmap )`
+
+Copy a pixmap
+
+#### Returns
+A new pixmap object
+
+
+
+### `Function ConvertPixmap:TPixmap( pixmap:TPixmap,format )`
+
+Convert pixel format of a pixmap
+
+
+See [CreatePixmap](../../brl/brl.pixmap/#function-createpixmap-tpixmap-width-height-format-align-bytes-4) for valid pixmap formats.
+
+
+#### Returns
+A new pixmap object with the specified pixel format
+
+
+
+### `Function PixmapWidth( pixmap:TPixmap )`
+
+Get pixmap width
+
+#### Returns
+The width, in pixels, of <b>pixmap</b>
+
+
+
+### `Function PixmapHeight( pixmap:TPixmap )`
+
+Get pixmap width
+
+#### Returns
+The height, in pixels, of <b>pixmap</b>
+
+
+
+### `Function PixmapPitch( pixmap:TPixmap )`
+
+Get pixmap pitch
+
+
+Pitch refers to the difference, in bytes, between the start of one row of pixels and the start of the next row.
+
+
+#### Returns
+The pitch, in bytes, of <b>pixmap</b>
+
+
+
+### `Function PixmapFormat( pixmap:TPixmap )`
+
+Get pixmap format
+
+
+See [CreatePixmap](../../brl/brl.pixmap/#function-createpixmap-tpixmap-width-height-format-align-bytes-4) for supported formats.
+
+
+#### Returns
+The format of the pixels stored in <b>pixmap</b>
+
+
+
+### `Function PixmapPixelPtr:Byte Ptr( pixmap:TPixmap,x=0,y=0 )`
+
+Get pixmap pixels
+
+#### Returns
+A byte pointer to the pixels stored in <b>pixmap</b>
+
+
+
+### `Function PixmapWindow:TPixmap( pixmap:TPixmap,x,y,width,height )`
+
+Create a pixmap window
+
+[PixmapWindow](../../brl/brl.pixmap/#function-pixmapwindow-tpixmap-pixmap-tpixmap-x-y-width-height) creates a 'virtual' window into <b>pixmap</b>.
+
+
+#### Returns
+A new pixmap object
+
+
+
+### `Function MaskPixmap:TPixmap( pixmap:TPixmap,mask_red,mask_green,mask_blue ) NoDebug`
+
+Mask a pixmap
+
+<b>MaskPixmap</b> builds a new pixmap with alpha components set to '0' wherever the pixel colors
+in the original <b>pixmap</b> match <b>mask_red</b>, <b>mask_green</b> and <b>mask_blue</b>. <b>mask_red</b>, <b>mask_green</b> and <b>mask_blue</b>
+should be in the range 0 to 255.
+
+
+#### Returns
+A new pixmap object
+
+
+
+### `Function XFlipPixmap:TPixmap( pixmap:TPixmap ) NoDebug`
+
+Flip a pixmap horizontally
+
+#### Returns
+A new pixmap object
+
+
+
+### `Function YFlipPixmap:TPixmap( pixmap:TPixmap ) NoDebug`
+
+Flip a pixmap vertically
+
+#### Returns
+A new pixmap object
+
+
+
+### `Function ResizePixmap:TPixmap( pixmap:TPixmap,width,height ) NoDebug`
+
+Resize a pixmap
+
+#### Returns
+A new pixmap object of the specified <b>width</b> and <b>height</b>
+
+
+
+### `Function LoadPixmap:TPixmap( url:Object )`
+
+Load a pixmap
+
+#### Returns
+A pixmap object
+
+
+
+### `Function ReadPixel( pixmap:TPixmap,x,y )`
+
+Read a pixel from a pixmap
+
+
+The returned 32 bit value contains the following components:
+
+<table><tr><td> bits 24-31</td><td>pixel alpha</td></tr><tr><td>  bits 16-23</td><td>pixel red</td></tr><tr><td>  bits 8-15</td><td>pixel green</td></tr><tr><td>  bits 0-7</td><td>pixel blue</table>
+
+
+
+#### Returns
+A 32 bit pixel value
+
+
+
+### `Function WritePixel( pixmap:TPixmap,x,y,argb )`
+
+Write a pixel to a pixmap
+
+
+The 32 bit <b>argb</b> value contains the following components:
+
+<table><tr><td> bits 24-31</td><td>pixel alpha</td></tr><tr><td>  bits 16-23</td><td>pixel red</td></tr><tr><td>  bits 8-15</td><td>pixel green</td></tr><tr><td>  bits 0-7</td><td>pixel blue</table>
+
+
+
+
+### `Function ClearPixels( pixmap:TPixmap,argb=0 )`
+
+Clear a pixmap
+
+
+Sets all pixels in a pixmap to a 32 bit pixel value.
+
+The 32 bit <b>argb</b> value contains the following components:
+
+<table><tr><td> bits 24-31</td><td>pixel alpha</td></tr><tr><td>  bits 16-23</td><td>pixel red</td></tr><tr><td>  bits 8-15</td><td>pixel green</td></tr><tr><td>  bits 0-7</td><td>pixel blue</table>
+
+
+
+

+ 37 - 0
docs/api/brl/brl_pngloader.md

@@ -0,0 +1,37 @@
+---
+id: brl.pngloader
+title: BRL.PNGLoader
+sidebar_label: BRL.PNGLoader
+---
+
+
+
+The PNG loader module provides the ability to load PNG format pixmaps.
+
+
+## Functions
+
+### `Function LoadPixmapPNG:TPixmap( url:Object )`
+
+Load a Pixmap in PNG format
+
+
+[LoadPixmapPNG](../../brl/brl.pngloader/#function-loadpixmappng-tpixmap-url-object) loads a pixmap from <b>url</b> in PNG format.
+
+If the pixmap cannot be loaded, Null is returned.
+
+
+
+### `Function SavePixmapPNG( pixmap:TPixmap,url:Object,compression=5 )`
+
+Save a Pixmap in PNG format
+
+
+[SavePixmapPNG](../../brl/brl.pngloader/#function-savepixmappng-pixmap-tpixmap-url-object-compression-5) saves <b>pixmap</b> to <b>url</b> in PNG format. If successful, [SavePixmapPNG](../../brl/brl.pngloader/#function-savepixmappng-pixmap-tpixmap-url-object-compression-5) returns
+True, otherwise False.
+
+The optional <b>compression</b> parameter should be in the range 0 to 9, where
+0 indicates no compression (fastest) and 9 indicates full compression (slowest).
+
+
+

+ 360 - 0
docs/api/brl/brl_polledinput.md

@@ -0,0 +1,360 @@
+---
+id: brl.polledinput
+title: BRL.PolledInput
+sidebar_label: BRL.PolledInput
+---
+
+
+<h1>Polled input</h1>
+
+The polled input module provides an easy way to detect keyboard and mouse input.
+
+The functions in this module are only available when your program is running in [Graphics](../../brl/brl.graphics/#function-graphics-tgraphics-width-height-depth-0-hertz-60-flags-0) mode. When working on GUI applications, you should use events instead.
+
+
+## Functions
+
+### `Function AppSuspended()`
+
+Get app suspended state
+
+#### Returns
+True if application is currently suspended.
+
+
+
+### `Function AppTerminate()`
+
+Return app terminate state
+
+#### Returns
+True if user has requested to terminate application
+
+
+#### Example
+```blitzmax
+Graphics 640,480,0
+
+While Not AppTerminate() Or Not Confirm( "Terminate?" )
+
+	Cls
+	DrawText MouseX()+","+MouseY(),0,0
+	Flip
+
+Wend
+```
+
+### `Function KeyHit( key )`
+
+Check for key hit
+
+
+The returned value represents the number of the times <b>key</b> has been hit since the last
+call to [KeyHit](../../brl/brl.polledinput/#function-keyhit-key) with the same <b>key</b>.
+
+See the key codes module for a list of valid key codes.
+
+
+#### Returns
+Number of times <b>key</b> has been hit.
+
+
+#### Example
+```blitzmax
+' keyhit.bmx
+
+' the following code draws a circle every time the
+' program detects the spacebar has been pressed
+' and exits when it detects the ESCAPE key has
+' been pressed
+
+graphics 640,480
+while not keyhit(KEY_ESCAPE)
+	cls
+	if keyhit(KEY_SPACE) drawoval 0,0,640,480
+	flip
+wend
+```
+
+### `Function KeyDown( key )`
+
+Check for key state
+
+
+See the key codes module for a list of valid keycodes.
+
+
+#### Returns
+[True](../../brl/brl.blitz/#true) if <b>key</b> is currently down
+
+
+#### Example
+```blitzmax
+' keydown.bmx
+
+' the following code draws a circle if the
+' program detects the spacebar is pressed
+' and exits when it detects the ESCAPE key has
+' been pressed
+
+Graphics 640,480
+While Not KeyHit(KEY_ESCAPE)
+	Cls
+	If KeyDown(KEY_SPACE) DrawOval 0,0,640,480
+	Flip
+Wend
+```
+
+### `Function GetChar()`
+
+Get next character
+
+
+As the user hits keys on the keyboard, BlitzMax records the character codes of these
+keystrokes into an internal 'character queue'.
+
+[GetChar](../../brl/brl.polledinput/#function-getchar) removes the next character code from this queue and returns it the application.
+
+If the character queue is empty, 0 is returned.
+
+
+#### Returns
+The character code of the next character.
+
+
+
+### `Function FlushKeys(resetStates:Int = True)`
+
+Flush key states and character queue.
+
+
+[FlushKeys](../../brl/brl.polledinput/#function-flushkeys-resetstates-int-true) resets the state of all keys to 'off', and resets the character queue
+used by [GetChar](../../brl/brl.polledinput/#function-getchar).
+
+
+
+### `Function MouseX()`
+
+Get mouse x location
+
+
+The returned value is relative to the left of the screen.
+
+
+#### Returns
+Mouse x axis location
+
+
+#### Example
+```blitzmax
+' mousex.bmx
+
+' the following tracks the position of the mouse
+
+graphics 640,480
+while not keyhit(KEY_ESCAPE)
+	cls
+	drawoval mousex()-10,mousey()-10,20,20
+	flip
+wend
+```
+
+### `Function MouseY()`
+
+Get mouse y location
+
+
+The returned value is relative to the top of the screen.
+
+
+#### Returns
+Mouse y axis location
+
+
+#### Example
+```blitzmax
+' mousey.bmx
+
+' the following tracks the position of the mouse
+
+graphics 640,480
+while not keyhit(KEY_ESCAPE)
+	cls
+	drawrect mousex()-10,mousey()-10,20,20
+	flip
+wend
+```
+
+### `Function MouseZ()`
+
+Get mouse wheel
+
+
+The mouse wheel value increments when the mouse wheel is rolled 'away' from the user, and
+decrements when the mouse wheel is rolled 'towards' the user.
+
+
+#### Returns
+Mouse wheel value
+
+
+#### Example
+```blitzmax
+' mousez.bmx
+
+' prints mousez() the mousewheel position
+
+Graphics 640,480
+While Not keyhit(KEY_ESCAPE)
+	cls
+	drawtext "MouseZ()="+MouseZ(),0,0
+	flip
+Wend
+```
+
+### `Function MouseXSpeed()`
+
+Get mouse x speed
+
+#### Returns
+Mouse x speed
+
+
+
+### `Function MouseYSpeed()`
+
+Get mouse y speed
+
+#### Returns
+Mouse y speed
+
+
+
+### `Function MouseZSpeed()`
+
+Get mouse z speed
+
+#### Returns
+Mouse z speed
+
+
+
+### `Function FlushMouse()`
+
+Flush mouse button states
+
+
+[FlushMouse](../../brl/brl.polledinput/#function-flushmouse) resets the state of all mouse buttons to 'off'.
+
+
+
+### `Function MouseHit( button )`
+
+Check for mouse button click
+
+
+The returned value represents the number of the times <b>button</b> has been clicked since the
+last call to [MouseHit](../../brl/brl.polledinput/#function-mousehit-button) with the same <b>button</b>.
+
+<b>button</b> should be 1 for the left mouse button, 2 for the right mouse button or 3 for the
+middle mouse button.
+
+
+#### Returns
+Number of times <b>button</b> has been clicked.
+
+
+#### Example
+```blitzmax
+' mousehit.bmx
+
+graphics 640,480
+
+while not keyhit(KEY_ESCAPE)
+	cls
+	if mousehit(1) drawrect 0,0,200,200
+	if mousehit(2) drawrect 200,0,200,200
+	if mousehit(3) drawrect 400,0,200,200
+	flip
+wend
+```
+
+### `Function MouseDown( button )`
+
+Check for mouse button down state
+
+
+<b>button</b> should be 1 for the left mouse button, 2 for the right mouse button or 3 for the
+middle mouse button.
+
+
+#### Returns
+[True](../../brl/brl.blitz/#true) if <b>button</b> is currently down
+
+
+#### Example
+```blitzmax
+' mousedown.bmx
+
+graphics 640,480
+
+while not keyhit(KEY_ESCAPE)
+	cls
+	if mousedown(1) drawrect 0,0,200,200
+	if mousedown(2) drawrect 200,0,200,200
+	if mousedown(3) drawrect 400,0,200,200
+	flip
+wend
+```
+
+### `Function WaitKey()`
+
+Wait for a key press
+
+
+[WaitKey](../../brl/brl.polledinput/#function-waitkey) suspends program execution until a key has been hit. The keycode of this
+key is then returned to the application.
+
+See the key codes module for a list of valid keycodes.
+
+
+#### Returns
+The keycode of the pressed key
+
+
+
+### `Function WaitChar()`
+
+Wait for a key press
+
+
+[WaitChar](../../brl/brl.polledinput/#function-waitchar) suspends program execution until a character is available from [GetChar](../../brl/brl.polledinput/#function-getchar). This
+character is then returned to the application.
+
+
+#### Returns
+The character code of the pressed key
+
+
+
+### `Function WaitMouse()`
+
+Wait for mouse button click
+
+
+[WaitMouse](../../brl/brl.polledinput/#function-waitmouse) suspends program execution until a mouse button is clicked.
+
+[WaitMouse](../../brl/brl.polledinput/#function-waitmouse) returns 1 if the left mouse button was clicked, 2 if the right mouse button was
+clicked or 3 if the middle mouse button was clicked.
+
+
+#### Returns
+The clicked button
+
+
+
+### `Function SetAutoPoll(value:Int)`
+
+Enables or disables autopolling.
+
+

+ 25 - 0
docs/api/brl/brl_ramstream.md

@@ -0,0 +1,25 @@
+---
+id: brl.ramstream
+title: BRL.RamStream
+sidebar_label: BRL.RamStream
+---
+
+
+## Functions
+
+### `Function CreateRamStream:TRamStream( ram:Byte Ptr,size:Long,readable,writeable )`
+
+Create a ram stream
+
+A ram stream allows you to read and/or write data directly from/to memory.
+A ram stream extends a stream object so can be used anywhere a stream is expected.
+
+Be careful when working with ram streams, as any attempt to access memory
+which has not been allocated to your application can result in a runtime crash.
+
+
+#### Returns
+A ram stream object
+
+
+

+ 234 - 0
docs/api/brl/brl_random.md

@@ -0,0 +1,234 @@
+---
+id: brl.random
+title: BRL.Random
+sidebar_label: BRL.Random
+---
+
+
+<h1>Random numbers</h1>
+
+The random module contains commands for generating random numbers.
+
+The numbers generated are not really random, as without special hardware support a software algorithm cannot produce 'real' random numbers.
+
+Instead, the algorithm produces values that merely appear to be random. In reality, each generated value actually depends on the previously generated value.
+
+You can set the 'state' of the random number generator using the [SeedRnd](../../brl/brl.random/#function-seedrnd-seed-int) command. A common practice is to seed the random number generator with the system time when your program starts up, for example:
+```
+SeedRnd MilliSecs()
+````
+
+This ensures that the random number generator does not start in the same state each time your program is run, which would cause it to produce the same sequence of random numbers.
+
+
+## Functions
+
+### `Function RndFloat#()`
+
+Generate random float
+
+#### Returns
+A random float in the range 0 (inclusive) to 1 (exclusive)
+
+
+#### Example
+```blitzmax
+' RndFloat.bmx
+' Two players take turns shooting at a target. The first hit wins.
+' Player 1 hits 30% of the time, player 2 hits 40%.
+' What is the probability that player 1 wins?
+
+Function winner()   ' play game once, return winner 1 or 2
+    Repeat
+        If RndFloat() < 0.3 Then Return 1
+        If RndFloat() < 0.4 Then Return 2
+    Forever
+End Function
+
+Local count[3]
+
+trials = 1000000
+
+For n = 1 to trials
+    count[ winner() ] :+ 1
+Next
+
+Print "Estimated probability = " + ( Float( count[1] ) / Float( trials ) )
+Print
+Print "    Exact probability = " + ( 15.0 / 29.0 )
+
+Input ; End
+```
+
+### `Function RndDouble!()`
+
+Generate random double
+
+#### Returns
+A random double in the range 0 (inclusive) to 1 (exclusive)
+
+
+#### Example
+```blitzmax
+' RndDouble.bmx
+' Two players take turns shooting at a target. The first hit wins.
+' Player 1 hits 30% of the time, player 2 hits 40%.
+' What is the probability that player 1 wins?
+
+Function winner()   ' play game once, return winner 1 or 2
+    Repeat
+        If RndDouble() < 0.3 Then Return 1
+        If RndDouble() < 0.4 Then Return 2
+    Forever
+End Function
+
+Local count[3]
+
+trials = 1000000
+
+For n = 1 to trials
+    count[ winner() ] :+ 1
+Next
+
+Print "Estimated probability = " + ( Double( count[1] ) / Double( trials ) )
+Print
+Print "    Exact probability = " + ( 15.0 / 29.0 )
+
+Input ; End
+```
+
+### `Function Rnd!( min_value!=1,max_value!=0 )`
+
+Generate random double
+
+
+The optional parameters allow you to use Rnd in 3 ways:
+
+<table><tr><td> <b>Format</b></td><td><b>Result</b></td></tr><tr><td>  &Rnd()</td><td>Random double in the range 0 (inclusive) to 1 (exclusive)</td></tr><tr><td>  &Rnd(_x_)</td><td>Random double in the range 0 (inclusive) to n (exclusive)</td></tr><tr><td>  &Rnd(_x,y_)</td><td>Random double in the range x (inclusive) to y (exclusive)</table>
+
+
+
+#### Returns
+A random double in the range min (inclusive) to max (exclusive)
+
+
+#### Example
+```blitzmax
+' Rnd.bmx
+' Use Rnd() to estimate area inside the unit circle x^2 + y^2 = 1.
+
+totalpoints = 1000000
+
+For n = 1 to totalpoints
+    x! = Rnd( -1.0, 1.0 )               ' Generate random point in 2 by 2 square.
+    y! = Rnd( -1.0, 1.0 )
+
+    If x*x + y*y < 1.0 Then inpoints :+ 1     ' point is inside the circle
+Next
+
+' Note: Ratio of areas circle/square is exactly Pi/4.
+
+Print "Estimated area = " + ( 4.0 * Double(inpoints)/Double(totalpoints) )
+Print
+Print "    Exact area = " + Pi     '  4 * Pi/4, compare with estimate
+
+Input ; End
+```
+
+### `Function Rand:Int( min_value:Int,max_value:Int=1 )`
+
+Generate random integer
+
+
+The optional parameter allows you to use [Rand](../../brl/brl.random/#function-rand-int-min-value-int-max-value-int-1) in 2 ways:
+
+<table><tr><td> <b>Format</b></td><td><b>Result</b></td></tr><tr><td>  &Rand(x)</td><td>Random integer in the range 1 to x (inclusive)</td></tr><tr><td>  &Rand(x,y)</td><td>Random integer in the range x to y (inclusive)</table>
+
+
+
+#### Returns
+A random integer in the range min (inclusive) to max (inclusive)
+
+
+#### Example
+```blitzmax
+' Rand.bmx
+' Toss a pair of dice. Result is in the range 1+1 to 6+6.
+' Count how many times each result appears.
+
+Local count[13]
+
+For n = 1 To 3600
+    toss = Rand(1,6) + Rand(1,6)
+    count[toss] :+ 1
+Next
+
+For toss = 2 To 12
+    Print LSet(toss, 5)+count[toss]
+Next
+```
+
+### `Function SeedRnd( seed:Int )`
+
+Set random number generator seed
+
+#### Example
+```blitzmax
+' RndSeed.bmx and SeedRnd.bmx ( one example for both )
+' Get/Set random number seed.
+
+SeedRnd MilliSecs()
+
+seed=RndSeed()
+
+Print "Initial seed="+seed
+
+For k=1 To 10
+Print Rand(10)
+Next
+
+Print "Restoring seed"
+
+SeedRnd seed
+
+For k=1 To 10
+Print Rand(10)
+Next
+```
+
+### `Function RndSeed:Int()`
+
+Get random number generator seed
+
+Use in conjunction with SeedRnd, RndSeed allows you to reproduce sequences of random
+numbers.
+
+
+#### Returns
+The current random number generator seed
+
+
+#### Example
+```blitzmax
+' RndSeed.bmx and SeedRnd.bmx ( one example for both )
+' Get/Set random number seed.
+
+SeedRnd MilliSecs()
+
+seed=RndSeed()
+
+Print "Initial seed="+seed
+
+For k=1 To 10
+Print Rand(10)
+Next
+
+Print "Restoring seed"
+
+SeedRnd seed
+
+For k=1 To 10
+Print Rand(10)
+Next
+```
+

+ 139 - 0
docs/api/brl/brl_reflection.md

@@ -0,0 +1,139 @@
+---
+id: brl.reflection
+title: BRL.Reflection
+sidebar_label: BRL.Reflection
+---
+
+
+<h1>Reflection</h1>
+
+BlitzMax provides limited support for a form of runtime <i>reflection</i>.
+
+Using reflection, programs can 'inspect' objects and types at runtime. You can determine the fields and methods contained in an object or type, set and get object fields and invoke - or 'call' - object methods.
+
+To use reflection, you first need a TTypeId object. TTypeId objects correspond to BlitzMax user defined types, and there is a single TTypeId object for every user defined type in the program. There are also TTypeId objects for the 'primitive' types - byte, short, int, long, float, double and string. TTypeId objects are returned by the <b>TTypeId.ForName</b> and <b>TTypeId.ForObject</b> functions.
+
+Once you have a TTypeId object, you can inspect the fields and methods of a user defined type using the <b>EnumFields</b> and <b>EnumMethods</b> methods. These methods return <b>TField</b> and <b>TMethod</b> objects that describe the fields and methods within the type. For example:
+```
+Strict
+
+Type TMyType
+	Field x,y,z
+End Type
+
+Local id:TTypeId=TTypeId.ForName( "TMyType" )
+
+For Local fld:TField=EachIn id.EnumFields()
+   Print fld.Name()+":"+fld.TypeId().Name()
+Next
+````
+
+This simple program will print "x:Int", "y:Int" and "z:Int" - the names and types of the fields within TMyType. Note that this is done without actually creating a new TMyType.
+
+The following example sets the fields of an object:
+```
+Strict
+
+Type TMyType
+	Field x,y,z
+End Type
+
+Local obj:TMyType=New TMyType
+Local id:TTypeId=TTypeId.ForObject( obj )
+
+For Local fld:TField=EachIn id.EnumFields()
+	fld.Set obj,String( Rand(10) )
+Next
+
+Print obj.x+","+obj.y+","+obj.z
+````
+
+In this case we need an actual instance of TMyType, otherwise we have nothing to set the fields of! Also, we have used TTypeId.ForObject instead of TTypeId.ForName to get a TTypeId. While in this case TTypeId.ForName could have been used to achieve the same result, in general we may not know the exact type of the object, and therefore we wont know its type name.
+
+Also note that the code that actually sets the fields uses String( Rand(10) ). This is because the <b>Set</b> method takes an object - but our fields are ints! BlitzMax reflection deals with this by using strings to represent numeric types. The same rule applies to the <b>Get</b> method. Any numeric fields will be returned as strings which you must then convert to the appropriate type if necessary.
+
+Finally, let's invoke an object method:
+```
+Strict
+
+Type TMyType
+	Method Update( t# )
+		Print "TMyType.Update:"+t
+	End Method
+End Type
+
+Local obj:TMyType=New TMyType
+Local id:TTypeId=TTypeId.ForObject( obj )
+
+Local update:TMethod=id.FindMethod( "Update" )
+
+update.Invoke obj,[String( .25 )]
+````
+
+This example uses <b>FindMethod</b> to locate a type method and <b>Invoke</b> to call it. Arguments to the method are contained in an object array, and again the float argument is converted to a string.
+
+In addition to the TTypeId, TField and TMethod types, the BlitzMax reflection module also declares a number of global TTypeId objects: 
+* <b>ByteTypeId</b>
+* <b>ShortTypeId</b>
+* <b>IntTypeId</b>
+* <b>LongTypeId</b>
+* <b>FloatTypeId</b>
+* <b>DoubleTypeId</b>
+* <b>StringTypeId</b>
+* <b>ObjectTypeId</b>
+These may be used instead of the corresponding TTypeId.ForName call. For example, <b>TTypeId.ForName( "Int" )</b> and <b>IntTypeId</b> will return the same object.
+
+
+## Types
+| Type | Description |
+|---|---|
+| [TMember](../../brl/brl.reflection/tmember) | Type member - Field Or Method. |
+| [TConstant](../../brl/brl.reflection/tconstant) | Type constant |
+| [TField](../../brl/brl.reflection/tfield) | Type field |
+| [TGlobal](../../brl/brl.reflection/tglobal) | Type global |
+| [TFunction](../../brl/brl.reflection/tfunction) | Type function |
+| [TMethod](../../brl/brl.reflection/tmethod) | Type method |
+| [TTypeId](../../brl/brl.reflection/ttypeid) | Type id |
+
+## Globals
+
+### `Global ByteTypeId:TTypeId`
+
+Primitive byte type
+
+
+### `Global ShortTypeId:TTypeId`
+
+Primitive short type
+
+
+### `Global IntTypeId:TTypeId`
+
+Primitive int type
+
+
+### `Global UIntTypeId:TTypeId`
+
+Primitive unsigned int type
+
+
+### `Global LongTypeId:TTypeId`
+
+Primitive long type
+
+
+### `Global ULongTypeId:TTypeId`
+
+Primitive unsigned long type
+
+
+### `Global FloatTypeId:TTypeId`
+
+Primitive float type
+
+
+### `Global DoubleTypeId:TTypeId`
+
+Primitive double type
+
+

+ 185 - 0
docs/api/brl/brl_retro.md

@@ -0,0 +1,185 @@
+---
+id: brl.retro
+title: BRL.Retro
+sidebar_label: BRL.Retro
+---
+
+
+
+The BASIC compatibility module provides miscellaneous functions that emulate the behaviour
+of 'classic' BASIC.
+
+The functions in this module have largely been superceded by BlitzMax features such as 
+'string slicing', and the Find, Replace, Trim, ToLower and ToUpper string methods.
+
+However, for programmers from a classic BASIC background, these utility functions should make
+the transition to BlitzMax a little easier.
+
+NOTE: Strings in classic BASIC are '1 based'. This means that the first character within a 
+string is at index 1, the second at index 2 and so on. However, BlitzMax strings are '0 based',
+meaning the first character is at index 0, the second at index 1 and so on. The [instr](../../brl/brl.retro/#function-instr-str-sub-start-1) and
+[Mid](../../brl/brl.retro/#function-mid-str-pos-size-1) functions in this module retain the '1 based' behaviour of classic BASIC.
+
+
+## Functions
+
+### `Function Mid$( str$,pos,size=-1 )`
+
+Extract substring from a string
+
+
+The Mid$ command returns a substring of a String.
+
+Given an existing string, a <b>position</b> from the start of the string and
+an optional <b>size</b>, [Mid](../../brl/brl.retro/#function-mid-str-pos-size-1) creates a new string equal to the section specified.
+If no size if given, [Mid](../../brl/brl.retro/#function-mid-str-pos-size-1) returns the characters in the existing string from
+<b>position</b> to the end of the string.
+
+For compatibility with classic BASIC, the <b>pos</b> parameter is 'one based'.
+
+
+#### Returns
+A sequence of characters from <b>str</b> starting at position <b>pos</b> and of length <b>size</b>
+
+
+
+### `Function Instr( str$,sub$,start=1 )`
+
+Find a string within a string
+
+
+The <b>start</b> parameter allows you to specifying a starting index for the search.
+
+For compatiblity with classic BASIC, the <b>start</b> parameter and returned position
+are both 'one based'.
+
+
+#### Returns
+The position within <b>str</b> of the first matching occurance of <b>sub</b>
+
+
+
+### `Function Left$( str$,n )`
+
+Extract characters from the beginning of a string
+
+
+The Left$ command returns a substring of a String.
+Given an existing String and a <b>size</b>, Left$ returns the first <b>size</b>
+characters from the start of the String in a new String.
+
+
+#### Returns
+<b>size</b> leftmost characers of <b>str</b>
+
+
+
+### `Function Right$( str$,n )`
+
+Extract characters from the end of a string
+
+
+The Right$ command returns a substring of a String.
+Given an existing String and a <b>size</b>, Right$ returns the last <b>size</b>
+characters from the end of the String.
+
+
+#### Returns
+<b>size</b> rightmost characters of <b>str</b>
+
+
+
+### `Function LSet$( str$,n )`
+
+Left justify string
+
+#### Returns
+A string of length <b>n</b>, padded with spaces
+
+
+
+### `Function RSet$( str$,n )`
+
+Right justify string
+
+#### Returns
+A string of length <b>n</b>, padded with spaces
+
+
+
+### `Function Replace$( str$,sub$,replaceWith$ )`
+
+Performs a search and replace function
+
+
+The Replace$ command replaces all instances of one string with another.
+
+
+#### Returns
+A string with all instances of <b>sub</b>$ replaced by <b>replace</b>$
+
+
+
+### `Function Trim$( str$ )`
+
+Remove unprintable characters from ends a string
+
+#### Returns
+<b>str</b> with leading and trailing unprintable characters removed
+
+
+
+### `Function Lower$( str$ )`
+
+Convert string to lowercase
+
+#### Returns
+Lowercase equivalent of <b>str</b>
+
+
+
+### `Function Upper$( str$ )`
+
+Convert string to uppercase
+
+#### Returns
+Uppercase equivalent of <b>str</b>
+
+
+
+### `Function Hex$( val )`
+
+Convert an integer value to a hexadecimal string
+
+#### Returns
+The hexadecimal string representation of <b>val</b>
+
+
+
+### `Function Bin$( val )`
+
+Convert an integer value to a binary string
+
+#### Returns
+The binary string representation of <b>val</b>
+
+
+
+### `Function LongHex$( val:Long )`
+
+Convert a 64 bit long integer value to a hexadecimal string
+
+#### Returns
+The hexadecimal string representation of <b>val</b>
+
+
+
+### `Function LongBin$( val:Long )`
+
+Convert a 64 bit long integer value to a binary string
+
+#### Returns
+The binary string representation of <b>val</b>
+
+
+

+ 203 - 0
docs/api/brl/brl_socket.md

@@ -0,0 +1,203 @@
+---
+id: brl.socket
+title: BRL.Socket
+sidebar_label: BRL.Socket
+---
+
+
+## Functions
+
+### `Function CreateUDPSocket:TSocket()`
+
+Create a UDP socket
+
+
+The new socket is not bound to any local or remote address.
+
+
+#### Returns
+A new socket
+
+
+
+### `Function CreateTCPSocket:TSocket()`
+
+Create a TCP socket
+
+
+The new socket is not bound to any local or remote address.
+
+
+#### Returns
+A new socket
+
+
+
+### `Function CloseSocket( socket:TSocket )`
+
+Close a socket
+
+
+All sockets should eventually be closed. Once closed, a socket can no longer
+be used.
+
+
+
+### `Function BindSocket( socket:TSocket, localPort, family:Int = AF_INET_)`
+
+Bind a socket to a local port
+
+
+If <b>localPort</b> is 0, a new local port will be allocated. If <b>localPort</b> is not 0,
+[BindSocket](../../brl/brl.socket/#function-bindsocket-socket-tsocket-localport-family-int-af-inet) will fail if there is already an application bound to <b>localPort</b>.
+
+
+#### Returns
+True if successful, otherwise false
+
+
+
+### `Function ConnectSocket( socket:TSocket, AddrInfo:TAddrInfo )`
+
+Connect a socket to a remote ip and port
+
+
+For both UDP and TCP sockets, [ConnectSocket](../../brl/brl.socket/#function-connectsocket-socket-tsocket-addrinfo-taddrinfo) will fail if the specified
+ip address could not be reached.
+
+In the case of TCP sockets, [ConnectSocket](../../brl/brl.socket/#function-connectsocket-socket-tsocket-addrinfo-taddrinfo) will also fail if there is
+no application listening at the remote port.
+
+
+#### Returns
+True if successful, otherwise false
+
+
+
+### `Function SocketListen( socket:TSocket,backlog=0 )`
+
+Start listening at a socket
+
+
+The specified socket must be a TCP socket, and must already be bound to a local port.
+
+
+
+### `Function SocketAccept:TSocket( socket:TSocket,timeout=0 )`
+
+Accept new connections on a listening socket
+
+
+The specified socket must be a TCP socket, and must be listening.
+
+
+#### Returns
+A new socket, or Null if no connection was made in the specified timeout
+
+
+
+### `Function SocketConnected( socket:TSocket )`
+
+Get socket connection status
+
+
+[SocketConnected](../../brl/brl.socket/#function-socketconnected-socket-tsocket) allows you to determine if a TCP connection is still
+alive or has been remotely closed.
+
+[SocketConnected](../../brl/brl.socket/#function-socketconnected-socket-tsocket) should only be used with TCP sockets that have already
+connected via [ConnectSocket](../../brl/brl.socket/#function-connectsocket-socket-tsocket-addrinfo-taddrinfo) or [SocketAccept](../../brl/brl.socket/#function-socketaccept-tsocket-socket-tsocket-timeout-0).
+
+
+#### Returns
+True if socket is connected
+
+
+
+### `Function SocketReadAvail( socket:TSocket )`
+
+Get number of bytes available for reading from a socket
+
+#### Returns
+Number of bytes that may be read without causing the socket to block
+
+
+
+### `Function SocketLocalIP:String( socket:TSocket )`
+
+Get local ip of a socket
+
+
+### `Function SocketLocalPort( socket:TSocket )`
+
+Get local port of a socket
+
+
+### `Function SocketRemoteIP:String( socket:TSocket )`
+
+Get remote ip of a socket
+
+
+### `Function SocketRemotePort( socket:TSocket )`
+
+Get remote port of a socket
+
+
+### `Function DottedIP$( ip:Int )`
+
+Convert an ip address to a dotted string
+
+#### Returns
+Dotted string version of ip address
+
+
+
+### `Function DottedIPToInt:Int(addr:String)`
+
+Converts a dotted IPv4 string to an ip address.
+
+#### Returns
+An integer version of an ip address.
+
+
+
+### `Function InetPton:Int(family:Int, src:String, dst:Byte Ptr)`
+
+Converts an IP address string into a binary representation.
+
+For AF_INET_, <b>dst</b> should be an Int or 32-bit (4 bytes) in size.
+For AF_INET6_, <b>dst</b> should be 128-bits (16 bytes) in size.
+
+
+
+### `Function HostIp:String( HostName$, index:Int=0, family:Int = AF_UNSPEC_ )`
+
+Convert a host name to an ip address
+
+#### Returns
+Host ip address, or 0 if host not found
+
+
+
+### `Function HostIps:String[]( HostName$, family:Int = AF_UNSPEC_ )`
+
+Get all ip addresses for a host name
+
+#### Returns
+Array of host ips, or Null if host not found
+
+
+
+### `Function HostName$( HostIp:String, family:Int = AF_UNSPEC_ )`
+
+Convert a host ip address to a name
+
+#### Returns
+Name of host, or Null if host not found
+
+
+
+### `Function AddrInfo:TAddrInfo[](host:String, service:String, hints:TAddrInfo)`
+
+Returns an array of TAddrInfo objects.
+
+

+ 35 - 0
docs/api/brl/brl_socketstream.md

@@ -0,0 +1,35 @@
+---
+id: brl.socketstream
+title: BRL.SocketStream
+sidebar_label: BRL.SocketStream
+---
+
+
+## Functions
+
+### `Function CreateSocketStream:TSocketStream( socket:TSocket,autoClose:Int=True )`
+
+Create a socket stream
+
+
+A socket stream allows you to treat a socket as if it were a stream.
+
+If <b>autoClose</b> is true, <b>socket</b> will be automatically closed when the socket
+stream is closed. Otherwise, it is up to you to somehow close <b>socket</b> at
+a later time.
+
+
+#### Returns
+A new socket stream
+
+
+
+### `Function SocketStreamSocket:TSocket( stream:TSocketStream )`
+
+Get underlying socket from a socket stream
+
+#### Returns
+The socket used to create the socket stream
+
+
+

+ 57 - 0
docs/api/brl/brl_standardio.md

@@ -0,0 +1,57 @@
+---
+id: brl.standardio
+title: BRL.StandardIO
+sidebar_label: BRL.StandardIO
+---
+
+
+The BlitzMax StandardIO module contains commands for reading and writing text to the standard IO (Input/Output) stream.<br>
+<br>
+The standard IO stream is generally connected to a 'console', allowing you to interact with an application in a very simple way.
+
+
+## Functions
+
+### `Function Print( str$="" )`
+
+Write a string to the standard IO stream
+
+A newline character is also written after <b>str</b>.
+
+
+#### Example
+```blitzmax
+Rem
+Use the Print command to output BlitzMax strings to the Console window.
+End Rem
+
+Print "Hello World"
+```
+
+### `Function Input$( prompt$=">" )`
+
+Receive a line of text from the standard IO stream
+
+The optional <b>prompt</b> is displayed before input is returned.
+
+
+#### Example
+```blitzmax
+Rem
+Use the Input command to read user input from the console to a BlitzMax String.
+End Rem
+
+name$=Input("What is your name")
+print "Hello "+name
+```
+
+## Globals
+
+### `Global StandardIOStream:TStream=TTextStream.Create( New TCStandardIO,TTextStream.UTF8 )`
+
+BlitzMax Stream object used for Print and Input
+
+The [Print](../../brl/brl.standardio/#function-print-str) and [Input](../../brl/brl.standardio/#function-input-prompt) commands can be redirected by setting the <b>StandardIOStream</b> Global to an alternative Stream Object.
+
+
+

+ 12 - 0
docs/api/brl/brl_stbimageloader.md

@@ -0,0 +1,12 @@
+---
+id: brl.stbimageloader
+title: BRL.StbImageLoader
+sidebar_label: BRL.StbImageLoader
+---
+
+
+
+The stb image loader module provides the ability to load different image format pixmaps.
+Supported formats include, BMP, PSD, TGA, GIF, HDR, PIC and PNM
+
+

+ 465 - 0
docs/api/brl/brl_stream.md

@@ -0,0 +1,465 @@
+---
+id: brl.stream
+title: BRL.Stream
+sidebar_label: BRL.Stream
+---
+
+
+
+Streams are used to read or write data in a sequential manner.
+
+BlitzMax supports many kinds of streams, including standard file streams 
+(for reading and writing to files), bank streams (for reading and writing to banks) and 
+endian streams (for swapping the byte order of stream data).
+
+Streams are usually created using [OpenStream](../../brl/brl.stream/#function-openstream-tstream-url-object-readable-int-true-writeable-int-true), [ReadStream](../../brl/brl.stream/#function-readstream-tstream-url-object) or [WriteStream](../../brl/brl.stream/#function-writestream-tstream-url-object). However,
+some kinds of streams provide their own methods for creating streams. For example, banks
+streams are created with the [CreateBankStream](../../brl/brl.bankstream/#function-createbankstream-tbankstream-bank-tbank) command.
+
+[OpenStream](../../brl/brl.stream/#function-openstream-tstream-url-object-readable-int-true-writeable-int-true), [ReadStream](../../brl/brl.stream/#function-readstream-tstream-url-object) and [WriteStream](../../brl/brl.stream/#function-writestream-tstream-url-object) all require a <i>url</i> parameter, which is used to
+'locate' the stream. A url is usually a string value.
+
+If the url contains the string "::", then a stream <i>protocol</i> is being specified. If not,
+then the url is assumed to be a simple filename.
+
+External modules can add their own stream protocols to the system, allowing you to use streams
+for a wide variety of purposes. For example, the "incbin::" protocol allows you to read data
+from a binary file that has been embedded in an application using the [Incbin](../../brl/brl.blitz/#incbin) command.
+
+Other protocols include "http::" for reading and writing data over a network, and 
+"littleendian::" and "bigendian::" for swapping the byte order of streams.
+
+To write to a stream, use one of the 'Write' style commands, such as [WriteByte](../../brl/brl.stream/#method-writebyte-n-int).
+
+To read from a stream, use one of the 'Read' style commands, such as [ReadByte](../../brl/brl.stream/#method-readbyte-int).
+
+Some kinds of streams (for example, file streams and bank streams) support <i>random access</i>.
+This means that you can modify where in the stream the next read or write is to occur using
+the [SeekStream](../../brl/brl.stream/#function-seekstream-long-stream-tstream-pos-long-whence-int-seek-set) command. You can also tell where you are in such streams using the 
+[StreamPos](../../brl/brl.stream/#function-streampos-long-stream-tstream) command.
+
+When you are finished with a stream, you should always close it using [CloseStream](../../brl/brl.stream/#function-closestream-stream-tstream).
+Failure to do so may result in a resource leak, or prevent the stream from successfully
+opening in future.
+
+
+## Types
+| Type | Description |
+|---|---|
+| [TStreamException](../../brl/brl.stream/tstreamexception) | Base exception type thrown by streams |
+| [TStreamReadException](../../brl/brl.stream/tstreamreadexception) | Exception type thrown by streams in the event of read errors |
+| [TStreamWriteException](../../brl/brl.stream/tstreamwriteexception) | Exception type thrown by streams in the event of write errors |
+| [TIO](../../brl/brl.stream/tio) | Base input/output type |
+| [TStream](../../brl/brl.stream/tstream) | Data stream type |
+| [TStreamWrapper](../../brl/brl.stream/tstreamwrapper) | Utility stream wrapper type |
+| [TCStream](../../brl/brl.stream/tcstream) | Standard C file stream type |
+| [TStreamFactory](../../brl/brl.stream/tstreamfactory) | Base stream factory type |
+
+## Functions
+
+### `Function OpenStream:TStream( url:Object,readable:Int=True,writeable:Int=True )`
+
+Open a stream for reading/writing
+
+All streams created by [OpenStream](../../brl/brl.stream/#function-openstream-tstream-url-object-readable-int-true-writeable-int-true), [ReadStream](../../brl/brl.stream/#function-readstream-tstream-url-object) or [WriteStream](../../brl/brl.stream/#function-writestream-tstream-url-object) should eventually be
+closed using [CloseStream](../../brl/brl.stream/#function-closestream-stream-tstream).
+
+
+#### Returns
+A stream object
+
+
+
+### `Function ReadStream:TStream( url:Object )`
+
+Open a stream for reading
+
+All streams created by [OpenStream](../../brl/brl.stream/#function-openstream-tstream-url-object-readable-int-true-writeable-int-true), [ReadStream](../../brl/brl.stream/#function-readstream-tstream-url-object) or [WriteStream](../../brl/brl.stream/#function-writestream-tstream-url-object) should eventually
+be closed using [CloseStream](../../brl/brl.stream/#function-closestream-stream-tstream).
+
+
+#### Returns
+A stream object
+
+
+#### Example
+```blitzmax
+' readstream.bmx
+
+' opens a read stream to the blitzbasic.com website and
+' dumps the homepage to the console using readline and print
+
+in=ReadStream("http::blitzbasic.com")
+
+If Not in RuntimeError "Failed to open a ReadStream to file http::www.blitzbasic.com"
+
+While Not Eof(in)
+	Print ReadLine(in)
+Wend
+CloseStream in
+```
+
+### `Function WriteStream:TStream( url:Object )`
+
+Open a stream for writing
+
+All streams created by [OpenStream](../../brl/brl.stream/#function-openstream-tstream-url-object-readable-int-true-writeable-int-true), [ReadStream](../../brl/brl.stream/#function-readstream-tstream-url-object) or [WriteStream](../../brl/brl.stream/#function-writestream-tstream-url-object) should eventually
+be closed using [CloseStream](../../brl/brl.stream/#function-closestream-stream-tstream).
+
+
+#### Returns
+A stream object
+
+
+#### Example
+```blitzmax
+' writestream.bmx
+
+' opens a write stream to the file mygame.ini and
+' outputs a simple text file using WriteLine
+
+out=WriteStream("mygame.ini")
+
+if not out RuntimeError "Failed to open a WriteStream to file mygame.ini"
+
+WriteLine out,"[display]"
+WriteLine out,"width=800"
+WriteLine out,"height=600"
+WriteLine out,"depth=32"
+WriteLine out,""
+WriteLine out,"[highscores]"
+WriteLine out,"AXE=1000"
+WriteLine out,"HAL=950"
+WriteLine out,"MAK=920"
+
+CloseStream out
+
+print "File mygame.ini created, bytes="+FileSize("mygame.ini")
+```
+
+### `Function Eof:Int( stream:TStream )`
+
+Get stream end of file status
+
+#### Returns
+True If stream is at end of file
+
+
+
+### `Function StreamPos:Long( stream:TStream )`
+
+Get current position of seekable stream
+
+#### Returns
+Current stream position, or -1 If stream is not seekable
+
+
+
+### `Function StreamSize:Long( stream:TStream )`
+
+Get current size of seekable stream
+
+#### Returns
+Current stream size in bytes, or -1 If stream is not seekable
+
+
+
+### `Function SeekStream:Long( stream:TStream, pos:Long, whence:Int = SEEK_SET_ )`
+
+Set stream position of seekable stream
+
+#### Returns
+New stream position, or -1 If stream is not seekable
+
+
+
+### `Function FlushStream( stream:TStream )`
+
+Flush a stream
+
+[FlushStream](../../brl/brl.stream/#function-flushstream-stream-tstream) writes any outstanding buffered data to <b>stream</b>.
+
+
+
+### `Function CloseStream( stream:TStream )`
+
+Close a stream
+
+
+All streams should be closed when they are no longer required.
+Closing a stream also flushes the stream before it closes.
+
+
+
+### `Function ReadByte:Int( stream:TStream )`
+
+Read a Byte from a stream
+
+[ReadByte](../../brl/brl.stream/#method-readbyte-int) reads a single Byte from <b>stream</b>.
+A TStreamReadException is thrown If there is not enough data available.
+
+
+#### Returns
+A Byte value
+
+
+
+### `Function ReadShort:Int( stream:TStream )`
+
+Read a Short from a stream
+
+[ReadShort](../../brl/brl.stream/#method-readshort-int) reads 2 bytes from <b>stream</b>.
+A TStreamReadException is thrown If there is not enough data available.
+
+
+#### Returns
+A Short value
+
+
+
+### `Function ReadInt:Int( stream:TStream )`
+
+Read an Int from a stream
+
+[ReadInt](../../brl/brl.stream/#method-readint-int) reads 4 bytes from <b>stream</b>.
+A TStreamReadException is thrown If there is not enough data available.
+
+
+#### Returns
+An Int value
+
+
+
+### `Function ReadLong:Long( stream:TStream )`
+
+Read a Long from a stream
+
+[ReadLong](../../brl/brl.stream/#method-readlong-long) reads 8 bytes from <b>stream</b>.
+A TStreamReadException is thrown If there is not enough data available.
+
+
+#### Returns
+A Long value
+
+
+
+### `Function ReadFloat#( stream:TStream )`
+
+Read a Float from a stream
+
+[ReadFloat](../../brl/brl.stream/#method-readfloat) reads 4 bytes from <b>stream</b>.
+A TStreamReadException is thrown If there is not enough data available.
+
+
+#### Returns
+A Float value
+
+
+
+### `Function ReadDouble!( stream:TStream )`
+
+Read a Double from a stream
+
+[ReadDouble](../../brl/brl.stream/#method-readdouble) reads 8 bytes from <b>stream</b>.
+A TStreamWriteException is thrown If there is not enough data available.
+
+
+#### Returns
+A Double value
+
+
+
+### `Function WriteByte( stream:TStream,n:Int )`
+
+Write a Byte to a stream
+
+[WriteByte](../../brl/brl.stream/#method-writebyte-n-int) writes a single Byte to <b>stream</b>.
+A TStreamWriteException is thrown If the Byte could Not be written
+
+
+
+### `Function WriteShort( stream:TStream,n:Int )`
+
+Write a Short to a stream
+
+[WriteShort](../../brl/brl.stream/#method-writeshort-n-int) writes 2 bytes to <b>stream</b>.
+A TStreamWriteException is thrown if not all bytes could be written
+
+
+
+### `Function WriteInt( stream:TStream,n:Int )`
+
+Write an Int to a stream
+
+[WriteInt](../../brl/brl.stream/#method-writeint-n-int) writes 4 bytes to <b>stream</b>.
+A TStreamWriteException is thrown if not all bytes could be written
+
+
+
+### `Function WriteLong( stream:TStream,n:Long )`
+
+Write a Long to a stream
+
+[WriteLong](../../brl/brl.stream/#method-writelong-n-long) writes 8 bytes to <b>stream</b>.
+A TStreamWriteException is thrown if not all bytes could be written
+
+
+
+### `Function WriteFloat( stream:TStream,n# )`
+
+Write a Float to a stream
+
+[WriteFloat](../../brl/brl.stream/#method-writefloat-n) writes 4 bytes to <b>stream</b>.
+A TStreamWriteException is thrown if not all bytes could be written
+
+
+
+### `Function WriteDouble( stream:TStream,n! )`
+
+Write a Double to a stream
+
+[WriteDouble](../../brl/brl.stream/#method-writedouble-n) writes 8 bytes to <b>stream</b>.
+A TStreamWriteException is thrown if not all bytes could be written
+
+
+
+### `Function ReadString$( stream:TStream,length:Int )`
+
+Read a String from a stream
+
+
+A [TStreamReadException](../../brl/brl.stream/tstreamreadexception) is thrown if not all bytes could be read.
+
+
+#### Returns
+A String of length <b>length</b>
+
+
+
+### `Function WriteString( stream:TStream,str$ )`
+
+Write a String to a stream
+
+
+Each character in <b>str</b> is written to <b>stream</b>.
+
+A [TStreamWriteException](../../brl/brl.stream/tstreamwriteexception) is thrown if not all bytes could be written.
+
+
+
+### `Function ReadLine$( stream:TStream )`
+
+Read a line of text from a stream
+
+
+Bytes are read from <b>stream</b> until a newline character (ascii code 10) or null
+character (ascii code 0) is read, or end of file is detected.
+
+Carriage Return characters (ascii code 13) are silently ignored.
+
+The bytes read are returned in the form of a string, excluding any terminating newline
+or null character.
+
+
+#### Returns
+A string
+
+
+
+### `Function WriteLine:Int( stream:TStream,str$ )`
+
+Write a line of text to a stream
+
+
+A sequence of bytes is written to the stream (one for each character in <b>str</b>)
+followed by the line terminating sequence "rn".
+
+
+#### Returns
+True if line successfully written, else False
+
+
+
+### `Function LoadString$( url:Object )`
+
+Load a String from a stream
+
+
+The specified <b>url</b> is opened for reading, and each byte in the resultant stream
+(until eof of file is reached) is read into a string.
+
+A [TStreamReadException](../../brl/brl.stream/tstreamreadexception) is thrown if the stream could not be read.
+
+
+#### Returns
+A String
+
+
+
+### `Function SaveString( str$,url:Object )`
+
+Save a String to a stream
+
+
+The specified <b>url</b> is opened For writing, and each character of <b>str</b> is written to the
+resultant stream.
+
+A [TStreamWriteException](../../brl/brl.stream/tstreamwriteexception) is thrown if not all bytes could be written.
+
+
+
+### `Function LoadByteArray:Byte[]( url:Object )`
+
+Load a Byte array from a stream
+
+
+The specified <b>url</b> is opened for reading, and each byte in the resultant stream
+(until eof of reached) is read into a byte array.
+
+
+#### Returns
+A Byte array
+
+
+
+### `Function SaveByteArray( byteArray:Byte[],url:Object )`
+
+Save a Byte array to a stream
+
+
+The specified <b>url</b> is opened For writing, and each element of <b>byteArray</b> is written to the
+resultant stream.
+
+A [TStreamWriteException](../../brl/brl.stream/tstreamwriteexception) is thrown if not all bytes could be written.
+
+
+
+### `Function CopyStream( fromStream:TStream,toStream:TStream,bufSize:Int=4096 )`
+
+Copy stream contents to another stream
+
+
+[CopyStream](../../brl/brl.stream/#function-copystream-fromstream-tstream-tostream-tstream-bufsize-int-4096) copies bytes from <b>fromStream</b> to <b>toStream</b> Until <b>fromStream</b> reaches end
+of file.
+
+A [TStreamWriteException](../../brl/brl.stream/tstreamwriteexception) is thrown if not all bytes could be written.
+
+
+
+### `Function CopyBytes( fromStream:TStream,toStream:TStream,count:Int,bufSize:Int=4096 )`
+
+Copy bytes from one stream to another
+
+
+[CopyBytes](../../brl/brl.stream/#function-copybytes-fromstream-tstream-tostream-tstream-count-int-bufsize-int-4096) copies <b>count</b> bytes from <b>fromStream</b> to <b>toStream</b>.
+
+A [TStreamReadException](../../brl/brl.stream/tstreamreadexception) is thrown if not all bytes could be read, and a
+[TStreamWriteException](../../brl/brl.stream/tstreamwriteexception) is thrown if not all bytes could be written.
+
+
+
+### `Function CasedFileName$(path$)`
+
+Returns a case sensitive filename if it exists from a case insensitive file path.
+
+

+ 13 - 0
docs/api/brl/brl_stringbuilder.md

@@ -0,0 +1,13 @@
+---
+id: brl.stringbuilder
+title: BRL.StringBuilder
+sidebar_label: BRL.StringBuilder
+---
+
+
+## Types
+| Type | Description |
+|---|---|
+| [TStringBuilder](../../brl/brl.stringbuilder/tstringbuilder) | A modifiable String. |
+| [TSplitBuffer](../../brl/brl.stringbuilder/tsplitbuffer) | An array of split text from a TStringBuilder. |
+

+ 305 - 0
docs/api/brl/brl_system.md

@@ -0,0 +1,305 @@
+---
+id: brl.system
+title: BRL.System
+sidebar_label: BRL.System
+---
+
+
+
+The system module's primary function is to provide synchronization with the operating system.
+
+This achieved through the [PollSystem](../../brl/brl.system/#function-pollsystem) and [WaitSystem](../../brl/brl.system/#function-waitsystem) commands. However, you don't usually 
+have to call these commands yourself as other BlitzMax commands will call them when necessary.
+
+In addition, the system module also provides commands for checking the date and time, for moving
+the mouse pointer and for generating simple system requesters.
+
+
+## Functions
+
+### `Function InitSystemDriver(driver:TSystemDriver)`
+
+Initialises the BlitzMax system driver.
+
+There can only be one system driver initialised. A second call to this function will result in an exception.
+
+
+
+### `Function SystemDriver:TSystemDriver()`
+
+Returns the BlitzMax system driver, or throws an exception if [InitSystemDriver](../../brl/brl.system/#function-initsystemdriver-driver-tsystemdriver)() hasn't been called with one.
+
+
+### `Function PollSystem()`
+
+Poll operating system
+
+
+[PollSystem](../../brl/brl.system/#function-pollsystem) returns control back to the operating system, allowing such
+events as keystrokes and gadget actions to be processed. Control is then
+returned back to your program.
+
+If [PollSystem](../../brl/brl.system/#function-pollsystem) encounters a key, mouse or app suspend/resume/terminate
+event, an equivalent [TEvent](../../brl/brl.event/tevent) object event will be generated which may be intercepted using
+the [EmitEventHook](../../brl/brl.event/#global-emiteventhook-int-allochookid) hook.
+
+
+
+### `Function WaitSystem()`
+
+Wait for operating system
+
+
+[WaitSystem](../../brl/brl.system/#function-waitsystem) returns control back to the operating system, waiting until
+an event such as a keystroke or gadget action occurs.
+
+Note that [WaitSystem](../../brl/brl.system/#function-waitsystem) may wait indefinitely if there is no possibility
+of any events occuring, so use with caution.
+
+If [WaitSystem](../../brl/brl.system/#function-waitsystem) encounters a key, mouse or app suspend/resume/terminate
+event, an equivalent [TEvent](../../brl/brl.event/tevent) object will be generated which may be intercepted using
+the [EmitEventHook](../../brl/brl.event/#global-emiteventhook-int-allochookid) hook.
+
+
+
+### `Function CurrentDate$(_format$="%d <i>b</i> <i>Y</i>")`
+
+Get current date
+
+
+By default, it returns the current date in the format: DD MON YYYY (i.e. 10 DEC 2000).
+You can also specify some parameters to return the date in a format of your choice:
+<table><tr><td> <b>parameter</b></td><td><b>description</b></td></tr><tr><td>  %%a</td><td>Abbreviated day name (sun - mon).</td></tr><tr><td>  %%A</td><td>Long day name (Sunday - Monday).</td></tr><tr><td>  %%b</td><td>Abbreviated month name (jan - feb).</td></tr><tr><td>  %%B</td><td>Long month name (January...).</td></tr><tr><td>  %%c</td><td>Locale date & time.</td></tr><tr><td>  %%d</td><td>day - in number (1..31).</td></tr><tr><td>  %%H</td><td>hour - in number (0..23).</td></tr><tr><td>  %%I</td><td>hour - in number (1..12).</td></tr><tr><td>  %%j</td><td>day of the year (1..366).</td></tr><tr><td>  %%m</td><td>month - in number (1..12).</td></tr><tr><td>  %%M</td><td>minutes - in number (00..59).</td></tr><tr><td>  %%P</td><td>AM / PM.</td></tr><tr><td>  %%S</td><td>seconds - in number (00..59).</td></tr><tr><td>  %%U</td><td>week number</td></tr><tr><td>  %%w</td><td>day of the week (0..6).</td></tr><tr><td>  %%W</td><td>week of the year (0..53).</td></tr><tr><td>  %%x</td><td>locale data representation.</td></tr><tr><td>  %%y</td><td>year without century (2014 --> 14).</td></tr><tr><td>  %%Y</td><td>Year (2014).</td></tr><tr><td>  %%Z</td><td>Time zone name.</table>
+
+You can use these parameters together:<br>
+CurrentDate("Month: %%a Day: %%d")<br>
+
+
+#### Returns
+The current date as a string
+
+
+#### Example
+```blitzmax
+' currentdate.bmx
+
+Print "The date is "+CurrentDate$()
+```
+
+### `Function CurrentTime$()`
+
+Get current time
+
+
+Returns the current time in the format: HH:MM:SS (i.e. 14:31:57).
+
+
+#### Returns
+The current time as a string
+
+
+#### Example
+```blitzmax
+' currenttime.bmx
+
+Print "The time is "+CurrentTime$()
+```
+
+### `Function MoveMouse( x,y )`
+
+Move mouse pointer
+
+
+[MoveMouse](../../brl/brl.system/#function-movemouse-x-y) positions the mouse cursor at a specific location within
+the current window or graphics display.
+
+
+
+### `Function ShowMouse()`
+
+Make the mouse pointer visible
+
+
+### `Function HideMouse()`
+
+Make the mouse pointer invisible
+
+
+### `Function Notify( text$,serious=False )`
+
+Notify user
+
+
+[Notify](../../brl/brl.system/#function-notify-text-serious-false) activates a simple user interface element informing the user of an event.
+The optional <b>serious</b> flag can be used to indicate a 'critical' event.
+
+Note that a user interface may not be available when in graphics mode on some platforms.
+
+
+#### Example
+```blitzmax
+' notify.bmx
+
+Notify "Hello World"
+```
+
+### `Function Confirm( text$,serious=False )`
+
+Request user confirmation.
+
+
+[Confirm](../../brl/brl.system/#function-confirm-text-serious-false) activates a simple user interface element requesting the user to select between
+YES and NO options. If the user selects YES, then [Confirm](../../brl/brl.system/#function-confirm-text-serious-false) returns True. Otherwise,
+False is returned.
+
+Note that a user interface may not be available when in graphics mode on some platforms.
+
+
+#### Returns
+True or False depending on the user's selection
+
+
+#### Example
+```blitzmax
+' confirm.bmx
+
+result=Confirm("Are you sure?")
+
+print result
+```
+
+### `Function Proceed( text$,serious=False )`
+
+Request user confirmation or cancellation.
+
+
+[Proceed](../../brl/brl.system/#function-proceed-text-serious-false) activates a simple user interface element requesting the user to select between
+YES, NO and CANCEL options. If the user selects YES, then [Proceed](../../brl/brl.system/#function-proceed-text-serious-false) return 1. If the user
+selects NO, then [Proceed](../../brl/brl.system/#function-proceed-text-serious-false) returns 0. Otherwise, [Proceed](../../brl/brl.system/#function-proceed-text-serious-false) returns -1.
+
+Note that a user interface may not be available when in graphics mode on some platforms.
+
+
+#### Returns
+1, 0 or -1 depending on the user's selection
+
+
+#### Example
+```blitzmax
+' proceed.bmx
+
+result=Proceed("Are you sure you want to continue?")
+
+print result
+```
+
+### `Function RequestFile$( text$,extensions$="",save_flag=False,initial_path$="" )`
+
+Display system file requester.
+
+
+<b>text</b> is used as the title of the file requester.
+
+The optional <b>extensions</b> string can either be a comma separated list of
+file extensions or as in the following example groups of extensions
+that begin with a "group:" and separated by a semicolon.
+<b>save_flag</b> can be True to create a save-style requester, or False to create a load-style requester.
+
+<b>initial_path</b> is the initial path for the file requester.
+
+Note that a user interface may not be available when in graphics mode on some platforms.
+
+
+#### Returns
+The path of the selected file or an empty string if the operation was cancelled.
+
+
+#### Example
+```blitzmax
+' requestfile.bmx
+
+filter$="Image Files:png,jpg,bmp;Text Files:txt;All Files:*"
+filename$=RequestFile( "Select graphic file to open",filter$ )
+
+Print filename
+```
+
+### `Function RequestDir$( text$,initial_path$="" )`
+
+Display system folder requester.
+
+
+<b>text</b> is used as the title of the file requester.
+
+<b>initial_path</b> is the initial path for the folder requester.
+
+Note that a user interface may not be available when in graphics mode on some platforms.
+
+
+#### Returns
+The path of the selected folder or an empty string if the operation was cancelled.
+
+
+#### Example
+```blitzmax
+' requestdir.bmx
+
+path$=RequestDir("Select a Folder",CurrentDir())
+
+Print "directory selected was "+path
+```
+
+### `Function OpenURL( url$ )`
+
+Opens a URL with the system's default web browser.
+
+Note that a user interface may not be available when in graphics mode on some platforms.
+
+
+
+### `Function DesktopWidth()`
+
+Get desktop width
+
+#### Returns
+Width of the desktop, in pixels
+
+
+
+### `Function DesktopHeight()`
+
+Get desktop height
+
+#### Returns
+Height of the desktop, in pixels
+
+
+
+### `Function DesktopDepth()`
+
+Get desktop depth
+
+
+The depth of the desktop is the number of bits per pixel.
+
+Note that on some platforms this function may return 0 if the desktop depth cannot be determined.
+
+
+#### Returns
+Bits per pixel depth of the desktop
+
+
+
+### `Function DesktopHertz()`
+
+Get desktop refresh rate
+
+
+Note that on some platforms this function may return 0 if the desktop refresh rate cannot be determined.
+
+
+#### Returns
+Refresh rate, in cycles per second, of the desktop
+
+
+

+ 17 - 0
docs/api/brl/brl_systemdefault.md

@@ -0,0 +1,17 @@
+---
+id: brl.systemdefault
+title: BRL.SystemDefault
+sidebar_label: BRL.SystemDefault
+---
+
+
+
+The system module's primary function is to provide synchronization with the operating system.
+
+This achieved through the [PollSystem](../../brl/brl.system/#function-pollsystem) and [WaitSystem](../../brl/brl.system/#function-waitsystem) commands. However, you don't usually 
+have to call these commands yourself as other BlitzMax commands will call them when necessary.
+
+In addition, the system module also provides commands for checking the date and time, for moving
+the mouse pointer and for generating simple system requesters.
+
+

+ 57 - 0
docs/api/brl/brl_textstream.md

@@ -0,0 +1,57 @@
+---
+id: brl.textstream
+title: BRL.TextStream
+sidebar_label: BRL.TextStream
+---
+
+
+
+The Text Stream module allows you to load and save text in a number
+of formats: LATIN1, UTF8 and UTF16.
+
+The LATIN1 format uses a single byte to represent each character, and
+is therefore only capable of manipulating 256 distinct character values.
+
+The UTF8 and UTF16 formats are capable of manipulating up to 1114112
+character values, but will generally use greater storage space. In addition,
+many text processing applications are unable to handle UTF8 and UTF16 files.
+
+
+## Functions
+
+### `Function LoadText$( url:Object )`
+
+Load text from a stream
+
+
+[LoadText](../../brl/brl.textstream/#function-loadtext-url-object) loads LATIN1, UTF8 or UTF16 text from <b>url</b>.
+
+The first bytes read from the stream control the format of the text:
+<table><tr><td> &$fe $ff</td><td>Text is big endian UTF16</td></tr><tr><td>  &$ff $fe</td><td>Text is little endian UTF16</td></tr><tr><td>  &$ef $bb $bf</td><td>Text is UTF8</table>
+
+
+If the first bytes don't match any of the above values, the stream
+is assumed to contain LATIN1 text.
+
+A [TStreamReadException](../../brl/brl.stream/tstreamreadexception) is thrown if not all bytes could be read.
+
+
+#### Returns
+A string containing the text
+
+
+
+### `Function SaveText:Int( str$,url:Object )`
+
+Save text to a stream
+
+
+[SaveText](../../brl/brl.textstream/#function-savetext-int-str-url-object) saves the characters in <b>str</b> to <b>url</b>.
+
+If <b>str</b> contains any characters with a character code greater than 255,
+then <b>str</b> is saved in UTF16 format. Otherwise, <b>str</b> is saved in LATIN1 format.
+
+A [TStreamWriteException](../../brl/brl.stream/tstreamwriteexception) is thrown if not all bytes could be written.
+
+
+

+ 11 - 0
docs/api/brl/brl_tgaloader.md

@@ -0,0 +1,11 @@
+---
+id: brl.tgaloader
+title: BRL.TGALoader
+sidebar_label: BRL.TGALoader
+---
+
+
+
+The TGA loader module provides the ability to load TGA format pixmaps.
+
+

+ 13 - 0
docs/api/brl/brl_threadpool.md

@@ -0,0 +1,13 @@
+---
+id: brl.threadpool
+title: BRL.ThreadPool
+sidebar_label: BRL.ThreadPool
+---
+
+
+## Types
+| Type | Description |
+|---|---|
+| [TRunnable](../../brl/brl.threadpool/trunnable) | An object that is intended to be executed by a thread pool. |
+| [TThreadPoolExecutor](../../brl/brl.threadpool/tthreadpoolexecutor) | An executor that executes each submitted task using one of possibly several pooled threads. |
+

+ 391 - 0
docs/api/brl/brl_threads.md

@@ -0,0 +1,391 @@
+---
+id: brl.threads
+title: BRL.Threads
+sidebar_label: BRL.Threads
+---
+
+
+
+Welcome to the weird and wonderful world of multithreading!
+
+Multithreading effectively allows your programs to do several things at the same time. The word 'thread' in this context means 'thread of execution' - or, the series of instructions, branches and so on executed by your program. Most programs are 'single threaded', meaning there is only one thread of execution. However, more and more programs are using multiple threads.
+
+Multithreading used to be achieved by software trickery, which made threading useful but not really faster - there was still only one CPU pretending to do multiple things at the same time! But these days, multicore CPUs mean that threading can be used to truly do multiple things at the same time (or 'in parallel').
+
+Creating a thread is easy - just call [CreateThread](../../brl/brl.threads/#function-createthread-tthread-entry-object-data-object-data-object). You will need to provide a function for the thread to use as it's 'entry point'. Once the thread is created, this function will start executing in parallel with the code that called [CreateThread](../../brl/brl.threads/#function-createthread-tthread-entry-object-data-object-data-object). When the thread function returns, that thread will be 'terminated'.
+
+Alas, threading turns out to be rather tricky due to an issue known as 'synchronization'. Synchronization is required when you need to prevent multiple threads from modifying or accessing the same data at the same time. Synchronization usually involves a thread 'blocking'. When a thread blocks, it completely halts execution until another thread does something that causes it to 'unblock' and resume execution.
+
+BlitzMax provides 2 primitives known as 'mutexes' and 'semaphores' to assist with synchronization:
+
+* Mutexes provide a simple locking mechanism. Only one thread at a time can lock a mutex (using [LockMutex](../../brl/brl.threads/#function-lockmutex-mutex-tmutex) or [TryLockMutex](../../brl/brl.threads/#function-trylockmutex-int-mutex-tmutex)), so this is an easy way to protect resources from simultaneous access. If a thread calls [LockMutex](../../brl/brl.threads/#function-lockmutex-mutex-tmutex) and the mutex is already locked by another thread, the current thread will block until the other thread releases the mutex using [UnlockMutex](../../brl/brl.threads/#function-unlockmutex-mutex-tmutex). So don't forget to [UnlockMutex](../../brl/brl.threads/#function-unlockmutex-mutex-tmutex) a mutex after you are finished with it!
+
+* Semaphores provide a synchronized counting mechanism, and contain an internal integer counter. There are 2 operations you can perform on a semaphore - post and wait. Posting a semaphore (using [PostSemaphore](../../brl/brl.threads/#function-postsemaphore-semaphore-tsemaphore)) causes the semaphore's internal counter to be incremented, while waiting for a semaphore (using [WaitSemaphore](../../brl/brl.threads/#function-waitsemaphore-semaphore-tsemaphore)) will cause the current thread to block until the semaphore's internal counter is greater than 0. When it is, the counter is decremented and the thread unblocks. Semaphores are very useful for producer/consumer type situations.
+
+
+## Types
+| Type | Description |
+|---|---|
+| [TThread](../../brl/brl.threads/tthread) | Thread type |
+| [TThreadData](../../brl/brl.threads/tthreaddata) | ThreadData type |
+| [TMutex](../../brl/brl.threads/tmutex) | Mutex type |
+| [TSemaphore](../../brl/brl.threads/tsemaphore) | Semaphore type |
+| [TCondVar](../../brl/brl.threads/tcondvar) | CondVar type |
+
+## Functions
+
+### `Function CreateThread:TThread( entry:Object( data:Object ),data:Object )`
+
+Create a thread
+
+
+Creates a thread and returns a thread object.
+
+The value returned by the thread <b>entry</b> routine can be later retrieved using [WaitThread](../../brl/brl.threads/#function-waitthread-object-thread-tthread).
+
+To 'close' a thread, call either [DetachThread](../../brl/brl.threads/#function-detachthread-thread-tthread) or [WaitThread](../../brl/brl.threads/#function-waitthread-object-thread-tthread). This isn't strictly
+necessary as the thread will eventually be closed when it is garbage collected, however, it
+may be a good idea if you are creating many threads very often, as some operating systems have
+a limit on the number of threads that can be allocated at once.
+
+
+#### Returns
+A new thread object.
+
+
+#### Example
+```blitzmax
+'Make sure to have 'Threaded build' enabled!
+'
+Strict
+
+'Custom print that shows which thread is doing the printing
+Function MyPrint( t$ )
+	If CurrentThread()=MainThread() 
+		Print "Main thread: "+t
+	Else
+		Print "Child thread: "+t
+	EndIf
+End Function
+
+'Our thread function
+Function MyThread:Object( data:Object )
+
+	'show data we were passed
+	Myprint data.ToString()
+
+	'do some work
+	For Local i=1 To 1000
+		MyPrint "i="+i
+	Next
+	
+	'return a value from the thread
+	Return "Data returned from child thread."
+	
+End Function
+
+MyPrint "About to start child thread."
+
+'create a thread!
+Local thread:TThread=CreateThread( MyThread,"Data passed to child thread." )
+
+'wait for thread to finish and print value returned from thread
+MyPrint WaitThread( Thread ).ToString()
+```
+
+### `Function MainThread:TThread()`
+
+Get main thread
+
+#### Returns
+A thread object representing the main application thread.
+
+
+
+### `Function CurrentThread:TThread()`
+
+Get current thread
+
+#### Returns
+A thread object representing the current thread.
+
+
+
+### `Function DetachThread( thread:TThread )`
+
+Detach a thread
+
+
+[DetachThread](../../brl/brl.threads/#function-detachthread-thread-tthread) closes a thread's handle, but does not halt or otherwise affect the target thread.
+
+Once one a thread has been detached, it wil no longer be possible to use [WaitThread](../../brl/brl.threads/#function-waitthread-object-thread-tthread) to get its return value.
+
+This allows the thread to run without your program having to continually check whether it has completedin order to close it.
+
+
+
+### `Function WaitThread:Object( thread:TThread )`
+
+Wait for a thread to finish
+
+
+[WaitThread](../../brl/brl.threads/#function-waitthread-object-thread-tthread) causes the calling thread to block until the target thread has completed execution.
+
+If the target thread has already completed execution, [WaitThread](../../brl/brl.threads/#function-waitthread-object-thread-tthread) returns immediately.
+
+The returned object is the object returned by the thread's entry routine, as passed to [CreateThread](../../brl/brl.threads/#function-createthread-tthread-entry-object-data-object-data-object).
+
+
+#### Returns
+The object returned by the thread entry routine.
+
+
+
+### `Function ThreadRunning:Int( thread:TThread )`
+
+Check if a thread is running
+
+#### Returns
+[True](../../brl/brl.blitz/#true) if <b>thread</b> is still running, otherwise [False](../../brl/brl.blitz/#false).
+
+
+
+### `Function CreateThreadData:TThreadData()`
+
+Create thread data
+
+#### Returns
+A new thread data object.
+
+
+
+### `Function SetThreadDataValue( data:TThreadData,value:Object )`
+
+Set thread data value
+
+
+### `Function GetThreadDataValue:Object( data:TThreadData )`
+
+Get thread data value
+
+
+### `Function CreateMutex:TMutex()`
+
+Create a mutex
+
+#### Returns
+A new mutex object
+
+
+#### Example
+```blitzmax
+'Make sure to have 'Threaded build' enabled!
+'
+Strict
+
+'a global list that multiple threads want to modify
+Global list:TList=New TList
+
+'a mutex controlling access to the global list
+Global listMutex:TMutex=CreateMutex()
+
+Function MyThread:Object( data:Object )
+
+	For Local item=1 To 10
+		'simulate 'other' processing...
+		Delay Rand( 10,50 )
+
+		'lock mutex so we can safely modify global list
+		LockMutex listMutex
+
+		'modify list
+		list.AddLast "Thread "+data.ToString()+" added item "+item
+
+		'unlock mutex
+		UnlockMutex listMutex
+	Next
+	
+End Function
+
+Local threads:TThread[10]
+
+'Create worker threads
+For Local i=0 Until 10
+	threads[i]=CreateThread( MyThread,String( i+1 ) )
+Next
+
+Print "Waiting for worker threads..."
+
+'Wait for worker threads to finish
+For Local i=0 Until 10
+	WaitThread threads[i]
+Next
+
+'Show the resulting list
+'
+'Note: We don't really have to lock the mutex here, as there are no other threads running.
+'Still, it's a good habit to get into.
+LockMutex listMutex
+For Local t$=EachIn list
+	Print t
+Next
+UnlockMutex listMutex
+```
+
+### `Function CloseMutex( mutex:TMutex )`
+
+Close a mutex
+
+
+### `Function LockMutex( mutex:TMutex )`
+
+Lock a mutex
+
+
+### `Function TryLockMutex:Int( mutex:TMutex )`
+
+Try to lock a mutex
+
+#### Returns
+[True](../../brl/brl.blitz/#true) if <b>mutex</b> was successfully locked; [False](../../brl/brl.blitz/#false) if <b>mutex</b> was already locked by another thread.
+
+
+
+### `Function UnlockMutex( mutex:TMutex )`
+
+Unlock a mutex
+
+
+### `Function CreateSemaphore:TSemaphore( count:Int )`
+
+Create a semaphore
+
+#### Returns
+A new semaphore object
+
+
+#### Example
+```blitzmax
+'Make sure to have 'Threaded build' enabled!
+'
+Strict
+
+'a simple queue
+Global queue$[100],put,get
+
+'a counter semaphore
+Global counter:TSemaphore=CreateSemaphore( 0 )
+
+Function MyThread:Object( data:Object )
+
+	'process 100 items
+	For Local item=1 To 100
+	
+		'add an item to the queue
+		queue[put]="Item "+item
+		put:+1
+		
+		'increment semaphore count.
+		PostSemaphore counter
+	
+	Next
+		
+End Function
+
+'create worker thread
+Local thread:TThread=CreateThread( MyThread,Null )
+
+'receive 100 items
+For Local i=1 To 100
+
+	'Wait for semaphore count to be non-0, then decrement.
+	WaitSemaphore counter
+	
+	'Get an item from the queue
+	Local item$=queue[get]
+	get:+1
+	
+	Print item
+
+Next
+```
+
+### `Function CloseSemaphore( semaphore:TSemaphore )`
+
+Close a semaphore
+
+
+### `Function WaitSemaphore( semaphore:TSemaphore )`
+
+Wait for a semaphore
+
+
+### `Function PostSemaphore( semaphore:TSemaphore )`
+
+Post a semaphore
+
+
+### `Function CreateCondVar:TCondVar()`
+
+Create a condvar
+
+#### Returns
+A new condvar object
+
+
+
+### `Function CloseCondVar( condvar:TCondVar )`
+
+Close a condvar
+
+
+### `Function WaitCondVar( condvar:TCondVar,mutex:TMutex )`
+
+Wait for a condvar
+
+
+### `Function SignalCondVar( condvar:TCondVar )`
+
+Signal a condvar
+
+
+### `Function BroadcastCondVar( condvar:TCondVar )`
+
+Broadcast a condvar
+
+
+### `Function CompareAndSwap:Int( target:Int Var,oldValue:Int,newValue:Int )`
+
+Compare and swap
+
+
+Atomically replace <b>target</b> with <b>new_value</b> if <b>target</b> equals <b>old_value</b>.
+
+
+#### Returns
+<b>True</b> if target was updated
+
+
+
+### `Function AtomicAdd:Int( target:Int Var,value:Int )`
+
+Atomic add
+
+
+Atomically add <b>value</b> to <b>target</b>.
+
+
+#### Returns
+Previuous value of target
+
+
+
+### `Function AtomicSwap:Int( target:Int Var,value:Int )`
+
+Atomically swap values
+
+#### Returns
+The old value of <b>target</b>
+
+
+

+ 61 - 0
docs/api/brl/brl_timer.md

@@ -0,0 +1,61 @@
+---
+id: brl.timer
+title: BRL.Timer
+sidebar_label: BRL.Timer
+---
+
+
+## Functions
+
+### `Function CreateTimer:TTimer( hertz#,event:TEvent=Null )`
+
+Create a timer
+
+
+[CreateTimer](../../brl/brl.timer/#function-createtimer-ttimer-hertz-event-tevent-null) creates a timer object that 'ticks' <b>hertz</b> times per second.
+
+Each time the timer ticks, <b>event</b> will be emitted using [EmitEvent](../../brl/brl.event/#function-emitevent-event-tevent).
+
+If <b>event</b> is Null, an event with an <b>id</b> equal to EVENT_TIMERTICK and
+<b>source</b> equal to the timer object will be emitted instead.
+
+
+#### Returns
+A new timer object
+
+
+
+### `Function TimerTicks:Int( timer:TTimer )`
+
+Get timer tick counter
+
+#### Returns
+The number of times <b>timer</b> has ticked over
+
+
+
+### `Function WaitTimer:Int( timer:TTimer )`
+
+Wait until a timer ticks
+
+#### Returns
+The number of ticks since the last call to [WaitTimer](../../brl/brl.timer/#function-waittimer-int-timer-ttimer)
+
+
+#### Example
+```blitzmax
+timer=CreateTimer( 10 )
+
+Repeat
+	Print "Ticks="+WaitTimer( timer )
+Forever
+```
+
+### `Function StopTimer( timer:TTimer )`
+
+Stop a timer
+
+Once stopped, a timer can no longer be used.
+
+
+

+ 7 - 0
docs/api/brl/brl_timerdefault.md

@@ -0,0 +1,7 @@
+---
+id: brl.timerdefault
+title: BRL.TimerDefault
+sidebar_label: BRL.TimerDefault
+---
+
+

+ 10 - 0
docs/api/brl/brl_wavloader.md

@@ -0,0 +1,10 @@
+---
+id: brl.wavloader
+title: BRL.WAVLoader
+sidebar_label: BRL.WAVLoader
+---
+
+
+The WAV loader module provides the ability to load WAV format audio samples.
+
+

+ 7 - 0
docs/api/intro.md

@@ -0,0 +1,7 @@
+---
+id: intro
+title: Introduction
+sidebar_label: Introduction
+---
+
+TODO

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.