Example #1
0
// GL_GetAttribute (https://wiki.libsdl.org/SDL_GL_GetAttribute)
func GL_GetAttribute(attr GLattr) (int, error) {
	var _value C.int
	if C.SDL_GL_GetAttribute(attr.c(), &_value) != 0 {
		return int(_value), GetError()
	}
	return int(_value), nil
}
Example #2
0
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
}
Example #3
0
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
}
Example #4
0
func GL_GetAttribute(attribute uint32) (value int, status int) {
	_attribute := (C.SDL_GLattr)(attribute)
	var _value, _status C.int
	_status = (C.SDL_GL_GetAttribute(_attribute, &_value))
	return int(_status), int(_value)
}
Example #5
0
func GL_GetAttribute(attribute uint32, value *int) int {
	_attribute := (C.SDL_GLattr)(attribute)
	_value := (*C.int)(unsafe.Pointer(value))
	return (int)(C.SDL_GL_GetAttribute(_attribute, _value))
}
Example #6
0
func GL_GetAttribute(attr GLattr) (value int, status int) {
	var _value, _status C.int
	_status = (C.SDL_GL_GetAttribute(attr.c(), &_value))
	return int(_status), int(_value)
}
Example #7
0
// 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)
}