Class: system

system information and settings

Methods:

Method overview:


autoscreenshot ([boolean],[boolean tga])
returns: ([boolean])
makes a screenshot at end of every frame.
buffermempoolsize ([int])
returns: ([int])
gets or sets maximum size in bytes of bufferpool used primarily in l3d rendering and various load buffers. This is a scratch memory in which visible nodes, particles... are written into. It uses various worst-case approximations, hence the maximum size it needs at runtime depends both on total l3dnodes and per-frame situation. Don't change this unless you know what you are doing and have used luxinias's profiling info (render.drawstats -> rpoolmax) and know the upper limits. Only try to lower the pool if you either exceed limits or want to save every byte.
Large memory operations such as screenshot and texture saving may resize the buffer to prevent an allocation error, all other operations however will quit with error message written to log.
currenttime ()
returns: (float seconds)
returns time
drivelabel (string drive)
returns: ([string name])
returns drivelabel or nil if not succesful
drivelist ()
returns: (string drive, ...)
returns available drives on windows
drivesizes (string drive)
returns: ([float freetocaller,totalbytes,freebytes])
returns information on drive sizes or nil if not succesful
drivetype (string drive)
returns: (string type)
returns type for given drive. A trailing backslash is required. Returns either 'unkown', 'removable', 'norootdir', 'fixed', 'cdrom', 'ramdisk' or 'remote' (network)
exit ([boolean nocleanup])
returns: ()
closes application, if nocleanup is true, this will perform no proper cleanup but leave to os.
frame ()
returns: (int frame)
returns current render frame
getmillis ()
returns: (float millis)
returns time in milliseconds, time is taken from motherboard high precision timer. Useful for profiling
macaddress ()
returns: (string)
returns MAC adress of first network adapter.
maxfps ([int])
returns: ([int])
gets or sets if fps of the app should be capped, 0 is uncapped, minimum will be 15.
nosound ([boolean])
returns: ([boolean])
sets/gets if sound is disabled. Affects system only during startup.
osinfo ()
returns: (string)
returns information about OS
processframe ([float timediff],[boolean drawfirst])
returns: ()
allows manuall processing of frames. timediff is in milliseconds, if not passed or -1, we will compute from the last time this function was called. this will run all internal thinks except the lua think. You should never start this unless you want to do frame processing from this time on for the rest of the runtime. Ideally this function is part of a loop which you start right in your initialisation script. Using this kind of setup will not return the same results as the automatic think and maxfps will show no effect. For one the performance graphs will not measure the luathink correctly, as well as ode. Also the order of the thinkcycle is slightly different. Be aware that you must run swapbuffers yourself to see the result of rendering. A good order of your think would be: processframe,your changes, swapbuffers. This would be close to the internal order, just that swapbuffers is called differently, but still would allow some cpu/gpu parallelism. Internally the order of a think in automatic mode is in one frame: render, luathink, sound, actors/scenenodes,swapbuffers.
Compared to the manual mode of this function: sound,actors/scenenodes,render. However when setting drawfirst to true, sound/actor etc. stuff is handled after rendering.
processors ()
returns: (int)
returns number of processors in system
projectpath ([string])
returns: ([string])
gets or sets used projectpath.
queryfrontend ([string])
returns: (string)
queries the frontend, in which luxinia is embedded
refcount ()
returns: (int refcount)
returns current number of references in the system. There's (currently) a limit of 65000 references. Although Luxinia is using the garbage collection system of Lua, it permanent data outside of Lua can be created which results in memory leaks if this is not managed.
screenshot (string filename,[int scaling],[int quality],[int x,y,w,h])
returns: ()
writes an jpg or tga image file in a file with the given name, depending on the suffix of the string (.jpg or .tga - case sensitive!). The scaling should be a number >=0 and <=3 and tells luxinia the scaling factor of the screenshot. 0 means full resolution, 3 means 1/8th of the resolution. The scaling is done with a simple and fast but lowquality pixelresize. The quality integer describes the quality of the jpg compression: lower means less quality but smaller filesize. Note: Smaller files can be flushed much faster to the HD, so if you want to do a little imagesequence, you may prefer a lower resolution mode with low quality.
You can also make a snapshot of a screenarea by defining x,y,w,h. Be aware those coordinates are in GL coords meaning 0,0 is bottom left.
screenshotquality ([int])
returns: ([int])
quality of jpg screenshots (0-100).
sleep (int millis)
returns: ()
trys to sleep for given time. The sleeptime will be subtracted from the next thinktime difference
swapbuffers ()
returns: ()
should only be used in manual frame processing. swaps backbuffer, which we normally render to, and front buffer, which is what you see.
time ()
returns: (int milisecs, float frametimediff, float avgdiff)
returns internal luxinia time in milliseconds since start and precise difference since the last frame, plus average of last 8 frames
version ()
returns: (string version,string data,string time)
returns luxinia version, builddate and buildtime.
vidinfo ()
returns: ()
prints info on renderer