c3d.graphics

The graphics module is used for image and rendering settings related things, such as texture loading and starting frame renders

load_texture(path, settings)loads a texture from a file with given settings and returns the texture object.
load_material(path, settings)loads a material from a file with given given texture load settings and returns the decoded material.
clear_buffer(color)clears the screen pixel buffer with set color
render_frame()issues a command to the rasterizer to render a frame
get_bg()returns the current set background color
set_bg(color)sets the background color of the render
get_resolution()returns the screen with and height in pixels
set_pixel_size(pixel_size)allows you to change the pixel size and the resolution of the render (objects can use their own)
get_stats()gives you a bunch of data about the C3D renderer.
autoresize(enable)allows you to disable and enable the default automatic resizing system.
set_size([width [, height]])changes the size C3D is rendering at
change_terminal(term [, block_resize])changes the terminal object C3D is managing
set_pixel(x, y, color)writes a pixel to the screen buffer.
blank_texture(width, height [, the])creates a blank texture with the given size
generate_frame()allows you to force draw a frame
load_texture(path, settings)Source

loads a texture from a file with given settings and returns the texture object.

Parameters

  1. path string the path to the texture file
  2. settings table the settings to load the texture with

Returns

  1. texture object

See also

load_material(path, settings)Source

loads a material from a file with given given texture load settings and returns the decoded material.

Parameters

  1. path string the path to the material file
  2. settings table the settings to load the textures with

Returns

  1. material object
clear_buffer(color)Source

clears the screen pixel buffer with set color

Parameters

  1. color number the color to clear with
render_frame()Source

issues a command to the rasterizer to render a frame

get_bg()Source

returns the current set background color

Returns

  1. number the current background color
set_bg(color)Source

sets the background color of the render

Parameters

  1. color number the background color
get_resolution()Source

returns the screen with and height in pixels

Returns

  1. number width
  2. number height
set_pixel_size(pixel_size)Source

allows you to change the pixel size and the resolution of the render (objects can use their own)

Parameters

  1. pixel_size number the pixel size to use for the render
get_stats()Source

gives you a bunch of data about the C3D renderer. And the rendering pipeline. Mainly rendering stats but some more too.

Returns

  1. table engine stats
autoresize(enable)Source

allows you to disable and enable the default automatic resizing system. note this does not affect the {c3d.resize|resize callback}

Parameters

  1. enable boolean the state to put the resizing thread to
set_size([width [, height]])Source

changes the size C3D is rendering at

Parameters

  1. width? number the width of the render
  2. height? number the height of the render
change_terminal(term [, block_resize])Source

changes the terminal object C3D is managing

Parameters

  1. term terminal_object the terminal object to switch to
  2. block_resize? boolean allows you to have C3D not automatically resize to this terminal
set_pixel(x, y, color)Source

writes a pixel to the screen buffer. Should be getting ran from c3d.render

Parameters

  1. x number x position of the pixel in the buffer
  2. y number y position of the pixel in the buffer
  3. color number color to set the pixel in the buffer to
blank_texture(width, height [, the])Source

creates a blank texture with the given size

Parameters

  1. width number width of the texture
  2. height number height of the texture
  3. the? settings image creation settings to create this texture with
generate_frame()Source

allows you to force draw a frame