本文整理汇总了Golang中C.SDL_GLattr函数的典型用法代码示例。如果您正苦于以下问题:Golang SDL_GLattr函数的具体用法?Golang SDL_GLattr怎么用?Golang SDL_GLattr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SDL_GLattr函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: GL_SetAttribute
func GL_SetAttribute(attr GLattr, val int) error {
if C.SDL_GL_SetAttribute(C.SDL_GLattr(attr), C.int(val)) != 0 {
return getError()
}
return nil
}
示例2: GL_GetAttribute
func GL_GetAttribute(attr int) (int, error) {
var value C.int = 0
ret := C.SDL_GL_GetAttribute(C.SDL_GLattr(attr), &value)
if ret == 0 {
return int(value), NewSDLError()
}
return int(value), nil
}
示例3: GL_GetAttribute
func GL_GetAttribute(attr GLattr) (int, error) {
var val C.int
if C.SDL_GL_GetAttribute(C.SDL_GLattr(attr), &val) != 0 {
return 0, getError()
}
return int(val), nil
}
示例4: GL_SetAttribute
func GL_SetAttribute(attr int, value int) int {
GlobalMutex.Lock()
status := int(C.SDL_GL_SetAttribute(C.SDL_GLattr(attr), C.int(value)))
GlobalMutex.Unlock()
return status
}
示例5: GL_SetAttribute
func GL_SetAttribute(attr int, value int) int {
return int(C.SDL_GL_SetAttribute(C.SDL_GLattr(attr), C.int(value)))
}
示例6: GL_SetAttribute
func GL_SetAttribute(attribute GLattr, value int) (err error) {
if C.SDL_GL_SetAttribute(C.SDL_GLattr(attribute), C.int(value)) != 0 {
return errors.New(C.GoString(C.SDL_GetError()))
}
return nil
}
示例7: GL_SetAttribute
func GL_SetAttribute(attr int, value int) int {
status := int(C.SDL_GL_SetAttribute(C.SDL_GLattr(attr), C.int(value)))
return status
}
示例8: c
func (attr GLattr) c() C.SDL_GLattr {
return C.SDL_GLattr(attr)
}
示例9: GLGetAttribute
// Get an attribute of the OpenGL subsystem from the windowing
// interface, such as glX. This is of course different from getting
// the values from SDL's internal OpenGL subsystem, which only
// stores the values you request before initialization.
//
// Developers should track the values they pass into SDL_GL_SetAttribute
// themselves if they want to retrieve these values.
// extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value);
func GLGetAttribute(attr int) (int, int) {
var value C.int
res := int(C.SDL_GL_GetAttribute(C.SDL_GLattr(attr), &value))
return res, int(value)
}