opengl

Keyboard input hesitation when held down?

Does anyone know why there is some hesitation when you hold down a keyboard key and try to process it? I'm calling a function right in my WinProc(...) that will move an image on the screen (OpenGL) when a key is held down. I press it and get a single response, then there is about .5 seconds of nothing, then it behaves as normal (moves 1 ...

Problem with glui

hi all, i was trying out a free code i downloaded from the internet, when i compiled it says.. "Error 2 fatal error LNK1104: cannot open file 'glui32d.lib' MarchingCubesGLUI MarchingCubesGLUI" i cant seems to find much reference online about GLui, i know i dont have glui.h .dll and .lib files etc etc. so what should/can i do? FYI: i...

Multiple viewports in OpenGL

I need to show the same object in OpenGL in two different viewports, for instance, one using ortographic projection and the other using perspective. In order to do this, do I need to draw again the object after each call to glViewport()? ...

efficient texel access in OpenGL

I'm working on a game in OpenGL and here's what I'd like to do: During an iteration of game logic, access texels of a texture for computations. Still during the same logic interation, possibly modify the texels of the texture. Render the game scene with the current version of the texture. Start another iteration with similar access to ...

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...

draw text with GLUT / OpenGL in Python

Hey, I m drawing text with OpenGL in Python. It all works ok, however the font is really bad. If I make it thick the letters start to look very occurred (especially the ones which are round like 'o' or 'g'. For the purpose of my program it must be thick. Is there any font I could use which does not look so bad when thickened, or is ther...

Change cursor in GL fullscreen on OSX using cocoa?

Can anyone provide a sample / link to a sample Cocoa app that changes the 'hardware' cursor in a fullscreen OpenGL Cocoa app? I have been able to create a full screen GL app and an app that changes the cursor by overriding NSView::resetCursorRects but I have not been able to get both to work simultaneously. I've also refitted some of t...

Access violation with malloc() and glDrawPixels()?

Can anyone see what's wrong with this code? SIZE_BG is 6MB as I am trying to draw a large bitmap image (3366x600). I use malloc to prevent my image from overflowing the stack. I get an access violation error on the call to glDrawPixels(). bgPtr seems to point to the correct data as I checked the first few bytes before calling glDrawPix...

With OpenGL, how can I use gluOrtho2D properly with default projection?

I'm trying to use gluOrtho2D with glutBitmapCharacter so that I can render text on the screen as well as my 3D objects. However, when I use glOrtho2D, my 3D objects dissapear; I assume this is because I'm not setting the projection back to the OpenGL/GLUT default, but I'm not really sure what that is. Anyway, this is the function I'm u...

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...

What are the usual troubleshooting steps for OpenGL textures not showing?

After making a few changes in my application, my textures are no longer showing. So far I've checked the following: The camera direction hasn't changed. I can see the vectors (when colored instead of textured). Any usual suspects? ...

Transforming 3D text using OpenGL

I'm currently studying this tutorial: and I understand completely how to rotate/scale/translate each of the strings in that tutorial. But does anyone know what steps are necessary to shear/taper/twist each of the strings in a user-configurable manner? As far as I know, those are not part of OpenGL calls, so normally how are such trans...

How to draw opengl graphics from different threads?

I want to make an opengl application that shows some 3d graphics and a command-line. I would like to make them separate threads, because they both are heavy processes. I thought that I could approach this with 2 different viewports, but I would like to know how to handle the threads in opengl. According to what I've been reading, Opengl...

Simple OpenGL texture map not working?

I'm trying to figure out texture mapping in OpenGL and I can't get a simple example to work. The polygon is being drawn, though it's not textured but just a solid color. Also the bitmap is being loaded correctly into sprite1[] as I was successfully using glDrawPixels up til now. I use glGenTextures to get my tex name, but I notice it ...

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...

glDrawTexOES in opengl

I am a newbie to opengl. I wish to do the same thing what glDrawTexOES does in opengles1.1. Can anyone suggest any corresponding function in opengl or any way to do it. Thanks a lot... RS ...

[JOGL] Why won't my text show up?

For some reason which I can't figure out for the life of me, my text in my JOGL hello world program won't show up at all. I'll include the display method so you'll all know what I'm talking about. public void display(GLAutoDrawable gLDrawable) { final GL gl = gLDrawable.getGL(); final GLU glu = new GLU(); GLU...

C - GLFW window doesn't open on Debian

Hey, I'm trying to get started with GLFW on Debian, I've tried compiling and running an example program but it refuses to run. With the help of a couple of printf statements I've found that when the program tries to open a GLFW window it fails, then exits - but I don't know why. Any help would be amazing. #include <stdlib.h> // For ...

glDrawPixels in grayscale?

I have an image that I'm rendering like this: glDrawPixels(image->width, image->height, GL_BGR, GL_UNSIGNED_BYTE, image->imageData); Is there anyway I can draw it in grayscale instead (without loading it into a texture first)? I don't care if only, say, the blue component is used for the gray value rather than the L2 norm or something...