Не открывается окно в руководстве по SDL2 из-за libEGL: не удалось аутентифицировать предупреждение - PullRequest
0 голосов
/ 25 февраля 2019

Я пытался этот учебник SDL.
Я пытался выполнить следующий простой код в учебнике.
Но при его выполнении выдается предупреждение, поэтому окно не открывается.

Я считал, что эта ошибка вызвана символической ссылкой, ссылающейся на здесь .Но libEGL.so.1 уже существует в /usr/lib/x86_64-linux-gnu

libEGL warning: DRI2: failed to authenticate

код:

#include <iostream>
#include "SDL.h"
#include <memory>

int main() {
    if (SDL_Init(SDL_INIT_VIDEO) != 0) {
        std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
        return 1;
    }
    SDL_Window *win = SDL_CreateWindow("Hello World!", 100, 100, 640, 480, SDL_WINDOW_SHOWN);
    if (win == nullptr) {
        std::cout << "SDL_CreateWindow Error: " << SDL_GetError() << std::endl;
        SDL_Quit();
        return 1;
    }
    auto *ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED|SDL_RENDERER_PRESENTVSYNC);
    if (ren == nullptr) {
        SDL_DestroyWindow(win);
        std::cout << "SDL_CreateRenderer Error: " << SDL_GetError() << std::endl;
        SDL_Quit();
        return 1;
    }

}

Ubuntu Linux 18.10 на виртуальной машине.ОС хоста: Windows 10

Edit

Я установил virtualbox-guest-дополнения:

modinfo vboxguest
filename:       /lib/modules/4.18.0-15-generic/misc/vboxguest.ko
version:        6.0.4 r128413
license:        GPL
description:    Oracle VM VirtualBox Guest Additions for Linux Module
author:         Oracle Corporation
srcversion:     95F53B9B95BC6E03156A1D8
alias:          pci:v000080EEd0000CAFEsv00000000sd00000000bc*sc*i*
depends:        
retpoline:      Y
name:           vboxguest
vermagic:       4.18.0-15-generic SMP mod_unload 

Edit2

xdpyinfo вывод (Это не все, вывод слишком длинный, поэтому это несколько строк вершины вывода.

name of display:    :0
version number:    11.0
vendor string:    The X.Org Foundation
vendor release number:    12001000
X.Org version: 1.20.1
maximum request size:  16777212 bytes
motion buffer size:  256
bitmap unit, bit order, padding:    32, LSBFirst, 32
image byte order:    LSBFirst
number of supported pixmap formats:    7
supported pixmap formats:
    depth 1, bits_per_pixel 1, scanline_pad 32
    depth 4, bits_per_pixel 8, scanline_pad 32
    depth 8, bits_per_pixel 8, scanline_pad 32
    depth 15, bits_per_pixel 16, scanline_pad 32
    depth 16, bits_per_pixel 16, scanline_pad 32
    depth 24, bits_per_pixel 32, scanline_pad 32
    depth 32, bits_per_pixel 32, scanline_pad 32
keycode range:    minimum 8, maximum 255
focus:  window 0x2e00007, revert to Parent
number of extensions:    27
    BIG-REQUESTS
    Composite
    DAMAGE
    DOUBLE-BUFFER
    DPMS
    DRI2
    GLX
    Generic Event Extension
    MIT-SCREEN-SAVER
    MIT-SHM
    Present
    RANDR
    RECORD
    RENDER
    SECURITY
    SHAPE
    SYNC
    X-Resource
    XC-MISC
    XFIXES
    XFree86-DGA
    XFree86-VidModeExtension
    XINERAMA
    XInputExtension
    XKEYBOARD
    XTEST
    XVideo
default screen number:    0
number of screens:    1

screen #0:
  dimensions:    952x966 pixels (251x255 millimeters)
  resolution:    96x96 dots per inch
  depths (7):    24, 1, 4, 8, 15, 16, 32
  root window id:    0x2bd
  depth of root window:    24 planes
  number of colormaps:    minimum 1, maximum 1
  default colormap:    0x20
  default number of colormap cells:    256
  preallocated pixels:    black 0, white 16777215
  options:    backing-store WHEN MAPPED, save-unders NO
  largest cursor:    64x64
  current input event mask:    0xda0003
    KeyPressMask             KeyReleaseMask           StructureNotifyMask      
    SubstructureNotifyMask   SubstructureRedirectMask PropertyChangeMask       
    ColormapChangeMask       
  number of visuals:    270
  default visual id:  0x21
  visual:
    visual id:    0x21
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff0000, 0xff00, 0xff
    significant bits in color specification:    8 bits

Журнал Xorg (несколько строк хвоста журнала Xorg):

[    14.691] (II) Using input driver 'libinput' for 'ImExPS/2 Generic Explorer Mouse'
[    14.694] (II) systemd-logind: got fd for /dev/input/event3 13:67 fd 28 paused 0
[    14.694] (**) ImExPS/2 Generic Explorer Mouse: always reports core events
[    14.694] (**) Option "Device" "/dev/input/event3"
[    14.694] (**) Option "_source" "server/udev"
[    14.696] (II) event3  - ImExPS/2 Generic Explorer Mouse: is tagged by udev as: Mouse
[    14.696] (II) event3  - ImExPS/2 Generic Explorer Mouse: device is a pointer
[    14.696] (II) event3  - ImExPS/2 Generic Explorer Mouse: device removed
[    14.696] (**) Option "config_info" "udev:/sys/devices/platform/i8042/serio1/input/input4/event3"
[    14.697] (II) XINPUT: Adding extended input device "ImExPS/2 Generic Explorer Mouse" (type: MOUSE, id 12)
[    14.697] (**) Option "AccelerationScheme" "none"
[    14.697] (**) ImExPS/2 Generic Explorer Mouse: (accel) selected scheme none/0
[    14.697] (**) ImExPS/2 Generic Explorer Mouse: (accel) acceleration factor: 2.000
[    14.698] (**) ImExPS/2 Generic Explorer Mouse: (accel) acceleration threshold: 4
[    14.699] (II) event3  - ImExPS/2 Generic Explorer Mouse: is tagged by udev as: Mouse
[    14.699] (II) event3  - ImExPS/2 Generic Explorer Mouse: device is a pointer
[    14.700] (II) config/udev: Adding input device ImExPS/2 Generic Explorer Mouse (/dev/input/mouse0)
[    14.700] (II) No input driver specified, ignoring this device.
[    14.700] (II) This device may have been added with another device file.
[    16.545] (II) modeset(0): EDID vendor "VBX", prod id 0
[    16.545] (II) modeset(0): DDCModeFromDetailedTiming: 952x966 Warning: We only handle separate sync.
[    16.545] (II) modeset(0): Using EDID range info for horizontal sync
[    16.545] (II) modeset(0): Using EDID range info for vertical refresh
[    16.549] (II) modeset(0): EDID vendor "VBX", prod id 0
[    16.549] (II) modeset(0): DDCModeFromDetailedTiming: 952x966 Warning: We only handle separate sync.
[    16.549] (II) modeset(0): Using hsync ranges from config file
[    16.549] (II) modeset(0): Using vrefresh ranges from config file
[    17.169] (II) modeset(0): EDID vendor "VBX", prod id 0
[    17.169] (II) modeset(0): DDCModeFromDetailedTiming: 952x966 Warning: We only handle separate sync.
[    17.169] (II) modeset(0): Using hsync ranges from config file

glxgears: flxgears picture

...