Texture mapping problems

Post: #1
As you may know, I've just started learning OpenGL. I've been trying so far to use only OpenGL and GLUT, because I want to be able to program on multiple platforms. I found OneSadCookie's XCodeGLUT tutorial with the help of faithful google, and used it in combination with the NeHe tutorials and other bits and pieces to make the application do what I want. However, on Nehe lesson 6, my limited Mac and GLUT combo petered out pathetically. I cannot texture map, it seems. I tried to use several Cocoa texture loaders, but when I try to load the cocoa header or any other header containing a reference to <Cocoa/Cocoa.h> I hit thousands of compile errors, most of which don't make any sense. For instance, I get three errors on the #include <Cocoa/Cocoa.h> line which read "parse error before '@'". This occurs if I put #import <Cocoa/Cocoa.h>, as well. Wacko After 2 days of searching, it's becoming tiresome... If someone here could point me in a direction where I won't have to learn Cocoa or Objective C, I would probably love them forever. I only know C++ and Basic, and I really don't want to learn anything else right now.

Here's (Click the XCodeGLUT2 link) my source code as an XCode project. It should compile as is without errors at build and go. However, you can play around with #include and #import to reproduce the problem. WAS and D now do something too.

Sorry for any terseness or spelling errors, I'm a bit frustrated. Thanks for helping.Smile
Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #2

Take a look at OpenGLTexture.c -- it shows how to load an image as a texture using QuickTime.

You can't include Cocoa.h into a C or C++ file, it's Objective C code.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Mapping 2D texture to multiple GL_TRIANGLES ardowz 4 8,632 Feb 27, 2017 11:09 PM
Last Post: Nicolredmay
  OpenGL ES Texture Problems jhbau1000 1 6,880 Jul 12, 2010 05:57 AM
Last Post: Kezhaya
  Texture mapping single 3D object with one draw call jeonghyunhan 1 4,575 Jul 13, 2009 06:05 AM
Last Post: ThemsAllTook
  Texture Mapping: Loading a texture from a .bmp file? ishrock 5 10,286 Dec 13, 2008 09:27 AM
Last Post: ThemsAllTook
  OpenGL and cylindrical texture mapping spsweet 0 6,876 May 1, 2007 02:55 PM
Last Post: spsweet