Skip to content
reduz edited this page Feb 23, 2014 · 15 revisions

OS

####Inherits: Object ####Category: Core

Brief Description

Operating System functions.

Member Functions

Numeric Constants

  • DAY_SUNDAY = 0
  • DAY_MONDAY = 1
  • DAY_TUESDAY = 2
  • DAY_WEDNESDAY = 3
  • DAY_THURSDAY = 4
  • DAY_FRIDAY = 5
  • DAY_SATURDAY = 6
  • MONTH_JANUARY = 0
  • MONTH_FEBRUARY = 1
  • MONTH_MARCH = 2
  • MONTH_APRIL = 3
  • MONTH_MAY = 4
  • MONTH_JUNE = 5
  • MONTH_JULY = 6
  • MONTH_AUGUST = 7
  • MONTH_SEPTEMBER = 8
  • MONTH_OCTOBER = 9
  • MONTH_NOVEMBER = 10
  • MONTH_DECEMBER = 11

Description

Operating System functions. OS Wraps the most common functionality to communicate with the host Operating System, such as: -Mouse Grabbing -Mouse Cursors
-Clipboard -Video Mode -Date " Time -Timers
-Environment Variables -Execution of Binaries -Command Line

Member Function Description

  • Vector2 get&#95mouse&#95pos ( ) const

Return the mouse pos.

  • void set&#95clipboard ( String clipboard )

Set clipboard to the OS.

  • String get&#95clipboard ( ) const

Get clipboard from the host OS.

  • void set&#95video&#95mode ( Vector2 size, bool fullscreen, bool resizable, int screen=0 )

Change the video mode.

  • Vector2 get&#95video&#95mode&#95size ( int screen=0 ) const

Return the current video mode size.

  • bool is&#95video&#95mode&#95fullscreen ( int screen=0 ) const

Return true if the current video mode is fullscreen.

  • bool is&#95video&#95mode&#95resizable ( int screen=0 ) const

Return true if the window is resizable.

  • Array get&#95fullscreen&#95mode&#95list ( int screen=0 ) const

Return the list of fullscreen modes.

  • void set&#95iterations&#95per&#95second ( int iterations_per_second )

Set the amount of fixed iterations per second (for fixed process and physics).

  • int get&#95iterations&#95per&#95second ( ) const

Return the amount of fixed iterations per second (for fixed process and physics).

  • void set&#95low&#95processor&#95usage&#95mode ( bool enable )

Set to true to enable the low cpu usage mode. In this mode, the screen only redraws when there are changes, and a considerable sleep time is inserted between frames. This way, editors using the engine UI only use very little cpu.

  • bool is&#95in&#95low&#95processor&#95usage&#95mode ( ) const

Return true if low cpu usage mode is enabled.

  • String get&#95executable&#95path ( ) const

Return the path tot he current engine executable.

Execute the binary file in given path, optionally blocking until it returns. A process ID is returned.

Kill a process ID.

Return an environment variable.

  • bool has&#95environment ( String environment ) const

Return true if an envieronment variable exists.

  • String get&#95name ( ) const

Return the name of the host OS.

Return the commandline passed to the engine.

  • Object get&#95main&#95loop ( ) const

Return the main loop object (see MainLoop).

Return the current date.

Return the current time.

  • void delay&#95usec ( int usec ) const

Delay executing of the current thread by given usecs.

  • int get&#95ticks&#95msec ( ) const

Return the amount of time passed in milliseconds since the engine started.

  • String get&#95locale ( ) const

Return the host OS locale.

  • bool can&#95draw ( ) const

Return true if the host OS allows drawing.

  • int get&#95frames&#95drawn ( )

Return the total amount of frames drawn.

  • bool is&#95stdout&#95verbose ( ) const

Return true if the engine was executed with -v (verbose stdout).

  • int get&#95mouse&#95button&#95state ( ) const

Return the state of the mouse buttons (each button in each bit).

  • int get&#95static&#95memory&#95peak&#95usage ( ) const

Return the max amount of static memory used (only works in debug).

  • int get&#95dynamic&#95memory&#95usage ( ) const

Return the total amount of dynamic memory used (only works in debug).

Clone this wiki locally