本文整理汇总了C++中GImage::loadPng方法的典型用法代码示例。如果您正苦于以下问题:C++ GImage::loadPng方法的具体用法?C++ GImage::loadPng怎么用?C++ GImage::loadPng使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GImage
的用法示例。
在下文中一共展示了GImage::loadPng方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: r
CarOnHillModel(GRand* prng, GImage* pImage, GWidgetTextLabel* pWins)
{
m_pWins = pWins;
m_wins = 0;
m_pImage = pImage;
m_carPos = 0;
m_velocity = 0;
m_prng = prng;
// Load the car image and add some border so we can rotate it
GImage tmp;
tmp.loadPng("minicar.png");
m_pCar = new GImage();
m_pCar->setSize(70, 60);
GRect r(0, 0, 60, 36);
m_pCar->blit(5, 5, &tmp, &r);
m_pRotatedCar = new GImage();
// Make the agent
GMixedRelation* pRelAgent = new GMixedRelation();
sp_relation relAgent;
relAgent = pRelAgent;
pRelAgent->addAttr(0); // position
pRelAgent->addAttr(0); // velocity
pRelAgent->addAttr(2); // action {forward, reverse}
double initialState[2];
initialState[0] = m_carPos;
initialState[1] = m_velocity;
double goalState[2];
goalState[0] = 2;
goalState[1] = 0;
m_pActionIterator = new GDiscreteActionIterator(2);
m_pAgents[0] = new CarQAgent(relAgent, initialState, m_prng, m_pActionIterator);
((GQLearner*)m_pAgents[0])->setLearningRate(.9);
((GQLearner*)m_pAgents[0])->setDiscountFactor(0.999);
}