问题描述
我有以下简单的代码可以打开SDL窗口:
#include <stdio.h>
#include <SDL2/SDL.h>
#define WIDTH 800
#define HEIGHT 600
int main (int argc,char **argv)
{
SDL_Window *window = NULL;
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
fprintf(stderr,"SDL failed to initialise: %s\n",SDL_GetError());
return 1;
}
window = SDL_CreateWindow("SDL Example",SDL_WINDOWPOS_UNDEFINED,WIDTH,HEIGHT,0);
printf("%s\n",SDL_GetError());
SDL_Event e;
unsigned int c = 0;
while (1){
while (SDL_PollEvent(&e)){
if (e.type == SDL_QUIT){
break;
}
}
}
/*return code */
...
我在Weston 8.0.0版上运行此程序,但没有显示任何窗口。不过,它可以在GNOME Wayland上正常运行。 SDL_GetError()不返回任何错误。 SDL2版本为2.0.12 知道为什么吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)