Click here to Skip to main content
15,886,199 members
Articles / Desktop Programming / MFC

SolidGraph CAD System

Rate me:
Please Sign up or sign in to vote.
4.97/5 (78 votes)
12 Sep 20062 min read 375.3K   29.8K   209  
A SolidGraph CAD system source code.
#if !defined(BACKGROUND_H)
#define BACKGROUND_H

struct SCOLOR4F
{
	float r, g, b, a;
};

enum MIRROR_TYPE	{ MIRROR00, MIRROR10, MIRROR01, MIRROR11 	    };


struct SBACKGROUND_PARAMS
{
	int row_num;
	int col_num;
	SCOLOR4F corner [4];
	MIRROR_TYPE mirror_type;
	CString texture_file;
};

// background construction and visualizing (2D and 3D)
class CBackground
{
private:
    
    float m_depth;
    
	int m_row_num;
    
	int m_col_num;
    
    SCOLOR4F m_corners[4];
    
    MIRROR_TYPE m_mirror_type;
    
	CString m_texture_file;
    
    GLuint m_textureID;
   
    bool CreateTexture();
    
    unsigned char *LoadFromBmp(char *filename, int* bmpWidth, int* bmpHeight);
public:
    
    CBackground();
    
	~CBackground();
   
    void SetParams(SBACKGROUND_PARAMS *params);
    
	void GetParams(SBACKGROUND_PARAMS *params);
    
    void Display();
    
    void SetDepth(float depth);
};

#endif //BACKGROUND_H

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions