GLUT (pronounced like the glut in gluttony) is the OpenGL Utility Toolkit, available for C, C++, FORTRAN, and Ada. GLUT is a window system independent toolkit for OpenGL that implements a simple windowing API. Because of its ease of use, it is often used to learn how to write programs with OpenGL. ...

learn more… | top users | synonyms

11
votes
3answers
7k views

What animation technique is used in 'Dont Starve'? [closed]

While playing a few games in my personal time off development I've stumbled across a survival 2D/3D survival game. The game was apparently made in SDL and GLUT (Dont starve) but what really amazed me ...
10
votes
1answer
27k views

How to get and use delta time

I have mice looking and walking in my game, but they are very slow and hard to use. I think it's because I'm using fixed speed. I heard that in big projects developers use delta time. How do I ...
9
votes
5answers
4k views

Is GLUT obsolete?

A question was asked about good, up-to date OpenGL resources, one of the answers was a link to a tutorial about modern OpenGL programming. The tutorial in question uses GLUT and GLEW, but I have read ...
9
votes
1answer
19k views

How does gluLookAt work?

From my understanding, gluLookAt( eye_x, eye_y, eye_z, center_x, center_y, center_z, up_x, up_y, up_z ); is equivalent to: glRotatef(B, 0.0, 0.0, 1.0); ...
8
votes
4answers
5k views

Trapping mouse inside window in OpenGL with GLUT?

I perfectly understand that GLUT is limited and the following problem can't probably be solved with OpenGL/GLUT, but since I don't know exactly if it can or not, I better just ask. Maybe I'm doing ...
7
votes
2answers
4k views

Why should I not use glTools/glut when developing complete applications?

I've started learning how to use OpenGL a while back, using the OpenGL SuperBible, Fifth Edition, and I've had people arguing about the fact that the book doesn't really teach how to use OpenGL but ...
7
votes
1answer
601 views

How to render portals in OpenGL?

I am making RPG in OpenGl and I need to make some portals. How should I render it if I want to see through the portal on the other side?
6
votes
1answer
184 views

Excluding Background from Color Picking

I've implemented picking based on color coding, but I don't want the background color to be pickable. Is there any way in openGL (2.x) to exclude the background color? For some reason, doing ...
5
votes
2answers
6k views

Constant game speed independent of variable FPS in OpenGL with GLUT?

I've been reading Koen Witters detailed article about different game loop solutions but I'm having some problems implementing the last one with GLUT, which is the recommended one. After reading a ...
5
votes
3answers
877 views

Rotate a particle system

Languages / Libraries in use: C++, OpenGL, GLUT Okay, here's the deal. I've got a particle system which shoots out alpha blended textures to produce a flame. The system only keeps track of very ...
3
votes
1answer
530 views

Are ambient, diffuse and specular light or material properties?

Are ambient, diffuse and specular properties of light or material? I am doing ray casting in OpenGL, I've managed to create lit sphere using formula I = L Ka + L Kd (n . l) + L Ks (r . v)^n but I ...
3
votes
1answer
386 views

rotating objects in a double orbit

I have a object at the center. Other set of objects rotating around center in first orbit. Now i want other objects to rotate around the objects in 1st orbit. In the above fig, set of triangles are ...
3
votes
1answer
89 views

In GLUT, how do I bind an action to a press of “any key”?

Well, this sound ridiculous but the logic is escaping me. I have drawn my cube in OpenGL and I want to translate it to the right if any of the key on the keyboard is pressed. I know how to do this for ...
2
votes
2answers
4k views

Frame timing for GLFW versus GLUT

I need a library which ensures me that the timing between frames are more constant as possible during an experiment of visual psychophics. This is usually done synchronizing the refresh rate of the ...
2
votes
2answers
1k views

Simple OpenGL program major slow down at high resolution

I have created a small OpenGL 3.3 (Core) program using freeglut. The whole geometry is two boxes and one plane with some textures. I can move around like in an FPS and that's it. The problem is I face ...
2
votes
2answers
833 views

VBO triangle not rendered using Freeglut Opengl 3.x, not understanding the weird fixes

