我刚开始学习Pygame.我正在学习本教程.我运行了以下程序,但它显示的是黑色而不是蓝色:
import pygame
h = input("Enter the height of the window : ")
w = input("Enter the width of the window : ")
screen = pygame.display.set_mode((w,h))
running = True
while running:
event = pygame.event.poll()
if event.type == pygame.QUIT:
running=0
screen.fill((0,0,1))
pygame.display.flip()
Run Code Online (Sandbox Code Playgroud) 我试图使用freeglut2在OpenGL中渲染文本.当我包含以下标题时,
#include <freetype2/ft2build.h>
它给出以下错误:
/usr/local/include/freetype2/ft2build.h:37:38: fatal error: freetype/config/ftheader.h: No such file or directory
但是当我去的时候/usr/local/include/freetype2/freetype/config,我找到了文件ftheader.h.
请帮我弄清问题.谢谢.
我去了这个,但没有任何效果.
在"C++编程语言 "一书的 9.2节中,Bjarne Stroustrup写道:
请注意,默认情况下会初始化在全局或命名空间范围内未定义初始值设定项的变量.对于在免费商店中创建的局部变量或对象,情况并非如此.
但是以下程序打印的值为0:
#include <iostream>
using namespace std;
int main() {
int x;
cout << x << endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
它不应该返回某种错误吗?
我g++用来编译.