我不明白此错误&无法找到任何信息。限定符在类型为&的类型&的初始值设定项的绑定引用中丢失
#ifndef GAME_H
#define GAME_H
#include <SFML/System.hpp>
#include <cmath>
#include "Submarine.h"
#include "Obstacle.h"
class Game : public Submarine
{
public:
Game(unsigned w,unsigned h,bool g);
void setKey(char Key='n');
void update(float dt);
void Render (const RenderWindow &Window) const ;
static bool Collision(sf::Sprite& object1, sf::Sprite& object2);
unsigned getWidth();
unsigned getHeight();
char getKey();
protected:
bool newGame;
unsigned width;
unsigned height;
char currentInput;
};
#endif
这里发生的错误;
void Game::Render(const RenderWindow &Window) const
{
sf::Sprite::Render(Window);
}
错误27错误C2664: 'SF ::雪碧::渲染':不能从 'const的SF :: RenderWindow的' 到 'SF ::的RenderTarget &' 转换参数1
你不能从'void Render(const RenderWindow&Window)const;'中移除'const'吗? – 2014-11-25 12:00:42