www.pudn.com > 3dsMFCRender.rar > toolGL.h, change:1998-05-23,size:2433b
//
//
// Classinterface to CtoolGL toolGL.h
// Sivert L. Nielsen
// This Class and the classes used from this is freeware
// You may do as you wish with it. Please note that I
// strongly encourage you to share of yourself and of
// your own knowledge.
//
// One world, one mind.
//
// Sivert, 1998
//
//
//
#include "ToolAscReader.h" //an simple .asc file reader
#include "glStructures.h" //structs and stuff
#include "3dsReader.h" //3DS-reader
#include "TriList.h" //Object container
#ifndef CTOOLGL_H
#define CTOOLGL_H
class CtoolGL
{
public:
void setDisplayListMode();
void SetBoundingBoxMode();
void SetSceneRot(int axis, int value, BOOL increment = TRUE, BOOL apply = FALSE);
void SetCamPos(int axis, int value, BOOL increment = TRUE, BOOL apply = FALSE);
long AdvanceAnim(int step=1, int direction=1, long frame=-1);
BOOL Open3dsFile(char *filename);
BOOL setAsc( CtoolAscReader* theAsc, BOOL loaded);
BOOL OpenBitmapFile(char *filename);
CtoolGL();
~CtoolGL();
BOOL Destroy();
BOOL InitializeOpenGL(CDC* pDC);
BOOL RenderScene();
BOOL Resize(int cx, int cy);
BOOL SetupPixelFormat(void);
BOOL SetupViewport(int cx, int cy);
BOOL SetupViewingFrustrum(GLdouble);
BOOL SetupViewingTransform(void);
private:
void Draw3ds(); //tegn innlastet 3ds-fil
void DrawAsc(); //tegn innlastet asc-fil
void DrawAxis(); //aksekors x-y-z
void DrawBitmap(); //bitmap
void DrawGuy(); //mann med pistol ..øh.. kommer
void SetError(int e); //sett feilnummer
static const char* const _ErrorStrings[];
const char* m_ErrorStrings;
HGLRC m_hRC; //OpenGL rendering context
CDC * m_pDC; //peker til device context
TriList m_triList; //list med triangelobjekter
RECT m_pRectSize; //brukes for å holde current vindustørrelse
BOOL m_bitmapIs; //har vi et bitmap?
BOOL m_AscLoaded; //har vi et objekt liggende?
BOOL m_3dsLoaded; //har vi les inn suksessfullt en 3dstudio fil?
BOOL m_Bbox; //skal vi bruke bounding box?
BOOL m_DispList; //skal vi bruke display lists?
int recompile; //skal displayliste rekompileres
int list; //displaylist ID
float camRot[3]; //viewportrotation x y z
float camPos[3]; //cameraposition
float sceneRot[3]; //viewportrotation x y z
float scenePos[3]; //cameraposition
long animstart; //hmm...
long animend; //hmm...
};
#endif