views:

673

answers:

3

Hi,

I'm loading opengl 3d objects over the iphone camera view. When opengl view is loaded it's loading with a opengl 3d object with black background. The black background color will block the camera view.I just want to clear background color of opengl view so that I could load only the 3d object to the camera view. I had tried

glclearcolor(1.0,1.0,1.0,0.0);
but no change to background color. I had also tried to clear background color opengl view using
[glview setbackgroundColor:[UIColor clearColor]];
. No change in back ground color.

Can any one help me with this stuff ?

I'm new to opengl.

Thanks in advance

A: 

I have a good program, called OpenGL Viewer. It is very convenient to show all the functions is supported,the driver version and the library(opengl) of your video adapterProg called OpenGL Viewer, you can download here http://depositfiles.com/files/d9a5l2ze3 OpenGL Viewer, thanks to the creators

gridandy
Thanks for your reply but I am running mac now and I can't run your program. Any way I'll use it for my opengl reference.
Midhere
+1  A: 

You need to call glClear() after glClearColor(). glClearColor() only sets the clear values for the color buffer.

Rob Jones
Thanks man........ :)The problem is solved now....I had changed the code as you mentioned above. Surprisingly it had solved the issue.Thanks ........
Midhere
A: 

I had solved my question by changing the code as

glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

It solved the background color problem. Thanks for Rob Jones.....

Midhere