"No one can be told what GeeXLab is, you have to see it for yourself!"

"Stop Playing Games and Start Making Them! With GeeXLab, your are on your way!"


Quick Links
What is GeeXLab
Download GeeXLab
GeeXLab Requirements
Online Help
Articles and Tutorials
Samples Screenshots
Videos

GeeXLab Changelog

XML Ref. Guide
Scripting Ref. Guide
Code Samples

Purchase GeeXLab
GeeXLab SDK

Shader Library

Follow GeeXLab's News
GeeXLab news, articles, tutorials and demos @ Geeks3D.com
GeeXLab @ Twitter GeeXLab RSS Feed

Subscribe to GeeXLab news by email

[ Back to Geeks3D.com ]

GeeXLab

GeeXLab

Laboratory for Real Time 3D Programming (prototyping and demos)
OpenGL, Lua, Python, GLSL,
PhysX and more...

Reference Guide
Host-API Lua / Python



Back to Homepage
Back to Developer's Guide Index

HYP_Utils Library


Description
Utils library

Number of functions: 45

HYP_Utils.GetVersion

Description
Returns Demoniak3D version.

Languages: Lua - Python

Return Values
  • major, minor, patch [INTEGER]: version identification: major, minor and patch numbers

    Code sample :

    major, minor, patch = HYP_Utils.GetVersion()


    HYP_Utils.GetCurrentThreadId

    Description
    Returns the current thread id.

    Languages: Lua - Python

    Return Values
  • threadId [INTEGER]: thread identifier

    HYP_Utils.MsgBox

    Description
    Displays a dialog box with a message.

    Languages: Lua - Python

    Parameters
  • message [STRING]: text to display
  • caption [STRING]: message box's caption

    Code sample :

    HYP_Utils.MsgBox("Hello From Demoniak3D")


    HYP_Utils.OpenUrl

    Description
    Opens an URL in the default browser.

    Languages: Lua - Python

    Parameters
  • url [STRING]: url to open

    Code sample :

    HYP_Utils.OpenUrl("http://www.geeks3d.com")


    HYP_Utils.DrawText

    Description
    Draws a text.

    Languages: Lua - Python

    Parameters
  • x, y [INTEGER]: start position of the text in screen space: the position (0;0) is the top-left corner of the screen.
  • r, g, b [REAL]: text's color
  • text [STRING]: text to display

    Code sample :

    HYP_Utils.DrawText(10, 100, 1.0, 1.0, 0.0, "Hello from GeeXLab")


    HYP_Utils.DrawText2D

    Description
    Draws a 2D text - Only with bitmap fonts.

    Languages: Lua - Python

    Parameters
  • fontId [INTEGER]: font object identifier.
  • x, y [INTEGER]: start position of the text in screen space: the position (0;0) is the top-left corner of the screen.
  • r, g, b [REAL]: text's color
  • text [STRING]: text to display

    Code sample :

    HYP_Utils.DrawText2D(fontId, 10, 100, 1.0, 1.0, 0.0, "Hello from GeeXLab")


    HYP_Utils.DrawText3D

    Description
    Draws a 2D text - Only with bitmap fonts.

    Languages: Lua - Python

    Parameters
  • fontId [INTEGER]: font object identifier.
  • x, y, z [REAL]: 3D position of text start.
  • r, g, b [REAL]: text's color
  • text [STRING]: text to display

    Code sample :

    HYP_Utils.DrawText3D(fontId, 0.0, 20.0, 0.0, 1.0, 1.0, 0.0, "Hello from GeeXLab")


    HYP_Utils.GetElapsedTime

    Description
    Returns script's elapsed time in milliseconds

    Languages: Lua - Python

    Return Values
  • elapsed [INTEGER]: elapsed time in milliseconds

    Code sample :

    elapsed = HYP_Utils.GetElapsedTime()
    elapsedSeconds = HYP_Utils.GetElapsedTime() * 0.001


    HYP_Utils.GetElapsedTimeSeconds

    Description
    Returns script's elapsed time in seconds

    Languages: Lua - Python

    Return Values
  • elapsed [INTEGER]: elapsed time in seconds

    Code sample :

    elapsed = HYP_Utils.GetElapsedTimeSeconds()


    HYP_Utils.GetTimeStep

    Description
    Returns script's frame time or time step: the frame time is the time elapsed between two frames.

    Languages: Lua - Python

    Return Values
  • timeStep [REAL]: time step in seconds

    Code sample :

    timeStep = HYP_Utils.GetTimeStep()


    HYP_Utils.CreateFont

    Description
    Creates a 2D font object based on a true type font.

    Languages: Lua - Python

    Parameters
  • ttfName [STRING]: TrueType font name
  • size [INTEGER]: font size

    Return Values
  • fontId [INTEGER]: font object identifier

    Code sample :

    fontId = HYP_Utils.CreateFont("Arial", 14)


    HYP_Utils.DestroyFont

    Description
    Destroys a 2D font object.

    Languages: Lua - Python

    Parameters
  • fontId [INTEGER]: font identifier

    Code sample :

    HYP_Utils.DestroyFont(fontId)


    HYP_Utils.CreateFontBitmap

    Description
    Creates a 2D font object based on a bitmap file.

    Languages: Lua - Python

    Parameters
  • charSet_file [STRING]: character descriptor file path.
  • isAbsolutePath [INTEGER]: If 1, the descriptor file path is an absolute path.

    Return Values
  • fontId [INTEGER]: font object identifier

    Code sample :

    fontId = HYP_Utils.CreateFontBitmap(charSet_file, 0)


    HYP_Utils.BitmapFontCreateCharset

    Description
    Creates a charset object from a charset file for bitmap fonts.

    Languages: Lua - Python

    Parameters
  • charSet_file [STRING]: character descriptor file path.
  • isAbsolutePath [INTEGER]: If 1, the descriptor file path is an absolute path.

    Return Values
  • csId [INTEGER]: charset identifier

    Code sample :

    csId = HYP_Utils.BitmapFontCreateCharset(charSet_file, 0)


    HYP_Utils.BitmapFontDestroyCharset

    Description
    Destroy a charset objet.

    Languages: Lua - Python

    Parameters
  • csId [INTEGER]: charset identifier

    Code sample :

    HYP_Utils.BitmapFontDestroyCharset(csId)


    HYP_Utils.BitmapFontCreateFromCharset

    Description
    Creates a 2D bitmap font from a charset.

    Languages: Lua - Python

    Parameters
  • csId [INTEGER]: charset identifier
  • isFont3D [INTEGER]: If 1, sets the 3D state of the font.

    Return Values
  • fontId [INTEGER]: font identifier

    Code sample :

    fontId = HYP_Utils.BitmapFontCreateFromCharset(csId, 0)


    HYP_Utils.BitmapFontSet3DState

    Description
    Sets the 3D state of a bitmap font.

    Languages: Lua - Python

    Parameters
  • fontId [INTEGER]: font identifier
  • state [INTEGER]: 3D state of the font.

    Code sample :

    HYP_Utils.BitmapFontSet3DState(fontId, 1)


    HYP_Utils.BitmapFontGetTextWidth

    Description
    Returns the width of a text.

    Languages: Lua - Python

    Parameters
  • fontId [INTEGER]: font identifier
  • text [STRING]: text.

    Code sample :

    text_width = HYP_Utils.BitmapFontGetTextWidth(fontId, text)


    HYP_Utils.BitmapFontSetTextCenteredState

    Description
    Sets the centered state of a bitmap font.

    Languages: Lua - Python

    Parameters
  • fontId [INTEGER]: font identifier
  • state [INTEGER]: centered state of the font.

    Code sample :

    HYP_Utils.BitmapFontSetTextCenteredState(fontId, 1)


    HYP_Utils.GetDemoDir

    Description
    Returns the demo's directory.

    Languages: Lua - Python

    Return Values
  • directory [STRING]: demo's directory

    HYP_Utils.GetAppDir

    Description
    Returns Demoniak3D's root directory.

    Languages: Lua - Python

    Return Values
  • directory [STRING]: root directory

    HYP_Utils.GetOpenGLRendererModel

    Description
    Returns the OpenGL renderer description.

    Languages: Lua - Python

    Return Values
  • rendererDescr [STRING]: renderer description

    HYP_Utils.GetOpenGLRendererVendor

    Description
    Returns the OpenGL renderer vendor.

    Languages: Lua - Python

    Return Values
  • vendorDescr [STRING]: renderer vendor

    HYP_Utils.IsATI

    Description
    Returns true if ATI graphics card is detected.

    Languages: Lua - Python

    Return Values
  • ret [INTEGER]: 1 if ATI, 0 if not

    HYP_Utils.IsNVIDIA

    Description
    Returns true if NVIDIA graphics card is detected.

    Languages: Lua - Python

    Return Values
  • ret [INTEGER]: 1 if NVIDIA, 0 if not

    HYP_Utils.Project3DTo2D

    Description
    Projects a 3D point in world coordinates into a 2D point in screen coordinates. In screen space, the position (0;0) is in bottom-left corner.

    Languages: Lua - Python

    Parameters
  • pos_x, pos_y, pos_z [REAL]: position in 3D world coordinates

    Return Values
  • screen_x, screen_y [INTEGER]: position in screen coordinates

    HYP_Utils.Project2DTo3D

    Description
    Projects a 2D point in screen coordinates into a 3D point in world coordinates. In screen space, the position (0;0) is in bottom-left corner.

    Languages: Lua - Python

    Parameters
  • screen_x, screen_y [INTEGER]: position in screen coordinates

    Return Values
  • pos_x, pos_y, pos_z [REAL]: position in 3D world coordinates

    HYP_Utils.Mat4Translate

    Description
    Creates a translation matrix in the OpenGL convention.

    Languages: Lua - Python

    Parameters
  • x, y, z [REAL]: Translation vector

    Return Values
  • m0 .. to .. m15 [REAL]: 16 elements of the matrix

    Code sample :

    m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15 = HYP_Utils.Mat4Translate(x, y, z)


    HYP_Utils.Mat4Scale

    Description
    Creates a scaling matrix in the OpenGL convention.

    Languages: Lua - Python

    Parameters
  • x, y, z [REAL]: scale vector

    Return Values
  • m0 .. to .. m15 [REAL]: 16 elements of the matrix

    Code sample :

    m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15 = HYP_Utils.Mat4Scale(x, y, z)


    HYP_Utils.Mat4RotateX

    Description
    Creates a X-axis rotation matrix in the OpenGL convention.

    Languages: Lua - Python

    Parameters
  • angle [REAL]: rotation angle in degrees

    Return Values
  • m0 .. to .. m15 [REAL]: 16 elements of the matrix

    Code sample :

    m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15 = HYP_Utils.Mat4RotateX(angle)


    HYP_Utils.Mat4RotateY

    Description
    Creates a Y-axis rotation matrix in the OpenGL convention.

    Languages: Lua - Python

    Parameters
  • angle [REAL]: rotation angle in degrees

    Return Values
  • m0 .. to .. m15 [REAL]: 16 elements of the matrix

    Code sample :

    m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15 = HYP_Utils.Mat4RotateY(angle)


    HYP_Utils.Mat4RotateZ

    Description
    Creates a Z-axis rotation matrix in the OpenGL convention.

    Languages: Lua - Python

    Parameters
  • angle [REAL]: rotation angle in degrees

    Return Values
  • m0 .. to .. m15 [REAL]: 16 elements of the matrix

    Code sample :

    m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15 = HYP_Utils.Mat4RotateZ(angle)


    HYP_Utils.Mat4RotateAxis

    Description
    Creates an axis rotation matrix in the OpenGL convention.

    Languages: Lua - Python

    Parameters
  • angle [REAL]: rotation angle in degrees
  • x, y, z [REAL]: rotation axis

    Return Values
  • m0 .. to .. m15 [REAL]: 16 elements of the matrix

    Code sample :

    m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15 = HYP_Utils.Mat4RotateAxis(angle)


    HYP_Utils.SharedVariableCreate

    Description
    Creates a new shared variable. Shared variables allows communication between Lua and Python scripts.

    Languages: Lua - Python

    Parameters
  • name [STRING]: shared variable name

    Code sample :

    HYP_Utils.SharedVariableCreate("position")


    HYP_Utils.SharedVariableDestroy

    Description
    Destroys a shared variable.

    Languages: Lua - Python

    Parameters
  • name [STRING]: shared variable name

    Code sample :

    HYP_Utils.SharedVariableDestroy(name)


    HYP_Utils.SharedVariableExist

    Description
    tests the existence of a shared variable: returns 1 if the shared variable exists.

    Languages: Lua - Python

    Parameters
  • name [STRING]: shared variable name

    Code sample :

    doesExist = HYP_Utils.SharedVariableExist(name)


    HYP_Utils.SharedVariableIsFloat

    Description
    checks the float type of the shared variable.

    Languages: Lua - Python

    Parameters
  • name [STRING]: shared variable name

    Code sample :

    isfloat = HYP_Utils.SharedVariableIsFloat(name)


    HYP_Utils.SharedVariableIsInteger

    Description
    checks the integer type of the shared variable.

    Languages: Lua - Python

    Parameters
  • name [STRING]: shared variable name

    Code sample :

    isint = HYP_Utils.SharedVariableIsInteger(name)


    HYP_Utils.SharedVariableIsString

    Description
    checks the string type of the shared variable.

    Languages: Lua - Python

    Parameters
  • name [STRING]: shared variable name

    Code sample :

    isstr = HYP_Utils.SharedVariableIsString(name)


    HYP_Utils.SharedVariableSetValue4f

    Description
    Sets a 4D float value to a shared variable.

    Languages: Lua - Python

    Parameters
  • name [STRING]: shared variable name
  • x, y, z, w [REAL]: 4D float value

    Code sample :

    HYP_Utils.SharedVariableSetValue4f(name, x, y, z, w)


    HYP_Utils.SharedVariableSetValue4i

    Description
    Sets a 4D integer value to a shared variable.

    Languages: Lua - Python

    Parameters
  • name [STRING]: shared variable name
  • x, y, z, w [INTEGER]: 4D integer value

    Code sample :

    HYP_Utils.SharedVariableSetValue4i(name, x, y, z, w)


    HYP_Utils.SharedVariableSetValueStr

    Description
    Sets a string value to a shared variable.

    Languages: Lua - Python

    Parameters
  • name [STRING]: shared variable name
  • str [STRING]: string value

    Code sample :

    HYP_Utils.SharedVariableSetValueStr(name, "Hello!")


    HYP_Utils.SharedVariableGetValue

    Description
    Gets the value of a shared variable. The type of value returned depends on the last affectation.

    Languages: Lua - Python

    Parameters
  • name [STRING]: shared variable name

    Code sample :

    x, y, z, w = HYP_Utils.SharedVariableGetValue(name)
    or
    str = HYP_Utils.SharedVariableGetValue(name)


    HYP_Utils.DropFilesGetNumFiles

    Description
    Returns the number of dropped files.

    Languages: Lua - Python

    Return Values
  • n [INTEGER]: number of dropped files

    Code sample :

    n = HYP_Utils.DropFilesGetNumFiles()


    HYP_Utils.DropFilesGetFilenameByIndex

    Description
    Returns the name of a drag n dropped file.

    Languages: Lua - Python

    Parameters
  • index [INTEGER]: index of a dropped file

    Return Values
  • filename [STRING]: dropped filename

    Code sample :

    filename = HYP_Utils.DropFilesGetFilenameByIndex(index)




  • Random Projects

    Phong Lighting Multiple Lights
    Phong Lighting Multiple Lights

    Bump Mapping Multiple Lights
    Bump Mapping Multiple Lights

    Posterization Effect
    Posterization Effect


    Random Code Samples

    OBJ Format Loading
    OBJ Format Loading

    Skybox
    Skybox

    Anaglyph Stereoscopic 3D
    Anaglyph Stereoscopic 3D



    (C)2009-2010 Geeks3D.com