安装glslViewer

368 阅读4分钟

MAC

Tip: Mac系统建议先安装 homebrew

Homebrew是macOS(或 Linux)缺失的软件包的管理器

1. Install dependencies 安装依赖

brew install pkg-config cmake ncurses

pkg-config是一个linux下的命令,用于获得某一个库/模块的所有编译相关的信息

CMake是一个跨平台的编译(Build)工具,可以用简单的语句来描述所有平台的编译过程

ncurses计算机语言,是一套编程库,它提供了一系列的函数以便使用者调用它们去生成基于文本的用户界面

For video support (using FFMpeg library LIBAV), also do:

对于视频支持(使用 FFMpeg 库 LIBAV),也可以执行以下操作:

brew install ffmpeg --build-from-source

FFmpeg是一套可以用来记录、转换数字音频、视频,并能将其转化为流的开源计算机程序。

2. Clone repository and submodules 克隆存储库和子模块

git clone https://github.com/patriciogonzalezvivo/glslViewer.git
cd glslViewer
git submodule init
git submodule update

3. Compile 编译

mkdir build
cd build
cmake ..
make
sudo make install

Linux

1. Install dependencies 安装依赖

Ubuntu

sudo apt install git build-essential cmake xorg-dev libglu1-mesa-dev libncurses5-dev libncursesw5-dev 

For video support (using FFMpeg library LIBAV), also do:

对于视频支持(使用 FFMpeg 库 LIBAV),也可以执行以下操作:

sudo apt install ffmpeg libavcodec-dev libavcodec-extra libavfilter-dev libavfilter-extra libavdevice-dev libavformat-dev libavutil-dev libswscale-dev libv4l-dev libjpeg-dev libpng-dev libtiff-dev

RaspberryPi OS (with X11/Wayland Window Manager) RaspberryPi 操作系统(带有 X11/Wayland 窗口管理器)

sudo apt install git cmake xorg-dev libglu1-mesa-dev libncurses5-dev libncursesw5-dev 

RaspberryPi OS (without X11/Wayland Window Manager) RaspberryPi OS(无 X11/Wayland 窗口管理器)

sudo apt install git cmake libgbm-dev libdrm-dev libegl1-mesa-dev libgles2-mesa-dev libncurses5-dev libncursesw5-dev 

Fedora

sudo dnf install git gcc-c++ cmake mesa-libGLU-devel libXi-devel libXxf86vm-devel libXrandr-devel libXinerama-devel libXcursor-devel ncurses-compat-libs ncurses-static libatomic
sudo yum install libXdamage-devel ncurses-devel
sudo ldconfig -v
​

For video support (using FFMpeg library LIBAV), also do:

对于视频支持(使用 FFMpeg 库 LIBAV),也可以执行以下操作:

sudo dnf install ffmpeg ffmpeg-devel

Arch

sudo pacman -S glu ncurses

For video support (using FFMpeg library LIBAV), also do:

对于视频支持(使用 FFMpeg 库 LIBAV),也可以执行以下操作:

sudo pacman -S ffmpeg

2. Clone repository and submodules 克隆存储库和子模块

git clone https://github.com/patriciogonzalezvivo/glslViewer.git
cd glslViewer
git submodule init
git submodule update

3. Compile 编译

For any Linux X11 environment (uses of GLFW 3.0) 适用于任何 Linux X11 环境(使用 GLFW 3.0)

mkdir build
cd build
cmake ..
make
sudo make install

For NO X11 context (uses BROADCOM legacy drivers or GBM on Raspberry PI v4)

对于 NO X11 上下文(在 Raspberry PI v4 上使用 BROADCOM 旧版驱动程序或 GBM)

mkdir build
cd build
cmake -DNO_X11=TRUE ..
make
sudo make install

Note 1: Newer RaspberryPi distribution do have BROADCOM drivers but work only on GBM for that use -DFORCE_GBM=TRUE instead.

Note 1:较新的 RaspberryPi 发行版确实具有 BROADCOM 驱动程序,但仅适用于 GBM,因为它使用 -DFORCE_GBM=TRUE 代替。

Note 2: If you are using GBM make sure on your /boot/config.txt you have the following lines present and/or un-commented:

Note 2: 如果您使用 GBM,请确保在您的 /boot/config.txt 中有以下行存在和/或未注释:

dtoverlay=vc4-fkms-v3d
max_framebuffers=2
hdmi_force_hotplug=1

Windows

1. Install dependencies 安装依赖

To compile this project you will need: 要编译这个项目,你需要:

  • Visual Studio 2019 or higher. Make sure to check "Desktop development with C++" and "Universal Windows Platform development" are installed

Visual Studio 2019 或更高版本。 确保选中“使用 C++ 进行桌面开发”和“通用 Windows 平台开发”已安装

一个 git 客户端

  • CMake (through Scoop is recommended)

CMake(推荐通过Scoop

2. Clone repository and submodules 克隆存储库和子模块

git clone https://github.com/patriciogonzalezvivo/glslViewer.git
cd glslViewer
git submodule init
git submodule update

3. Create a Visual Studio Project 创建一个 Visual Studio 项目

cmake .

This will create a .sln solution file which you can open with Visual Studio

这将创建一个可以使用 Visual Studio 打开的“.sln”解决方案文件

4. Compile 编译

Once you open the .sln solution file on Visual Studio, you can compile it by using Ctr+Shift+B.

在 Visual Studio 上打开 .sln 解决方案文件后,可以使用 Ctr+Shift+B 对其进行编译。

5. Install

In order to lunch glslViewer anywhere on your system (doesn't matter in which directory you are in the terminal/console) you will need to find the glslViewer.exe into a System Path folder.

为了在系统上的任何位置使用 glslViewer(无论您在终端/控制台中的哪个目录中),您需要在系统路径文件夹中找到“glslViewer.exe”。

For that you have two options:

为此,您有两个选择:

glslViewer.exe所在的文件夹添加到您的系统路径中您可以按照此说明进行操作

  • moving glslViewer.exe to an existing System Path folder

将“glslViewer.exe”移动到现有的系统路径文件夹