GLSL Hacker
FEATURES DOWNLOAD GALLERY BLOG LEARN



» Back to Reference Guide Index

gh_renderer Library

Description

gh_renderer is the module that talks directly with the graphics hardware.

Number of functions: 51



gh_renderer.set_vsync

Description

Enables or disables the vertical synchronization.

Languages

Lua - Python

Parameters

  • state [INTEGER]: enabled (1) or disabled (0).

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.set_vsync(0)



    gh_renderer.point

    Description

    Enables the POINT rendering mode.

    Languages

    Lua - Python

    Parameters

    This function has no input parameter(s).

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.point()



    gh_renderer.wireframe

    Description

    Enables the WIREFRAME (or LINE) rendering mode.

    Languages

    Lua - Python

    Parameters

    This function has no input parameter(s).

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.wireframe()



    gh_renderer.solid

    Description

    Enables the SOLID rendering mode.

    Languages

    Lua - Python

    Parameters

    This function has no input parameter(s).

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.solid()



    gh_renderer.get_opengl_error

    Description

    Returns the OpenGL error code or 0 if no error.

    Languages

    Lua - Python

    Parameters

    This function has no input parameter(s).

    Return Values

  • error [INTEGER]: error code.

    Code sample


    err_code = gh_renderer.get_opengl_error()



    gh_renderer.get_capability_4i

    Description

    Gets a hardware capability.

    Languages

    Lua - Python

    Parameters

  • cap_name [STRING]: name of the capability.

    Return Values

  • x, y, z, w [INTEGER]: capability values (up to 4 values).

    Code sample


    --[[
    Capabilities supported:
    "GL_MAX_SUBROUTINES"
    "GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS"
    "GL_MAX_VERTEX_ATTRIBS"
    "GL_MAX_TEXTURE_SIZE"
    "GL_MAX_TEXTURE_IMAGE_UNITS"
    "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS"
    "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS"
    "GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS"
    "GL_MAX_ARRAY_TEXTURE_LAYERS"
    "GL_MAX_COLOR_ATTACHMENTS"
    "GL_MAX_DRAW_BUFFERS"
    "GL_MAX_VIEWPORT_DIMS"
    "GL_MAX_SAMPLES"
    "GL_MAX_VERTEX_STREAMS"
    "GL_MAX_GEOMETRY_SHADER_INVOCATIONS"
    "GL_MAX_PATCH_VERTICES"
    "GL_MAX_TESS_GEN_LEVEL"
    "GL_MAX_TRANSFORM_FEEDBACK_BUFFERS"
    "GL_MAX_COMPUTE_WORK_GROUP_COUNT"
    "GL_MAX_COMPUTE_WORK_GROUP_SIZE"
    "GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS"
    "GL_MAX_COMPUTE_SHARED_MEMORY_SIZE"
    "GL_MAX_FRAMEBUFFER_WIDTH"
    "GL_MAX_FRAMEBUFFER_WIDTH"
    "GL_MAX_FRAMEBUFFER_HEIGHT"
    "GL_MAX_FRAMEBUFFER_LAYERS"
    "GL_MAX_FRAMEBUFFER_SAMPLES"
    "GL_MAX_WIDTH"
    "GL_MAX_HEIGHT"
    "GL_MAX_DEPTH"
    "GL_MAX_LAYERS"
    "GL_MAX_COMBINED_DIMENSIONS"
    "GL_MAX_VERTEX_ATTRIB_STRIDE"
    "GL_MIN_MAP_BUFFER_ALIGNMENT"
    "GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT"
    "GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT"
    "GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT"
    "GL_MAX_UNIFORM_BUFFER_BINDINGS"
    "GL_MAX_UNIFORM_BLOCK_SIZE"
    "GL_MAX_VERTEX_UNIFORM_BLOCKS"
    "GL_MAX_FRAGMENT_UNIFORM_BLOCKS"
    "GL_MAX_GEOMETRY_UNIFORM_BLOCKS"
    "GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS"
    "GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS"
    "GL_MAX_COMPUTE_UNIFORM_BLOCKS"
    "GL_MAX_COMBINED_UNIFORM_BLOCKS"
    "GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT"
    "GL_MAX_SHADER_STORAGE_BLOCK_SIZE"
    "GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS"
    "GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS"
    "GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS"
    "GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS"
    "GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS"
    "GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS"
    "GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS"
    "GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS"
    "GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE"
    "GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS"
    "GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS"
    "GL_MAX_VERTEX_ATOMIC_COUNTERS"
    "GL_MAX_FRAGMENT_ATOMIC_COUNTERS"
    "GL_MAX_GEOMETRY_ATOMIC_COUNTERS"
    "GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS"
    "GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS"
    "GL_MAX_COMPUTE_ATOMIC_COUNTERS"
    "GL_MAX_CULL_DISTANCES"
    "GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES"
    --]]

    max_tex_size = gh_renderer.get_capability_4i("GL_MAX_TEXTURE_SIZE")



    gh_renderer.enable_state

    Description

    Enables a rendering state.

    Languages

    Lua - Python

    Parameters

  • state_name [STRING]: name of the state.

    Return Values

    This function has no return value(s).

    Code sample


    --[[
    States supported:
    "GL_CLIP_DISTANCE0"
    "GL_CLIP_DISTANCE1"
    "GL_CLIP_DISTANCE2"
    "GL_CLIP_DISTANCE3"
    "GL_MULTISAMPLE"
    "GL_CULL_FACE"
    "GL_BLEND"
    "GL_DEPTH_TEST"
    "GL_SCISSOR_TEST"
    --]]
    gh_renderer.enable_state("GL_CLIP_DISTANCE0")



    gh_renderer.disable_state

    Description

    Disables a rendering state.

    Languages

    Lua - Python

    Parameters

  • state_name [STRING]: name of the state.

    Return Values

    This function has no return value(s).

    Code sample


    --[[
    States supported:
    "GL_CLIP_DISTANCE0"
    "GL_CLIP_DISTANCE1"
    "GL_CLIP_DISTANCE2"
    "GL_CLIP_DISTANCE3"
    "GL_MULTISAMPLE"
    "GL_CULL_FACE"
    "GL_BLEND"
    "GL_DEPTH_TEST"
    "GL_SCISSOR_TEST"
    --]]
    gh_renderer.disable_state("GL_CLIP_DISTANCE0")



    gh_renderer.set_viewport

    Description

    Sets the viewport.

    Languages

    Lua - Python

    Parameters

  • x, y [INTEGER]: viewport offsets.
  • width, height [INTEGER]: viewport size.

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.set_viewport(0, 0, width, height)



    gh_renderer.set_scissor

    Description

    Sets the scissor rectangle.

    Languages

    Lua - Python

    Parameters

  • x, y [INTEGER]: scissor rectangle offsets.
  • width, height [INTEGER]: scissor rectangle size.

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.set_scissor(0, 0, width, height)



    gh_renderer.set_viewport_scissor

    Description

    Sets the viewport and the scissor rectangle in the same call.

    Languages

    Lua - Python

    Parameters

  • x, y [INTEGER]: offsets.
  • width, height [INTEGER]: viewport and scissor rectangle size.

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.set_viewport_scissor(0, 0, width, height)



    gh_renderer.set_viewport_scissor_ptr

    Description

    Sets the viewport and the scissor rectangle in the same call.

    Languages

    Lua - Python

    Parameters

  • R_ptr [POINTER]: pointer on the current renderer.
  • x, y [INTEGER]: offsets.
  • width, height [INTEGER]: viewport and scissor rectangle size.

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.set_viewport_scissor_ptr(R_ptr, 0, 0, width, height)



    gh_renderer.set_scissor_state

    Description

    Enables or disable the scissor test.

    Languages

    Lua - Python

    Parameters

  • state [INTEGER]: enabled (1) or disabled (0).

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.set_scissor_state(1)



    gh_renderer.clear_color_buffer

    Description

    Clear the color buffer with a RGBA color.

    Languages

    Lua - Python

    Parameters

  • r, g, b, a [CLAMPED_REAL]: RGBA clear color.

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.clear_color_buffer(0, 0, 0, 1)



    gh_renderer.clear_color_buffer_ptr

    Description

    Clear the color buffer with a RGBA color.

    Languages

    Lua - Python

    Parameters

  • R_ptr [POINTER]: pointer on the current renderer.
  • r, g, b, a [CLAMPED_REAL]: RGBA clear color.

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.clear_color_buffer_ptr(R_ptr, 0, 0, 0, 1)



    gh_renderer.clear_depth_buffer

    Description

    Clear the depth buffer.

    Languages

    Lua - Python

    Parameters

  • z [CLAMPED_REAL]: z buffer value.

    Return Values

    This function has no return value(s).

    Code sample


    z = 1.0
    gh_renderer.clear_depth_buffer(z)



    gh_renderer.clear_depth_buffer_ptr

    Description

    Clear the depth buffer.

    Languages

    Lua - Python

    Parameters

  • R_ptr [POINTER]: pointer on the current renderer.
  • z [CLAMPED_REAL]: z buffer value.

    Return Values

    This function has no return value(s).

    Code sample


    z = 1.0
    gh_renderer.clear_depth_buffer_ptr(R_ptr, z)



    gh_renderer.clear_color_depth_buffers

    Description

    Clear the color and depth buffers in the same call.

    Languages

    Lua - Python

    Parameters

  • r, g, b, a [CLAMPED_REAL]: RGBA clear color.
  • z [CLAMPED_REAL]: z buffer value.

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.clear_color_depth_buffers(r, g, b, a, z)



    gh_renderer.clear_color_depth_buffers_ptr

    Description

    Clear the color and depth buffers in the same call.

    Languages

    Lua - Python

    Parameters

  • R_ptr [POINTER]: pointer on the current renderer.
  • r, g, b, a [CLAMPED_REAL]: RGBA clear color.
  • z [CLAMPED_REAL]: z buffer value.

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.clear_color_depth_buffers_ptr(R_ptr, r, g, b, a, z)



    gh_renderer.set_depth_test_state

    Description

    Enables or disable the depth test.

    Languages

    Lua - Python

    Parameters

  • state [INTEGER]: enabled (1) or disabled (0).

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.set_depth_test_state(1)



    gh_renderer.set_depth_test_state_ptr

    Description

    Enables or disable the depth test.

    Languages

    Lua - Python

    Parameters

  • R_ptr [POINTER]: pointer on the current renderer.
  • state [INTEGER]: enabled (1) or disabled (0).

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.set_depth_test_state_ptr(R_ptr, 1)



    gh_renderer.set_depth_test_func

    Description

    Sets the depth test function.

    Languages

    Lua - Python

    Parameters

  • func_type [INTEGER]: depth test comparison function:
    • CMP_FUNC_NEVER = 0
    • CMP_FUNC_LESS = 1
    • CMP_FUNC_LESS_OR_EQUAL = 2
    • CMP_FUNC_GREATER = 3
    • CMP_FUNC_GREATER_OR_EQUAL = 4
    • CMP_FUNC_EQUAL = 5
    • CMP_FUNC_NOT_EQUAL = 6
    • CMP_FUNC_ALWAYS = 7

    Return Values

    This function has no return value(s).

    Code sample


    local CMP_FUNC_LESS = 1
    gh_renderer.set_depth_test_func(CMP_FUNC_LESS)



    gh_renderer.rasterizer_set_cull_state

    Description

    Enables or disable the face culling state.

    Languages

    Lua - Python

    Parameters

  • state [INTEGER]: enabled (1) or disabled (0).

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.rasterizer_set_cull_state(1)



    gh_renderer.rasterizer_set_cull_face

    Description

    Sets the face type to be culled.

    Languages

    Lua - Python

    Parameters

  • face [INTEGER]: type of face: back (0), front (1) or back_and_front (2).

    Return Values

    This function has no return value(s).

    Code sample


    local BACK_FACE = 0
    gh_renderer.rasterizer_set_cull_face(BACK_FACE)
    gh_renderer.rasterizer_set_cull_state(1)



    gh_renderer.rasterizer_set_polygon_mode

    Description

    Sets the polygon rendering mode.

    Languages

    Lua - Python

    Parameters

  • face [INTEGER]: type of face: back (0), front (1) or back_and_front (2).
  • mode [INTEGER]: polygon rendering mode: point (0), line (1) or solid (2).

    Return Values

    This function has no return value(s).

    Code sample


    local BACK_FRONT_FACE = 2
    local LINE = 1
    gh_renderer.rasterizer_set_polygon_mode(BACK_FRONT_FACE, LINE)



    gh_renderer.rasterizer_set_polygon_mode_ptr

    Description

    Sets the polygon rendering mode.

    Languages

    Lua - Python

    Parameters

  • R_ptr [POINTER]: pointer on the current renderer.
  • face [INTEGER]: type of face: back (0), front (1) or back_and_front (2).
  • mode [INTEGER]: polygon rendering mode: point (0), line (1) or solid (2).

    Return Values

    This function has no return value(s).

    Code sample


    local BACK_FRONT_FACE = 2
    local LINE = 1
    gh_renderer.rasterizer_set_polygon_mode_ptr(R_ptr, BACK_FRONT_FACE, LINE)



    gh_renderer.rasterizer_apply_states

    Description

    Applies all states modified with gh_renderer.rasterizer_xxxx() functions.

    Languages

    Lua - Python

    Parameters

    This function has no input parameter(s).

    Return Values

    This function has no return value(s).

    Code sample


    local BACK_FACE = 0
    gh_renderer.rasterizer_set_cull_face(BACK_FACE)
    gh_renderer.rasterizer_set_cull_state(0)
    local BACK_FRONT_FACE = 2
    local LINE = 1
    gh_renderer.rasterizer_set_polygon_mode(BACK_FRONT_FACE, LINE)
    gh_renderer.rasterizer_apply_states()



    gh_renderer.rasterizer_apply_states_ptr

    Description

    Applies all states modified with gh_renderer.rasterizer_xxxx() functions.

    Languages

    Lua - Python

    Parameters

  • R_ptr [POINTER]: pointer on the current renderer.

    Return Values

    This function has no return value(s).

    Code sample


    local BACK_FRONT_FACE = 2
    local LINE = 1
    gh_renderer.rasterizer_set_polygon_mode_ptr(R_ptr, BACK_FRONT_FACE, LINE)
    gh_renderer.rasterizer_apply_states_ptr(R_ptr)



    gh_renderer.set_blending_state

    Description

    Enables or disables the color blending.

    Languages

    Lua - Python

    Parameters

  • state [INTEGER]: enabled (1) or disabled (0).

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.set_blending_state(1)



    gh_renderer.set_blending_state_ptr

    Description

    Enables or disables the color blending.

    Languages

    Lua - Python

    Parameters

  • R_ptr [POINTER]: pointer on the current renderer.
  • state [INTEGER]: enabled (1) or disabled (0).

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.set_blending_state_ptr(R_ptr, 1)



    gh_renderer.set_blending_factors

    Description

    Sets the source and destination blending factors.

    Languages

    Lua - Python

    Parameters

  • src [INTEGER]: source factor. Possible values for source and destination factors:
    • RENDERER_BLEND_FACTOR_ZERO = 0
    • BLEND_FACTOR_ONE = 1
    • BLEND_FACTOR_SRC_ALPHA = 2
    • BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 3
    • BLEND_FACTOR_ONE_MINUS_DST_COLOR = 4
    • BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 5
    • BLEND_FACTOR_DST_COLOR = 6
    • BLEND_FACTOR_DST_ALPHA = 7
    • BLEND_FACTOR_SRC_COLOR = 8
    • BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 9
  • dst [INTEGER]: destination factor. For possible values, see the source factor.

    Return Values

    This function has no return value(s).

    Code sample


    local BLEND_FACTOR_ONE = 1
    gh_renderer.set_blending_factors(BLEND_FACTOR_ONE, BLEND_FACTOR_ONE)
    gh_renderer.set_blending_state(1)



    gh_renderer.set_blending_factors_ptr

    Description

    Sets the source and destination blending factors.

    Languages

    Lua - Python

    Parameters

  • R_ptr [POINTER]: pointer on the current renderer.
  • src [INTEGER]: source factor. Possible values for source and destination factors:
    • RENDERER_BLEND_FACTOR_ZERO = 0
    • BLEND_FACTOR_ONE = 1
    • BLEND_FACTOR_SRC_ALPHA = 2
    • BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 3
    • BLEND_FACTOR_ONE_MINUS_DST_COLOR = 4
    • BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 5
    • BLEND_FACTOR_DST_COLOR = 6
    • BLEND_FACTOR_DST_ALPHA = 7
    • BLEND_FACTOR_SRC_COLOR = 8
    • BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 9
  • dst [INTEGER]: destination factor. For possible values, see the source factor.

    Return Values

    This function has no return value(s).

    Code sample


    local BLEND_FACTOR_ONE = 1
    gh_renderer.set_blending_factors_ptr(R_ptr, BLEND_FACTOR_ONE, BLEND_FACTOR_ONE)
    gh_renderer.set_blending_state_ptr(R_ptr, 1)



    gh_renderer.update_fixed_mvp_matrices

    Description

    Updates the fixed modelview and projection matrices from a camera and an object. No GPU program is required for the rendering of the object.

    Languages

    Lua - Python

    Parameters

  • camera_id [INTEGER]: camera identifier.
  • object_id [INTEGER]: object identifier.

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.update_fixed_mvp_matrices(camera_id, object_id)



    gh_renderer.update_fixed_mvp_matrices_ptr

    Description

    Updates the fixed modelview and projection matrices from a camera and an object. No GPU program is required for the rendering of the object.

    Languages

    Lua - Python

    Parameters

  • R_ptr [POINTER]: pointer on the current renderer.
  • camera_ptr [POINTER]: pointer on the camera node.
  • object_ptr [POINTER]: pointer on the object node.

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.update_fixed_mvp_matrices_ptr(R_ptr, camera_ptr, object_ptr)



    gh_renderer.get_api_version_major

    Description

    Gets OpenGL major version number.

    Languages

    Lua - Python

    Parameters

    This function has no input parameter(s).

    Return Values

  • major [INTEGER]: major version

    Code sample


    glmajor = gh_renderer.get_api_version_major()
    if (glmajor < 4) then
    -- Tessellation not supported
    end



    gh_renderer.get_api_version_minor

    Description

    Gets OpenGL minor version number.

    Languages

    Lua - Python

    Parameters

    This function has no input parameter(s).

    Return Values

  • minor [INTEGER]: minor version

    Code sample


    glminor = gh_renderer.get_api_version_minor()



    gh_renderer.get_api_version

    Description

    Gets the OpenGL version.

    Languages

    Lua - Python

    Parameters

    This function has no input parameter(s).

    Return Values

  • version [STRING]: OpenGL version

    Code sample


    glversion = gh_renderer.get_api_version()



    gh_renderer.get_renderer_model

    Description

    Gets the model of the renderer (the name of the graphics card).

    Languages

    Lua - Python

    Parameters

    This function has no input parameter(s).

    Return Values

  • model [STRING]: Renderer model

    Code sample


    glrenderer = gh_renderer.get_renderer_model()



    gh_renderer.get_renderer_vendor

    Description

    Gets the vendor of the renderer (the name of the graphics card GPU maker).

    Languages

    Lua - Python

    Parameters

    This function has no input parameter(s).

    Return Values

  • vendor [STRING]: Renderer vendor

    Code sample


    glvendor = gh_renderer.get_renderer_vendor()



    gh_renderer.get_shading_language_version

    Description

    Gets the GLSL version.

    Languages

    Lua - Python

    Parameters

    This function has no input parameter(s).

    Return Values

  • version [STRING]: GLSL version

    Code sample


    glsl_version = gh_renderer.get_shading_language_version()



    gh_renderer.get_num_opengl_extensions

    Description

    Returns the number of OpenGL extensions.

    Languages

    Lua - Python

    Parameters

    This function has no input parameter(s).

    Return Values

  • num [INTEGER]: number of OpenGL extensions

    Code sample


    num_extensions = gh_renderer.get_num_opengl_extensions()



    gh_renderer.get_opengl_extension

    Description

    Returns the name of a particular OpenGL extension.

    Languages

    Lua - Python

    Parameters

  • index [INTEGER]: index of the OpenGL extension: from 0 to get_num_opengl_extensions()-1.

    Return Values

  • name [STRING]: OpenGL extension name

    Code sample


    index = 0
    gl_extension = gh_renderer.get_opengl_extension(index)



    gh_renderer.check_opengl_extension

    Description

    Checks if a particular OpenGL extension is exposed.

    Languages

    Lua - Python

    Parameters

  • extension_name [STRING]: name of the extension.

    Return Values

  • name [STRING]: OpenGL extension name

    Code sample


    if (gh_renderer.check_opengl_extension("GL_ARB_compute_shader") == 1) then
    -- OpenGL 4.3 compute shaders are supported.
    end



    gh_renderer.set_texture2d_state

    Description

    Enables or disable the texturing state of the fixed pipeline.

    Languages

    Lua - Python

    Parameters

  • state [INTEGER]: enabled (1) or disabled (0).

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.set_texture2d_state(state)



    gh_renderer.set_texture2d_state_ptr

    Description

    Enables or disable the texturing state of the fixed pipeline.

    Languages

    Lua - Python

    Parameters

  • R_ptr [POINTER]: pointer on the current renderer.
  • state [INTEGER]: enabled (1) or disabled (0).

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.set_texture2d_state_ptr(R_ptr, state)



    gh_renderer.display_progress_bar

    Description

    Renders a progress bar. The progress bar percent is set with gh_utils.set_progress_bar_percent(). Both functions can be used in an INIT script to draw a progress bar while loading data.

    Languages

    Lua - Python

    Parameters

  • percent [REAL]: size of the progress bar: 100% means the window width.

    Return Values

    This function has no return value(s).

    Code sample


    gh_utils.set_progress_bar_percent(20)
    gh_renderer.display_progress_bar()
    ...
    ... do some stuff
    ...
    gh_utils.set_progress_bar_percent(60)
    gh_renderer.display_progress_bar()
    ...
    ... do some stuff
    ...
    gh_utils.set_progress_bar_percent(100)
    gh_renderer.display_progress_bar()



    gh_renderer.set_virtual_screen

    Description

    Sets the current virtual screen (Mac OS X only).

    Languages

    Lua - Python

    Parameters

  • screen [INTEGER]: current virtual screen

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.set_virtual_screen(screen)



    gh_renderer.get_virtual_screen

    Description

    Gets the current virtual screen (Mac OS X only).

    Languages

    Lua - Python

    Parameters

    This function has no input parameter(s).

    Return Values

  • screen [INTEGER]: current virtual screen

    Code sample


    screen = gh_renderer.get_virtual_screen(ac_buffer, index)



    gh_renderer.get_num_virtual_screens

    Description

    Gets the number of virtual screens (Mac OS X only).

    Languages

    Lua - Python

    Parameters

    This function has no input parameter(s).

    Return Values

  • num_screens [INTEGER]: number of virtual screens

    Code sample


    num_screens = gh_renderer.get_num_virtual_screens()



    gh_renderer.update_virtual_screen

    Description

    Updates the virtual screen. Call this function after a change of virtual screen (Mac OS X only).

    Languages

    Lua - Python

    Parameters

    This function has no input parameter(s).

    Return Values

    This function has no return value(s).

    Code sample


    gh_renderer.update_virtual_screen()



    gh_renderer.memory_barrier

    Description

    Based on OpenGL glMemoryBarrier: defines a barrier ordering memory transactions.

    Languages

    Lua - Python

    Parameters

  • mask [STRING]: mask description

    Return Values

    This function has no return value(s).

    Code sample


    mask = "GL_SHADER_STORAGE_BARRIER_BIT​ GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT"
    gh_renderer.memory_barrier(mask)





    2013-2015 Geeks3D. All Rights Reserved.

    .:- G3D Network -:.