Пример #1
0
// Surface (https://wiki.libsdl.org/SDL_ConvertSurfaceFormat)
func (surface *Surface) ConvertFormat(pixelFormat uint32, flags uint32) (*Surface, error) {
	_surface := (*Surface)(unsafe.Pointer(C.SDL_ConvertSurfaceFormat(surface.cptr(), C.Uint32(pixelFormat), C.Uint32(flags))))
	if _surface == nil {
		return nil, GetError()
	}
	return _surface, nil
}
Пример #2
0
func (s *Surface) ConvertFormat(pf uint32, flags uint32) (*Surface, error) {
	cs := C.SDL_ConvertSurfaceFormat(s.c(), C.Uint32(pf), C.Uint32(flags))
	if cs == nil {
		return nil, getError()
	}

	return (*Surface)(unsafe.Pointer(cs)), nil
}
Пример #3
0
func (surface *Surface) ConvertFormat(pixelFormat uint32, flags uint32) *Surface {
	return (*Surface)(unsafe.Pointer(C.SDL_ConvertSurfaceFormat(surface.cptr(), C.Uint32(pixelFormat), C.Uint32(flags))))
}
Пример #4
0
func (surface *Surface) ConvertFormat(pixel_format uint32, flags uint32) *Surface {
	_surface := (*C.SDL_Surface)(unsafe.Pointer(surface))
	_pixel_format := (C.Uint32)(pixel_format)
	_flags := (C.Uint32)(flags)
	return (*Surface)(unsafe.Pointer(C.SDL_ConvertSurfaceFormat(_surface, _pixel_format, _flags)))
}