Questions tagged [glut]

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. Since it is closed source, some people have gone on to create newer, open source alternatives (two examples of this are Freeglut, and GLFW).

Filter by
Sorted by
Tagged with
-2
votes
0answers
44 views

I need help with OpenGL Quads Building a 3D room

I’ve been studying OpenGL for some time now and got very good at it to a point in my studying but the next adventure I’m trying to create a 3D room with a floor, ceiling, and walls and maybe a bonus ...
0
votes
1answer
76 views

OpenGL 2D Game Render Help

I just recently started using C++ and OpenGL and I am running into an issue. I am not totally sure what I am doing so could you please tell me what I am doing wrong and what I could improve? Here is ...
0
votes
1answer
55 views

I have a question about Projection on OpenGL

I am confused about the projection matrix in OpenGL. i have a habit of writing the code as follows. ...
0
votes
2answers
2k views

Drawing a simple triangular prism in opengl in 3D

Is there a simple way to draw a triangular prism in opengl? I'm using lighting and a non-orthographic camera. I basically need a 3d object, not just vertices. edit: well I've tried searching, and I ...
0
votes
1answer
2k views

How can I use keybord keys like W, A, S and D in GLUT and C++?

I want to use W, A, S and D keys like GLUT_KEY_LEFT. My Code: ...
5
votes
1answer
682 views

Loading screen OpenGL with glut API

I'm trying to make a loading screen. My idea is to have two threads working - one in the background loading the 'game' scene, one displaying 'load' scene. When building 'game' scene is finished, it's ...
3
votes
1answer
375 views

How do I add freeglut to a Visual Studio project?

I am working on making a game for Windows in c++. I have previously made games for Ubuntu using freeglut, and I found freeglut for windows, but when I added it to the ...
1
vote
1answer
296 views

Transform existing C++ OpenGL project from glut/glew to GLFW

Is it possible to easly transform existing glut/glew to GLFW API?
1
vote
1answer
244 views

C++ turning towards mouse

I'm creating an attack boat game in c++ and I have an issue with my boat following the mouse around the screen. My plan is to have the boat follow the mouse more like a boat (slow rotations, instead ...
0
votes
1answer
381 views

How do I implement object picking, using OBB in OpenGL?

I am trying to make 3D drawing software. I wanted to have the drag feature so I am using object picking using the OBB algorithm. I am facing problems in understanding the algorithm, and my ...
1
vote
1answer
348 views

Creating and Destroying OpenGl objects dynamically

I was trying to build a game like this and i want to create and destroy these ships at runtime , I have used GL_QUADS and used an image to plot over the QUAD, how can I dynamically create multiple ...
0
votes
1answer
398 views

Problem Rotating z-axis openGL c++

i am trying to rotate a quad at z-axis but the problem is , it is not rotating but translating towards some other direction rather than rotating at a particular point.I believe my display function is ...
1
vote
1answer
1k views

GL how to look at the center of the viewport

I'm using GLFW3 and OpenGL to visualize measurements from an IMU that I have. I've gotten the simple cube example working and I can rotate it successfully with quaternions that I've input. However ...
1
vote
2answers
760 views

How to initialize OpenGL context with PyGame instead of GLUT

I'm trying to start with OpenGL, using Python and PyGame. I'm going to use PyGame instead of GLUT to do all the initializing, windows opening, input handling, etc. However, my shaders are failing to ...
0
votes
3answers
259 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. ...
2
votes
2answers
332 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
138 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 ...
2
votes
0answers
792 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
0answers
777 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
937 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 ...
4
votes
1answer
865 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
1answer
63 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
1k 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
1answer
171 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
0answers
36 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
911 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
244 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 ...
0
votes
3answers
254 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 ...
1
vote
1answer
187 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
1k 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
896 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 ...
0
votes
1answer
410 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 ...
0
votes
1answer
116 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
2k 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 ...
3
votes
2answers
5k 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 ...
2
votes
1answer
2k 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
1answer
924 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 ...
2
votes
1answer
624 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 ...
1
vote
0answers
246 views

FreeGLUT keyboard IO timing and synchronization

Using FreeGLut's keyboard callbacks, glutKeyboardFunc(); glutKeyboardUpFunc(); glutSpecialFunc(); glutSpecialUpFunc(); When in the ...
3
votes
1answer
1k 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
2answers
256 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
5k 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 ...
2
votes
1answer
682 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 ...
1
vote
2answers
7k views

Keyboard and Mouse callbacks in GLUT

I'm using OpenGL via GLUT in Ubuntu. ...
0
votes
1answer
4k 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 ...
3
votes
1answer
658 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 ...
1
vote
1answer
3k 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
1answer
230 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
779 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
793 views

GLUT Window not responding

I'm trying to calculate the delta time of my program. In main, I call: ...