opengl

OpenGl Frame rate

What would be the best way to measure the frame rate of my OpenGL program? ...

How to Create OpenGL 3 Context with Qt 4?

I would like to learn graphics programming with OpenGL. And since I will just start learning it I decided to learn the new/OpenGL3 way of doing things.As far as I can see one has to create an OpenGL 3 context for this (Core profile in the new OpenGL 3.2 if I understand this correctly). Well I thought about using Qt for this, currently us...

Opengl Selective glClipPlane

I have a scene drawn in openGL (openGl 1.1 win32). I use glClipPlane to hide foreground objects to allow the user to see/edit distance parts. The selection is done natively without using openGL. But the glClipPlane applies to all openGL elements - coordinate icons, gridlines etc and even elements drawn in gluOrtho2D on top - scale bars...

what is the best approach for to use openGL in the web?

I wrote a program in C++/OpenGL (using Dev-C++ compiler) for my calculus 2 class. The teacher liked the program and he requested me to somehow put it online so that instead of downloading the .exe file and run it the web browser will run it automatically just like a java applet. The question is: How if possible, can I display a C++/Ope...

Flipping an angle horizontally

I want to know a way to flip an angle in a horizontal axis, without having to do many operations. Say I have an angle of 0 ("pointing right" in my code's coordinate system), the flipped angle should be 180 (pointing left). If 90 (pointing up), flipped it should still be 90. 89 is 91, and so on. I can operate on the X/Y speeds implied by ...

Text localization in iPhone apps that use openGL ?

I'm writting an small game in iPhone, and I'm being asked to add in-game text will be localized in EFIGS+J+Chinese Simplified and provided to me later. Which tools and methods are avaiable in OpenGL ES for the iphone in order to render text ? ...

Most efficient way to draw individual pixels in OpenGL ES (Cocos2d-iphone)

I'm writing a flood-fill algorithm...it needs to paint individual pixels. What's the fastest way to do this? At first I thought of using cocos2d's drawpoint, but having 320 * 480 vertices doesn't sound too good. Is there a faster way using memset or something? ...

Why use multiple OpenGL context

For rendering I have a current GL context, associated to a window. In the case the application render multiple scenes (for example using accumulation or different viewports) I think it is ok to reuse the same context. My question, indeed, is: why should I use multiple GL context? I red on ARB_framebuffer_object extension spec that MakeC...

GtkGlArea's configure script is ignoring opengl32.a in MinGW

I've got a strange situation. I downloaded gtkglarea. I ran the configure script, telling it --with-lib-opengl32. This is necessary under MinGW because OpenGL is in the library c:/mingw/lib/opengl32.a. I also specified to configure that it needs to look for libraries in c:/mingw/lib using --libdir=c:/mingw/lib. And I have the library ope...

Which version of OpenGL supports rectangular textures (w/o extensions)?

Rectangular textures used to be support through extensions and at some version of OpenGL are now directly supported, i.e I can create textures with the same basic opengl methods just supplying non-power-of-two sizes. I've googled and can't seem to find a definitive changelog for the OpenGL spec. I need this information to dynamically de...

How can I get meaningful error info from OpenGL on Windows

I'm trying to create a GL context, and the call fails, returning a null pointer. According to MSDN, when wglCreateContext fails, you get the reason why from GetLastError. Except that GetLastError gives me a number, which isn't all that informative. Again according to MSDN, you can get a descriptive string out of the GetLastError code ...

Draw polygon to clip texture to be transparent where polygon is openGL(EL)

I have two layers being drawn. A static background texture and a texture(png) with transparent parts. I can correctly see the background with no problems. What I would like to do is modify the top layer by drawing a polygon(rectangle) with size that will change at run time to make that portion of the top layer transparent so you just see...

Delphi form gives a bad pixel format for OpenGL

I'm using the SDL library to try to create a rendering context in a Delphi form. Everything works well until I try to create the renderer itself. It calls wglCreateContext, which fails. The error message says "Invalid pixel format." The pixel format is based on the hdc for the form, which is all set up and managed internally by the V...

opengl frustum culling without glGet* calls

Various examples of view frustum calculations are using glGetFloatv() to get the current projection and modelview matrices (GL_PROJECTION_MATRIX, GL_MODELVIEW_MATRIX), and based of that do some view frustum culling. I have read that glGet* is something you do not want in your main render loop; "Using "Get" or "Is" functions slows ...

Gettig started with Tao OpenGL on windows form application in VC++

Hello, I added SimpleOpenglControl Component Of Tao Opengl Framework on windows form application. I drew 3d object and could display it on SimpleOpenglControl.But I want to rotate it using mouse. It will rotate according to the mouse move on 3d object .And object's rotate velocity and direction depend on mouse move velocity. Unfortu...

Playing with geometry?

Does anyone have some useful beginner tutorials and code snippets for playing with basic geometric shapes and geometric proofs in code? In particular something with the ability to easily create functions and recursively draw them on the screen. Additional requirements, but not absolute, support for Objective-C and basic window drawing r...

OpenGL in Python with Snow Leopard?

I'm interested in playing around with OpenGL in Python. I've used OpenGL in C++ and Objective-C, but I don't have much experience in Python. I'm wondering if there's a good tutorial that works in Snow Leopard. I'd prefer to stay in 64-bit mode if possible, since I've heard 32-bit programs require loading a lot of extra 32-bit libraries. ...

Using OpenGL's Frame Buffer Objects (FBOs) for Image Manipulation?

I've read that FBOs can be used for fast image manipulation using the OpenGL drawing actions. Does anyone know the basics of how to do this? or has some very simple example code illustrating it? ...

iPhone: Layering a transparent openGL view on top of a UIView?

I am working on iPhone app and I have an openGL view rendering on top of a regular UIView. It's working, but I can't seem to get the openGL view to have a transparent background that shows the UIView underneath. Instead, I get a big black box. I have tried setting the background color to UIColor clearColor, I've set opaque to NO, I've...

Building FLTK Project in Eclipse

I am having trouble getting set up with FLTK in Eclipse. I am trying to create an OpenGL window with the following code (which I found here): #include <FL/Fl.H> #include <FL/Fl_Gl_Window.H> #include <FL/gl.h> // // Simple resizable 2D GL window // erco 10/08/05 // class MyGlWindow : public Fl_Gl_Window { // DRAW METHOD // ...