Questions tagged [glfw]

GLFW is a free, Open Source, multi-platform library for opening a window, creating an OpenGL context and managing input. It is easy to integrate into existing applications and does not lay claim to the main loop. GLFW is written in C and has native support for Windows, Mac OS X and many Unix-like systems using the X Window System, such as Linux and FreeBSD. GLFW is licensed under the zlib/libpng license.

What is GLFW?

GLFW is an Open Source, multi-platform library for creating windows with OpenGL or OpenGL ES contexts and managing input. It is easy to integrate into existing applications and does not lay claim to the main loop.

GLFW is written in C and has native support for Windows, Mac OS X and many Unix-like systems using the X Window System, such as Linux and FreeBSD.

GLFW is licensed under the zlib/libpng license.

Features

  • Easy to use API in the style of the OpenGL APIs
  • Gives you a window and OpenGL context with two function calls
  • Explicit support for MSAA and OpenGL 3.2+, including profiles and flags
  • Keyboard, mouse, joystick and time input
  • Input can be either polled or delivered via callbacks
  • Basic Unicode character input
  • Supports both static and dynamic linking
  • Open Source with a liberal OSI-certified license
  • Makefiles or project files for most popular C/C++ compilers
  • Examples and comprehensive documentation

Documentation

  • The documentation contains a tutorial, guides on the different areas of the API, compilation and linking guides, a reference manual and a guide for migrating from older versions of the API.

Ressources

2371 questions
137
votes
2 answers

Small Haskell program compiled with GHC into huge binary

Even trivially small Haskell programs turn into gigantic executables. I've written a small program, that was compiled (with GHC) to the binary with the size extending 7 MB! What can cause even a small Haskell program to be compiled to the huge…
user181351
112
votes
10 answers

How to build & install GLFW 3 and use it in a Linux project

GLFW3 Last night I was working late trying to build the GLFW 3 packages for Linux from source. This process took me a very long time, about 3 hours in total, partly because I am unfamiliar with CMake, and partly because I am was unfamiliar with…
FreelanceConsultant
  • 13,167
  • 27
  • 115
  • 225
61
votes
1 answer

What is the difference between FreeGLUT vs GLFW?

My university started teaching a course which includes OpenGL programming. They make us use FreeGLUT to create a window and a context for OpenGL, but I found an online course at lynda.com about OpenGL in which they use GLFW instead of FreeGLUT. So I…
varun
  • 1,473
  • 1
  • 9
  • 15
53
votes
2 answers

difference of freeglut vs glew?

I've recently started learning OpenGL (> 3.3) & I've noticed a lot of examples & tutorials use both freeglut & glew, but don't really explain the difference at all. The best description I've found, after googling & reading ad nauseum, has been this…
ReturnVoid
  • 1,106
  • 1
  • 11
  • 18
39
votes
7 answers

Pointing to a function that is a class member - GLFW setKeycallback

I'm writing a GLFW app, in which I've wrapped the function calls into a simple class. I'm having trouble setting the key callback. My class is defined as: class GAME { private: bool running; public: GAME(); int execute(); void…
viraj
  • 1,784
  • 4
  • 35
  • 52
31
votes
4 answers

Current state and solutions for OpenGL over Windows Remote

OpenGL and Windows Remote don't play along nicely. Solutions for this are dependent on the use case and answers are fragmented across the vast depths of the net. This is a write-up I wish existed when I started researching this, both for coders and…
FrostKiwi
  • 741
  • 1
  • 6
  • 16
24
votes
4 answers

Proper way to link a static library using GCC

Why is it that some static libraries (lib*.a) can be linked in the same way that shared libraries (lib*.so) are linked (ld -l switch), but some can not? I had always been taught that all libraries, static or not, can be linked with -l..., however…
Nairou
  • 3,585
  • 5
  • 29
  • 47
24
votes
2 answers

Hiding mouse cursor with glfw

I'm working with a game made with glfW and running in Ubuntu. My problem is that hiding the mouse cursor with the line glfwDisable(GLFW_MOUSE_CURSOR); causes some machines to simply disregard the mouse input, and thus breaks the game. Has anyone…
JMCampos
  • 636
  • 1
  • 9
  • 21
24
votes
3 answers

DLL-linking via Windows cgo->gcc->ld gives "undefined-reference-to-(function)" errors

(Very detailed problem report -- tl;dr at the bottom!) I really prefer GLFW to Glut and want to get its Golang binding working under Windows 64-bit with Go 1.0.1 64-bit. Under Linux, the binding it works flawlessly. This is in principle doable under…
metaleap
  • 2,132
  • 2
  • 22
  • 40
22
votes
1 answer

GLFW - Failed To Open A Window

As my hunt for a cross-platform framework/library went in progress, GLFW was mentioned many times. So, I decided to try it out. Now, it seems as though I can't even init a window. :-/ #include #include #include int main(int argc, char…
Imnotanerd
  • 1,167
  • 2
  • 14
  • 30
22
votes
4 answers

Linking error: DSO missing from command line

I am rather new to Linux (using Ubuntu 14.04 LTS 64bit), coming from Windows, and am attempting to port over an existing CUDA project of mine. When linking via /usr/local/cuda/bin/nvcc -arch=compute_30 -code=sm_30,compute_30 -o Main.o Display.o…
Will Bolden
  • 810
  • 1
  • 7
  • 13
20
votes
3 answers

How to draw while resizing GLFW window?

Whenever I resize a GLFW window it doesn't draw while I'm resizing the window. The newly exposed part of the window only gets drawn on after I finish resizing the window. You can see it for yourself in the picture below: Here is the code for my…
a programmer
  • 333
  • 1
  • 3
  • 9
20
votes
3 answers

OpenGL 3.3/4.1 on Mac OSX 10.9 using GLFW library

I’m trying to use OpenGL 3.3/4.1 on my Mac OSX 10.9 now that its finally available. I’ve been using the SuperBible 5 book and its examples to learn 3.3. I just found out that its actually only running OpenGL 2.1 though for my examples when my…
user3600260
  • 203
  • 1
  • 2
  • 5
20
votes
1 answer

Why is my OpenGL version always 2.1 on Mac OS X?

I'm using GLFW 3.0 on Mac OS X 10.8, graphic card is Intel HD Graphics 5000 And my OpenGL API version is 2.1, aquired by glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MAJOR); glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MINOR); Compiling…
RnMss
  • 3,696
  • 3
  • 28
  • 37
18
votes
5 answers

OpenGL GLFW: undefined reference to 'glfwInit'

I am simply trying to get OpenGL working on my machine (Windows 7 64-bit) with GLFW. I am getting the singular linker error: undefined reference to 'glfwInit'. The code I am trying to compile is the simplest possible (in a file Test.cpp). #include…
Matt Martin
  • 807
  • 2
  • 8
  • 15
1
2 3
99 100