simple texture example on OS X, does not work?

  • Follow


I've downloaded and built a very simple texture example on Mac OS X
10.4.11 from here:

http://www.gamedev.net/reference/programming/features/ogltm/texture.zip

It just needed a few little fixes to compile and build as a "Standard
tool" (C command line):

1. Comment or delete #include <windows.h>
2. Fix the main() declaration
3. Add a line
glutInit(&argc, (char **)argv);
in main()
4. Replace includes
<gl/gl.h> with
#include <GLUT/glut.h>
#include <OpenGL/OpenGL.h>
....
Link with Frameworks OpenGL, GLUT, CoreServices, ApplicationServices

Alas, in the end when you run it, it displays a white rectangle in a
window with a black background, but NO texture....

Any idea what is wrong here? Can you reproduce it? Email me if you'd
like a copy of my code plus project

Thanks

Martin
0
Reply freesteel 11/29/2007 3:16:10 PM

"freesteel" <freesteelusenet@googlemail.com> wrote in message 
news:697a7e31-b188-40ee-bf4f-20600264eb4f@d61g2000hsa.googlegroups.com...
> I've downloaded and built a very simple texture example on Mac OS X
> 10.4.11 from here:
>
> http://www.gamedev.net/reference/programming/features/ogltm/texture.zip
>
> It just needed a few little fixes to compile and build as a "Standard
> tool" (C command line):
>
> 1. Comment or delete #include <windows.h>
> 2. Fix the main() declaration
> 3. Add a line
> glutInit(&argc, (char **)argv);
> in main()
> 4. Replace includes
> <gl/gl.h> with
> #include <GLUT/glut.h>
> #include <OpenGL/OpenGL.h>
> ...
> Link with Frameworks OpenGL, GLUT, CoreServices, ApplicationServices
>
> Alas, in the end when you run it, it displays a white rectangle in a
> window with a black background, but NO texture....
>
> Any idea what is wrong here? Can you reproduce it? Email me if you'd
> like a copy of my code plus project
>
> Thanks
>
> Martin


Did you check for OpenGL errors ?

jbw


0
Reply jbwest 11/28/2007 4:12:49 PM


APOLOGIES

Very silly: The code does work, the only thing that was broken is that
it never loaded the image file: my error checking was simply wrong and
it assumed we had an image loaded.... very sorry and embarassed.

Martin
0
Reply freesteel 12/13/2007 12:15:54 PM

2 Replies
259 Views

(page loaded in 0.17 seconds)

Similiar Articles:













7/25/2012 9:04:28 AM


Reply: