glut

Question about running a program at same speed in any computer

I made a program (in C++, using gl/glut) for study purposes where you can basically run around a screen (in first person), and it has several solids around the scene. I tried to run it on a different computer and the speed was completely different, so I searched on the subject and I'm currently doing something like this: Idle function: ...

OpenGL texture mapping on sides cube using GL_QUADS

I am trying to map a different texture on each side of a cube using a GL_QUADS. My first problem is that I cannot even get a texture to display on the side of a GL_QUADS. I can however get a texture to display using GL_TRIANGLES but I do no understand how to draw things very well using triangles and I want to use QUADS. I also can only u...

OpenGL multiple texture mapping on a cube using GLUT

Have been trying to figure out how to put a different texture on each side of a cube using OpenGL and GLUT. I can get it to be a simple texture but multiple texture won't. I would put up my code but it is ugly and cluttered right now. If this is pretty easy to do please post some code for me to follow. Thanks! ...

How to pass a class method as an argument for another function in C++ and openGL?

I know this thing works: void myDisplay() { ... } int main() { ... glutDisplayFunc(myDisplay) ... } so I tried to include myDisplay() function to a class that I made. Because I want to overload it in the future with a different class. However, the compiler complains that argument of type 'void (ClassBlah::)()' does not match 'void(*...

How can I use GLUT with CUDA on MACOSX?

Hi, I'm having problems compiling a CUDA program that uses GLUT on MacOsX. Here is the command line I use to compile the source: nvcc main.c -o main -Xlinker "-L/System/Library/Frameworks/OpenGL.framework/Libraries -lGL -lGLU" "-L/System/Library/Frameworks/GLUT.framework" And here is the errors I get: Undefined symbols: "_glutInitW...

OpenGl glutIdleFunc(void (*func)(void))

I'm trying to design very simple animation in OpenGL such as rotating and translating objects. In the red book, I found that using GLUT's glutIdleFunc() is okay for a simple animation. How many times does glutIdleFunc(...) call the function in one second? Thank you. ...

Setting glutBitmapCharacter color?

Just wondering if someone can help me track down my issue with the following code where the text color is not being set correctly (its just rendering whatever color is in the background) void RenderText(int x, int y, const char *string) { int i, len; glUseProgram(0); glLoadIdentity(); glColor3f(1.0f, 1.0f, 1.0f); glTranslatef(0.0f, 0....

How can I start a new glutMainLoop() after exiting one in OpenGL with Perl?

I've written a Perl script using OpenGL. It calls glutMainLoop() to let the user view some stuff, then the user closes the window but I want to let him continue using the script and reopening a new window and seeing some other stuff. Is that possible? I've found that it is possible to execute this instruction: glutSetOption(GLUT_ACTION_...

Cleaning up when exiting an OpenGL app

This might be a dumb question but I've spent some time asking Google and haven't been able to find anything. I have an an OSX OpenGL app I'm trying to modify. When I create the app a whole bunch of initialisation functions are called -- including methods where I can specify my own mouse and keyboard handlers etc. For example: glutInit(...

Call glutinit in a PHP extension

Hi guys, I am developing a php extension that require the use of opengl. I tried to initialize the library with glutinit; it works in CLI environment but when I tried on browser it doesn't seem to execute the code. The code is actually executed on the server side. It is part of a process to extract features from an image, and the serv...

OpenGL FrameBuffer Objects weird behavior

My algorithm is this: Render the scene to a FBO with shadow mapping from multiple locations Render the scene to the screen with shadow mapping ...black magic that I still have to imlement... Combine the samples from step 1 with the image from step 2 I'm trying to debug steps 1 and 2 and am coming across STRANGE behavior. My algorithm ...

OpenGL Coordinate system confusion

Maybe I set up GLUT wrong. Basically I want verticies to be reletive to their size in pixels. Ex:right now if I create a hexagon, it hakes up the whole screen even though the units are 6. #include <iostream> #include <stdlib.h> //Needed for "exit" function #include <cmath> //Include OpenGL header files, so that we can use OpenGL #ifdef ...

Is there a way to move two squares in OpenGL simultaneously?

Hi, so I have a function that handles key presses in a game I'm working on in OpenGL. But, the thing is that even though I have made two squares and they both move when the correct key is pressed only one square is moved. Is there a way I can make the two squares move. This is the glutKeyboardFunc function I implimented: void handle...

why compiling GLUT project in NetBeans with MinGW doesnt work.

Hello, I have this situation, I use Netbeans 6.8 with recommended MinGW+msys configuration, and compiling works. Now I have a project which is using glut, so I linked the libraries opengl32, glut32, glu32, gdi32, winmm, mingw32 in "project properties->build->linker->libraries", i manually selected all .lib files and the compilation works...

difference between SDL and GLUT

Hi, I am learning the Opengl graphic programming at Eclipse. Can someone tell me the difference between GLUT application and SDL application, so that I can dig into either one of them? Tks. ...

glut library for Eclipse

hello everyone I'm working with Eclipse under Windows XP, but I can't find there glut library, all I have inside GL are only gl.h, glu.h and glext.h, can somebody please help me import glut library and explain what is this glext.h, thanks in advance for any help ...

OpenGL and GLUT in Eclipse on Windows

Hello to everyone, can somebody explain please how can I import glut library to the eclipse, I can't find any explanations in net, thanks in advance ...

difference between freeglut.h and glut.h

can somebody please explain what is the difference between freeglut.h and glut.h ...

problems with openGl on eclipse

I'm working on Windows XP I have portable version of Eclipse Galileo, but I didn't find there glut so I decided to add it using this link I made all steps and and now I'm trying to compile this code #include "GL/glut.h" #include "GL/gl.h" #include "GL/glu.h" /////////////////////////////////////////////////////////// // Called to draw ...

How do I extend mouse space in OpenGL windowed mode

How do I extend the distance the mouse can move in an OpenGL window? What I wish to achieve is an fps like interface where the cursor is hidden and camera rotations are not limited by the mouse having to remain inside the window boundaries. ...