Skip to content

Commit

Permalink
[mac]Issue #123, Tutorials.
Browse files Browse the repository at this point in the history
  • Loading branch information
M-F-K committed May 11, 2013
1 parent fa1f853 commit 37517bb
Show file tree
Hide file tree
Showing 32 changed files with 1,615 additions and 131 deletions.
106 changes: 106 additions & 0 deletions IndieLib/tutorials/basic/01_Installing/CIndieLib.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*****************************************************************************************
* Desc: IndieLib singleton initialization class
*****************************************************************************************/

#include "CIndieLib.h"

//#ifdef PLATFORM_WIN32
//#include "TCHAR.h"
//#endif

/*
==================
Init singleton
==================
*/
CIndieLib *CIndieLib::_pinstance = 0;// initialize pointer
CIndieLib *CIndieLib::instance() {
if (_pinstance == 0) { // is it the first call?
_pinstance = new CIndieLib; // create sole instance
}
return _pinstance; // address of sole instance
}



/*
==================
Init IndieLib
==================
*/
bool CIndieLib::init() {
//resetCurrentDirectory_W();

// IndieLib Initialization, a debug.log file will be created.
IndieLib::init(IND_DEBUG_MODE);

_input = new IND_Input;
_render = new IND_Render;
//_lightManager = new IND_LightManager;
_imageManager = new IND_ImageManager;
_surfaceManager = new IND_SurfaceManager;
//_meshManager = new IND_3dMeshManager;
_animationManager = new IND_AnimationManager;
_fontManager = new IND_FontManager;
_entity2dManager = new IND_Entity2dManager;
//_entity3dManager = new IND_Entity3dManager;
_math = new IND_Math;

IND_WindowProperties props ("IndieLib", 800, 600, 32, 0, 0, 1);


_window = _render ->initRenderAndWindow(props);
if(!_window)
return 0;

//if (!_lightManager ->init (_render)) return 0;
if (!_imageManager ->init()) return 0;
if (!_surfaceManager ->init(_imageManager, _render)) return 0;
if (!_animationManager ->init(_imageManager, _surfaceManager)) return 0;
if (!_fontManager ->init(_imageManager, _surfaceManager)) return 0;
if (!_entity2dManager ->init(_render)) return 0;
//if (!_entity3dManager ->init (_render)) return 0;
//if (!_meshManager ->init (_render)) return 0;
if (!_input ->init(_render)) return 0;
if (!_math ->init()) return 0;

return 1;
}


/*
==================
Free Indielib managers
==================
*/
void CIndieLib::end() {
// ----- Freeing objects -----

_math ->end();
//_meshManager ->end();
_input ->end();
_entity2dManager ->end();
//_entity3dManager ->end();
_fontManager ->end();
_animationManager ->end();
_surfaceManager ->end();
_imageManager ->end();
//_lightManager ->end();
_render ->end();

DISPOSE(_math);
//DISPOSE(_meshManager);
DISPOSE(_input);
DISPOSE(_entity2dManager);
//DISPOSE(_entity3dManager);
DISPOSE(_fontManager);
DISPOSE(_animationManager);
DISPOSE(_surfaceManager);
DISPOSE(_imageManager);
//DISPOSE(_lightManager);
DISPOSE(_render);

IndieLib::end();

DISPOSE(_pinstance);
}
2 changes: 1 addition & 1 deletion IndieLib/tutorials/basic/01_Installing/Tutorial01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Desc: Tutorial a) 01 Installing
*****************************************************************************************/

#include "CIndieLib_vc2008.h"
#include "CIndieLib.h"

/*
==================
Expand Down
106 changes: 106 additions & 0 deletions IndieLib/tutorials/basic/02_IND_Surface/CIndieLib.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*****************************************************************************************
* Desc: IndieLib singleton initialization class
*****************************************************************************************/

#include "CIndieLib.h"

//#ifdef PLATFORM_WIN32
//#include "TCHAR.h"
//#endif

/*
==================
Init singleton
==================
*/
CIndieLib *CIndieLib::_pinstance = 0;// initialize pointer
CIndieLib *CIndieLib::instance() {
if (_pinstance == 0) { // is it the first call?
_pinstance = new CIndieLib; // create sole instance
}
return _pinstance; // address of sole instance
}



/*
==================
Init IndieLib
==================
*/
bool CIndieLib::init() {
//resetCurrentDirectory_W();

// IndieLib Initialization, a debug.log file will be created.
IndieLib::init(IND_DEBUG_MODE);

_input = new IND_Input;
_render = new IND_Render;
//_lightManager = new IND_LightManager;
_imageManager = new IND_ImageManager;
_surfaceManager = new IND_SurfaceManager;
//_meshManager = new IND_3dMeshManager;
_animationManager = new IND_AnimationManager;
_fontManager = new IND_FontManager;
_entity2dManager = new IND_Entity2dManager;
//_entity3dManager = new IND_Entity3dManager;
_math = new IND_Math;

IND_WindowProperties props ("IndieLib", 800, 600, 32, 0, 0, 1);


_window = _render ->initRenderAndWindow(props);
if(!_window)
return 0;

//if (!_lightManager ->init (_render)) return 0;
if (!_imageManager ->init()) return 0;
if (!_surfaceManager ->init(_imageManager, _render)) return 0;
if (!_animationManager ->init(_imageManager, _surfaceManager)) return 0;
if (!_fontManager ->init(_imageManager, _surfaceManager)) return 0;
if (!_entity2dManager ->init(_render)) return 0;
//if (!_entity3dManager ->init (_render)) return 0;
//if (!_meshManager ->init (_render)) return 0;
if (!_input ->init(_render)) return 0;
if (!_math ->init()) return 0;

return 1;
}


