glut

Is GLUT dead?

After reading a discussion on Ubuntu Forums concerning GLUT vs. FreeGLUT. Is GLUT dead for graphics programming? Is SDL all the rage now for OpenGL programming? ...

OpenGL coordinate problem

Hello, I am creating a simple 2D OpenGL application but I seem to be experiencing some camera issues. When I draw a rectangle at (20,20) it is drawn at (25,20) or so. When I draw it at (100, 20) it is drawn at 125 or so. For some reasons everything is being shifted to the right by a few %. I have pasted a trimmed down version here http:...

Resizing an OpenGL window causes it to fall apart

For some reason when I resize my OpenGL windows, everything falls apart. The image is distorted, the coordinates don't work, and everything simply falls apart. I am sing Glut to set it up. //Code to setup glut glutInitWindowSize(appWidth, appHeight); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA); glutCreateWindow("Test Window"); //In d...

problem with glut.h

[Linker error] undefined reference to `__glutInitWithExit@12' [Linker error] undefined reference to `__glutCreateWindowWithExit@8' [Linker error] undefined reference to `__glutCreateMenuWithExit@8' [Linker error] undefined reference to `glutSolidSphere@16' the problem above came out if i include glut.h header.. why? i cant use gl...

glutPassiveMotionFunc and glutWarpMousePointer

I want to implement my own cursor in an OpenGL / GLUT window. The usual way to do this is to freeze the cursor (so it can't hit the edges of the screen) and keep track of its position yourself. I can make the onscreen cursor invisible using glutSetCursor(GLUT_CURSOR_NONE); and then inside of my glutPassiveMotionFunc callback move the...

OpenGL,SOIL library and a textured rectangular

I'm trying to make a simple textured rectangular in OpenGL using SOIL and GLUT. This is my Display function (executed in main by glutDisplayFunc(Display)): void Display () { GLuint tex_2d; glMatrixMode (GL_MODELVIEW); glLoadIdentity (); glClear (GL_COLOR_BUFFER_BIT); glClearColor (1.0,1.0,1.0,1.0); gluLookAt (e...

Create a Chrome cube in OpenGL / Glut?

I'm attempting to make a chromed cube in GLUT / OpenGL and I'm not sure exactly how to do it. I looked up a "Materials Table" in a textbook which showed "Chrome" as being: Ambient: (0.25, 0.25, 0.25), Diffuse: (0.4, 0.4, 0.4), and Specular: (0.774597,0.774597,0.774597). My question is, how do I create a simple cube and apply this mater...

Tiling texture bmp file as texture onto a rectangle in OpenGL?

I have a pic.bmp that I'm attempting to tile onto a 3 x 2 rectangular flat surface for a demo I'm making. I'm attempting to keep the aspect ratio of the bmp in tact but I still want to tile it across that surface. Right now I have the surfaces vertices as (0,0,0), (3,0,0), (0,2,0) and (3,2,0). How can I apply this bmp to the flat surf...

Handle Tab key in GLUT

Hi everyone! I use OpenGL+GLUT for simple application, but I can't handle a "Tab" key press. Does anybody knows how to handle pressing of Tab key ? thanx P.S.:Mac OS 10.5.6, GCC 4.0 Solution void processNormalKeys(unsigned char key, int x, int y){ if ((int)key == 9) { //tab pressed .... } .... } .... int ma...

How can I change the position of the mouse cursor in OpenGL/Glut?

I'm writing a simple game and I'm going to have the mouse control the camera (using GlutPassiveMotionFunc). I'm going to pitch and yaw based off the mouse difference between callbacks, however I think it would be a good idea to "force" the mouse back to the center of the screen every time they tried to move it. This way their cursor wo...

How could simply calling Pitch() and Yaw() cause the camera to eventually Roll()?

I'm coding a basic OpenGL game and I've got some code that handles the mouse in terms of moving the camera. I'm using the following method: int windowWidth = 640; int windowHeight = 480; int oldMouseX = -1; int oldMouseY = -1; void mousePassiveHandler(int x, int y) { int snapThreshold = 50; if (oldMouseX != -1 && oldMouseY !...

Can someone explain how I can use Quanternions to use the mouse to look around like a FPS?

Yesterday I asked: How could simply calling Pitch and Yaw cause the camera to roll? Basically, I found out because of "Gimbal Lock" that if you pitch + yaw you will inevitably produce a rolling effect. For more information you can read that question. I'm trying to stop this from happening. When you look around in a normal FPS shooter ...

Visual Studio 2008 with Vista, GLUT projects gives error on runtime

I'm sure that there is nothing wrong with my project. Because I have tried it on my ex computer with visual studio 2005 and windows xp pro, and it works error-free. I can compile my project. There is no errors on build phase.But when I try to run my project it says "*.exe has stopped working". Then I runned it on debugger mode. I saw t...

Glut glLoadMatrixf camera equivalent.

In my glut application I'm simulating a plane with the camera. When the planes speed is low I intend to have the nose start to point towards the ground as the camera falls. My first instinct was to just change the pitch until it was pointed downwards at -90degrees. However I can't just change the pitch because if the plane is tilted o...

How do I tell if a button is being held down in OpenGL/Glut? (linux)

This is a similar problem: Link Which was solved by calling GetAsyncKeyState(). While all fine and dandy, I need a Linux alternative. I need to know if a button is being held down, not just being pressed (because of the keyboard buffer delay). Does anything like this exist in the OpenGL/Glut libraries, or will I have to look elsewhere? ...

Using OpenGL /GLUT how would I detect if two keys are held down at the same time?

Using OpenGL /GLUT how would I detect if two keys, say 'a' and 'j' are held down at the same time? (This program needs to compile with OSX GCC, Windows GCC, Windows VS2005 so no OS dependent hacks please.) ...

Initializing OpenGL without GLUT

Hi, every introduction and sample that I can find seems to use GLUT or some other framework to "initialize" OpenGL. Is there a way of initializing OpenGL with just what is available in GL and GLU? If not, then what is GLUT doing that is not possible without it? ...

Access violation error when using glut on vista

I am new in OpenGL. I am using glut library in VC express edition on vista. I am getting runtime error of "access violation" on the following line glClear(GL_COLOR_BUFFER_BIT); Can I avoid this error somehow? Shahab ...

Library for drop-down Quake-like console for OpenGL(GLUT) programs ?

Is there any open-source library doing that? I've seen a few on sourceforge for python (Pygame) or OGLCONSOLE for the SDL library (GLUT support not implemented yet) but nothing for the GLUT (or freeGLUT) library... Many thanks in advance for your help David ...

What is the normal way of dealing with non-standard library locations in an autoconf script?

I'm trying to use the GNU autoconf/automake toolchain for the first time, so the answer to my question might be trivial. The program needs OpenGL/GLUT where the headers and libraries are installed in a non standard location. I found these macros that should do all the checking for me. I'm simply calling it with *AX_CHECK_GLUT*. How do ...