Skip to main content
gamedev.net
🔒 Locked

Spooling files

Started by d000hg Jun 19, 2002 at 5:04 PM 1 replies 200+ views
Original Post
d000hg
d000hg
If I have a huge level like a couple of hundred megabytes, how do I open the file so I can spool it? For instance if I divide my map into chunks and I want to load chunk #412, how does windows support that? I think windows auotomatically loads the entire file into memory when you open it, doesn''t it? Oh and a side issue - in windows with c++ should I open files using the c file functions, the c++ stream methods of the windows API calls?
Oluseyi
Oluseyi
quote:
Original post by d000hg
I think windows auotomatically loads the entire file into memory when you open it, doesn''t it?

No. And you could have found that out by reading the docs. You read the data in yourself.

quote:

Oh and a side issue - in windows with c++ should I open files using the c file functions, the c++ stream methods of the windows API calls?

Whichever floats your boat. If you''re writing an application specifically for Windows (or any OS in general), using the OS-specific APIs are good because they offer you the most functionality and control. If you''re writing an abstraction layer or portable library, stick to C or C++ functions (I recommend C++ streams because they work well with other parts of the Standard C++ Library).
IndirectX
IndirectX
If you''re after Win32 solution, use memory mapped files (look up CreateFileMapping & MapViewOfFile). They are really great for this type of application.
---visit #directxdev on afternet <- not just for directx, despite the name

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.