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

1
vote
1answer
92 views

GL uniform variables

I have been studying on glsl lately, starting from very simple vertex and fragment shaders creation for Blender3d, I was quickly drawn to writing the OpenGL context in C++. I find it difficult to ...
0
votes
3answers
73 views

I have my mouse coords converted to world coords. Now how do I detect objects with it? (C++, OpenGL, FreeGlut)

I found a way to convert my mouse coordinates to world coordinates that I can easily understand but now I need to know how to use it to check if the mouse is currently over any of my rendered objects. ...
0
votes
1answer
219 views

Invalid coordinates returned by glutMouseFunc()

I am using GLUT's glutMouseFunc() function to retrieve the coordinates of mouse clicks. I want to move the object on that coordinate to another coordinate. But when I click on the object the ...
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 ...
0
votes
2answers
69 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 ...
3
votes
1answer
105 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
0answers
226 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 ...
0
votes
3answers
180 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
1answer
75 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 ...
1
vote
0answers
250 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
144 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 ...
2
votes
1answer
52 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 ...
7
votes
1answer
646 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?
0
votes
0answers
33 views

Having trouble running OpenGL on MSVC

I'm using the OpenGL Programming Guide, 8th Edition with MSVC 2013 but I can't get the triangles.cpp file to run. These are the errors popping up: http://puu.sh/jAokn/c07420cf46.png
0
votes
1answer
271 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 ...
1
vote
2answers
64 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 ...
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 ...
1
vote
1answer
147 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
454 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 ...
2
votes
1answer
406 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
289 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 + delta_time*...
0
votes
1answer
85 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
1answer
970 views

C++ timer function acts as if time limit is instantly reached if it is less than 1 second [closed]

I'm trying to make a Snake clone with C++ and OpenGL/GLUT, but I've been having trouble with programming the timed input. I made a timer class, as you'll see below, to be used for the short time ...
1
vote
1answer
723 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
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
1answer
364 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 ...
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 ...
1
vote
0answers
152 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
989 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()? ...
2
votes
1answer
389 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 ...
3
votes
1answer
558 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 ...
0
votes
1answer
824 views

c++ most used libraries [closed]

I'm trying to find out whether or not I want to switch from Java to c++ for my OpenGL game programming. I now have setup a test project in VS 11 professional, with GLUT. I created my windows with GLUT,...
0
votes
2answers
176 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
4k views

rotating 3D object around the center

I have object moving from A to B on x-axis and there is no translation of object apart from it. Now, while moving, i want to rotate it around y-axis and the motion should change accordingly, i mean if ...
0
votes
1answer
2k views

OpenGL resize problems

I'm developing a minesweeper game. I'm having a problem with reshaping(resize) the window. I'm using Ubuntu Linux. Following are the code snippets and the entire code is here: This is my initializing ...
1
vote
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 ...
3
votes
1answer
408 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 ...
11
votes
1answer
29k 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 ...
0
votes
1answer
133 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 ...
-6
votes
1answer
427 views

multiplayer game in openGL [closed]

what is the easiest way how to make network communication in openGL/glut? Does anybody know any good tutorial for beginners? thanks (or is there any simpler way then openGL?)
1
vote
1answer
425 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); glutInitWindowPosition(...
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 ...
1
vote
2answers
4k 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 ...
9
votes
1answer
20k 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); ...
5
votes
3answers
901 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 ...
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 ...
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 ...
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. ...
6
votes
1answer
186 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 glClear(...
2
votes
2answers
851 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 ...