Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

OpenGL-10.4.7 incompatibility



Okay, I have identified where the problem in my program is:

When I disable lighting my app works fine in 10.4.7 Intel or ppc.

When lighting is enabled the app only works fine in 10.4.7 ppc.

The initialization code for my NSOpenGLView is in the

initWithCoder: method

The code that I use to define lighting within this method is something like:

	self = [super initWithCoder:c];
	NSOpenGLContext *glContext;
	glContext = [self openGLContext];
	[glContext makeCurrentContext];

// Lights
	GLfloat ambientLight[] = {intAmbient,intAmbient,intAmbient,1.0};
	GLfloat diffuseLight[] = {intDiffuse,intDiffuse,intDiffuse,1.0};
	GLfloat specular [] = {intSpecular, intSpecular, intSpecular, 1.0};
	GLfloat specref[] = {0.5, 0.5, 0.5, 1.0};

	glEnable(GL_LIGHTING);
	glLightfv(GL_LIGHT0, GL_AMBIENT,ambientLight);
	glLightfv(GL_LIGHT0, GL_DIFFUSE,diffuseLight);
	glLightfv(GL_LIGHT0, GL_SPECULAR, specular);
	glEnable(GL_LIGHT0);
	glEnable(GL_COLOR_MATERIAL);
	glColorMaterial(GL_FRONT,GL_AMBIENT_AND_DIFFUSE);
	glMaterialfv(GL_FRONT,GL_SPECULAR,specref);
	glMateriali(GL_FRONT,GL_SHININESS,50);

	// other stuff
	return self;

As I said when I comment the glEnable (GL_LIGHTING) line, everything works fine (except that there are no lights). When I comment the glEnable(GL_COLOR_MATERIAL) line everything shows up well but only in gray.

The strange thing is that my code works well in 10.4.7 ppc, but not 10.4.7 Intel.

I have installed the newest 10.4.7 Intel update:

SHA1MacOSXUpd10.4.7Intel.dmg= 10aa57dfccd63accb0939a894cea202a8910fb45

I appreciate any help

Nestor Cardozo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.