Class: RBGL::GUI::Wayland::ShmPool

Inherits:
WaylandObject show all
Defined in:
lib/rbgl/gui/wayland/protocol_objects/shm.rb

Instance Attribute Summary

Attributes inherited from WaylandObject

#connection, #id

Instance Method Summary collapse

Methods inherited from WaylandObject

#initialize, #send_request

Constructor Details

This class inherits a constructor from RBGL::GUI::Wayland::WaylandObject

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

#destroyObject



34
35
36
# File 'lib/rbgl/gui/wayland/protocol_objects/shm.rb', line 34

def destroy
  send_request(1)
end