Giter Club home page Giter Club logo

glfw's Introduction

GLFW 3.3 for Go Build Status GoDoc

Installation

  • GLFW C library source is included and built automatically as part of the Go package. But you need to make sure you have dependencies of GLFW:
    • On macOS, you need Xcode or Command Line Tools for Xcode (xcode-select --install) for required headers and libraries.
    • On Ubuntu/Debian-like Linux distributions, you need libgl1-mesa-dev and xorg-dev packages.
    • On CentOS/Fedora-like Linux distributions, you need libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel mesa-libGL-devel libXi-devel libXxf86vm-devel packages.
    • On FreeBSD, you need the package pkgconf. To build for X, you also need the package xorg; and to build for Wayland, you need the package wayland.
    • On NetBSD, to build for X, you need the X11 sets installed. These are included in all graphical installs, and can be added to the system with sysinst(8) on non-graphical systems. Wayland support is incomplete, due to missing wscons support in upstream GLFW. To attempt to build for Wayland, you need to install the wayland libepoll-shim packages and set the environment variable PKG_CONFIG_PATH=/usr/pkg/libdata/pkgconfig.
    • On OpenBSD, you need the X11 sets. These are installed by default, and can be added from the ramdisk kernel at any time.
    • See here for full details.
  • Go 1.4+ is required on Windows (otherwise you must use MinGW v4.8.1 exactly, see Go issue 8811).
go get -u github.com/go-gl/glfw/v3.3/glfw

OpenGL ES

If your target system only provides an OpenGL ES implementation (true for some ARM boards), you need to link against that implementation. You do this by defining the appropriate build tags, e.g.

go get -u -tags=gles2 github.com/go-gl/glfw/v3.3/glfw

Supported tags are gles1, gles2, gles3 and vulkan. Note that required packages might differ from those listed above; consult your hardware's documentation.

Usage

package main

import (
	"runtime"
	"github.com/go-gl/glfw/v3.3/glfw"
)

func init() {
	// This is needed to arrange that main() runs on main thread.
	// See documentation for functions that are only allowed to be called from the main thread.
	runtime.LockOSThread()
}

func main() {
	err := glfw.Init()
	if err != nil {
		panic(err)
	}
	defer glfw.Terminate()

	window, err := glfw.CreateWindow(640, 480, "Testing", nil, nil)
	if err != nil {
		panic(err)
	}

	window.MakeContextCurrent()

	for !window.ShouldClose() {
		// Do OpenGL stuff.
		window.SwapBuffers()
		glfw.PollEvents()
	}
}

Changelog

GLFW 3.3 Specific Changes

  • Joystick functions now uses receivers instead of passing the joystick ID as argument.
  • Vulkan methods are intentionally not implemented. Window.Handle can be used to create a Vulkan surface via the this package.
  • Renamed Window.GLFWWindow to Window.Handle
  • Added function Window.SetAttrib.
  • Added function Window.RequestAttention.
  • Added function Window.GetContentScale.
  • Added function Window.GetOpacity.
  • Added function Window.SetOpacity.
  • Added function Window.SetMaximizeCallback.
  • Added function Window.SetContentScaleCallback.
  • Added function Monitor.GetWorkarea.
  • Added function Monitor.GetContentScale.
  • Added function Monitor.SetUserPointer.
  • Added function Monitor.GetUserPointer.
  • Added function InitHint.
  • Added function RawMouseMotionSupported
  • Added function GetKeyScancode.
  • Added function WindowHintString.
  • Added function GetClipboardString.
  • Added function SetClipboardString.
  • Added function Joystick.GetHats.
  • Added function Joystick.IsGamepad.
  • Added function Joystick.GetGUID.
  • Added function Joystick.GetGamepadName.
  • Added function Joystick.GetGamepadState.
  • Added function Joystick.SetUserPointer.
  • Added function Joystick.GetUserPointer.
  • Added function UpdateGamepadMappings.
  • Added function SetX11SelectionString.
  • Added function GetX11SelectionString.
  • Added gamepad button IDs.
  • Added gamepad axis IDs.
  • Added joystick hat state IDs.
  • Added ModifierKey ModCapsLock.
  • Added ModifierKey ModNumLock
  • Added InputMode LockKeyMods.
  • Added InputMode RawMouseMotion.
  • Added hint Hovered.
  • Added hint CenterCursor.
  • Added hint TransparentFramebuffer.
  • Added hint FocusOnShow.
  • Added hint ScaleToMonitor.
  • Added hint JoystickHatButtons.
  • Added hint CocoaChdirResources.
  • Added hint CocoaMenubar.
  • Added hint TransparentFramebuffer.
  • Added hint value OSMesaContextAPI.
  • Added hint value CocoaGraphicsSwitching.
  • Added hint value CocoaRetinaFramebuffer.
  • Added string hint value CocoaFrameNAME.
  • Added string hint value X11ClassName.
  • Added string hint value X11InstanceName.
  • MonitorEvent renamed to PeripheralEvent for reuse with joystick events.
  • Joystick.GetButtons Returns []Action instead of []byte.
  • SetMonitorCallback Returns MonitorCallback.
  • Focus No longer returns an error.
  • Iconify No longer returns an error.
  • Maximize No longer returns an error.
  • Restore No longer returns an error.
  • GetClipboardString No longer returns an error.

GLFW 3.2 Specfic Changes

  • Easy go get installation. GLFW source code is now included in-repo and compiled in so you don't have to build GLFW on your own and distribute shared libraries. The revision of GLFW C library used is listed in GLFW_C_REVISION.txt file.
  • The error callback is now set internally. Functions return an error with corresponding code and description (do a type assertion to glfw3.Error for accessing the variables) if the error is recoverable. If not a panic will occur.
  • Added function Window.SetSizeLimits.
  • Added function Window.SetAspectRatio.
  • Added function Window.SetMonitor.
  • Added function Window.Maximize.
  • Added function Window.SetIcon.
  • Added function Window.Focus.
  • Added function GetKeyName.
  • Added function VulkanSupported.
  • Added function GetTimerValue.
  • Added function GetTimerFrequency.
  • Added function WaitEventsTimeout.
  • Added function SetJoystickCallback.
  • Added window hint Maximized.
  • Added hint NoAPI.
  • Added hint NativeContextAPI.
  • Added hint EGLContextAPI.

