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
Returns
- 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
Returns
- material object
- clear_buffer(color)Source
clears the screen pixel buffer with set color
Parameters
- 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
- number the current background color
- set_bg(color)Source
sets the background color of the render
Parameters
- color number the background color
- get_resolution()Source
returns the screen with and height in pixels
Returns
- number width
- 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
- 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
- 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
- enable boolean the state to put the resizing thread to
- set_size([width [, height]])Source
changes the size C3D is rendering at
Parameters
- width? number the width of the render
- height? number the height of the render
- change_terminal(term [, block_resize])Source
changes the terminal object C3D is managing
Parameters
- term terminal_object the terminal object to switch to
- 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
- x number x position of the pixel in the buffer
- y number y position of the pixel in the buffer
- 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
- width number width of the texture
- height number height of the texture
- the? settings image creation settings to create this texture with
- generate_frame()Source
allows you to force draw a frame