I've just started to learn OpenGL 3 and I'm using freeglut for the context. I ask for a 3.3 context using: glutInitContextVersion(3,3); glutInitContextFlags(GLUT_FORWARD_COMPATIBLE | GLUT_DEBUG); I ...
2
votes
1answer
4k views

Converting 3D coordinates to 2D and back?

I'm wondering if there is a simple way to convert 3D coordinates to 2D coordinates. Also, if it's possible, to convert in the reverse direction. I'm using OpenGL(GLUT) in my C++ project. I am also ...
2
votes
1answer
364 views

moving from Glut to SDL2

I'm using Glut with OpenGL for drawing. Glut is very simple and straightforward but I have to give up Glut and move on toward SDL2. I'm reading SDL for Game Development, good book. I need to speed up ...
2
votes
1answer
49 views

OpenGL pitching problem

I've been trying to implement several camera movements for my application. So far yawing, rolling, strafing, walking has been working properly, but I can't get my pitching to work properly. If I ...
2
votes
1answer
278 views

Mouse Speed in GLUT and OpenGL?

I would like to simulate a point that moves in 2D. The input should be the speed of the mouse, so the new position will be computed as following new_position = old_position + ...
2
votes
1answer
369 views

Proportional speed movement between mouse and cube

Hi i´m trying to move a cube with the freeglut mouse "glutMotionFunc(processMouseActiveMotion)" callback, my problem is that the movement is not proportional between the mouse speed movement and the ...
2
votes
0answers
166 views

OpenGL textures make very low fps

I loaded some textures just one time before I go to my mainloop(glutMainLoop). I am using SDL for the texture loading. However, when I compile, my game is running at 6-10 fps. When I don't load the ...
1
vote
2answers
2k views

glGenVertexArrays causes crash

My code keeps crashing at runtime, I have done some creative debugging and determined that it was the glGenVertexArrays that was causing the crash, I've looked around and come across some answers that ...
1
vote
2answers
110 views

Is FreeGLUT still a good choice? [closed]

I recently decided to utilize the C++ library called FreeGLUT to have a window be managed from my program, where I can draw things via OpenGL. But at the same time I saw some people telling that it is ...
1
vote
1answer
144 views

Is there a way to start with OpenGL 3.0+ without need to write my own shaders?

I'm starting with OpenGL and found out that after OpenGL 3.x you must write your own shaders (think it's obligatory). Am I right here? I have made some research but I can't seem to find the answer. ...
1
vote
1answer
335 views

Is there a way to use other fonts, besides the default ones in OpenGLUT?

I'm using OpenGLUT functions like glutBitmapString to render sentences and words in a game. However, there is a limited set of fonts to use and I need some bigger size fonts. Is there a way to add new ...
1
vote
2answers
4k views

Keyboard and Mouse callbacks in GLUT

I'm using OpenGL via GLUT in Ubuntu. While writing text in a text editor, the first keystroke is printed immediately. But if we keep pressing the key, it waits for a moment and then prints a trail of ...
1
vote
1answer
941 views

Countdown Timer for Racing Game

I want to make a countdown timer for my racing game such as "3... 2... 1... GO!" I'm using GLUT, OpenGL, and C++. I was wondering what the most appropriate method to handle this in C++. clock()? ...
1
vote
1answer
375 views

Change flag if mousepress while on loop

I have this program that starts a loop when the key is pressed The problem is that when i start the loop, i want to be able to stop it halfway with my mousepress. The problem is that it doesn't ...
1
vote
2answers
1k views

Having a slight problem moving my camera based on time passed using GLUT/OpenGL

Before anyone asks, this is for a university project and I have to use GLUT. I'm not tagging this as homework because this is not a requirement, nor will I have extra points for this. With GLUT, for ...
1
vote
1answer
421 views

Firing bullets with a time interval between them [duplicate]

How can I make my enemies shoot bullets in intervals? I already have the enemy shooting bullets, however my problem is that it shoots the next bullet instantly, making it look like a line instead of ...
1
vote
1answer
646 views

Why am I not getting an sRGB default framebuffer?

I'm trying to make my OpenGL Haskell program gamma correct by making appropriate use of sRGB framebuffers and textures, but I'm running into issues making the default framebuffer sRGB. Consider the ...
1
vote
2answers
3k views

Rotating 2D Object