GLFW 3.1 Specfic Changes

  • Added type Cursor.
  • Added function Window.SetDropCallback.
  • Added function Window.SetCharModsCallback.
  • Added function PostEmptyEvent.
  • Added function CreateCursor.
  • Added function CreateStandardCursor.
  • Added function Cursor.Destroy.
  • Added function Window.SetCursor.
  • Added function Window.GetFrameSize.
  • Added window hint Floating.
  • Added window hint AutoIconify.
  • Added window hint ContextReleaseBehavior.
  • Added window hint DoubleBuffer.
  • Added hint value AnyReleaseBehavior.
  • Added hint value ReleaseBehaviorFlush.
  • Added hint value ReleaseBehaviorNone.
  • Added hint value DontCare.

API changes

  • Window.Iconify Returns an error.
  • Window.Restore Returns an error.
  • Init Returns an error instead of bool.
  • GetJoystickAxes No longer returns an error.
  • GetJoystickButtons No longer returns an error.
  • GetJoystickName No longer returns an error.
  • GetMonitors No longer returns an error.
  • GetPrimaryMonitor No longer returns an error.
  • Monitor.GetGammaRamp No longer returns an error.
  • Monitor.GetVideoMode No longer returns an error.
  • Monitor.GetVideoModes No longer returns an error.
  • GetCurrentContext No longer returns an error.
  • Window.SetCharCallback Accepts rune instead of uint.
  • Added type Error.
  • Removed SetErrorCallback.
  • Removed error code NotInitialized.
  • Removed error code NoCurrentContext.
  • Removed error code InvalidEnum.
  • Removed error code InvalidValue.
  • Removed error code OutOfMemory.
  • Removed error code PlatformError.
  • Removed KeyBracket.
  • Renamed Window.SetCharacterCallback to Window.SetCharCallback.
  • Renamed Window.GetCursorPosition to GetCursorPos.
  • Renamed Window.SetCursorPosition to SetCursorPos.
  • Renamed CursorPositionCallback to CursorPosCallback.
  • Renamed Window.SetCursorPositionCallback to SetCursorPosCallback.
  • Renamed VideoMode to VidMode.
  • Renamed Monitor.GetPosition to Monitor.GetPos.
  • Renamed Window.GetPosition to Window.GetPos.
  • Renamed Window.SetPosition to Window.SetPos.
  • Renamed Window.GetAttribute to Window.GetAttrib.
  • Renamed Window.SetPositionCallback to Window.SetPosCallback.
  • Renamed PositionCallback to PosCallback.
  • Ranamed Cursor to CursorMode.
  • Renamed StickyKeys to StickyKeysMode.
  • Renamed StickyMouseButtons to StickyMouseButtonsMode.
  • Renamed ApiUnavailable to APIUnavailable.
  • Renamed ClientApi to ClientAPI.
  • Renamed OpenglForwardCompatible to OpenGLForwardCompatible.
  • Renamed OpenglDebugContext to OpenGLDebugContext.
  • Renamed OpenglProfile to OpenGLProfile.
  • Renamed SrgbCapable to SRGBCapable.
  • Renamed OpenglApi to OpenGLAPI.
  • Renamed OpenglEsApi to OpenGLESAPI.
  • Renamed OpenglAnyProfile to OpenGLAnyProfile.
  • Renamed OpenglCoreProfile to OpenGLCoreProfile.
  • Renamed OpenglCompatProfile to OpenGLCompatProfile.
  • Renamed KeyKp... to KeyKP....

glfw's People

Contributors

andydotxyz avatar codephobia avatar dmitshur avatar egonelbre avatar fastpars avatar flyx avatar hajimehoshi avatar ilylily avatar jacalz avatar james-lawrence avatar james4k avatar juturnas avatar mewmew avatar michael-k avatar neilpa avatar pchampio avatar pwaller avatar r0l1 avatar rajveermalviya avatar rbudzko avatar santiagocezar avatar sckelemen avatar slimsag avatar tapir avatar techievee avatar tmc avatar userab1236872 avatar xlab avatar zergon321 avatar zwang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

glfw's Issues

No way to detach the current context

GLFW3 C function:

glfwMakeContextCurrent(GLFWwindow *window)

can have a window parameter of NULL to detach the current context.This is not possible to do in the GO binding.

Fix naming scheme for abbreviations

I originally ignored the abbreviations alltogether to adhere strictly to Go naming schemes like this:

OpenglAnyProfile
ClientApi
SrgbCapable

But now I think the correct way should be like below

OpenGLAnyProfile
ClientAPI
SRGBCapable

What do you guys think? @shurcooL @pwaller

Invalid cgo verb

Hello,

running "go get -u github.com/go-gl/glfw3" produces following error:
"... /github.com/go-gl/glfw3/glfw.go: invalid #cgo verb: #cgo linux LDGLAGS: -lglfw"

On OpenSuse 12.3 64bit with go version go1.1.1 linux/amd64.
Glfw 3.0.1 install log:
-- Install configuration: ""
-- Installing: /usr/local/include/GLFW
-- Installing: /usr/local/include/GLFW/glfw3.h
-- Installing: /usr/local/include/GLFW/glfw3native.h
-- Up-to-date: /usr/local/lib/cmake/glfw/glfwConfig.cmake
-- Installing: /usr/local/lib/cmake/glfw/glfwConfigVersion.cmake
-- Up-to-date: /usr/local/lib/cmake/glfw/glfwTargets.cmake
-- Installing: /usr/local/lib/cmake/glfw/glfwTargets-noconfig.cmake
-- Installing: /usr/local/lib/pkgconfig/glfw3.pc
-- Installing: /usr/local/lib/libglfw3.a

