Class: RbSDL2::Surface::SurfacePointer
Class Method Summary
collapse
dec_ref, inc_ref, offset_of_refcount, #refcount, to_ptr
Class Method Details
.dontfree?(ptr) ⇒ Boolean
7
|
# File 'lib/rb_sdl2/surface.rb', line 7
def dontfree?(ptr) = ptr.read_uint32 & ::SDL::DONTFREE != 0
|
.entity_class ⇒ Object
9
|
# File 'lib/rb_sdl2/surface.rb', line 9
def entity_class = ::SDL::Surface
|
.release(ptr) ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/rb_sdl2/surface.rb', line 11
def release(ptr)
unless ptr.null?
if dontfree?(ptr)
dec_ref(ptr)
else
::SDL.FreeSurface(ptr)
end
end
end
|