/*
==================
Free Indielib managers
==================
*/
void CIndieLib::end() {
// ----- Freeing objects -----

_math ->end();
//_meshManager ->end();
_input ->end();
_entity2dManager ->end();
//_entity3dManager ->end();
_fontManager ->end();
_animationManager ->end();
_surfaceManager ->end();
_imageManager ->end();
//_lightManager ->end();
_render ->end();

DISPOSE(_math);
//DISPOSE(_meshManager);
DISPOSE(_input);
DISPOSE(_entity2dManager);
//DISPOSE(_entity3dManager);
DISPOSE(_fontManager);
DISPOSE(_animationManager);
DISPOSE(_surfaceManager);
DISPOSE(_imageManager);
//DISPOSE(_lightManager);
DISPOSE(_render);

IndieLib::end();

DISPOSE(_pinstance);
}
2 changes: 1 addition & 1 deletion IndieLib/tutorials/basic/02_IND_Surface/Tutorial02.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Desc: Tutorial 02 IND_Surface
*****************************************************************************************/

#include "CIndieLib_vc2008.h"
#include "CIndieLib.h"
#include "IND_Surface.h"
#include "IND_Entity2d.h"
#include "../../WorkingPath.h"
Expand Down
106 changes: 106 additions & 0 deletions IndieLib/tutorials/basic/03_IND_Image/CIndieLib.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*****************************************************************************************
* Desc: IndieLib singleton initialization class
*****************************************************************************************/

#include "CIndieLib.h"

//#ifdef PLATFORM_WIN32
//#include "TCHAR.h"
//#endif

/*
==================
Init singleton
==================
*/
CIndieLib *CIndieLib::_pinstance = 0;// initialize pointer
CIndieLib *CIndieLib::instance() {
if (_pinstance == 0) { // is it the first call?
_pinstance = new CIndieLib; // create sole instance
}
return _pinstance; // address of sole instance
}



/*
==================
Init IndieLib
==================
*/
bool CIndieLib::init() {
//resetCurrentDirectory_W();

// IndieLib Initialization, a debug.log file will be created.
IndieLib::init(IND_DEBUG_MODE);

_input = new IND_Input;
_render = new IND_Render;
//_lightManager = new IND_LightManager;
_imageManager = new IND_ImageManager;
_surfaceManager = new IND_SurfaceManager;
//_meshManager = new IND_3dMeshManager;
_animationManager = new IND_AnimationManager;
_fontManager = new IND_FontManager;
_entity2dManager = new IND_Entity2dManager;
//_entity3dManager = new IND_Entity3dManager;
_math = new IND_Math;

IND_WindowProperties props ("IndieLib", 800, 600, 32, 0, 0, 1);


_window = _render ->initRenderAndWindow(props);
if(!_window)
return 0;

//if (!_lightManager ->init (_render)) return 0;
if (!_imageManager ->init()) return 0;
if (!_surfaceManager ->init(_imageManager, _render)) return 0;
if (!_animationManager ->init(_imageManager, _surfaceManager)) return 0;
if (!_fontManager ->init(_imageManager, _surfaceManager)) return 0;
if (!_entity2dManager ->init(_render)) return 0;
//if (!_entity3dManager ->init (_render)) return 0;
//if (!_meshManager ->init (_render)) return 0;
if (!_input ->init(_render)) return 0;
if (!_math ->init()) return 0;

return 1;
}


/*
==================
Free Indielib managers
==================
*/
void CIndieLib::end() {
// ----- Freeing objects -----

_math ->end();
//_meshManager ->end();
_input ->end();
_entity2dManager ->end();
//_entity3dManager ->end();
_fontManager ->end();
_animationManager ->end();
_surfaceManager ->end();
_imageManager ->end();
//_lightManager ->end();
_render ->end();

DISPOSE(_math);
//DISPOSE(_meshManager);
DISPOSE(_input);
DISPOSE(_entity2dManager);
//DISPOSE(_entity3dManager);
DISPOSE(_fontManager);
DISPOSE(_animationManager);
DISPOSE(_surfaceManager);
DISPOSE(_imageManager);
//DISPOSE(_lightManager);
DISPOSE(_render);

IndieLib::end();

DISPOSE(_pinstance);
}
2 changes: 1 addition & 1 deletion IndieLib/tutorials/basic/03_IND_Image/Tutorial03.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Desc: Tutorial a) 03 Ind_Image
*****************************************************************************************/

#include "CIndieLib_vc2008.h"
#include "CIndieLib.h"

#include "IND_Surface.h"
#include "IND_Entity2d.h"
Expand Down
Loading

0 comments on commit 37517bb

Please sign in to comment.