opengl

In openGL, how can you get items to draw back to front?

By default it seems that objects are drawn front to back. I am drawing a 2-D UI object and would like to create it back to front. For example I could create a white square first then create a slightly smaller black square on top of it thus creating a black pane with a white border. This post had some discussion on it and described this...

glBlendFunc and alpha blending

I want to know how the glBlendFunc works. For example, i have 2 gl textures, where the alpha is on tex1, i want to have alpha in my final image. Where the color is on tex1, i want the color from tex2 to be. ...

Question about strange OpenGL ES behavior in iPhone app.

I'm making a simple 2D game for the iPhone. It's based on CrashLanding... so it's basically a background texture and a few rectangular textures moving around. I have this bizarre little graphics problem: some of the small 2d items (can assume just rectangles) moving around get this little flashing black bar on top of them (the backg...

Using pbuffer with GLUT ?

I have been scouring the web for a code sample that shows how to use pbuffer with GLUT but I could not find anything... I am puzzled with the context switching between pbuffer and the rendering window. I guess that I will have to use glutSetWindow to switch between the two rendering surface but I am not too sure about the details. Can...

Simple 3D graphics project?

I'm looking for some good ideas for a simple 3d graphics program as my final project for an intro to computer graphics class. As for some background information, we'll be using opengl and will have a little over a month to work on it, so nothing too far-fetched. The simpler and "prettier" looking, the better. It does, however, require...

Simple wireframe format?

I'm looking for a simple file format to use for wireframe models. I am aware of VRML, u3D, etc, but these seem heavyweight for my needs. My criterea are: Must have a clear spec. Either open or very well established/documented. I only need (want) simple models - vertices and edges. I don't want to handle faces or objects. If the format ...

What is the easiest way to align the Z axis with a vector?

Given a point such as (0, 0, 0) and a vector like (x, y, z). What is the easiest way to align the negative Z-axis centered at (0, 0, 0) to point in the direction of this vector? Examples using OpenGL would be welcome, but not neccessary. ...

Programmatically send keystrokes to GLUT application

I have an OpenGL/GLUT program running on my linux machine that views a 3D model from various angles and can take screenshots, and everything is controlled from the keyboard. I want to write a script that moves around the model in a particular way, taking screenshots at every step. It seems there should be a simple way in Linux to send ...

wglCreateContext in C# failing but not in managed C++

I'm trying to use opengl in C#. I have following code which fails with error 2000 ERROR_INVALID_PIXEL_FORMAT First definitions: [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)] public static extern IntPtr GetDC(IntPtr hWnd); [StructLayout(LayoutKind.Sequential)] public struct PIXELFORMATD...

openGL SubTexturing

I have image data and i want to get a sub image of that to use as an opengl texture. glGenTextures(1, &m_name); glGetIntegerv(GL_TEXTURE_BINDING_2D, &oldName); glBindTexture(GL_TEXTURE_2D, m_name); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexIm...

opengl problem under vista

Hello I've just started with opengl but I ran into some strange behaviour. Below I posted code that runs well in xp but on vista it renders just black screen. Sorry for posting unusally (as for this board) long code. Is there something very specific to open gl in vista? Thanks. #include<windows.h> #include<gl\gl.h> #include<gl\glu.h...

What is the best free cross-platform OpenGL GUI library for a video game?

It must come with source. I've looked at these which look semi-promising: glgooey, guichan, and cegui. I've come across others that look more Windows-y than game-y, but that's not the direction I am looking to go in. I would like some simple functionality of typical controls (lists, dropdown box, etc.) but with support for graphical wi...

OpenGL: Fast off-screen rendering

I need to render quite alot (tens of thousands) images off-screen using OpenGL. I am running under Windows and using QT as a framework. the solution can be windows only, it doesn't really matter. From what I've found using Google there are a number of options for doing this This article which seems rather dated suggest a few ways, out o...

uxtheme equivalent for opengl (or directx)?

When you use WPF (which uses DirectX) you quickly notice one fact that WPF themes are independent from windows themes and styles. I'm playing with GUI using opengl on windows and right now I have one problem: I want to use windows themes and styles. I don't want to go WPF route and make it independent. I know that all information about i...

opengl rotation using gldrawpixels

Hi all, My team is currently limited to drawing images on an opengl 1.4 platform, which means that we can't use any nifty texture mapping to draw an image (yes, we're confined to using the intel integrated graphics platform, it's very annoying). So far, we're able to draw, scale, and flip an image, but the guy doing the graphics claim...

OpenGL textures with multiple display contexts

I have an undefined number of display context and each will display a texture. When I call glGenTextures I get the same name returned across all display contexts. Will this work? Even though they have the same name will they still store and display different textures? If not what should do to get around this? ...

Color mapping a texture in opengl

I am displaying a texture that I want to manipulate without out affecting the image data. I want to be able to clamp the texel values so that anything below the lower value becomes 0, anything above the upper value becomes 0, and anything between is linearly mapped from 0 to 1. Originally, to display my image I was using glDrawPixels. ...

Showing a view controller from an OpenGL view

Hey! I have created an iPhone application based on an OpenGL view. Now I would like to show a "settings" form. Since my code runs in UIView, I have no pushViewController. How do I show a view controller on screen? Thanks! ...

How to draw a filled envelop like a cone on OpenGL (using GLUT)?

Hi, I am relatively new to OpenGL programming...currently involved in a project that uses freeglut for opengl rendering... I need to draw an envelop looking like a cone (2D) that has to be filled with some color and some transparency applied. Is the freeglut toolkit equipped with such an inbuilt functionality to draw filled geometries...

Getting started with OpenGL

As you can see here I'm about to start work on a 3d project for class. Do you have any useful resources/websites/tips/etc. on someone getting started with OpenGL for the first time? The project will be in C++ and accessing OpenGL via GLUT. Thanks! ...