ContextVersion WindowHints create an OpenGL error upon initialization.

The OpenGL error status just after initialization is not always 0. When I ask for an OpenGL 3.3 context, OpenGL starts with an error status of InvalidEnum. By default my graphic card/driver gives me a 3.3 context anyway, whether I ask for it or not, so it is 3.3 capable.

Am I doing anything wrong? Should I worry about this?

package main

import (
    "fmt"
    "github.com/go-gl/gl"
    glfw "github.com/go-gl/glfw3"
)

func main() {
    glfw.Init()
    defer glfw.Terminate()
    // If I uncomment any of these two WindowHint lines, then gl.GetError
    // returns 0.  But when both lines are uncommented, OpenGL returns 1280
    // (invalid enum).
    glfw.WindowHint(glfw.ContextVersionMajor, 3)
    glfw.WindowHint(glfw.ContextVersionMinor, 3)
    window, err := glfw.CreateWindow(640, 480, "Testing", nil, nil)
    if err != nil {
        panic(err)
    }
    window.MakeContextCurrent()
    gl.Init()
    fmt.Println(gl.GetError()) // Should print 0.
}

glfwProcAddress

I see there is an ExtensionSupported function, but no ProcAddress. Is this missing or is it something you should do in C via cgo?

64-bit Build fails to link on windows

I have been trying to compile this for hours now. At first the glfw3 files were in the wrong place, then there was the renaming issue. I have 64-bit versions of everything (cygwin, go, glfw3 binaries), but cgo still attempts to find mingw32 and mingwex(??) when linking. I've been unable to find any problems related to this on Google. I've tried copying the libmingw32.a files from other distributions, but of course it doesn't work since they're 32-bit.

> go get github.com/go-gl/glfw3
# github.com/go-gl/glfw3
/usr/lib/gcc/x86_64-pc-cygwin/4.8.3/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lmingwex
/usr/lib/gcc/x86_64-pc-cygwin/4.8.3/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lmingw32
collect2: error: ld returned 1 exit status

I am using the following versions of everything:

> gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/4.8.3/lto-wrapper.exe
Target: x86_64-pc-cygwin

> go version
Go version go1.3.3 windows/amd64

OS: 64-bit Windows 7 Pro
Cygwin: Fresh cygwin64 install with working 64-bit gcc

I'm not sure if this is a bug in glfw3 or if my system is bugged, so I'm sorry if this is just annoying the shit out of you. If nothing else, consider it a documentation issue. Do you guys have any idea what I am doing wrong?

commented line acting like it's not a comment?

Why am I getting this error when that line is commented out ?

Thu 08/08/2013 23:30:40.67 s:\workspace.go.2013\src\github.com\go-gl\glfw3>go build
# github.com/go-gl/glfw3
clipboard.go:4:24: fatal error: GLFW/glfw3.h: No such file or directory
compilation terminated.

This line:
https://github.com/go-gl/glfw3/blob/faedfffa4b7b6d5e1924c94e6a3ee2e1d460088e/clipboard.go#L4
acting as if it's not a comment ? what am I missing here

EDIT: btw this doesn't seem to happen with 64bit go (1.1.1), but something else happens:

Thu 08/08/2013 23:35:06.89 s:\workspace.go.2013\src\github.com\go-gl\glfw3>go build
# github.com/go-gl/glfw3
cc1.exe: sorry, unimplemented: 64-bit mode not compiled in

EDIT2: tested with latest (default branch) of go 32bit and same thing happens (acts like a non comment)
go version devel +b0240b16a8e0 Thu Aug 08 23:28:53 2013 +0200 windows/386

EDIT3: nevermind, someone explained it to me here https://twitter.com/shurcooL/status/365595945049661442
http://golang.org/cmd/cgo/

CGO linking with correct glfw libraries

Either link with libglfw3.a along with needed platform specific libraries or
just link with libglfw.so and don't worry about platform specific libraries.

Go 1.3: "Code that uses unsafe.Pointer to convert an integer-typed value held in memory into a pointer is illegal and must be rewritten."

Since Go 1.3 we have a situation where "Code that uses unsafe.Pointer to convert an integer-typed value held in memory into a pointer is illegal and must be rewritten."

In glfw3 this affects clipboard.go, context.go, input.go, monitor.go, window.go.

I have no idea yet how one would rewrite such code, otherwise I'd include a pull-request. Maybe/hopefully I'll figure it out shortly after some more research. But I wanted to raise the potential issue already lest I forget ;)

On the plus side, as of right now the glfw3 package seems to run just fine in Go 1.3 on my system. But if this is something "Go code should never do" since 1.3, before long we'll have to address it..

Canonical import statement.

I just noticed the name of this Go package is already "glfw" and not "glfw3", so the import in the example in README.md can be changed from

import glfw "github.com/go-gl/glfw3"

to

import "github.com/go-gl/glfw3"

since the rename doesn't do anything.

devel_glfw3.1: incorrect renaming of Char to Character?

It looks like we renamed these functions spelling out Char as Character.

For example glfwSetCharCallback -> SetCharacterCallback spelled out fully. We did it with SetCharacterModsCallback too.

This isn't a big deal but it seems rather inconsistent I think. What say you guys?

Use more idiomatic spacing for comments.

Currently, all comments look like this:

