我正在关注TheChernoProjects教程,我正在尝试绘制像素 到屏幕。 。 。这是我的代码:
private void Render() {
BufferStrategy BufferSrat = this.getBufferStrategy();
if (BufferStrat == null) {
createBufferStrategy(3);
return;
}
Screen.Render();
for (int i = 0; i < (WindowWidth * WindowHeight); i++) {
Pixels[i] = Screen.Pixels[i];
}
Graphics GG = BufferStrat.getDrawGraphics();
GG.drawImage(Image, 0, 0, WindowWidth, WindowHeight, null);
GG.dispose();
BufferStrat.show(Pixels);
}
并且错误是:&#39;方法getDrawGraphics()未定义类型字符串&#39;和&#39;方法show(int [])未定义类型字符串&#39;我使用的是eclipse luna和Java SE 1.7
请帮助,谢谢!
答案 0 :(得分:0)
你在第BufferStrategy BufferSrat = this.getBufferStrategy();
应为BufferStrategy BufferStrat = this.getBufferStrategy();