Class: Cairo::GLSurface
Direct Known Subclasses
Instance Method Summary collapse
- #height ⇒ Object
- #initialize ⇒ Object constructor
- #set_size ⇒ Object
- #swap_buffers ⇒ Object
- #width ⇒ Object
Methods inherited from Surface
#clone, #content, #copy_page, #create_similar, #destroy, #device, #device_offset, #dup, #fallback_resolution, #finish, #flush, #font_options, #get_mime_data, #mark_dirty, #set_device_offset, #set_fallback_resolution, #set_mime_data, #show_page, #sub_rectangle_surface, #write_to_png
Constructor Details
#initialize ⇒ Object
1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 |
# File 'ext/cairo/rb_cairo_surface.c', line 1468
static VALUE
cr_gl_surface_initialize (int argc, VALUE *argv, VALUE self)
{
cairo_surface_t *surface;
cairo_device_t *device;
int width, height;
cairo_content_t content = CAIRO_CONTENT_COLOR_ALPHA;
VALUE rb_device, rb_width, rb_height, rb_content;
rb_scan_args (argc, argv, "31",
&rb_device, &rb_width, &rb_height, &rb_content);
device = RVAL2CRDEVICE (rb_device);
width = NUM2INT (rb_width);
height = NUM2INT (rb_height);
switch (TYPE (rb_content))
{
case T_NIL:
break;
case T_STRING:
case T_SYMBOL:
case T_FIXNUM:
content = RVAL2CRCONTENT (rb_content);
break;
default:
rb_raise (rb_eArgError,
"invalid argument (expect "
"(device, width, height) or "
"(device, width, height, content)): %s",
rb_cairo__inspect (rb_ary_new4 (argc, argv)));
break;
}
surface = cairo_gl_surface_create (device, content, width, height);
cr_surface_check_status (surface);
DATA_PTR (self) = surface;
if (rb_block_given_p ())
yield_and_finish (self);
return Qnil;
}
|
Instance Method Details
#height ⇒ Object
1574 1575 1576 1577 1578 |
# File 'ext/cairo/rb_cairo_surface.c', line 1574
static VALUE
cr_gl_surface_get_height (VALUE self)
{
return INT2NUM (cairo_gl_surface_get_height (_SELF));
}
|
#set_size ⇒ Object
1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 |
# File 'ext/cairo/rb_cairo_surface.c', line 1557
static VALUE
cr_gl_surface_set_size (VALUE self, VALUE width, VALUE height)
{
cairo_surface_t *surface = NULL;
surface = _SELF;
cairo_gl_surface_set_size (surface, NUM2INT (width), NUM2INT (height));
cr_surface_check_status (surface);
return Qnil;
}
|
#swap_buffers ⇒ Object
1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 |
# File 'ext/cairo/rb_cairo_surface.c', line 1580
static VALUE
cr_gl_surface_swap_buffers (VALUE self)
{
cairo_surface_t *surface = NULL;
surface = _SELF;
cairo_gl_surface_swapbuffers (surface);
cr_surface_check_status (surface);
return Qnil;
}
|
#width ⇒ Object
1568 1569 1570 1571 1572 |
# File 'ext/cairo/rb_cairo_surface.c', line 1568
static VALUE
cr_gl_surface_get_width (VALUE self)
{
return INT2NUM (cairo_gl_surface_get_width (_SELF));
}
|