|
Life
|
Defines simulation API. More...
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
| struct | gol_simulation_property_grid_access_profiling |
| Statistics collected per frame about access to grid cells. More... | |
| struct | gol_grid_position |
| Position in 2D simulation grid. More... | |
| struct | gol_cell |
| Cell at certain position that can be either dead or alive. More... | |
Macros | |
| #define | GOL_TRUE 1 |
| True value. | |
| #define | GOL_FALSE 0 |
| False value. | |
Typedefs | |
| typedef void * | gol_handle |
| Generic opaque handle. | |
| typedef gol_handle | gol_simulation |
| Handle for simulation resource. | |
| typedef int32_t | gol_grid_scalar |
| Position in single grid dimension. | |
| typedef int32_t | gol_bool |
| Boolean type. | |
| typedef uintptr_t | gol_size |
| Type representing nonnegative size of collections. | |
| typedef uint32_t | gol_simulation_property_frame_count |
| Count of time steps processed by the simulation. | |
Enumerations | |
| enum | gol_result { GOL_RESULT_SUCCESS = 0 , GOL_RESULT_ERROR = 1 , GOL_RESULT_UNKNOWN_SIMULATION_PROPERTY } |
| Defines possible operation results. More... | |
| enum | gol_simulation_property_type { GOL_SIMULATION_PROPERTY_TYPE_FRAME_COUNT , GOL_SIMULATION_PROPERTY_TYPE_GRID_ACCESS_PROFILING } |
| Lists available simulation properties. More... | |
Functions | |
| gol_result | gol_simulation_create (gol_simulation *simulation) |
| Creates new simulation. | |
| gol_result | gol_simulation_query_property (gol_simulation simulation, gol_simulation_property_type property, gol_size *bytes, void *data) |
| Query simulation property. | |
| gol_result | gol_simulation_next_frame (gol_simulation simulation) |
| Progress simulation to next time step. | |
| gol_result | gol_simulation_query_cells (gol_simulation simulation, gol_size size, const gol_grid_position *positions, gol_cell *cells) |
| Query cells at multiple positions. | |
| gol_result | gol_simulation_set_cells (gol_simulation simulation, gol_size size, const gol_cell *cells) |
| Update multiple simulation cells. | |
| gol_result | gol_simulation_get_alive_cells (gol_simulation simulation, gol_size *size, gol_cell *cells) |
| Query all alive cells. | |
| gol_result | gol_simulation_get_updated_cells (gol_simulation simulation, gol_size *size, gol_cell *cells) |
| Query cells updated by the simulation in last time step. | |
| gol_result | gol_simulation_destroy (gol_simulation simulation) |
| Destroys existing simulation. | |
Defines simulation API.