Jump to content
  • Advertisement


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


classes->conversion correct?

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

okie i seriously dunno whether my own conversion is correct or not...i am trying to convert Mr LaMothe's struct engine to class type engine. this is for the header file, is a constructor necessary here? or must i call a default constructor, coz i dun find any data members to add into the constructors.
// class for bitmaps .BMP file


BITMAPFILEHEADER bitmapfileheader;  // this contains the bitmapfile header

BITMAPINFOHEADER bitmapinfoheader;  // this is all the info including the palette

PALETTEENTRY     palette[256];      // we will store the palette here

UCHAR            *buffer;           // this is a pointer to the data

//default constructor

//member functions

int Load_Bitmap_File(BITMAP_FILE_PTR bitmap, char *filename);
and i couldnt find a place to put this: *BITMAP_FILE_PTR which is found on the previous structure. [edited by - edwinnie on May 6, 2002 9:58:00 AM]

Share this post

Link to post
Share on other sites
Guest Anonymous Poster



Your data members should be private, and the methods (Load_Bitmap_File) public. Also, your methods (L_B_F) don''t have to take a BITMAP_FILE_PTR, because it is now a class and refers to itself via the "this" pointer.. you no longer need to pass the object to load the data into.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!