• Advertisement

Archived

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

Suggestion: customizable data loading.

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

Using WGTLIB files in Power Rener seems nice and working very well.
But many programmers may have their own methods of managing data.
(Ex: own methods of compressing data, own methods of encrypting.)

My suggestion is like this:
Let Power Render users customize data loading
by setting some function pointers with pre-defined specification.


I saw some data-compress lib providing just one function.
-> void uncompress_data(int (*read_byte()),int (*write_byte()));

With my own read/write functions,
I was able to successfully customize that function.


For example,
(1) I call PR_LoadTexture("my texture")
(2) PR_LoadTexture calls back my own function requesting to open it.
-> HANDLE open_data(char DataName[]);
(3) PR_LoadTexture takes the bytes with successive calls to my own function.
It's over when it returns EOF(-1).
-> int get_byte(HANDLE h);
(4) PR_LoadTexture calls back my own function saying it's over.
-> void close_data(HANDLE h);


If U think this useful,
please consider including in next release of PR.

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement