BlitzMax

BlitzMax

  • Downloads
  • Docs
  • API
  • Resources
  • About

›BRL

BlitzMax API

  • Introduction

BRL

    Audio

    • Introduction
    • TChannel
    • TSound

    AudioSample

    • Introduction
    • TAudioSample
    • TAudioSampleLoader

    Bank

    • Introduction
    • TBank

    BankStream

    • Introduction
    • TBankStream

    Base64

    • Introduction
    • TBase64

    Blitz

    • Introduction
    • TArrayBoundsException
    • TBlitzException
    • TNullFunctionException
    • TNullMethodException
    • TNullObjectException
    • TOutOfDataException
    • TRuntimeException
  • BRL.BMPLoader
  • Clipboard

    • Introduction
    • TClipboard
    • TClipboardOpts
    • TWin32ClipboardOpts
    • TX11ClipboardOpts
  • BRL.D3D7Max2D
  • BRL.D3D9Max2D
  • BRL.DirectSoundAudio
  • BRL.EndianStream
  • Event

    • Introduction
    • TEvent
  • BRL.EventQueue
  • BRL.FileSystem
  • BRL.FreeAudioAudio
  • BRL.GLGraphics
  • BRL.GLMax2D
  • BRL.GNet
  • BRL.Graphics
  • BRL.Hook
  • IO

    • Introduction
    • MaxIO
  • BRL.JPGLoader
  • BRL.KeyCodes
  • LinkedList

    • Introduction
    • TList
    • TListEnum
    • TLink

    Map

    • Introduction
    • TMap
    • TIntMap
    • TIntKey
    • TPtrMap
    • TPtrKey
    • TStringMap
  • BRL.Math
  • Matrix

    • Introduction
    • SMat2D
    • SMat2F
    • SMat2I
    • SMat3D
    • SMat3F
    • SMat3I
    • SMat4D
    • SMat4F
    • SMat4I

    Max2D

    • Introduction
    • TImage

    MaxLua

    • Introduction
    • TLuaClass
    • TLuaObject
  • BRL.OGGLoader
  • BRL.OpenALAudio
  • ObjectList

    • Introduction
    • TObjectList
    • TObjectListEnumerator
    • TObjectListReverseEnumerator

    Pixmap

    • Introduction
    • TPixmap
    • TPixmapLoader
  • BRL.PNGLoader
  • BRL.PolledInput
  • Quaternion

    • Introduction
    • SQuatD
    • SQuatF
    • SQuatI
  • BRL.RamStream
  • Random

    • Introduction
    • TRandom

    Reflection

    • Introduction
    • TTypeId
    • TMember
    • TConstant
    • TField
    • TGlobal
    • TFunction
    • TMethod
  • BRL.Retro
  • BRL.Socket
  • BRL.SocketStream
  • BRL.StandardIO
  • Stream

    • Introduction
    • TCStream
    • TIO
    • TStream
    • TStreamException
    • TStreamFactory
    • TStreamReadException
    • TStreamWrapper
    • TStreamWriteException

    StringBuilder

    • Introduction
    • TStringBuilder
    • TSplitBuffer
  • BRL.System
  • BRL.SystemDefault
  • BRL.TextStream
  • BRL.TGALoader
  • ThreadPool

    • Introduction
    • TRunnable
    • TThreadPoolExecutor

    Threads

    • Introduction
    • TThread
    • TThreadData
    • TMutex
    • TSemaphore
    • TCondVar

    Timer

    • Introduction
    • TChrono
  • BRL.TimerDefault
  • Vector

    • Introduction
    • SVec2D
    • SVec2F
    • SVec2I
    • SVec3D
    • SVec3F
    • SVec3I
    • SVec4D
    • SVec4F
    • SVec4I

    Volumes

    • Introduction
    • TVolume
  • BRL.WAVLoader

Text

    CSV

    • Introduction
    • TCsvParser
    • TCsvHeader
    • TCsvRow
    • TCsvOptions
    • SCsvColumn

    Format

    • Introduction
    • TFormatter

    Ini

    • Introduction
    • TIni
    • TIniProperty
    • TIniSection

    JConv

    • Introduction
    • TJConv
    • TJConvBuilder
    • TJConvSerializer

    Json

    • Introduction
    • TJSON
    • TJSONObject
    • TJSONString
    • TJSONInteger
    • TJSONReal
    • TJSONBool
    • TJSONArray
    • TJSONNull
    • TJSONError
    • TJSONNumber

    Regex

    • Introduction
    • TRegEx
    • TRegExMatch
    • TRegExOptions
    • TRegExException

    TOML

    • Introduction
    • ETomlNodeType
    • TToml
    • ITomlNode
    • STomlDate
    • STomlDateTime
    • STomlTime
    • TTomlArray
    • TTomlInteger
    • TTomlString
    • TTomlTable
    • TTomlBoolean

    Xml

    • Introduction
    • TxmlDoc
    • TxmlNode
    • TxmlAttribute

MaxGUI

  • MaxGUI.MaxGUI
  • MaxGUI.Drivers
  • MaxGUI.Localization
  • MaxGUI.ProxyGadgets
  • MaxGUI.CocoaMaxGUI
  • MaxGUI.Win32MaxGUIEx

PUB

  • Pub.FreeJoy
  • Pub.FreeProcess
  • Pub.Glad
  • Pub.Glew
  • Joystick

    • Introduction
    • TJoystickDriver
  • Pub.Lua
  • Pub.OpenAL
  • Pub.OpenGLES
  • Pub.xmmintrin
  • Pub.ZLib

Crypto

    Digest

    • Introduction
    • TMessageDigest
    • TDigestRegister
    • TNoSuchAlgorithmException

    Cipher

    • Introduction
    • TCipher
    • TCipherMode
    • Crypto.AESCipher
    • Crypto.AnubisCipher
    • Crypto.BlowfishCipher
    • Crypto.CamelliaCipher
    • Crypto.Cast5Cipher
    • Crypto.DESCipher
    • Crypto.IdeaCipher
    • Crypto.KasumiCipher
    • Crypto.KhazadCipher
    • Crypto.KSeedCipher
    • Crypto.NoekeonCipher
    • Crypto.SerpentCipher
    • Crypto.SkipjackCipher
    • Crypto.TwofishCipher
    • Crypto.XTeaCipher

    CBCMode

    • Introduction
    • TCBCCipherMode

    CFBMode

    • Introduction
    • TCFBCipherMode

    CTRMode

    • Introduction
    • TCTRCipherMode

    ECBMode

    • Introduction
    • TECBCipherMode

    F8Mode

    • Introduction
    • TF8CipherMode

    LRWMode

    • Introduction
    • TLRWCipherMode

    OFBMode

    • Introduction
    • TOFBCipherMode

    XTSMode

    • Introduction
    • TXTSCipherMode

    Blake2BDigest

    • Introduction
    • TBlake2B_512
    • TBlake2B_384
    • TBlake2B_256
    • TBlake2B_160

    CRC32

    • Introduction
    • TCRC32

    MD5Digest

    • Introduction
    • TMD5

    Ripemd320Digest

    • Introduction
    • TRipemd320

    Ripemd356Digest

    • Introduction
    • TRipemd256

    Ripemd160Digest

    • Introduction
    • TRipemd160

    Ripemd128Digest

    • Introduction
    • TRipemd128

    SHA1Digest

    • Introduction
    • TSHA1

    SHA256Digest

    • Introduction
    • TSHA256

    SHA512Digest

    • Introduction
    • TSHA512

    SHA3Digest

    • Introduction
    • TSHA3_512
    • TSHA3_384
    • TSHA3_256
    • TSHA3_224

    TigerDigest

    • Introduction
    • TTiger

    WhirlpoolDigest

    • Introduction
    • TWhirlpool

    Crypto

    • Introduction
    • TCryptoRandom
    • TCryptoSecretBox
    • TCryptoHash
    • TCryptoSign
    • TCryptoKeyExchange
    • TCryptoKey
    • TCryptoHashKey
    • TCryptoSecretBoxKey
    • TCryptoSignature
    • TCryptoExchangeKeyPair
    • TCryptoSessionKeyPair
    • TCryptoNPacket
    • TCryptoKK1Packet
    • TCryptoKK2Packet
    • TCryptoXX1Packet
    • TCryptoXX2Packet
    • TCryptoXX3Packet
    • TCryptoExchangeState
    • TCryptoPWHashMasterKey
    • TCryptoPWHashStoredKey
    • TCryptoPasswordHash

SDL

    SDL

    • Introduction
    • TSDLStream

    SDLSystem

    • Introduction
    • TSDLMultiGesture

    SDLVideo

    • Introduction
    • TSDLDisplay
    • TSDLDisplayMode
    • TSDLGLContext
    • TSDLWindow

    SDLRender

    • Introduction
    • TSDLRenderer
    • TSDLTexture

    SDLTimer

    • Introduction
    • TSDLTimer

    SDLHaptic

    • Introduction
    • TSDLHaptic
    • TSDLHapticCondition
    • TSDLHapticConstant
    • TSDLHapticCustom
    • TSDLHapticDirection
    • TSDLHapticEffect
    • TSDLHapticLeftRight
    • TSDLHapticPeriodic
    • TSDLHapticRamp

    SDLSensor

    • Introduction
    • TSDLSensor
  • SDL.SDLFreeAudio
  • SDL.GLSDLMax2D
  • SDL.GL2SDLMax2D
  • SDL.D3D9SDLMax2D
  • SDLVirtualJoystick

    • Introduction
    • TVirtualJoystick

