我尝试缩放我的曲面,所以我尝试了openGL,但出现了一个显示openGL错误的错误
这是密码 https://pastebin.pl/view/8366ece3
我将展示重要的部分:
def main():
window = pg.display.set_mode((sw,sh))
gridlength = 35
level = 1
grid = drawgrid(gridlength + level)
samplechar = character(gridlength, grid)
mapgen(grid, gridlength, samplechar, level)
for i in grid:
print(*i)
run = True
while run:
for event in pg.event.get():
if event.type == pg.QUIT:
pg.quit()
quit()
elif event.type == pg.MOUSEBUTTONDOWN:
if event.button == 4:
glScaled(1.2,1.2,1.2);
elif event.button == 5:
glScaled(0.8,0.8,0.8);
错误是:
File "src/errorchecker.pyx", line 58, in OpenGL_accelerate.errorchecker._ErrorChecker.glCheckError
OpenGL.error.GLError: GLError(
err = 1282,
description = b'invalid operation',
baseOperation = glScaled,
cArguments = (1.2, 1.2, 1.2)
)
任何OpenGL语句的当前有效OpenGL Context。创建显示曲面时,需要设置
pygame.OPENGL
标志:window = pg.display.set_mode((sw,sh))
无论如何^{} 只适用于在OpenGL立即模式(^{}/^{} )下绘制的几何体,而不适用于精灵或由pygame函数绘制的几何体
相关问题 更多 >
编程相关推荐