Well I am trying to learn openGL and want to make a triangle move one unit (0.1) everytime I press one of the keyboard arrows. However i want the triangle to turn first pointing the direction where i ...
1
vote
2answers
4k views

OpenGL: glGetError() returns invalid enum after call to glewInit()

I use GLEW and freeglut. For some reason, after a call to glewInit(), glGetError() returns error code 1280. Reinstalling the drivers didn't help. I tried to disable glewExperimental, it had no effect. ...
1
vote
0answers
205 views

Restart a 2D game - OpenGL, GLUT

I started learning OpenGL and GLUT by making a snake game. The problem I encountered is that when I press the "new game" in the menu, the window has to be resized so that the content of the window to ...
1
vote
2answers
61 views

glutPostRedisplay() is not redrawing after updating model view matrix

I am trying to change the rotation of my object with keyboards, when I move the object in the direction of x, y or z it is okay, it is responding correctly. But when I try to change rotation, it does ...
1
vote
0answers
149 views

FreeGLUT keyboard IO timing and synchronization

Using FreeGLut's keyboard callbacks, glutKeyboardFunc(); glutKeyboardUpFunc(); glutSpecialFunc(); glutSpecialUpFunc(); When in the glutMainLoop pipeline do these functions get called? In other ...
1
vote
1answer
405 views

GLUT Window not responding

I'm trying to calculate the delta time of my program. In main, I call: glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutInitWindowSize(250, 250); ...
0
votes
2answers
1k views

OpenGL align grid like glOrtho but with gluPerspective?

Using gluPerspective makes OpenGL's grid really messy and rather hard to use especially when trying to do mouse input. The grid that perspective uses is completely messed up compared to the grid you ...
0
votes
1answer
1k views

How do I orbit one object around another?

I am trying to do animation using glut. I have 2 squares overlapping to each other and i want other square to rotate around this central object without rotating themselves. I want to rotate in orbit ...
0
votes
3answers
178 views

Editing the pixels of a rendered image

I want to render a simple OpenGL scene as usual, but then I want to superimpose a small image of my own (such as from a bitmap file) on top of the render, such that this image always shows. For ...
0
votes
2answers
168 views

view if GL_CULL_FACE is enabled/disabled

Im using GL_CULL_FACE, an i'm trying to map a key for enable/disable the gl_cull_face. Is there any posibility of viewing if it's enabled or not? Thanks
0
votes
1answer
127 views

Freeglut: Functions missing

I'm currently learning OpenGL (in class) and we're using freeglut 2.8.2, which works just fine (using Visual Studio 2012). As an additional learning resource I'm reading the "OpenGL Superbible, 5h ...
0
votes
2answers
312 views

Manually invoke key callback in (free)glut

I have to watch the keyboard during rendering. So, is there a way to force glut to invoke the Keyboard callback immediately?
0
votes
1answer
82 views

speed up the update of glutidle()

I have a client that sends data at 1KHz (i.e. 0.001 sec) to a master over Internet using UDP protocol. In Master, I need to draw an object, but the problem is that the update of GLUT is slower than ...
0
votes
2answers
130 views

Accessing struct in glut

I have to write a game for a uni project using openGL / glut. I am just going to use a generic example code as I'm just looking for a solution to one specific problem: Using glut, I have to call a ...
0
votes
1answer
669 views

Top-Down Racing Game C++

I'm creating a Top-Down Racing Game in C++ using GLUT/OPENGL and SOIL first of all I just wanted some opinions on how the track should be done. I was thinking about using a tile-map and so far I've ...
0
votes
2answers
65 views

Text in game with not english alphabet

I need to render some special text in my game. Currently I can render any text that use classic letters of english alphabet, but I have some problems with special alphabets. How do I render text: I ...
0
votes
1answer
67 views

GLUT multiple windows FPS drop sharply

When only the main window is created, the fps is able to reach above 1000.However creating 1 more window, resulted in the fps dropping significantly down to about 100. The draw callback draws a blank ...
0
votes
1answer
231 views

How to put the “camera” inside a cube in OpenGL

I'm really new to OpenGL and can't seem to figure out how to put the "camera" inside the cube I've created so that I can move in an FPS-like style. I tried to use gluLookAt and gluPerspective but I'm ...