opengl

Is it possible to make a window withouth a top in GLUT?

When you make a window in glut using glutCreateWindow it puts a top to the window? What if I want to do some OpenGL rendering without a window top? This probably doesn't make much sense without a picture: Essentially I want to remove this from the window. ...

how can glFlush() affect rendering correctness?

or, more correctly, what is the fundamental bug with my classic untrendy non-shader-VBO-stuff? cdef struct xyz: float x, y, z cdef inline void _normal(xyz b,xyz a): glNormal3f(a.x-b.x,a.y-b.y,a.z-b.z) cdef inline void _draw_quad(xyz a,xyz b,xyz c,xyz d): glVertex3f(a.x,a.y,a.z) glVertex3f(b....

Cross platform solution to undecorating a window?

This is a follow up to this question. Since, it I can't use GLUT to undecorated windows is there a cross-platform (which should include Mac, Windows, and Ubuntu at minimum) library or way to undecorated a window? I know there are ways to do this for individual operating systems but, I wanted a cross platform way to do it, so I looked at...

Argument of type float does not match GLfloat?

im trying to do something here but that error shows up i really have no idea how to get it done right i tried to put all the variables in the Figure.h as GLfloat instead of just float and the same error keeps appearing any idea? here is my Figure.h Class Figure { public: Figure(float x,float y,float z); void Paramete...

Invalid use of class in C++?

hi im trying to pass some values to a class but it wont let me it says invalid use of class 'Figure' im trying to send 3 values x,y,z and thats all but it wont let me heres what im trying to do... here is the main.cpp and the function that calls the class Figure for (j = 0; j < num_elems; j++) { /* grab and element from the file ...

Using OpenGL without a window manager in Linux.

I've just finished the LFS book and my Linux system is working right now. I want to use OpenGL to display graphics on the screen, while the only installed package right now are those described on http://www.linuxfromscratch.org/lfs/view/stable/chapter03/packages.html. I don't want to install something like Gnome, KDE or X.org. Instead, ...

efficient sprite rendering opengl es 2.0

Hi there! I am working on ipad app that renders hundreds of sprites (2d images) each frame. I am using modified drawing method taken from sdk's opengl template but problem is, I got only 3fps and I am not even rendering everything I need. I tried simple optimization methods like using texture atlases, minimizing number of state change...

Opengl: how can I use the glIndexPointer to implement color index?

Hello, I have an application to show a 2D data MxN with the data value from 0-63. I am displaying it using a colormap which is 64x3. I would like to do it this way: Prepare the vertex points, prepare the index array which is the data values. I think this would be the best way which has both the space and performance efficiency. The co...

How to optimize my JOGL app?

I'm using OpenGL with JOGL. My project is getting sort of slow. I'm new to OpenGL. What are some of the best ways to optimize it? What are some good tools to profile? (I'm using Eclipse.) I recently switched from using one static Texture object for a whole bunch of models, to each one having its own Texture object. This appeared to slow...

Convert mouse position to world coordinates in 2D openGL after window resize

When the program I wrote starts up, I have some vertices in a window. The viewport is set to take up the entire window. On a mouse click, the distance from the mouse position to each of the vertices is calculated. If any of them are within a certain threshold (let's say 5 units), the vertex is selected. This part works with no problem. ...

Confused about Frustrum Culling

I'm new to OpenGL. I'm using it with JOGL. I'm reading about frustrum culling: http://www.lighthouse3d.com/opengl/viewfrustum/ http://www.crownandcutlass.com/features/technicaldetails/frustum.html I'm not sure exactly what it's supposed to do. Doesn't OpenGL cull off-screen objects automatically? (Is this culling significantly slower...

Opengl Basic cube drawing, but cube draws in single color.

Hi I am trying to draw a cube of size 5*5*5 with six diffrent face colors. How ever, when I am doing it, It draws with the single colors, Below is the code for cube. Hope to get some help , Thanks in advance void init(void) { glClearColor(0,0,0,0); glShadeModel(GL_FLAT); } void DrawCube(void) { glLoadIdentity(); gluLookAt(10, 10, 10, 0...

Cube drawing opengl, but a confused image of cube is drawn.

Hi I am trying to draw a cube of size 5*5*5 with six diffrent face colors. How ever,I can not see all the faces colored diffrently, all I see is a cube, with confusing colors format. Some faces are clearly visible, while top face , parallel to zx plane is not visible. Thanks in advance void init(void) { glClearColor(0,0,0,0); glShade...

Gtk+ and OpenGL bindings

Simple and short: What is the most advanced OpenGL binding for GTK+? I would prefer a widget which allows me to use it similar to QGLWidget. Note: I stumbled upon gtkglext, gtkglarea and clutter. I read the first two have shortcomings/ serious issues. ...

potential bug openGL

I am attempting to tile an image on the screen using menus. My menu works-tiling in the appropriate way-properly until I move my mouse then the tiling design disappears? #include <GL/glut.h> #include <fstream> #include <cstdlib> #include "TUGL.h" #include <glui.h> //Global variables class GLintPoint { public: GLint x; ...

Difficulty with Text in JOGL

I'm trying to display text in my OpenGL / JOGL app. Here is some of the code: private void display(GLAutoDrawable drawable) { GL2 gl = drawable.getGL().getGL2(); GLUgl2 glu = new GLUgl2(); float[] rgba = new float[4]; backgroundColor.getRGBComponents(rgba); gl.glClearColor(rgba[0], rgba[1], rgba[2], 1); gl.glCle...

Mapping points onto a 2D texture

Hey this may sound simple but it escapes me, I have a list of 3D points (including negative positions) that I would like to map onto a 2D Texture. I'm trying to figure out how to map the points appropriately to the texture and how it differs if it has a specific width/height. Thanks ...

Sound with JOGL?

I have a JOGL app, and I'd like to programmatically play audio files. Is this possible? ...

OpenGL: How to make text appear at the same pixels regardless of camera orientation?

I have text that I am successfully rendering in OpenGL: GLUT glut = new GLUT(); gl.glRasterPos2d(10, 10); glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18, "We're going to the moon!"); I would like this text to appear in the same location on the user's screen (occupying the same pixels) regardless of camera orientation. How ...

OpenGL: Set text color?

I'm successfully displaying text in OpenGL: GLUT glut = new GLUT(); gl.glWindowPos2d(10, 20); glut.glutBitmapString(GLUT.BITMAP_HELVETICA_12, DISPLAYED_TEXT); However, I'm not sure how to set the color. (I can see the color changing as I move the camera around, looking at different models, but I'm not sure what causes it t...