Steam

    SteamSDK

    • Introduction
    • TSteamClient
    • TSteamUtils
    • TSteamUserStats
    • TSteamFriends
    • TSteamUGC
    • ISteamFriendsListener
    • ISteamUGCListener
    • ISteamUserStatsListener
    • ISteamUtilsListener
    • EItemPreviewType
    • EPersonaChange
    • EPersonaState
    • ERemoteStoragePublishedFileVisibility
    • EUGCMatchingUGCType
    • EUGCQuery
    • EUserRestriction
    • EUserUGCList
    • EWorkshopFileType
Edit

BRL.System

The system module's primary function is to provide synchronization with the operating system.

This achieved through the PollSystem and 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() hasn't been called with one.


Function PollSystem()

Poll operating system

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 encounters a key, mouse or app suspend/resume/terminate event, an equivalent TEvent object event will be generated which may be intercepted using the EmitEventHook hook.


Function WaitSystem()

Wait for operating system

WaitSystem returns control back to the operating system, waiting until an event such as a keystroke or gadget action occurs.

Note that WaitSystem may wait indefinitely if there is no possibility of any events occuring, so use with caution.

If WaitSystem encounters a key, mouse or app suspend/resume/terminate event, an equivalent TEvent object will be generated which may be intercepted using the EmitEventHook 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:

parameterdescription
%%aAbbreviated day name (sun - mon).
%%ALong day name (Sunday - Monday).
%%bAbbreviated month name (jan - feb).
%%BLong month name (January...).
%%cLocale date & time.
%%dday - in number (1..31).
%%Hhour - in number (0..23).
%%Ihour - in number (1..12).
%%jday of the year (1..366).
%%mmonth - in number (1..12).
%%Mminutes - in number (00..59).
%%PAM / PM.
%%Sseconds - in number (00..59).
%%Uweek number
%%wday of the week (0..6).
%%Wweek of the year (0..53).
%%xlocale data representation.
%%yyear without century (2014 --> 14).
%%YYear (2014).
%%ZTime zone name.

You can use these parameters together:
CurrentDate("Month: %%a Day: %%d")

Returns

The current date as a string

Example

' 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

' currenttime.bmx

Print "The time is "+CurrentTime$()


Function MoveMouse( x,y )

Move mouse pointer

MoveMouse 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 activates a simple user interface element informing the user of an event. The optional serious 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

' notify.bmx

Notify "Hello World"


Function Confirm( text$,serious=False )

Request user confirmation.

Confirm activates a simple user interface element requesting the user to select between YES and NO options. If the user selects YES, then Confirm 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

' confirm.bmx

result=Confirm("Are you sure?")

print result


Function Proceed( text$,serious=False )

Request user confirmation or cancellation.

Proceed activates a simple user interface element requesting the user to select between YES, NO and CANCEL options. If the user selects YES, then Proceed return 1. If the user selects NO, then Proceed returns 0. Otherwise, Proceed 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

' 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.

text is used as the title of the file requester.

The optional extensions 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. save_flag can be True to create a save-style requester, or False to create a load-style requester.

initial_path 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

' 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.

text is used as the title of the file requester.

initial_path 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

' 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


← TSplitBufferBRL.SystemDefault →
  • Functions
    • Function InitSystemDriver(driver:TSystemDriver)
    • Function SystemDriver:TSystemDriver()
    • Function PollSystem()
    • Function WaitSystem()
    • Function CurrentDate$(_format$="%d <i>b</i> <i>Y</i>")
    • Function CurrentTime$()
    • Function MoveMouse( x,y )
    • Function ShowMouse()
    • Function HideMouse()
    • Function Notify( text$,serious=False )
    • Function Confirm( text$,serious=False )
    • Function Proceed( text$,serious=False )
    • Function RequestFile$( text$,extensions$="",save_flag=False,initial_path$="" )
    • Function RequestDir$( text$,initial_path$="" )
    • Function OpenURL( url$ )
    • Function DesktopWidth()
    • Function DesktopHeight()
    • Function DesktopDepth()
    • Function DesktopHertz()
BlitzMax
Docs
Getting StartedDownloadsAbout
Community
ResourcesSyntaxBomb Forums
More
GitHubStarChat on Discord
Copyright © 2023 Bruce A Henderson