Home » Language IDEs » C / C++ IDE (CDT) » Load 3D Texture: SDL/OpenGL on Linux Eclipse(Load 3D Texture: SDL/OpenGL on Linux Eclipse)
Load 3D Texture: SDL/OpenGL on Linux Eclipse [message #697133] |
Fri, 15 July 2011 15:50 |
threaderslash Messages: 4 Registered: September 2009 |
Junior Member |
|
|
There is a strange issue with Eclipse and SDL textures in C OpenGL programming on FC15.
For set-up test purpose, the NeHe example code is used - lesson07.
The program runs and loads the texture if we run it on console with
$ make
$ ./lesson07
-- therefore, all the environment required libs are installed and present in the linux development environment. However, if we try to do the same on IDE Eclipse, the program runs, but no texture is loaded, so we can only see a white box with no texture on it.
The setup for the project environment has the libs into the Linker Libraries(L), such as SDL, SDLmain, SDL_image, GL, GLU, etc -- e.g.: OpenGL and GLUT in Eclipse on OS X.
Programs with SDL works fine for input with keyboard etc. However, the texture does not load.
In the Makefile provided from NeHe that is used run the command line in the console, I noticed the following info:
CC = gcc -Wall -ansi
all:
$(CC) lesson07.c -o lesson07 -lGL -lGLU `sdl-config --cflags --libs`
Then, reading the Makefile that is generated automatically on IDE Eclipse, I observed that apparently this additional flag is missing: sdl-config --cflags --libs. Should be this additional flag what is preventing the command SDL_LoadBMP to display the texture?
If so, some suggestion about how to properly tune this additional info for the Eclipse's settings to allow the generated IDE Makefile to work properly?
All comments are highly appreciated.
|
|
|
Re: Load 3D Texture: SDL/OpenGL on Linux Eclipse [message #697396 is a reply to message #697133] |
Sat, 16 July 2011 15:09 |
David Wegener Messages: 1445 Registered: July 2009 |
Senior Member |
|
|
On 07/15/2011 10:50 AM, threaderslash wrote:
> There is a strange issue with Eclipse and SDL textures in C OpenGL
> programming on FC15. 8o
> For set-up test purpose, the NeHe example code is used - lesson07.
>
> The program runs and loads the texture if we run it on console with
>
> $ make
> $ ./lesson07
> -- therefore, all the environment required libs are installed and
> present in the linux development environment. However, if we try to do
> the same on IDE Eclipse, the program runs, but no texture is loaded, so
> we can only see a white box with no texture on it.
>
> The setup for the project environment has the libs into the Linker
> Libraries(L), such as SDL, SDLmain, SDL_image, GL, GLU, etc -- e.g.:
> OpenGL and GLUT in Eclipse on OS X.
>
> Programs with SDL works fine for input with keyboard etc. However, the
> texture does not load.
>
> In the Makefile provided from NeHe that is used run the command line in
> the console, I noticed the following info:
>
> CC = gcc -Wall -ansi
> all:
> $(CC) lesson07.c -o lesson07 -lGL -lGLU `sdl-config --cflags --libs`
>
> Then, reading the Makefile that is generated automatically on IDE
> Eclipse, I observed that apparently this additional flag is missing:
> sdl-config --cflags --libs. Should be this additional flag what is
> preventing the command SDL_LoadBMP to display the texture?
>
> If so, some suggestion about how to properly tune this additional info
> for the Eclipse's settings to allow the generated IDE Makefile to work
> properly?
>
> All comments are highly appreciated. :d
If the texture is loaded from a file, then the problem could be a path
issue. If the program is using a relative path to locate the texture
file, then the working directory where the executable is run is very
important. On the launch config in Eclipse, you can set the working
directory on the Arguments tab.
|
|
|
Re: Load 3D Texture: SDL/OpenGL on Linux Eclipse [message #697397 is a reply to message #697133] |
Sat, 16 July 2011 15:09 |
David Wegener Messages: 1445 Registered: July 2009 |
Senior Member |
|
|
On 07/15/2011 10:50 AM, threaderslash wrote:
> There is a strange issue with Eclipse and SDL textures in C OpenGL
> programming on FC15. 8o
> For set-up test purpose, the NeHe example code is used - lesson07.
>
> The program runs and loads the texture if we run it on console with
>
> $ make
> $ ./lesson07
> -- therefore, all the environment required libs are installed and
> present in the linux development environment. However, if we try to do
> the same on IDE Eclipse, the program runs, but no texture is loaded, so
> we can only see a white box with no texture on it.
>
> The setup for the project environment has the libs into the Linker
> Libraries(L), such as SDL, SDLmain, SDL_image, GL, GLU, etc -- e.g.:
> OpenGL and GLUT in Eclipse on OS X.
>
> Programs with SDL works fine for input with keyboard etc. However, the
> texture does not load.
>
> In the Makefile provided from NeHe that is used run the command line in
> the console, I noticed the following info:
>
> CC = gcc -Wall -ansi
> all:
> $(CC) lesson07.c -o lesson07 -lGL -lGLU `sdl-config --cflags --libs`
>
> Then, reading the Makefile that is generated automatically on IDE
> Eclipse, I observed that apparently this additional flag is missing:
> sdl-config --cflags --libs. Should be this additional flag what is
> preventing the command SDL_LoadBMP to display the texture?
>
> If so, some suggestion about how to properly tune this additional info
> for the Eclipse's settings to allow the generated IDE Makefile to work
> properly?
>
> All comments are highly appreciated. :d
If the texture is loaded from a file, then the problem could be a path
issue. If the program is using a relative path to locate the texture
file, then the working directory where the executable is run is very
important. On the launch config in Eclipse, you can set the working
directory on the Arguments tab.
|
|
| |
Goto Forum:
Current Time: Fri Mar 29 04:39:15 GMT 2024
Powered by FUDForum. Page generated in 0.02939 seconds
|