Questions tagged [glfw]

GLFW is a cross-platform library for creating and interacting with windows with an OpenGL context.

Filter by
Sorted by
Tagged with
-1
votes
1answer
252 views

2D collision not working

I'm new to game programming and my first project is a platformer. All things are going well, I draw the map, got the scrolling working, there's only one problem. I can't get the collision to work, I ...
0
votes
1answer
235 views

Bare-bones OpenGL game engine crashing 1/6 of the time with GLFW/GLEW

I am currently writing an OpenGL game engine, in which I am currently experiencing a crash every 1 out of 6 times. The error message with Visual Studio 2015 is: Exception thrown at 0x545579C6 (...
1
vote
1answer
383 views

Why my images always change color when I use glDrawPixels?

I am doing a exercise for the college, where I need load a file 'ppm' but any picture does not load with correct colors. I tried change parameter of glDrawPixels, glBlendFunc, but nothing change for ...
-1
votes
1answer
165 views

GLFW VBO in World Space

Last year I wrote a basic 3D game for one of my modules using freeglut. Everything was fine and dandy because I used the deprecated immediate-mode of drawing things (glBegin, glVertex, glEnd) for ...
0
votes
1answer
97 views

Disable Ubuntu shortcuts

On Ubuntu when capturing keyboard input with GLFW some keys like LEFT ALT are not passed to my window. Instead some desktop functionality is triggered like the ...
0
votes
1answer
240 views

Mac OSX GLFW Fullscreen Crash

Whenever I run my code to make a fullscreen GLFW window, it crashes. Here is the code: ...
1
vote
2answers
818 views

Should I link GLFW and GLEW into my engine directly?

I want to write my own (simple) game engine with OpenGL. I use GLEW and GLFW and so far linked it successfully. Should the engine or the respective game (which depends on the engine) include GLFW ...
1
vote
1answer
913 views

OpenGL nothing being drawn to screen

I am following the book 'OpenGL SuperBible' and am trying to run one of the first examples of drawing a point to the screen, bit instead of using there lib, im using GLFW. I'm not sure where I am ...
3
votes
3answers
142 views

LWJGL version problems

Is it possible to create VAO's while my computer doesn't support openGL 3.0 or higher? I managed to create a vertex buffer object and draw a rectangle. But then I changed my lwjgl libraries to the ...
0
votes
1answer
495 views

Some OpenGL code not working, but some is

I'm just starting out using GLEW and GLFW in a C++ project for my rendering code, but I'm having trouble actually getting anything to render. I know OpenGL is working in some capacity, because I am ...
1
vote
0answers
231 views

How to create a second Window in OpenGL/GLFW

I would like to have 2 windows. 1 for display purposes and one for settings / buttons (for example to change the color of the background in my main display). How would I go about having a second ...
2
votes
1answer
60 views

Normals showing unexpected results

I am making a game in c++ with opengl and glm and was working on my terrain when this happend : as it appears it is renderering just the way i planned it, but my question was, how do i make it appear ...
0
votes
1answer
79 views

Terrain not rendering like it should be

i was following this tutorial here: https://www.youtube.com/watch?v=yNYwZMmgTJk, in which i was translating from Java to C++ to generate a terrain, and stumbled across this issue: As it appears, it ...
0
votes
2answers
152 views

How can I better structure my code to reduce coupling between input and graphics?

I've been working through a few OpenGL tutorials, and decided to give myself the exercise of trying to draw a grid, with the added requirement of being able to press the ...
1
vote
0answers
232 views

Memory leak with glfwSetWindowTitle? [closed]

I am using GLFW for a game, and I have a function which allows me to set the window title. ...
3
votes
1answer
508 views

OpenGL App not setting cursor position appropriately

I have written a small application using OpenGL, and have implemented some rudimentary camera controls. Unfortunately, I cannot get the application to set my cursor position correctly. The cursor is ...
0
votes
2answers
105 views

Cannot get mask with multiple textures to work

I am trying to render three textures: Background, Black/White Foreground Mask and Foreground. I have used this OpenGL - mask with multiple textures, but I cannot get it to work. I only get the last ...
0
votes
1answer
580 views

LWJGL3 Input for single press of keyboard

I am making a game with lwjgl and GLFW and am having a hard time figuring out how to check for a single press on the keyboard.
4
votes
1answer
504 views

What is causing my default libraries to conflict with OpenGL extensions?

So I'm currently following the tutorial for creating OpenGL programs on learnopengl.com,so I'm using GLFW, GLEW and the base library for OpenGL. However, when I go to build my code, I get a warning ...
2
votes
1answer
117 views

Invalid GLSL on some machines

I'm writing a game engine using OpenGL 4.3 using gcc 5, mainly to teach myself graphics programming. Initial development was on my Surface Pro 3 using mingw-w64 and worked like a charm. I've decided ...
0
votes
1answer
265 views

GLFW Fullscreen OS X in LWJGL 3

How does one create a fullscreen window properly in OS X from the code, instead of just expanding into the current desktop? I am referring to the sort of fullscreen window that one gets when the top-...
0
votes
1answer
162 views

How to make a triangle pixellated with GLFW?

How can one make a triangle look pixelated without modifying the size of the window in GLFW3? Preferably, I'd like to accomplish this without the use of shaders. For example, by setting the size of ...
0
votes
1answer
1k views

Can't draw lines in 2D space with GLFW and OpenGL

I'm trying to draw a grid in 2D space using GLFW and OpenGL but for some reason I only get this on the screen: Here's my code: ...
5
votes
2answers
3k views

Setting Window Icon Using GLFW (LWJGL 3)

What's the best, cross platform, way of setting the window icon using LWJGL 3? I have a PNG image and would like to set it to the icon present in my dock (OS X) or the application bar (Linux).
1
vote
2answers
1k views

GLFW / OpenGL location and size in pixels

I'm using GLFW to create a little game. (and by little, I mean: small, nonprofit) After a while of puzzling, I found out that this draws a texture (from an image, for instance) to the screen: (the ...
1
vote
0answers
2k views

How to toggle fullscreen with lwjgl

I'm using glfw in lwjgl-3 to try to create a toggleFullscreen method. However it always gives me errors. I saw this question Toggle Fullscreen at Runtime but it didn't help because glfwOpenWindow() ...
-3
votes
1answer
2k views

Licensing and commercial game development [closed]

I am thinking about developing my game and have a few questions. I am going to use these softwares and libraries : OpenGL, Visual Studio Express, GLFW. I have publishing and selling my game in plans. ...
1
vote
2answers
1k views

Runtime resolution changing with GLFW3

I've been trying to figure out the correct method for changing the resolution/fullscreen state of a GLFW window for a while now, but after searching all I found were references of how to do it with ...
1
vote
0answers
801 views

Compiling glfw application mingw [closed]

I am trying to compile a glfw application on mingw. I am using 64 bit windows and 32bit mingw compiler And I have downloaded 32 bit binaries from http://www.glfw.org/download.html I am trying do by ...
0
votes
1answer
148 views

How can I ensure GLFW callback events only happen once in the main loop?

The problem is that the mouse and keyboard events can be triggered before the main loop(in which the program starts to render and update content) takes place. In the program if the moues button is ...
0
votes
1answer
6k views

How do I set a background image in OpenGL/GLFW?

I'm writing a simple 2D game with C++ and OpenGL/GLFW, and my current step is to create a menu. I finished with buttons, but I think it looks a little bit boring (with only 4 buttons and a black ...
2
votes
1answer
630 views

GLFW mouselook under OSX

I'm continuing to port an OpenGL app from Visual Studio 2012 to XCode 5. The only major issue I'm having is mouselook. It "doesn't work" under OSX (Mavericks). Here's the (pseudocode): Pre-update,...
1
vote
1answer
293 views

GLFW3. Destroying and create new window results in a black window

I am trying to write a fullscreen toggle handler and running into an issue. In order to change between fullscreen and windowed I need to destroy the current window and create a new one with the '...
0
votes
1answer
672 views

OpenGL +SFML + GLFW3

I'am maybe asking a stupid question, but can we mix OpenGl + SMFL and add to it some GLFW in the same SFML window ?
6
votes
3answers
18k views

Why does my machine render OpenGL using my onboard chipset instead of my graphics card?

I'm following an OpenGL tutorial series at opengl-tutorial.org, but have run into a problem: The following lines: ...
9
votes
2answers
8k views

How can I forward GLFW's keyboard input to another object?

I'm having trouble trying to execute keyboard events in a another class with GLFW3. The problem I'm having is that GLFW3 uses a static function for input as shown: ...
-2
votes
1answer
420 views

Why OpenGL X and Z axis got inverted sometimes?

I'm having some troubles with my game code. I'm developing a Voxel Engine and everything is fine, but sometimes (like 30% of times) when I build and run my project, the X and Z axis got inverted (I ...
4
votes
1answer
3k views

GLFW3 multiple windows

I'm trying to use GLFW3 to develop VJing application. So basic idea is use two windows: 1st window for fullscreen projection on secondary monitor (basically projector) 2nd window for (hopefully) ...
0
votes
1answer
3k views

Texture Won't Load in OpenGL

I've started trying to make a 2D game in C++ using OpenGL, and I'm using SOIL as the imaging loading library. The problem is, I've been trying to get a simple 64x64 image of a red square to open and ...
3
votes
1answer
6k views

Why would creating a GLFW 3 window return null?

For some reason after calling 'glfwCreateWindow' I get back NULL as the return value. I'm initializing GLFW beforehand with 'glfwInit' and while searching for a ...
2
votes
1answer
11k views

How to find monitor resolution with glfw3?

For a while now, I have been playing around with making a game using OpenGL, and glfw3. I have been perfectly happy to create windows at my native resolution of 1920x1080. I'm getting to the point ...
1
vote
0answers
2k views

Creating a new GLFW window and re-using the old context causes crash

I am using GLFW 3.0.2 and when I want to switch the application to fullscreen, I create a new window and intend to use the OpenGL context of the old window so I don't have to reload all the meshes, ...
7
votes
2answers
12k views

How to set to fullscreen in GLFW3?

In the version 2.7 everything was pretty simple: glfwOpenWindow(Width, Height, 8, 8, 8, 8, 24, 0, isFullscr ? GLFW_FULLSCREEN : GLFW_WINDOW); But in version 3.x ...
13
votes
2answers
10k views

How can I associate a key_callback with a wrapper class instance?

I'm trying to wrap my GLFW3 calls into a single class: ...
1
vote
1answer
2k views

Why won't my vertex buffer render in GLFW3?

I have started to try to learn OpenGL, and I decided to use GLFW to assist in window creation. The problem is, since GLFW3 is so new, there are no tutorials on it or how to use it with modern OpenGL (...
2
votes
1answer
372 views

What is the purpose of bitdepth for the several components of the framebuffer in glfwWindowHint function of GLFW3?

I would like to know what are the following "framebuffer related hints" of GLFW3 function glfwWindowHint : GLFW_RED_BITS GLFW_GREEN_BITS GLFW_BLUE_BITS GLFW_ALPHA_BITS GLFW_DEPTH_BITS ...
-1
votes
2answers
2k views

Need help drawing obj file! [closed]

I'm using GLFW and I want to draw a obj file. How are they drawn? I know how to draw 3D in OpenGL but when I open the obj file I see "v"s, "vn"s, "f"s, "vt"s, what are these? I don't know how to read ...
24
votes
1answer
1k views

My game seems to be incompatible with recording software. What could be causing this?

I've just finished a little Game-Dev project for university and I need to record a video to accompany my submission (just in case they can't get my source to work). Basically my game doesn't work at ...
0
votes
1answer
919 views

gluLookAt strange behavior implementing camera

I'm having a super tough time trying to implement what I thought would be a very straightforward problem. I'm trying to demonstrate a free camera that can move forward/back, strafe left/right, fly up/...
2
votes
1answer
8k views

Why does glGetString returns a NULL string

I am trying my hands at GLFW library. I have written a basic program to get OpenGL renderer and vendor string. Here is the code ...