OpenGL 视差贴图(Parallax Mapping)
参考: 视差贴图(Parallax Mapping)学习笔记 视差映射(Parallax Mapping) Learn about Parallax(视差贴图)
参考: 视差贴图(Parallax Mapping)学习笔记 视差映射(Parallax Mapping) Learn about Parallax(视差贴图)
sRGBA 和 RGBA
一、总结 UDP 就像写信,可能会丢包 Linux UDP 通信过程 Qt UDP 通信过程 支持多路组播:D 类地址 局域网广播 IP: 255.255.255.255 二、每个实例都可以是服务端 只需要一个套接字,绑定到端口号即可 setWindowTitle(QString("服务器端口为:%1").arg(port)); udpSocket = new QUdpSocket(this); // 只需要绑定端口号,不用开启监听 udpSocket->bind(port); connect(udpSocket, &QUdpSocket::readyRead,[=](){ char buf[1024] = {0}; QHostAddress clientAddr; // 发送方 IP quint16 clientPort; // 发送方 Port qint64 len = udpSocket->readDatagram(buf, sizeof (buf), &clientAddr, &clientPort); qDebug() << "接收到" << len; if(len > 0){ QString str = QString("[%1:%2] %3")....
一、总结 TCP 就像打电话,安全,不会丢包 Linux TCP 通信 Qt TCP 通信 二、服务器端 TCP 服务器端有两个套接字,一个是监听套接字,一个是通信套接字 tcpServer = nullptr; // 服务监听套接字 tcpSocket = nullptr; // 通信套接字 // 创建tcp服务监听套接字 tcpServer = new QTcpServer(this); // tcp服务开启监听(bind端口号并开启监听) tcpServer->listen(QHostAddress::Any, 8008); // 绑定连接成功信号 connect(tcpServer, &QTcpServer::newConnection,[=](){ // 获取通信套接字 tcpSocket = tcpServer->nextPendingConnection(); // 获取客户端 IP 和 端口 QString ip = tcpSocket->peerAddress().toString(); quint16 port = tcpSocket->peerPort(); QString msg = QString("[%1:%2] 连接成功")....
cmake_minimum_required(VERSION 3.5)project(07_TCP LANGUAGES CXX)# 将编译目录包含到Include目录 set(CMAKE_INCLUDE_CURRENT_DIR ON)set(CMAKE_AUTOUIC ON)set(CMAKE_AUTOMOC ON)set(CMAKE_AUTORCC ON)# 根据 Qt 版本的环境变量,设置使用的 Qt 版本 set(CMAKE_PREFIX_PATH $ENV{QTDIR5141_64})set(CMAKE_CXX_STANDARD 11)set(CMAKE_CXX_STANDARD_REQUIRED ON)# QtCreator supports the following variables for Android, which are identical to qmake Android variables. # Check http://doc.qt.io/qt-5/deployment-android.html for more information. # They need to be set before the find_package(Qt5 ...) call. #if(ANDROID) # set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") # if (ANDROID_ABI STREQUAL "armeabi-v7a") # set(ANDROID_EXTRA_LIBS # ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libcrypto.so # ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libssl.so) # endif() #endif() # 工程中会用到的Qt模块 find_package(Qt5 COMPONENTS Widgets Network REQUIRED)if(ANDROID) add_library(07_TCP SHARED main....