Class: RBGL::GUI::Wayland::ShmPool
Instance Attribute Summary
#connection, #id
Instance Method Summary
collapse
#initialize, #send_request
Instance Method Details
#create_buffer(offset, width, height, stride, format) ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 15
def create_buffer(offset, width, height, stride, format)
buffer_id = @connection.allocate_id
format_val = case format
when :argb8888 then 0
when :xrgb8888 then 1
else 0
end
send_request(
0,
Arguments.new_id(buffer_id),
Arguments.int(offset),
Arguments.int(width),
Arguments.int(height),
Arguments.int(stride),
Arguments.uint(format_val)
)
@connection.register_object(WlBuffer.new(@connection, buffer_id))
end
|
#destroy ⇒ Object
34
35
36
|
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 34
def destroy
send_request(1)
end
|