Jump to content
  • Advertisement
Sign in to follow this  
_the_phantom_

Unity The Game Texture Loader

This topic is 4713 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So, I've got plans... great great plans and I'd like some feedback and what I've got thus far [grin] The basics is I plan to make a library which deals with loading textures and only loading textures. Infomation can be found here and I'll be updating it as and when I do things, however I'd like some feedback on my inital considerations. (This is also relivent) oh, and anyone who mentions SDL_Image will be shot for not reading the above links and the comments made [razz] [Edited by - _the_phantom_ on July 24, 2005 12:31:10 PM]

Share this post


Link to post
Share on other sites
Advertisement
Would this only be compatible with OpenGL or other API's too?

I suppose if the code was able to return pointers to simple RGBA values, which represent each pixel in the image, then it could be used by all API's. Is that what you are going for? That’s what my image library does, and while the memory taken is slightly more than it could be, it is quite flexible and used by both DirectX and OpenGL renderers.

It does defiantly seem like an interesting proposition, especially if you can keep it contained within one library.

By that, I mean, I have to use different libraries for loading different texture, so my current project requires jpeg lib, png lib etc. If I only needed to include GTL.lib (or whatever) then that would be a fantastic thing to use.

If on the other hand, your GTL used jpeglib and png lib, and I had to include them myself, I would be less likely to use it. Just my thoughts though.

What would be your standing on including gif images in the library also?

Sounds like a very worth while project and one I have often wondered why no-one else has done something similar.

Spree

Share this post


Link to post
Share on other sites
The plan is to make it API independant as possible, I dont see any good reason why it should favour one API over another.

As you say, its just going to be a case of passing a pointer to the values and telling you what format the data is in (RGBA, RGB, float, int, DXT compressed, whatever). Once you have that pointer you can do with it as you like.

Keeping it all in one library shouldnt be a huge problem, I'm a great fan of statically linked libs when the need arises and my last project was purely statically linked as well. So, it should have all the required decoding libs built in. Infact, if you are using an MS compiler it will be even easier as I always make a config.hpp file which will automatically insert pragmas to make the linker link to the correct library, so you'd just include GTL.hpp and it would work the rest out for you [grin]

Ofcourse, what with it being zlib based license wise there will be a source distro, so if poeple want to change/recompile it as a dll or whatever, they can.

GIF support is an option, however how common is it as a game image format? I cant say I've ever had need to use it myself, thus its exclusion from the inital format list...

edit: As to why no one has done it before.. well, they kinda have, however alot of projects start off as "I'll just do this" and kinda sprial from there, so they become a "jack of all trades, master of none" type thing. Me on the other hand, I'm too lazy to add features beyond what I need and I prefer to keep things focused as much as possible [smile]

Share this post


Link to post
Share on other sites
Quote:
Original post by gumpy macdrunken
your second link is broken.


hmmm... so it is... the link is being mangled for some reason when I post (I just tried to edit it)... it only points to the journal entry below the one first linked to anyways, it was kinda a convinance link to explain why I was going off on this anyways...

Share this post


Link to post
Share on other sites
Quote:
Original post by _the_phantom_
GIF support is an option, however how common is it as a game image format? I cant say I've ever had need to use it myself, thus its exclusion from the inital format list...


Well, I use it so its common enough for me ;)

Having said that, if it is open source would you be open to people submitting format classes that fit in with your libraries structure?

Spree

Share this post


Link to post
Share on other sites
Great idea, and I'd definately use it. Just give a shout if you need any help or any testing.

I would also suggest making the reading from file by using a callback function available. That way people who use zipfiles and such can also use this. libpng has a similar structure, as does libjpeg I believe.

Share this post


Link to post
Share on other sites
Phantom, your library would be a godsend for mine. I could incorperate yours as a standard implementation.

Tears of joy man, tears of freakin joy.

Share this post


Link to post
Share on other sites
@rick_appleton
Yeah, thats a thought I'd had and you mentioning it just confirms it as a good idea [grin]

@PnP Bios
heh, so you'll be intrested in it then? [grin]

Hopefully I'll start work on the inital version of it this week if not tonight (awakeness permitting)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!