glGetIntegerv( GL_MAX_TEXTURE_UNITS_ARB) problem

Member
Posts: 509
Joined: 2002.05
Post: #1
Sorry for my 100th thread in the last few days, but I keep crashing on the glGetint line here

Code:
GLint maxTexelUnits; (class declaration)

maxTexelUnits = 1;
    NSLog(@"%d",maxTexelUnits);
    glGetIntegerv( GL_MAX_TEXTURE_UNITS_ARB, &maxTexelUnits );
    NSLog(@"%d",maxTexelUnits);

Any ideas??? It worked in a NeHe example. I also have the same includes that they have.

Code:
#0    0x90c340f8 in glGetIntegerv
#1    0x0000b368 in -[controller awakeFromNib] at controller.m:612
#2    0x0000b368 in -[controller awakeFromNib] at controller.m:612
#3    0x90a2e750 in -[NSSet makeObjectsPerformSelector:]
#4    0x92df1c18 in -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:]
#5    0x92e85ddc in -[NSWindow(DrawerSupportPrivate) _destroyRealWindowForAllDrawers]
#6    0x92e3a80c in +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:]
#7    0x92eb95c8 in +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:]
#8    0x92ecadbc in +[NSBundle(NSNibLoading) loadNibNamed:owner:]
#9    0x92eb9430 in NSApplicationMain
#10    0x000085e0 in main at main.m:13
Quote this message in a reply
Sage
Posts: 1,234
Joined: 2002.10
Post: #2
It might not be safe to issue GL commands in your GLview subclass init called from awakeFromNib. Did you make the context current? Is the view visible on screen at that time?
Quote this message in a reply
Member
Posts: 509
Joined: 2002.05
Post: #3
arekkusu Wrote:It might not be safe to issue GL commands in your GLview subclass init called from awakeFromNib. Did you make the context current? Is the view visible on screen at that time?

That must be the problem, If I don't make another post assume that was the problem (it sounds like it is).

Thanks
Quote this message in a reply
Post Reply