glut

Detecting Ctrl-<Number> in GLUT

I use GLUT to handle keyboard input for Bitfighter. I've built a nice little keyboard event abstraction layer, which works great for most things, but I've run up against a few frustrating limitations. For example, when Ctrl is pressed, the number keys, plus, minus, and the quote key don't seem to trigger the glutKeyboardFunc() callback...

OpenGL gluUnProject object section

Hi everyone, I'm using gluUnProject to cast a ray into the scene and adding a primitive there. What I'm trying to do is now accurately pick existing primitives, so if I have 3 spheres I could click on one to delete it. I think the solution would somehow check if the ray intersected with an object and check if its the closest to the cast...

Drawing many spheres in OpenGL

I want to draw many spheres (~100k) using OpenGL. So far, I'm doing something like for (int i=0; i<pnum; i++){ glPushMatrix(); glTranslatef(bpos[i].x, bpos[i].y, bpos[i].z); glCallList(DListSPHERE); glPopMatrix(); } Before using proper spheres, I used GL_POINTS. That allowed me to call glDrawArrays with an array co...

Howto compile for Windows on Linux with gcc / g++ ?

Dear developers, I have written some effects in C++ (g++) using freeglut on Linux, and I compile them with g++ -Wall -lglut part8.cpp -o part8 So I was wondering if it is possible to have g++ make static compiled Windows executables that contains everything needed? I don't have Windows, so it would be really cool, if I could do that...

Callback to non-static method

I have this weird issue. Think of your basic openGL programs. They simply run from a main method and contain callbacks like `glutMouseFunc(MouseButton) where MouseButton is the name of a method. What I have done is I have encapsulated the main file into a class, so that MouseButton is no longer a static function but has an instance. But...

OpenGL and GLUT in Eclipse on OS X

I have been trying to setup the OpenGL and GLUT libraries in Eclipse, with CDT, on OS X with not very much success. I cannot seem to get eclipse to actually realize where GLUT is. It is currently giving me the error that I have an unresolved inclusion GL/glut.h. Looking around online I found that I should be using the -framework GLUT fla...

Problems initializing glut

I have simplified my problem to this example: #include <GL/glut.h> int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutInitWindowSize (600, 600); glutInitWindowPosition( 0, 0 ); int win = glutCreateWindow("Recon"); return 0; } When it execu...

Error when starting GLUT app when compiled for 64 bit

I have the bare bones of a GLUT app. When I compile it for Win32 it works fine, but if I compile it for x64 I get this error: The application was unable to start correctly (0xc000007b). Click OK to close the application. I have glut64.lib as an input for the Linker, which comes from the nVidia CUDA sdk at "C:\ProgramData\NVIDIA Corp...

How to create a class to wrap OpenGL drawing for a game

I'm writing a game for school in OpenGL. Since there will be several more similar assignments I want to make a small framework for doing common things in OpenGL. I have made a few simple games before and I usually break it down into an IO class to handle input and drawing to the screen, Game class for the main game loop/logic, and classe...

How to use GLUT not in main thread on OS X ?

I once tried to open a GLUT window from a sub-thread and got lots of nasty problems. I remember this post on lists.apple.com: GLUT functions may only be called from the application's main thread Has anything changed in this regard with GLUT on Mac OS X ? Is there a thread-safe GLUT that let's you open windows from any thread ? If GLU...

MacOSX Glut MainLoopEvent ?

On lnux, using freeglut, I have MainLoopEvent(); Now, I'm programming on the Mac, and I don't see it. Is there anyway to get MainLoopEvent() on the Mac with Glut? Thanks! ...

load ppm file using glut

I want to do a texture mapping to a PPM file in C++. Is there some way I can load the PPM file. Thanks. ...

Center an OpenGL window with GLUT

I have an openGL window that is 640x480 that I need to center in the middle of the screen. I previously used: glutInitWindowPosition((GetSystemMetrics(SM_CXSCREEN)-640)/2, (GetSystemMetrics(SM_CYSCREEN)-480)/2); which WORKED. But now all of a sudden when I compile... Linking... 1>Project1.obj : error LNK2028:...

glut visual editor

Hi I wanted to know if their is any Glut (opengl) visual editor some thing like autocad. ...

How can I resolve linker issues when I compile this C++ program that requires GLUT?

I'm trying to compile this C++ program which utilizes the GLUT32 libraries. Right now I'm getting the following errors: Error 1 error LNK2001: unresolved external symbol _gluPerspective@32 Camera.obj soundCube Error 2 error LNK2001: unresolved external symbol _gluLookAt@72 Camera.obj soundCube Error 3 error LNK2...

Getting X window id for GLUT program? or, How to remote control a GLUT program on X?

I want to send a keystroke to a GLUT program on X11, but I can't find there's an X11 client attached to the GLUT program. I do this, using the most excellent demo program for the chipmunk 2d physics package: xlsclients -a|sort >aa chipmunk_demos (in another window) xlsclients -a|sort >bb diff aa bb and there's no difference. My eve...

A glut/freeglut program creates visible window when debugging under the visual studio IDE but not when running the exe

I have a C++ console program which I can compile using glut or freeglut and get the same undesirable behavior. Specifically, if I "start with debugging" everything is fine, but if I start without debugging I have to manually switch to the window. Is there any way to force the GLUT window to the foreground on program start? ...

[VSC++][OpenGL] Huge Amount of Linker Issues with Release Build Only

Anyone have idea on this? Linker errors are way out of my wheelhouse, especially ones like this. Thanks for any help provided. ^_^ Is there any more info I should include? 1>Linking... 1>freeglut_static.lib(freeglut_window.obj) : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification 1>LIBCMTD.lib(dbgheap.obj) : ...

Corruption of the heap & F12 Problem

Hi everyone ! I'm trying to draw a line using GLUT with C++ - the IDE is VS 2008 -but an error message occurred : Windows has triggered a breakpoint in Graphics.exe. This may be due to a corruption of the heap, which indicates a bug in Graphics.exe or any of the DLLs it has loaded. This may also be due to the user ...

Standard and reliable mouse-reporting with GLUT

Hello! I'm trying to use GLUT (freeglut) in my OpenGL application, and I need to register some callbacks for mouse wheel events. I managed to dig out a fairly undocumented function: api documentation But the man page and the API entry for this function both state the same thing: Note: Due to lack of information about the mouse, i...