opengl

Mouse coordinates lags if CPU usage is not 100% - really weird!

When i make my program to use only 0-2% cpu (removed some CPU intensive opengl function), my mouse coordinates starts to lag! and when i use 100% CPU (when enabling the opengl function) i get nice and smooth mouse coordinates, note that the opengl function does nothing to my mouse coordinates. look at below image i recorded my rotation f...

Problem mapping textures to VBO in OpenGL

I'm having trouble getting a texture to map onto geometry properly with OpenGL. In fact I seem to have even broken the colour interpolation that used to work fine. I've created a test case in C99 that uses SDL, GLee and SOIL. #include <stdbool.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <assert.h> #include <S...

glfwOpenWindow and glReadPixels modes ?

Suppose I open a glfw window with: glfwOpenWindow(width, height, 8,8,8,8,8,8, GLFW_WINDOW); Then, I try to read it back with: glReadPixels(0, 0, width, height, ..1.., ..2..); I'm not sure what I should be putting in as ..1.. and ..2.. ; I think ..1.. should be GL_RGBA, but no idea for ..2.. Thanks! ...

Can I delete OpenGL vertex arrays after calling glDrawArrays?

I am generating the vertex arrays on the fly on each render and I want to delete the arrays afterwards. Does glDrawArrays immediately copy the vertex arrays to the server? Hence is it safe to delete the vertex arrays after calling glDrawArrays? float * vp = GetVertices(); // Regenerated on each render glVertexPointer(3, GL_FLOAT, 3 * s...

Whats the concept of and differences between 'FrameBuffer' and 'RenderBuffer' in OpenGL?

I'm GL newbie, and currently learning. I'm confusing about concept of FrameBuffer and RenderBuffer. I know that they're required to render, but I want to understand them before use. I know some bitmap buffer is required to store temporary drawing result. The back buffer. And the other buffer required to be seen on screen during those d...

OpenGL GPU Memory cleanup, required?

I have a simple but unanswered question. Do I have to clean up all DisplayLists, Textures, (Geometry-)Shaders and so on by hand via the glDelete* functions, or does the GPU mem get freed automagically when my Program exits/crashes? Note: GPU mem refers to dedicated memory on a dedicated Graphics card, not CPU memory. ...

180 to -180 motion in opengl c++?

i'm using a glutTimerFunc(...) to achieve motion of robot arm, my problem is left side 0 degree to 90 is easily done, when i try 0 to -90 degree, the arm is not stoping? i tried various methods, but all falied, can you suggest better options? here's my timer function, void myTimerFunc(int var) { switch(var) { case 1: if(shoulder>=90) ...

How are 3D games so efficient?

There is something I have never understood. How can a great big PC game like GTA IV use 50% of my CPU and run at 60fps while a DX demo of a rotating Teapot @ 60fps uses a whopping 30% ? Thanks ...

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

Overlay Webpage on 3D Application?

I'm looking for a free substitute for a library called Awesomium, that would allow me to display a local html page on top of a rendered openGL scene, such that the user could interact with the webpage (ie. click buttons), but also interact with the scene, when the mouse is no longer on top of the web page window. Any suggestions? Or any...

Cg shaders not being applied after switch to glVertexPointer

My renderer used to render geometry with the old fixed function stuff using glBegin/glEnd. After switching it to use vertex arrays via glVertexPointer et. al., my Cg shaders stopped showing up. If i just do a regular texture binding, it works fine, so the array data is solid. Also if I use the old glBegin/glEnd system, the Cg shaders wor...

Problem rendering non-English unicode text using freetype font on OpenGL

I am currently following NeHe tutorial lesson 43 ( http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=43). The code works satisfactorily only for English text, not Unicoded languages. Fortunately, I follow a link from NeHe lesson 43 to http://www.cs.northwestern.edu/~sco590/fonts_tutorial.html and found another identical tutorial sam...

texture the 3d cube in android

i have ever tried to texture the 3d cube in android using opengl es according to the example in c++, but after several times , the result is disappointed! so i wanna know, who have ever done it before? may you give me some suggestions? thanks in advance! ...

NSTextField over NSOpenGLView

I have made a window with an NSOpenGLView that I am rendering openGL content into. I want to add some buttons and text fields to the view: I can add NSTextFields and NSButtons using interface builder (or code) but they do not appear. NSOpenGLView is documented as not being able to have sub views, so I then made my own CustomGLView by d...

Explain the TexturedSphere example in Processing

The Processing project website has an example of implementing a 3D textured sphere with rotational capabilities. I'm trying to understand the code, but I'm having trouble comprehending many of the code blocks since I don't have a background in graphics. Any higher-level explanation of what each block is trying to accomplish, perhaps re...

non-blocking SwapBuffers() with VSync=on

I am looking for a portable way to make a non-blocking SwapBuffers() even if VSync is activated. In other words, is it possible to to be notified by an event or to know the delay until the next VSync ? ...

Using a singleton to store global application parameters

Hi, i'm developing a simple simulation with OpenGL and this simulation has some global constants that are changed by the user during the simulation execution. I would like to know if the Singleton design pattern is the best way to work as a temporary, execution time, "configuration repository" ...

Texturing Not Working

I am using code from this site: http://www.spacesimulator.net/tut4_3dsloader.html It works in their example project but when I placed the code into a class for easier and more modular use, the texture fails to appear on the object. I've double checked to make sure the texture ID is correct by debugging them side by side. On my project ...

3D intersection test

Hi, I have this 3D model loaded.Then on the same screen, I have many points draw on it.. how Can I determine whether the points are on the model or not.Only take the XY plane for consideration. Anyone can teach me how to do a 3D intersection test only on the XY plane, because Im really clueless. ...

OpenGL/Gtkmm game - keyboard moving

Hello, I am programming a game in "OpenGL" and using "Gtkmm" as a window manager. I want to use the keyboard to camera moving (thus, "UP-key" to move forward, "DOWN-key" to move backward, etc...) Some time ago, when I programmed in Java, I used this technique to "move": When the application received for example the "UP-key-press" signal...