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

1907 questions
132
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
102
votes
9 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
  • 9,832
  • 22
  • 88
  • 173
48
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,263
  • 1
  • 8
  • 15
45
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
  • 971
  • 1
  • 8
  • 16
31
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 callse into a simple class. Im having trouble setting the key callback. My class is defined as: class GAME { private: bool running; public: GAME(); int execute(); void…
viraj
  • 1,654
  • 4
  • 32
  • 49
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,054
  • 2
  • 17
  • 37
23
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,221
  • 3
  • 26
  • 39
22
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…
SairesArt
  • 519
  • 1
  • 3
  • 12
20
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
  • 584
  • 1
  • 8
  • 21
19
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,089
  • 2
  • 15
  • 29
18
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
  • 710
  • 1
  • 5
  • 13
17
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
  • 173
  • 1
  • 1
  • 5
16
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,337
  • 3
  • 21
  • 36
14
votes
0 answers

How to avoid handling both the key-event and char-event

To handle text input I've set up a char-event callback with glfwSetCharCallback, and to handle non-text keypresses (arrow keys & hotkeys) I've set up a key-event callback with glfwSetKeyCallback. What happens in this situation is that for a key…
yairchu
  • 21,122
  • 7
  • 65
  • 104
13
votes
1 answer

GLFW MinGW link error

I've been attempting to test out GLFW with C++ for quite a while and am having constant linker issues. I am fairly new to C++, although I have experience in Java and C#, working directly with the compiler is fairly new to me. Here's my setup…
Matthew D
  • 371
  • 2
  • 10
1
2 3
99 100