Well I attempted to build Ogre 2.0 on MSVC 2019 but ran into the error below. I couldn't find any way to disable precompiled headers in cmake like you can with 1.12.
Okay so I commented out use_precompiled_header in OgreMain/CMakeLists.txt and got 2.0 to build. However, building my game resulted in some errors.
So I installed MSVC 2017 Community Edition since that's the lowest version supported by the Visual Studio Installer that I downloaded from Microsoft's site. I got 2.0 to build again and then when I go to build my game against this version of 2.0 I get the following errors:
Okay I tried adding that to the top of playergamedata.cpp and it's header playergamedata.h but the error persists. Below are what both files look like:
#include <algorithm>
#include "data/playergamedata.h"
#include "utilities/typedefs.h"
//#include "OgreVector3.h"
playerGameData::playerGameData() // constructor
{
activePosition = NONE;
courtPosition = Ogre::Vector3(0.0f,0.0f,0.0f);
posChange = Ogre::Vector3(0.0f,0.0f,0.0f);
passToPlayer = NONE;
direction = NODIRECT;
oldDirection = NODIRECT;
courtPositionChangedType = NOCHANGE;
}
playerGameData::~playerGameData() = default; // destructor
playerPositions playerGameData::getActivePosition() const // retrieves the value of activePosition
{
return (activePosition);
}
void playerGameData::setActivePosition(const playerPositions &set) // sets the value of activePosition
{
activePosition = set;
}
Ogre::Vector3 playerGameData::getCourtPosition() const // retrieves the value of courtPosition
{
return (courtPosition);
}
void playerGameData::setCourtPosition(const Ogre::Vector3 &set) // sets the value of courtPosition
{
courtPosition = set;
}
std::vector<playerActions> playerGameData::getStateAction() const // retrieves the value of stateAction
{
return (stateAction);
}
void playerGameData::setStateAction(const std::vector<playerActions> &set) // sets the value of stateAction
{
stateAction = set;
}
directions playerGameData::getDirection() const // retrieves the value of direction
{
return (direction);
}
void playerGameData::setDirection(const directions &set) // sets the value of direction
{
direction = set;
}
directions playerGameData::getOldDirection() const // retrieves the value of oldDirection
{
return (oldDirection);
}
void playerGameData::setOldDirection(const directions &set) // sets the value of oldDirection
{
oldDirection = set;
}
Ogre::Vector3 playerGameData::getPosChange() const // retrieves the value of posChange
{
return (posChange);
}
void playerGameData::setPosChange(const Ogre::Vector3 &set) // sets the value of posChange
{
posChange = set;
}
playerPositions playerGameData::getPassToPlayer() const // retrieves the value of passToPlayer
{
return (passToPlayer);
}
void playerGameData::setPassToPlayer(const playerPositions &set) // sets the value of passToPlayer
{
passToPlayer = set;
}
Ogre::Vector3 playerGameData::getJumpBeginPos() const // retrieves the value of playerJumpBeginPos
{
return (jumpBeginPos);
}
void playerGameData::setJumpBeginPos(const Ogre::Vector3 &set) // sets the value of playerJumpBeginPos
{
jumpBeginPos = set;
}
Ogre::Vector3 playerGameData::getJumpEndPos() const // retrieves the value of playerJumpEndPos
{
return (jumpEndPos);
}
void playerGameData::setJumpEndPos(const Ogre::Vector3 &set) // sets the value of playerJumpEndPos
{
jumpEndPos = set;
}
Ogre::Vector3 playerGameData::getNewCourtPosition() const // retrieves the value of newCourtPosition
{
return (newCourtPosition);
}
void playerGameData::setNewCourtPosition(const Ogre::Vector3 &set) // sets the value of newCourtPosition
{
newCourtPosition = set;
}
positionChangedTypes playerGameData::getCourtPositionChangedType() const // retrieves the value of courtPositionChangedType
{
return (courtPositionChangedType);
}
void playerGameData::setCourtPositionChangedType(const positionChangedTypes &set) // sets the value of courtPositionChangedType
{
courtPositionChangedType = set;
}
#ifndef _PLAYERGAMEDATA_H_
#define _PLAYERGAMEDATA_H_
#include <algorithm>
#include "utilities/enums.h"
#include "OgreVector3.h"
class playerGameData
{
public:
playerGameData(); // constructor
~playerGameData(); // destructor
playerPositions getActivePosition() const; // retrieves the value of activePosition
void setActivePosition(const playerPositions &set); // sets the value of activePosition
Ogre::Vector3 getCourtPosition() const; // retrieves the value of courtPosition
void setCourtPosition(const Ogre::Vector3 &set); // sets the value of courtPosition
std::vector<playerActions> getStateAction() const; // retrieves the value of stateAction
void setStateAction(const std::vector<playerActions> &set); // sets the value of stateAction
directions getDirection() const; // retrieves the value of direction
void setDirection(const directions &set); // sets the value of direction
directions getOldDirection() const; // retrieves the value of oldDirection
void setOldDirection(const directions &set); // sets the value of oldDirection
Ogre::Vector3 getPosChange() const; // retrieves the value of posChange
void setPosChange(const Ogre::Vector3 &set); // sets the value of posChange
playerPositions getPassToPlayer() const; // retrieves the value of passToPlayer
void setPassToPlayer(const playerPositions &set); // sets the value of passToPlayer
Ogre::Vector3 getJumpBeginPos() const; // retrieves the value of playerJumpBeginPos
void setJumpBeginPos(const Ogre::Vector3 &set); // sets the value of playerJumpBeginPos
Ogre::Vector3 getJumpEndPos() const; // retrieves the value of playerJumpEndPos
void setJumpEndPos(const Ogre::Vector3 &set); // sets the value of playerJumpEndPos
Ogre::Vector3 getNewCourtPosition() const; // retrieves the value of newCourtPosition
void setNewCourtPosition(const Ogre::Vector3 &set); // sets the value of newCourtPosition
positionChangedTypes getCourtPositionChangedType() const; // retrieves the value of courtPositionChangedType
void setCourtPositionChangedType(const positionChangedTypes &set); // sets the value of courtPositionChangedType
private:
playerPositions activePosition; // stores the active position of the player
Ogre::Vector3 courtPosition; // stores the position of the player on the court in an Ogre::Vector3
directions direction; // stores direction player is moving
directions oldDirection; // stores the previous player direction.
Ogre::Vector3 posChange; // stores value of players' position changes during logic updates
playerPositions passToPlayer; // stores the value of the player to be passed to.
// player Jump variables
Ogre::Vector3 jumpBeginPos; // stores the coordinates of the player at the beginning of the jump
Ogre::Vector3 jumpEndPos; // stores the coordinates the player should reach at the end of the jump
Ogre::Vector3 newCourtPosition; // stores the upfated position of the player on the court in an Ogre::Vector3
positionChangedTypes courtPositionChangedType; // stores what subsystem changed the position of the player
std::vector<playerActions> stateAction; // controls the action performed by stateMachine
};
#endif