Compression

This is a discussion on Compression within the Game Programming forums, part of the General Programming Boards category; How are you able to make your own file extensions, like compressing them? I need to make my own 3D ...

  1. #1
    Registered User
    Join Date
    Jun 2007
    Location
    Canada
    Posts
    3

    Compression

    How are you able to make your own file extensions, like compressing them? I need to make my own 3D model and textures. I'm thinking of making my textures .tga, and my models .3ds, but I want to compress them from there on.

  2. #2
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    I don't quite understand what you want to do....

    if you want to make your own "file extension"...which I think you mean "file type", then you just define it either on paper or in your head, and then you do it.

    For example, if I want to define a file type called the "DTP" file type, and I want the DTP file type to hold pixel data in my own special way, then I would so something like this:

    Code:
    void WritePixelData ( void )
    {
    	ofstream output;
    	output.open ( "myfile.dtp" );
    	
    	output << pixeldata;
    	output << whatever_i_want;
    	
    	output.close();
    }
    If you want to compress files...use something like WinZip or WinRar...or whatever tool you can use to compress and archive a file.
    My Website

    "Circular logic is good because it is."

  3. #3
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    I think he means he wants to compress his pixel data in some proprietary format, but since he didnt specify, Ill just answer the questions he DID ask.

    How are you able to make your own file extensions, like compressing them?
    No, not like compressing them, like putting a custom extension on the file.

    Then to compress them you use a compression algorithm like huffman
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Compression
    By Ezerhorden in forum C++ Programming
    Replies: 5
    Last Post: 02-11-2006, 10:19 AM
  2. compression
    By X PaYnE X in forum C Programming
    Replies: 20
    Last Post: 01-11-2005, 05:14 PM
  3. efficient compression algorithm pls
    By gooddevil in forum C Programming
    Replies: 7
    Last Post: 05-08-2004, 04:33 AM
  4. Compression utility source code
    By Blizzarddog in forum C++ Programming
    Replies: 4
    Last Post: 11-07-2003, 08:15 PM
  5. help: compression algorithms...
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 02-24-2002, 06:10 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21