Advertisement

Texture mapping in dev-cpp with devil.

Started by June 21, 2003 12:08 AM
8 comments, last by Mithoric 21 years, 8 months ago
Ello, . I''m just getting into OpenGL and C++ and I''d like to be able to do texture mapping but dev-cpp doesn''t come with glaux, although I''ve recently learnt that''s most likely a good thing . So anyways I need a way to load images to texture without glaux, I''ve discovered devil (openil) but for some reason I didn''t get the examples in the download which is weird. Can someone here give me an example of how to texture map an object in OpenGL either with devil (openil) or something else that doesn''t require glaux? Kindest reagards, Michael.
nehe.gamedev.net, use ipicture
Advertisement
The tutorials are on the website...

http://openil.sourceforge.net/tuts/tut_10/index.htm

There are a few "bugs" ( outdated code ) but you should get the general idea..

Bugs:

You are actualy requires to use these lines to initialise; ( tut only says ilutRender(..) )
ilInit();
iluInit();
ilutRenderer(ILUT_OPENGL);

Also functions that has Ogl in thier names actualy has GL in thier names, eg:

ilutOglLoadImage -> ilutGLLoadImage

Other than that the lib is extremely easi to use...

And ofcourse you should rember to include and link to :

il\il.h
il\ilu.h
il\ilut.h



you should be aware that in the past there was some truoble using DevIL with Dev-C++ ( this may have been corrected - if not you can find my workaround repack of version 1.6.1 here : http://decoder.dk/prog/download/ )


gl & happy coding!



/Please excuse my bad spelling - My native language is binary not english
|Visit me
\Take my advice - I don''''t use it...
/Please excuse my bad spelling - My native language is binary not english|Visit meTake my advice - I don''t use it...
I can't get the Ipicture working but I'd rather use devil anyways.

Firstly what the heck is the error:

[Linker error] undefined reference to `WinMain@16'

????

Secondly I'd really like an example to work off, I find it easier to learn by example... so if someone could provide an example for dev-c++ I'd like that very much so.

[edited by - Mithoric on June 22, 2003 2:52:51 AM]
quote:
Original post by Mithoric
Firstly what the heck is the error:

[Linker error] undefined reference to `WinMain@16''
It means that the linker is looking for WinMain@16, but can''t find it.

I''m guessing that that you declared WinMain as int WinMain(etc). It should be int __stdcall WinMain(etc), or you can use one of the macros for __stdcall, such as WINAPI or APIENTRY.
I got rid of the problem but now have more problems.

1: I''ve no clue about using DevIL
2: I''ve no clue about using DevIL
3: Because I''ve no clue about using DevIL I get these errors when I try to use the ilInit();


error1)ISO C++ forbids declaration of `ilInit'' with no type
error2)new declaration `int ilInit()''
Advertisement
i think the officials tutorials at http://openil.sourceforge.net/tuts/index.htm are really clear, but you''ve got to READ them, not to copy/paste
and if you''re curious, you can try to load yourself your picture: go to nehe or search on google, there are lots of tut about loading bmp/tga/jpeg....
Most things come across very clear to me, but those tutorials just don't make much sense to me.

I'll have another read over them but I've already had a look a few times, maybe I missed something.

[EDIT] DUDE!!!! :D I dunno why but reading over it already and it's actually working. Thanks!

[edited by - Mithoric on June 22, 2003 5:20:52 AM]
Buh, I''ve hit a brick wall already. I keep getting these undefined type errors:

ISO C++ forbids declaration of `ilGenImages'' with no type

I have to define the function return type and the type of the variables etc which is very weird.

This is my code:

ILvoid ilInit(ILvoid);
ILuint ImageName;
ilGenImages(1, &ImageName);
ILvoid ilBindImage(ILuint ImageName);

As you can see I added ILvoid to the ilInit to make it compile without the error. The same goes for the ilBindImage, but I didn''t for ilGenImages and that''s where the compiler stops.

Why isn''t it working? I''ve included il\il.h and il\ilu.h ...
quote:
Original post by Mithoric
ILvoid ilInit(ILvoid);
[...]
ILvoid ilBindImage(ILuint ImageName);



uhm... those two lines are prototypes... why do you need to redefine those methodes?

somthing tells me that you either included the lib wrong ( "" vs <> ) or you forgot to copy the header files to the correct directory...



/Please excuse my bad spelling - My native language is binary not english
|Visit me
\Take my advice - I don''''t use it...
/Please excuse my bad spelling - My native language is binary not english|Visit meTake my advice - I don''t use it...

This topic is closed to new replies.

Advertisement