//CreateWindow creates a window and its associated context. Most of the options
//controlling how the window and its context should be created are specified
//through Hint.
func CreateWindow(width, height int, title string, monitor *Monitor, share *Window) (*Window, error) {

I think it would be better to follow the recommended Go style (https://code.google.com/p/go-wiki/wiki/CodeReviewComments#Comment_Sentences) for spacing, as seen in standard library source, and pretty much most 3rd party packages I've seen:

// CreateWindow creates a window and its associated context. Most of the options
// controlling how the window and its context should be created are specified
// through Hint.
func CreateWindow(width, height int, title string, monitor *Monitor, share *Window) (*Window, error) {

Personally, I'm used to temporarily commenting out code for debugging purposes, and then the form is //code. Whereas normal comments always look like //<space>Comment. So seeing //Comment just looks really odd to me.

What do you think?

Per-window callbacks are actually global

It appears that the per-window callbacks that are implied by the documentation (and API usage) are not actually per-window, but global callbacks, so setting a callback for one window will use that same callback for all windows.

Documentation: Insufficient function signature information for callback functions.

A user of the glfw3-go library would not be able to provide a function definition for some callback functions without looking at the source of the library.

For instance, the documentation of SetKeyCallback states:

Function signature for this callback is: func(*Window, int, int, int)

However, the purpose of the three integer values is not specified in the documentation. One would have to locate goKeyCB in the source to find out that they correspond to key, action and mods respectively.

The easiest solution is to simply add it to the documentation comment of each Set*Callback.

Another solution would be to include the information in the type definition itself. Either by exporting goKeyFunc and changing it's definition to:

type GoKeyFunc func(w *Window, key int, action int, mods int)

Or by changing the definition of SetKeyCallback to:

func (w *Window) SetKeyCallback(cbfun func(w *Window, key int, action int, mods int))

Personally I would prefer to export goKeyFunc (and all other go*Func) since we could easily add a documentation comment to it which further explains the individual arguments.

What are your thoughts?

Channel syncs mess everything up on Darwin

I had a bear of a time debugging a program on my Mac today. I know Mac is a bit wonky, but this is a bit silly:

https://gist.github.com/Jragonmiris/76e571593c6db62e5889

Can you spot the bug? I'll forgive you if you can't. Line 20, comment out <-r and it runs perfectly. Note that this isn't a case of it never getting past that line or anything, putting a print statement after it makes it clear that it does.

What's the exact error? The top bar fails to load and the program gets stuck in a way that you have to ctrl+c out of it (you get the spinning rainbow ball if you mouse over it).

Interestingly, this ONLY happens in the extremely specific case there <-r is after this in init. In main, it works even if you still launch a new Goroutine.

Literally the only case where a channel sync causes it to fail is the exact scenario where the lines

func init() {
     go render(someChan)
     <-someChan
}

occur.

Syncing the channel at any other time, or launching that goroutine at any other time, fixes it. Because reasons. Note that it doesn't matter if you write to the channel or close it, same behavior.

This doesn't happen on Windows, but does happen on Go1.2, Go1.2.2, and Go1.3. I'm not sure if there's anything you can do about it, but it may be worth looking into possibilities.

GetAttribute

Hi there, first off, thanks for the glfw3 bindings!

Now for my problem, I was trying out the multiple windows support of glfw3 and noticed I couldn't use glfw.Focused in window.GetAttribute(glfw.Focused) as the function takes an int rather than the 'Hint' type you defined for window hints.

So unless I'm missing something, the GetAttribute method should be changed to:

func (w *Window) GetAttribute(attrib Hint) int {

Returning errors

  • GetTime should return an error.
  • GLFW does not raise an error for null returns of getCurrentContext(). If no context is set as current this method will return nil.
  • GetJoystickAxes should not return an error.
  • GetJoystickButtons should not return an error.
  • GetJoystickName should not return an error.
  • GetMonitor should not return an error.
  • GetAttribute should return an error.

Since these break API, they will be changed with next big revision.

Consider making glfw3 Go package go-gettable by vendoring GLFW inside?

@slimsag was able to make the glfw3 Go package go-gettable by including GLFW sources inside. See azul3d-legacy/issues#18 (comment).

If that really works, I think it's a great idea and we should consider doing that. Either as a separate package, or simply modify glfw3 to do it.

Any reasons not to do that?

Advantages:

  • go-gettable Go package, much easier to use and install (especially for people trying to go get Go projects that import glfw3).

Disadvntages:

  • More work for us, since we'll need to maintain and update a working version of GLFW C source.
  • Less configurable? Unable to modify CMAKE parameters?
    • Are there any things that are worth modifying? I never changed anything besides the static build to make it compile, that's it.

include path?

Compiled with MinGW.
Set GOPATH to 'C:\Program Files (x86)\GLFW\include' (where 'glfw3.h' is) but still get:

C:\Go\gocode>go get github.com/go-gl/glfw3

#github.com/go-gl/glfw3 src\github.com\go-gl\glfw3\clipboard.go:4:24: fatal error: GLFW/glfw3.h: No such file or directory // # include <GLFW/glfw3.h> ^ compilation terminated.

/usr/local is not recognized

/usr/local is not recognized by go get.
The glfw package recognized it.
Difference:
Glfw:
/#cgo linux CFLAGS: -I/usr/local/include -pthread
//#cgo linux LDFLAGS: -L/usr/local/lib -pthread -lX11 -lXrandr -lm -lGL -lrt -lglfw
Glfw3:
//#cgo linux LDFLAGS: -lglfw

libglfw.so needs to be installed under /usr/lib at the moment.
Would be nice to be able to use the default /usr/local for self compiled binaries.

FreeBSD support

This worked for me on FreeBSD 10:

//#cgo freebsd LDFLAGS: -lglfw3 -lGL -lXrandr -lXxf86vm -lXi

Window [Set]ShouldClose inconsistency: bool/int

The ShouldClose method of Window currently returns a boolean while the SetShouldClose method takes an int.

Either use bool or int for both. Personally I would prefer bool but either works just fine as long as it is consistent.

Can't build on Ubuntu 13.04

After trying to install it on Ubuntu, the only way I could find was to change the cgo line in glfw.go to look like this:

//#cgo linux LDFLAGS: -lglfw3 -lGL -lm -lGLU -lX11 -lXi -lXxf86vm -lXrandr

Maybe it should be possible to use a cgo pkg-config instead of that line. Haven't tried though

Callback errors

Most of them gives "Go type not supported in export: [0]byte" error. Find the correct way of doing cgo callback things.

devel_glfw3.1: remaining parts for exposure

We're currently in a somewhat-awkward state where we haven't exposed all of GLFW 3.1 functionality, and it's not clear what hasn't yet been exposed. If it's okay with you all, lets keep this list here so we know need what needs to be exposed still.

We can check-off items as we add them to the 3.1 branch. These are just copied from the GLFW change log (I cut out the ones we already have):

  • Added GLFWcursor custom system cursor handle
  • Added glfwCreateCursor, glfwDestroyCursor and glfwSetCursor for
    managing custom system cursors
  • Added GLFWimage struct for passing 32-bit RGBA images
  • Added glfwGetWindowFrameSize for retrieving the size of the frame around
    the client area of a window
  • Added GLFW_DONT_CARE for indicating that any value is acceptable
  • Added GLFW_DOUBLEBUFFER for controlling whether to use double buffering
  • Added GLFW_CONTEXT_RELEASE_BEHAVIOR and values
    GLFW_ANY_RELEASE_BEHAVIOR, GLFW_RELEASE_BEHAVIOR_FLUSH and
    GLFW_RELEASE_BEHAVIOR_NONE for GL_KHR_context_flush_control support

Problems building go-gl/glfw3 on ubuntu 12.04 (libglfw3 3.0.3 built from source)

Hi there,

Apologies if this should go on stackoverflow.
After downloading GLFW 3.0.3 and building with:

cmake -G "Unix Makefiles" -DBUILD_SHARED_LIBS=on
make
sudo make install

and successfully compiling and running the glfw gears example.
The dev headers are here /usr/local/include/GLFW/glfw3.h
and the shared object files are in /usr/local/lib/libglfw.so.

I have successfully built and executed an app with go-gl/glfw but cannot get glfw3 to work.

I see the LD_FLAGS for linux are are -lglfw so could they be conflicting with my current installation of glfw 1? (I'm a c noob, so I'm quite sketchy about compilation and linking)

I try 'go getting' the golang bindings which fails as below.

$ go get github.com/go-gl/glfw3
# github.com/go-gl/glfw3
clipboard.go:43: error: undefined reference to 'glfwGetClipboardString'
clipboard.go:53: error: undefined reference to 'glfwSetClipboardString'
context.go:44: error: undefined reference to 'glfwGetCurrentContext'
context.go:53: error: undefined reference to 'glfwMakeContextCurrent'
error.go:34: error: undefined reference to 'glfwSetErrorCallback'
glfw.go:51: error: undefined reference to 'glfwGetVersionString'
input.go:81: error: undefined reference to 'glfwGetInputMode'
input.go:93: error: undefined reference to 'glfwGetJoystickAxes'
input.go:116: error: undefined reference to 'glfwGetJoystickName'
input.go:154: error: undefined reference to 'glfwJoystickPresent'
input.go:185: error: undefined reference to 'glfwSetCursorEnterCallback'
input.go:216: error: undefined reference to 'glfwSetCursorPosCallback'
input.go:287: error: undefined reference to 'glfwSetScrollCallback'
input.go:68: error: undefined reference to 'glfwGetCursorPos'
input.go:205: error: undefined reference to 'glfwSetCursorPos'
input.go:236: error: undefined reference to 'glfwSetInputMode'
monitor.go:87: error: undefined reference to 'glfwGetGammaRamp'
monitor.go:97: error: undefined reference to 'glfwGetMonitorName'
monitor.go:129: error: undefined reference to 'glfwGetMonitors'
monitor.go:138: error: undefined reference to 'glfwGetPrimaryMonitor'
monitor.go:148: error: undefined reference to 'glfwGetVideoMode'
monitor.go:190: error: undefined reference to 'glfwSetMonitorCallback'
monitor.go:108: error: undefined reference to 'glfwGetMonitorPhysicalSize'
monitor.go:119: error: undefined reference to 'glfwGetMonitorPos'
monitor.go:170: error: undefined reference to 'glfwSetGamma'
monitor.go:180: error: undefined reference to 'glfwSetGammaRamp'
window.go:45: error: undefined reference to 'glfwCreateWindow'
window.go:87: error: undefined reference to 'glfwGetWindowAttrib'
window.go:97: error: undefined reference to 'glfwGetWindowMonitor'
window.go:129: error: undefined reference to 'glfwGetWindowUserPointer'
window.go:176: error: undefined reference to 'glfwSetFramebufferSizeCallback'
window.go:216: error: undefined reference to 'glfwSetWindowFocusCallback'
window.go:236: error: undefined reference to 'glfwSetWindowIconifyCallback'
window.go:267: error: undefined reference to 'glfwSetWindowPosCallback'
window.go:397: error: undefined reference to 'glfwWindowShouldClose'
window.go:54: error: undefined reference to 'glfwDefaultWindowHints'
window.go:63: error: undefined reference to 'glfwDestroyWindow'
window.go:74: error: undefined reference to 'glfwGetFramebufferSize'
window.go:108: error: undefined reference to 'glfwGetWindowPos'
window.go:138: error: undefined reference to 'glfwHideWindow'
window.go:307: error: undefined reference to 'glfwSetWindowShouldClose'
window.go:358: error: undefined reference to 'glfwSetWindowUserPointer'
window.go:367: error: undefined reference to 'glfwShowWindow'
window.go:386: error: undefined reference to 'glfwWindowHint'
src/github.com/go-gl/glfw3/error.c:8: error: undefined reference to 'glfwSetErrorCallback'
src/github.com/go-gl/glfw3/input.c:40: error: undefined reference to 'glfwSetCursorPosCallback'
src/github.com/go-gl/glfw3/input.c:44: error: undefined reference to 'glfwSetCursorEnterCallback'
src/github.com/go-gl/glfw3/input.c:48: error: undefined reference to 'glfwSetScrollCallback'
src/github.com/go-gl/glfw3/monitor.c:16: error: undefined reference to 'glfwSetMonitorCallback'
src/github.com/go-gl/glfw3/window.c:32: error: undefined reference to 'glfwSetWindowPosCallback'
src/github.com/go-gl/glfw3/window.c:40: error: undefined reference to 'glfwSetFramebufferSizeCallback'
src/github.com/go-gl/glfw3/window.c:52: error: undefined reference to 'glfwSetWindowFocusCallback'
src/github.com/go-gl/glfw3/window.c:56: error: undefined reference to 'glfwSetWindowIconifyCallback'
collect2: ld returned 1 exit status

Mavericks: clang: error: argument unused during compilation: '-fno-eliminate-unused-debug-types'

Running Mac OS X mavericks the following commands are ok:
$ brew install go
$ brew tap homebrew/versions
$ brew install --build-bottle --static glfw3

But when I run the following command
$ go get github.com/go-gl/glfw3

I get the following error:
clang: error: argument unused during compilation: '-fno-eliminate-unused-debug-types'

Am I missing something, can anybody help me troubleshoot this issue further?

Some diagnostics:
andre@Andres-MacBook-Pro ~ $ go version
go version go1.1.2 darwin/amd64

andre@Andres-MacBook-Pro ~ $ clang --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

GLFW 3.1: incorrect window hints?

I believe the window hints may be incorrect -- but I am not sure. Attempting to use either Focused or Iconified as a window hint results in an invalid enum error for me on Linux/X11.

Taking a look at glfw3.h:495 tells shows me a section -- not declared as window hints -- but matching the ones declared in the Go package:

#define GLFW_FOCUSED                0x00020001
#define GLFW_ICONIFIED              0x00020002
#define GLFW_RESIZABLE              0x00020003
#define GLFW_VISIBLE                0x00020004
#define GLFW_DECORATED              0x00020005
#define GLFW_AUTO_ICONIFY           0x00020006
#define GLFW_FLOATING               0x00020007

Which makes me think they are valid. (Also, what is auto iconify and floating? They aren't exposed via the package ?)

devel_glfw3.1: MinGW version incompatabilities

Hey all,

I think there is a bug in Go somewhere causing incompatibilities with different MinGW versions (at least for MinGW-W64). Building a project using this package with certain MinGW versions causes the link process on windows to spout a bunch of errors.

I did test a bunch of different MinGW prebuilt binaries -- and I came up with these results:

MinGW binaries that do not work:

MinGW binaries that do work:

So it seems only GCC 4.8.1 works from my naive perspective. But I'll try to dig further and create an minimalistic example later on.

For an example today, try building hello.go inside the github.com/ajhager/engi/demos folder. It produces errors like this.

(Note: the issue started out here but everything important I have written here -- as that is just a mirror.)

devel_glfw3.1: Minor points.

Just so I don't forget, there were a few things I noticed while reviewing #96 but not directly related to it:

  • The GLFWError type comment mentions "GlfwError" instead of "GLFWError".
  • Does ErrorCode type need to be public, or would it be better to make it errorCode?

installation instructions

I'm likely being really dumb but I haven't been able to build this library.

I'm on the Linux(CentOS) VM within VirturalBox with x11 running.
I've downloaded 3.0.2 from https://github.com/glfw/glfw/releases
I've then run...
cmake -DBUILD_SHARED_LIBS=ON
make
sudo make install
cd ~/go/src/github.com/go-gl/glfw3
go build

I don't get any errors until the last part
https://gist.github.com/talltyler/6a40196d0d91fdf7e7cf

the output from the GLFW install output this at the end
-- Install configuration: ""
-- Installing: /usr/local/include/GLFW
-- Up-to-date: /usr/local/include/GLFW/glfw3.h
-- Up-to-date: /usr/local/include/GLFW/glfw3native.h
-- Up-to-date: /usr/local/lib/cmake/glfw/glfwConfig.cmake
-- Up-to-date: /usr/local/lib/cmake/glfw/glfwConfigVersion.cmake
-- Up-to-date: /usr/local/lib/cmake/glfw/glfwTargets.cmake
-- Installing: /usr/local/lib/cmake/glfw/glfwTargets-noconfig.cmake
-- Up-to-date: /usr/local/lib/pkgconfig/glfw3.pc
-- Up-to-date: /usr/local/lib/libglfw.so.3.0
-- Up-to-date: /usr/local/lib/libglfw.so.3
-- Up-to-date: /usr/local/lib/libglfw.so

It looks like it installed everything but something isn't linking. It is ok that it is putting them in /usr/local/include and not in /usr/include?

If it is just me doing something stupid I would love it if we could get a few lines in the read me about how to get glfw compiled to work with this.

Linker flags on Linux

Are the linker flags on Linux confirmed? I got a very large amount of linker errors unless I made the linker flags:

-lglfw3 -lGL -lX11 -lXrandr -lXi -lm

And yes, I made sure, removing and single one of those causes linking to fail.

It seems to build without -pthread for LD- and C- FLAGS, but almost every glfw3 example has it so maybe it should be added too (go-gl/glfw has -pthread as well)?

It's possible my setup is just weird though so I won't submit a pull request until I know it's not just my issue.

Go error handling

Is it better to use Go's error functionality instead of returning nil pointers?

Return errors where needed

SetClipboardString
SetErrorCallback
SetKeyCallback
SetCharacterCallback
SetMouseButtonCallback
SetCursorPositionCallback
SetCursorEnterCallback
SetScrollCallback
GetJoystickAxes
GetJoystickButtons
GetJoystickName
SetMonitorCallback
SetPositionCallback
SetSizeCallback
SetFramebufferSizeCallback
SetCloseCallback
SetRefreshCallback
SetFocusCallback
SetIconifyCallback

GLFW counterpart of above functions return a NULL if there occurs an error. If such thing happens, Go functions should return an error with a descriptive string.

GLFW/glfw3.h not found

When I execute go get github.com/go-gl/glfw3, I get the following error:

# github.com/go-gl/glfw3
../../golang/src/github.com/go-gl/glfw3/clipboard.go:4:24: fatal error: GLFW/glfw3.h: No such file or directory
 //#include <GLFW/glfw3.h>
                        ^
compilation terminated.

I guess I'm doing something wrong, but I don't really know what. I am using Ubuntu 14.04 and I have the package libglfw-dev installed.

Win7 x64 / Mingw64 linker errors

I have glfw3.dll, libxxx.a, and .h include files all deployed in my Win7 x64 MinGW64 setup.

But go get github.com/go-gl/glfw3 still gives many linker errors:

C:\Users\metaleap>go get github.com/go-gl/glfw3
# github.com/go-gl/glfw3
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\clipboard.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetClipboardString':
q:\d\src\github.com\go-gl\glfw3/clipboard.go:43: undefined reference to `glfwGetClipboardString'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\clipboard.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwSetClipboardString':
q:\d\src\github.com\go-gl\glfw3/clipboard.go:53: undefined reference to `glfwSetClipboardString'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\context.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetCurrentContext':
q:\d\src\github.com\go-gl\glfw3/context.go:44: undefined reference to `glfwGetCurrentContext'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\context.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwMakeContextCurrent':
q:\d\src\github.com\go-gl\glfw3/context.go:53: undefined reference to `glfwMakeContextCurrent'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\error.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwSetErrorCallback':
q:\d\src\github.com\go-gl\glfw3/error.go:34: undefined reference to `glfwSetErrorCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\glfw.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetVersionString':
q:\d\src\github.com\go-gl\glfw3/glfw.go:43: undefined reference to `glfwGetVersionString'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\input.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetInputMode':
q:\d\src\github.com\go-gl\glfw3/input.go:81: undefined reference to `glfwGetInputMode'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\input.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetJoystickAxes':
q:\d\src\github.com\go-gl\glfw3/input.go:93: undefined reference to `glfwGetJoystickAxes'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\input.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetJoystickName':
q:\d\src\github.com\go-gl\glfw3/input.go:116: undefined reference to `glfwGetJoystickName'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\input.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwJoystickPresent':
q:\d\src\github.com\go-gl\glfw3/input.go:154: undefined reference to `glfwJoystickPresent'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\input.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwSetCursorEnterCallback':
q:\d\src\github.com\go-gl\glfw3/input.go:185: undefined reference to `glfwSetCursorEnterCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\input.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwSetCursorPosCallback':
q:\d\src\github.com\go-gl\glfw3/input.go:216: undefined reference to `glfwSetCursorPosCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\input.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwSetScrollCallback':
q:\d\src\github.com\go-gl\glfw3/input.go:287: undefined reference to `glfwSetScrollCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\input.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetCursorPos':
q:\d\src\github.com\go-gl\glfw3/input.go:68: undefined reference to `glfwGetCursorPos'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\input.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwSetCursorPos':
q:\d\src\github.com\go-gl\glfw3/input.go:205: undefined reference to `glfwSetCursorPos'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\input.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwSetInputMode':
q:\d\src\github.com\go-gl\glfw3/input.go:236: undefined reference to `glfwSetInputMode'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\monitor.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetGammaRamp':
q:\d\src\github.com\go-gl\glfw3/monitor.go:87: undefined reference to `glfwGetGammaRamp'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\monitor.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetMonitorName':
q:\d\src\github.com\go-gl\glfw3/monitor.go:97: undefined reference to `glfwGetMonitorName'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\monitor.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetMonitors':
q:\d\src\github.com\go-gl\glfw3/monitor.go:129: undefined reference to `glfwGetMonitors'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\monitor.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetPrimaryMonitor':
q:\d\src\github.com\go-gl\glfw3/monitor.go:138: undefined reference to `glfwGetPrimaryMonitor'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\monitor.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetVideoMode':
q:\d\src\github.com\go-gl\glfw3/monitor.go:148: undefined reference to `glfwGetVideoMode'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\monitor.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwSetMonitorCallback':
q:\d\src\github.com\go-gl\glfw3/monitor.go:190: undefined reference to `glfwSetMonitorCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\monitor.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetMonitorPhysicalSize':
q:\d\src\github.com\go-gl\glfw3/monitor.go:108: undefined reference to `glfwGetMonitorPhysicalSize'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\monitor.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetMonitorPos':
q:\d\src\github.com\go-gl\glfw3/monitor.go:119: undefined reference to `glfwGetMonitorPos'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\monitor.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwSetGamma':
q:\d\src\github.com\go-gl\glfw3/monitor.go:170: undefined reference to `glfwSetGamma'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\monitor.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwSetGammaRamp':
q:\d\src\github.com\go-gl\glfw3/monitor.go:180: undefined reference to `glfwSetGammaRamp'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwCreateWindow':
q:\d\src\github.com\go-gl\glfw3/window.go:45: undefined reference to `glfwCreateWindow'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetWindowAttrib':
q:\d\src\github.com\go-gl\glfw3/window.go:87: undefined reference to `glfwGetWindowAttrib'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetWindowMonitor':
q:\d\src\github.com\go-gl\glfw3/window.go:97: undefined reference to `glfwGetWindowMonitor'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetWindowUserPointer':
q:\d\src\github.com\go-gl\glfw3/window.go:129: undefined reference to `glfwGetWindowUserPointer'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwSetFramebufferSizeCallback':
q:\d\src\github.com\go-gl\glfw3/window.go:176: undefined reference to `glfwSetFramebufferSizeCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwSetWindowFocusCallback':
q:\d\src\github.com\go-gl\glfw3/window.go:216: undefined reference to `glfwSetWindowFocusCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwSetWindowIconifyCallback':
q:\d\src\github.com\go-gl\glfw3/window.go:236: undefined reference to `glfwSetWindowIconifyCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwSetWindowPosCallback':
q:\d\src\github.com\go-gl\glfw3/window.go:267: undefined reference to `glfwSetWindowPosCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwWindowShouldClose':
q:\d\src\github.com\go-gl\glfw3/window.go:397: undefined reference to `glfwWindowShouldClose'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwDefaultWindowHints':
q:\d\src\github.com\go-gl\glfw3/window.go:54: undefined reference to `glfwDefaultWindowHints'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwDestroyWindow':
q:\d\src\github.com\go-gl\glfw3/window.go:63: undefined reference to `glfwDestroyWindow'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetFramebufferSize':
q:\d\src\github.com\go-gl\glfw3/window.go:74: undefined reference to `glfwGetFramebufferSize'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwGetWindowPos':
q:\d\src\github.com\go-gl\glfw3/window.go:108: undefined reference to `glfwGetWindowPos'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwHideWindow':
q:\d\src\github.com\go-gl\glfw3/window.go:138: undefined reference to `glfwHideWindow'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwSetWindowShouldClose':
q:\d\src\github.com\go-gl\glfw3/window.go:307: undefined reference to `glfwSetWindowShouldClose'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwSetWindowUserPointer':
q:\d\src\github.com\go-gl\glfw3/window.go:358: undefined reference to `glfwSetWindowUserPointer'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwShowWindow':
q:\d\src\github.com\go-gl\glfw3/window.go:367: undefined reference to `glfwShowWindow'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.cgo2.o: In function `_cgo_48bd544f57b8_Cfunc_glfwWindowHint':
q:\d\src\github.com\go-gl\glfw3/window.go:386: undefined reference to `glfwWindowHint'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\error.o: In function `glfwSetErrorCallbackCB':
q:/d/src/github.com/go-gl/glfw3/error.c:8: undefined reference to `glfwSetErrorCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\input.o: In function `glfwSetCursorPosCallbackCB':
q:/d/src/github.com/go-gl/glfw3/input.c:40: undefined reference to `glfwSetCursorPosCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\input.o: In function `glfwSetCursorEnterCallbackCB':
q:/d/src/github.com/go-gl/glfw3/input.c:44: undefined reference to `glfwSetCursorEnterCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\input.o: In function `glfwSetScrollCallbackCB':
q:/d/src/github.com/go-gl/glfw3/input.c:48: undefined reference to `glfwSetScrollCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\monitor.o: In function `glfwSetMonitorCallbackCB':
q:/d/src/github.com/go-gl/glfw3/monitor.c:16: undefined reference to `glfwSetMonitorCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.o: In function `glfwSetWindowPosCallbackCB':
q:/d/src/github.com/go-gl/glfw3/window.c:32: undefined reference to `glfwSetWindowPosCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.o: In function `glfwSetFramebufferSizeCallbackCB':
q:/d/src/github.com/go-gl/glfw3/window.c:40: undefined reference to `glfwSetFramebufferSizeCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.o: In function `glfwSetWindowFocusCallbackCB':
q:/d/src/github.com/go-gl/glfw3/window.c:52: undefined reference to `glfwSetWindowFocusCallback'
y:\t\go-build433906223\github.com\go-gl\glfw3\_obj\window.o: In function `glfwSetWindowIconifyCallbackCB':
q:/d/src/github.com/go-gl/glfw3/window.c:56: undefined reference to `glfwSetWindowIconifyCallback'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(glext.o):glext.c:(.text+0x17): undefined reference to `__imp_glGetString'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(glext.o):glext.c:(.text+0x1cc): undefined reference to `__imp_glGetIntegerv'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(glext.o):glext.c:(.text+0x211): undefined reference to `__imp_glGetIntegerv'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(glext.o):glext.c:(.text+0x2c5): undefined reference to `__imp_glGetString'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(glext.o):glext.c:(.text+0x2fc): undefined reference to `__imp_glGetIntegerv'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(window.o):window.c:(.text+0x974): undefined reference to`__imp_glClear'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(win32_glext.o):win32_glext.c:(.text+0x77): undefined reference to `__imp_wglGetProcAddress'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(win32_window.o):win32_window.c:(.text+0x244): undefined reference to `__imp_wglMakeCurrent'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(win32_window.o):win32_window.c:(.text+0x251): undefined reference to `__imp_wglDeleteContext'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(win32_window.o):win32_window.c:(.text+0xff9): undefined reference to `__imp_wglGetProcAddress'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(win32_window.o):win32_window.c:(.text+0x1726): undefined reference to `__imp_wglMakeCurrent'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(win32_window.o):win32_window.c:(.text+0x18d2): undefined reference to `__imp_wglCreateContext'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(win32_window.o):win32_window.c:(.text+0x1d36): undefined reference to `__imp_glGetIntegerv'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(win32_window.o):win32_window.c:(.text+0x1d49): undefined reference to `__imp_glGetFloatv'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(win32_window.o):win32_window.c:(.text+0x1d53): undefined reference to `__imp_glClearColor'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(win32_window.o):win32_window.c:(.text+0x1d69): undefined reference to `__imp_glClear'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/bin/ld.exe: c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/libglfw.a(win32_window.o): bad reloc address 0x0 in section `.rdata'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status

What am I missing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.