示例#1
0
void
rut_pointalism_grid_set_cell_size (RutObject *obj,
                                   float cell_size)
{
  RutPointalismGrid *grid = RUT_POINTALISM_GRID (obj);
  RutEntity *entity;
  RutContext *ctx;

  if (cell_size == grid->cell_size)
    return;

  grid->cell_size = cell_size;

  entity = grid->component.entity;
  ctx = rut_entity_get_context (entity);

  pointalism_generate_grid (grid->slice, grid->tex_width,
                            grid->tex_height, grid->cell_size);

  rut_property_dirty (&ctx->property_ctx,
                      &grid->properties[RUT_POINTALISM_GRID_PROP_CELL_SIZE]);

  rut_closure_list_invoke (&grid->updated_cb_list,
                           RutPointalismGridUpdateCallback,
                           grid);
}
示例#2
0
文件: rut-camera.c 项目: cee1/rig
void
rut_camera_set_viewport (RutCamera *camera,
                         float x,
                         float y,
                         float width,
                         float height)
{
  _rut_camera_set_viewport (camera, x, y, width, height);
  rut_property_dirty (&camera->ctx->property_ctx,
                      &camera->properties[RUT_CAMERA_PROP_VIEWPORT_X]);
  rut_property_dirty (&camera->ctx->property_ctx,
                      &camera->properties[RUT_CAMERA_PROP_VIEWPORT_Y]);
  rut_property_dirty (&camera->ctx->property_ctx,
                      &camera->properties[RUT_CAMERA_PROP_VIEWPORT_WIDTH]);
  rut_property_dirty (&camera->ctx->property_ctx,
                      &camera->properties[RUT_CAMERA_PROP_VIEWPORT_HEIGHT]);
}
示例#3
0
文件: rut-camera.c 项目: cee1/rig
void
rut_camera_set_background_color (RutObject *obj,
                                 const CoglColor *color)
{
  RutCamera *camera = RUT_CAMERA (obj);

  camera->bg_color = *color;
  rut_property_dirty (&camera->ctx->property_ctx,
                      &camera->properties[RUT_CAMERA_PROP_BG_COLOR]);
}
示例#4
0
void
rut_light_set_specular (RutObject *obj,
                        const CoglColor *specular)
{
  RutLight *light = RUT_LIGHT (obj);

  light->specular = *specular;

  rut_property_dirty (&light->context->property_ctx,
                      &light->properties[RUT_LIGHT_PROP_SPECULAR]);
}
示例#5
0
void
rut_light_set_diffuse (RutObject *obj,
                       const CoglColor *diffuse)
{
  RutLight *light = RUT_LIGHT (obj);

  light->diffuse = *diffuse;

  rut_property_dirty (&light->context->property_ctx,
                      &light->properties[RUT_LIGHT_PROP_DIFFUSE]);
}
示例#6
0
void
rut_light_set_ambient (RutObject *obj,
                       const CoglColor *ambient)
{
  RutLight *light = RUT_LIGHT (obj);

  light->ambient = *ambient;

  rut_property_dirty (&light->context->property_ctx,
                      &light->properties[RUT_LIGHT_PROP_AMBIENT]);
}
示例#7
0
文件: rut-fold.c 项目: cee1/rig
void
rut_fold_set_label (RutObject *object, const char *label)
{
  RutFold *fold = object;

  rut_text_set_text (fold->label, label);

  rut_property_dirty (&fold->context->property_ctx,
                      &fold->properties[RUT_FOLD_PROP_LABEL]);
  rut_shell_queue_redraw (fold->context->shell);
}
示例#8
0
文件: rut-camera.c 项目: cee1/rig
void
rut_camera_set_background_color4f (RutCamera *camera,
                                   float red,
                                   float green,
                                   float blue,
                                   float alpha)
{
  cogl_color_init_from_4f (&camera->bg_color,
                           red, green, blue, alpha);
  rut_property_dirty (&camera->ctx->property_ctx,
                      &camera->properties[RUT_CAMERA_PROP_BG_COLOR]);
}
示例#9
0
void
rig_transition_set_progress (RigTransition *transition,
                             float progress)
{
  transition->progress = progress;
  rut_property_dirty (&transition->context->property_ctx,
                      &transition->props[RUT_TRANSITION_PROP_PROGRESS]);

  rig_transition_foreach_property (transition,
                                   update_progress_cb,
                                   transition);
}
示例#10
0
文件: rut-camera.c 项目: cee1/rig
void
rut_camera_set_viewport_height (RutObject *obj,
                                float height)
{
  RutCamera *camera = RUT_CAMERA (obj);

  _rut_camera_set_viewport (camera,
                            camera->viewport[0],
                            camera->viewport[1],
                            camera->viewport[2],
                            height);
  rut_property_dirty (&camera->ctx->property_ctx,
                      &camera->properties[RUT_CAMERA_PROP_VIEWPORT_HEIGHT]);
}
示例#11
0
文件: rut-camera.c 项目: cee1/rig
void
rut_camera_set_viewport_width (RutObject *obj,
                               float width)
{
  RutCamera *camera = RUT_CAMERA (obj);

  _rut_camera_set_viewport (camera,
                            camera->viewport[0],
                            camera->viewport[1],
                            width,
                            camera->viewport[3]);
  rut_property_dirty (&camera->ctx->property_ctx,
                      &camera->properties[RUT_CAMERA_PROP_VIEWPORT_WIDTH]);
}
示例#12
0
文件: rut-camera.c 项目: cee1/rig
void
rut_camera_set_viewport_y (RutObject *obj,
                           float y)
{
  RutCamera *camera = RUT_CAMERA (obj);

  _rut_camera_set_viewport (camera,
                            camera->viewport[0],
                            y,
                            camera->viewport[2],
                            camera->viewport[3]);
  rut_property_dirty (&camera->ctx->property_ctx,
                      &camera->properties[RUT_CAMERA_PROP_VIEWPORT_Y]);
}
示例#13
0
文件: rut-camera.c 项目: cee1/rig
void
rut_camera_set_far_plane (RutObject *obj,
                          float far)
{
  RutCamera *camera = RUT_CAMERA (obj);

  if (camera->far == far)
    return;

  camera->far = far;
  rut_property_dirty (&camera->ctx->property_ctx,
                      &camera->properties[RUT_CAMERA_PROP_FAR]);
  camera->projection_age++;
  camera->transform_age++;
}
示例#14
0
文件: rut-camera.c 项目: cee1/rig
void
rut_camera_set_depth_of_field (RutObject *obj,
                               float depth_of_field)
{
  RutCamera *camera = RUT_CAMERA (obj);

  if (camera->depth_of_field == depth_of_field)
    return;

  camera->depth_of_field = depth_of_field;

  rut_shell_queue_redraw (camera->ctx->shell);

  rut_property_dirty (&camera->ctx->property_ctx,
                      &camera->properties[RUT_CAMERA_PROP_FOCAL_DISTANCE]);
}
示例#15
0
文件: rut-camera.c 项目: cee1/rig
void
rut_camera_set_focal_distance (RutObject *obj,
                               float focal_distance)
{
  RutCamera *camera = RUT_CAMERA (obj);

  if (camera->focal_distance == focal_distance)
    return;

  camera->focal_distance = focal_distance;

  rut_shell_queue_redraw (camera->ctx->shell);

  rut_property_dirty (&camera->ctx->property_ctx,
                      &camera->properties[RUT_CAMERA_PROP_FOCAL_DISTANCE]);
}
示例#16
0
void
rut_pointalism_grid_set_lighter (RutObject *obj,
                                 bool lighter)
{
  RutPointalismGrid *grid = RUT_POINTALISM_GRID (obj);
  RutEntity *entity;
  RutContext *ctx;

  if (lighter == grid->pointalism_lighter)
    return;

  grid->pointalism_lighter = lighter;

  entity = grid->component.entity;
  ctx = rut_entity_get_context (entity);
  rut_property_dirty (&ctx->property_ctx,
                 &grid->properties[RUT_POINTALISM_GRID_PROP_LIGHTER]);
}
示例#17
0
文件: rut-camera.c 项目: cee1/rig
void
rut_camera_set_field_of_view (RutObject *obj,
                              float fov)
{
  RutCamera *camera = RUT_CAMERA (obj);

  if (camera->fov == fov)
    return;

  camera->fov = fov;
  rut_property_dirty (&camera->ctx->property_ctx,
                      &camera->properties[RUT_CAMERA_PROP_FOV]);
  if (!camera->orthographic)
    {
      camera->projection_age++;
      camera->transform_age++;
    }
}
示例#18
0
void
rut_pointalism_grid_set_z (RutObject *obj,
                           float z)
{
  RutPointalismGrid *grid = RUT_POINTALISM_GRID (obj);
  RutEntity *entity;
  RutContext *ctx;

  if (z == grid->pointalism_z)
    return;

  grid->pointalism_z = z;

  entity = grid->component.entity;
  ctx = rut_entity_get_context (entity);
  rut_property_dirty (&ctx->property_ctx,
                     &grid->properties[RUT_POINTALISM_GRID_PROP_Z]);
}
示例#19
0
文件: rut-camera.c 项目: cee1/rig
void
rut_camera_set_zoom (RutObject *obj,
                     float zoom)
{
  RutCamera *camera = RUT_CAMERA (obj);

  if (camera->zoom == zoom)
    return;

  camera->zoom = zoom;

  rut_shell_queue_redraw (camera->ctx->shell);

  rut_property_dirty (&camera->ctx->property_ctx,
                      &camera->properties[RUT_CAMERA_PROP_ZOOM]);

  camera->projection_age++;
  camera->transform_age++;
}
示例#20
0
文件: rut-camera.c 项目: cee1/rig
void
rut_camera_set_projection_mode (RutCamera  *camera,
                                RutProjection projection)
{
  CoglBool orthographic;

  if (projection == RUT_PROJECTION_ORTHOGRAPHIC)
    orthographic = TRUE;
  else
    orthographic = FALSE;

  if (orthographic != camera->orthographic)
    {
      camera->orthographic = orthographic;
      rut_property_dirty (&camera->ctx->property_ctx,
                          &camera->properties[RUT_CAMERA_PROP_MODE]);
      camera->projection_age++;
      camera->transform_age++;
    }
}
示例#21
0
void
rut_shape_set_shaped (RutObject *obj,
                      CoglBool shaped)
{
  RutShape *shape = RUT_SHAPE (obj);

  if (shape->shaped == shaped)
    return;

  shape->shaped = shaped;

  if (shape->model)
    {
      rut_refable_unref (shape->model);
      shape->model = NULL;
    }

  rut_closure_list_invoke (&shape->reshaped_cb_list,
                           RutShapeReShapedCallback,
                           shape);

  rut_property_dirty (&shape->ctx->property_ctx,
                      &shape->properties[RUT_SHAPE_PROP_SHAPED]);
}