当前位置: 首页>>代码示例>>Golang>>正文


Golang C.ALint函数代码示例

本文整理汇总了Golang中C.ALint函数的典型用法代码示例。如果您正苦于以下问题:Golang ALint函数的具体用法?Golang ALint怎么用?Golang ALint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ALint函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: SetLooping

func (source Source) SetLooping(isLooping bool) error {
	var i int
	if isLooping {
		i = 1
	} else {
		i = 0
	}
	C.alSourcei(source.source, C.AL_LOOPING, C.ALint(C.int(i)))
	return GetError()
}
开发者ID:Jragonmiris,项目名称:go-al,代码行数:10,代码来源:source.go

示例2: SetSourceRelative

func (source Source) SetSourceRelative(isRelative bool) error {
	var i int
	if isRelative {
		i = 1
	} else {
		i = 0
	}
	C.alSourcei(source.source, C.AL_SOURCE_RELATIVE, C.ALint(C.int(i)))
	return GetError()
}
开发者ID:Jragonmiris,项目名称:go-al,代码行数:10,代码来源:source.go

示例3: Play

// Play will play the sound. Volume ( 1.0 is normal volume, 0 is silence )
// Returns the PlayInstance that can be used to stop the source while playing
func (s *Sound) Play(volume float32) (request PlayInstance) {
	source, err := requestSource()
	if err != nil {
		return request
	}
	C.alSourcef(source.id, C.AL_GAIN, C.ALfloat(volume))
	C.alSourcei(source.id, C.AL_SOURCE_RELATIVE, C.AL_TRUE)
	C.alSource3f(source.id, C.AL_POSITION, 0, 0, 0)
	C.alSourcei(source.id, C.AL_BUFFER, C.ALint(s.buffer))

	source.setToPlay()
	request.id = source.requestId
	request.src = source
	return request
}
开发者ID:anthonyrego,项目名称:gosmf,代码行数:17,代码来源:audio.go

示例4: Play3D

// Play will play the sound at a given position, the falloff distance in which the sound's volume is cut in half,
// and the volume ( 1.0 is normal volume, 0 is silence )
// It will return the PlayInstance that can be used to stop the source while playing
// Remember that in order for the 3D audio to work properly that the audio needs to be all in one channel, not stereo!
func (s *Sound) Play3D(x, y, z, falloff, volume float32) (request PlayInstance) {
	source, err := requestSource()
	if err != nil {
		return request
	}
	C.alSourcef(source.id, C.AL_GAIN, C.ALfloat(volume))
	C.alSourcei(source.id, C.AL_SOURCE_RELATIVE, C.AL_FALSE)
	C.alSourcef(source.id, C.AL_REFERENCE_DISTANCE, C.ALfloat(falloff))
	C.alSource3f(source.id, C.AL_POSITION, C.ALfloat(x), C.ALfloat(y), C.ALfloat(z))
	C.alSourcei(source.id, C.AL_BUFFER, C.ALint(s.buffer))

	source.setToPlay()
	request.id = source.requestId
	request.src = source
	return request
}
开发者ID:anthonyrego,项目名称:gosmf,代码行数:20,代码来源:audio.go

示例5: alSourcei

func alSourcei(s Source, k int, v int32) {
	C.alSourcei(C.ALuint(s), C.ALenum(k), C.ALint(v))
}
开发者ID:tanema,项目名称:amore,代码行数:3,代码来源:al_pc.go

示例6: SetConeOuterAngle

func (source Source) SetConeOuterAngle(i int) error {
	C.alSourcei(source.source, C.AL_CONE_OUTER_ANGLE, C.ALint(C.int(i)))
	return GetError()
}
开发者ID:Jragonmiris,项目名称:go-al,代码行数:4,代码来源:source.go

示例7: Set3i

// Renamed, was Listener3i.
func (self Listener) Set3i(param int32, value1, value2, value3 int32) {
	C.alListener3i(C.ALenum(param), C.ALint(value1), C.ALint(value2), C.ALint(value3))
}
开发者ID:timshannon,项目名称:go-openal,代码行数:4,代码来源:listener.go

示例8: SetAttr

// TODO: can't pass buffer really...
func (self *Source) SetAttr(param int, value *Buffer) {
	C.alSourcei(self.handle, C.ALenum(param), C.ALint(value.handle))
}
开发者ID:pigulon,项目名称:go-openal,代码行数:4,代码来源:core.go

示例9: Seti

// Renamed, was Sourcei.
func (self Source) Seti(param int32, value int32) {
	C.alSourcei(C.ALuint(self), C.ALenum(param), C.ALint(value))
}
开发者ID:jaekwon,项目名称:go-openal,代码行数:4,代码来源:source.go

示例10: Buffer3i

func (buffer Buffer) Buffer3i(
	param ALenum, value1, value2, value3 int) {
	C.alBuffer3i(
		C.ALuint(buffer), C.ALenum(param),
		C.ALint(value1), C.ALint(value2), C.ALint(value3))
}
开发者ID:nzlov,项目名称:goal,代码行数:6,代码来源:buffer.go

示例11: Bufferi

func (buffer Buffer) Bufferi(param ALenum, value int) {
	C.alBufferi(C.ALuint(buffer), C.ALenum(param), C.ALint(value))
}
开发者ID:nzlov,项目名称:goal,代码行数:3,代码来源:buffer.go

示例12: setSourcei

func setSourcei(s Source, param int, v int32) {
	C.alSourcei(C.ALuint(s), C.ALenum(param), C.ALint(v))
}
开发者ID:Miaque,项目名称:mojo,代码行数:3,代码来源:al.go

示例13: SetState

func (source Source) SetState(state SourceState) error {
	C.alSourcei(source.source, C.AL_SOURCE_STATE, C.ALint(state))
	return GetError()
}
开发者ID:Jragonmiris,项目名称:go-al,代码行数:4,代码来源:source.go

示例14: ClearBuffer

func (source Source) ClearBuffer(buf Buffer) error {
	C.alSourcei(source.source, C.AL_BUFFER, C.ALint(C.int(0)))
	return GetError()
}
开发者ID:Jragonmiris,项目名称:go-al,代码行数:4,代码来源:source.go

示例15: SetBuffer

func (source Source) SetBuffer(buf Buffer) error {
	C.alSourcei(source.source, C.AL_BUFFER, C.ALint(buf.buffer))
	return GetError()
}
开发者ID:Jragonmiris,项目名称:go-al,代码行数:4,代码来源:source.go


注:本文中的C.ALint函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。