[occam's Razor ȨÀ¸·Î]

OpenGlGameProgramming 20 ÀåÀÇ simpengine.h ÀÔ´Ï´Ù.

#ifndef __SIMPENGINE
#define __SIMPENGINE

#define WIN32_LEAN_AND_MEAN
#define WIN32_EXTRA_LEAN

/*
	SIMPENGINE.H

	The SimpEngine class

	Author: Kevin Hawkins
	Date: 3/29/2001
	Description: The SimpEngine class is the
      main interface for SimpEngine.
      Derived from CEngine, tt provides the camera and
      world objects.

*/
#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>

#include "engine.h"
#include "object.h"
#include "camera.h"
#include "terrain.h"
#include "world.h"

class CSimpEngine : public CEngine
{
private:

     CCamera *gameCamera;          // Ä«¸Þ¶ó °´Ã¼
     CWorld *gameWorld;            // ¼¼°è °´Ã¼

protected:
     CCamera *OnGetCamera() { return gameCamera; }
     CWorld *OnGetWorld() { return gameWorld; }

     void OnPrepare();
     void OnMouseDownL(float x, float y);
     void OnMouseMove(int deltaX, int deltaY);
     void OnMouseMove(int x, int y, int centerX, int centerY);
     void OnKeyDown(int nVirtKey);

public:
     CSimpEngine()
     {
          gameCamera = new CCamera;
          gameWorld = new CWorld;
     }

     CSimpEngine(const char *szName, bool fscreen, int w, int h, int b) :
          CEngine(szName, fscreen, w, h, b)
     {
          gameCamera = new CCamera;
          gameWorld = new CWorld(gameCamera);
     }

     ~CSimpEngine()
     {
          delete gameWorld;
          delete gameCamera;
          gameWorld = NULL;
          gameCamera = NULL;
     }
};

#endif

¸ÞÀÎ ÆäÀÌÁö

¹ø¿ª¼­ Á¤º¸

¹ø¿ª À̾߱â

¹®¼­ â°í

ÀÚÀ¯ °Ô½ÃÆÇ

¹æ¸í·Ï