Archived

This topic is now archived and is closed to further replies.

Good idea for OO Texure loading classes?

This topic is 5279 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

I am going to create a fairly simple OO texture loader and im just wondering if this is a good set up or if there is a better way to handle it... You have CTex (Main texture class holding all the variables needed for all loading such as the pointer to the data and main texture loading function) then there is (example can be any file type) CBmp : public CTex - inheriting CTex. CBmp then loads the BMP File, and Loads a bitmap texture into the pointer to the data in CTex. How this all works is inside of CTex i the main loading function: LoadTexture("Filename.EXT") and it reats the .EXT and loads according to the file type allowing for easy creation and deletion the class doing the loading of the file. Is this a good OO way to go about handling it or are there even better ways?

Share this post


Link to post
Share on other sites
Personally... I wouldn''t do it that way. I would just have one texture class with several functions for loading various file formats. Its a whole lot easier IMO and it''s prolly a little faster.

If you are using DX, then none of it should matter since you can load nearly any format with one function.

Share this post


Link to post
Share on other sites