Pointer Warning in glGenTextures

Pixelated
Unregistered
 
Post: #1
(I've been lurking this site for a long time, and have really enjoyed reading the posts here. Hopefully you guys can help me out on this one)

I've got a small problem...

I'm teaching myself Cocoa with OpenGL, and was writing a small program for practice to display a square and, with the right and left arrow keys, rotate it. The next step was for me to attempt to apply a texture to the object. For the texture loading code, I wrote this:

Code:
-(void) loadTextures
{
    NSLog(@"loading textures...");
    
    glGenTextures( TOTALTEXTURES, texture );
    
    glBindTexture(GL_TEXTURE_2D, texture[0] );
    [self loadImage:@"ship"];
}

However, when I build the code, I get the warning "pointer targets in passing argument 2 of 'glGenTextures' differ in signedness". When I compile the code, this occurs:

Code:
[Session started at 2008-04-06 14:01:10 -0400.]
2008-04-06 14:01:10.355 OpenGLLearning[2310:10b] loading textures...

[Session started at 2008-04-06 14:01:10 -0400.]
Loading program into debugger…
GNU gdb 6.3.50-20050815 (Apple version gdb-768) (Tue Oct  2 04:07:49 UTC 2007)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".Program loaded.
sharedlibrary apply-load-rules all
Attaching to program: `/Users/davidallen/Downloads/OpenGLrules/build/Release/OpenGLrules.app/Contents/MacOS/OpenGLrules', process 2310.

After that, no window pops up or anything. If I comment out the code, though, the program works normally. I've checked the debugger, but, considering I've never used it before, didn't see anything interesting.

I'm on a MacBook Pro 15.4" with 2GB RAM and 512MB VRAM.

** EDIT **

I got rid of the warning (texture was a GLint when it should have been a GLuint), but the program still crashes. Looking further into it, it appears to be because of an error EXEC_BAD_ACCESS (SIGSEGV). Any suggestions?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
If you're reporting a crash, you need to post a crash log.

That said, it's very likely that this is because you're making an OpenGL call at a time when you don't have a current context.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Dealing with Battery Low Warning During Full Screen AnotherJake 8 5,774 Feb 8, 2008 12:26 PM
Last Post: OneSadCookie
  glGenTextures() dies from EXC_BAD_ACCES? O.o wyrmmage 8 4,824 Apr 7, 2007 07:23 PM
Last Post: wyrmmage
  glGenTextures question Jake 5 3,888 Sep 1, 2003 08:27 AM
Last Post: Jake
  glGenTextures and EXC_BAD_ACCESS BobbyWatson 1 4,828 Aug 31, 2002 01:48 PM
Last Post: BobbyWatson
  death by glGenTextures(), with TGA sealfin 7 4,488 Jul 18, 2002 07:02 AM
Last Post: sealfin