Browse Source

update on android part

- linux and android part are separated in .pro file
- It runs on linux, still!
master
AliMehrabani 6 days ago
parent
commit
fc4c626794
  1. 25
      VkTest.pro
  2. 9
      VulkanTutorial1.0/Types.h
  3. 4
      VulkanTutorial1.0/VulkanWindow.h

25
VkTest.pro

@ -2,10 +2,7 @@ QT += core xml gui
CONFIG += c++17 CONFIG += c++17
QMAKE_SPEC_T = $$[QMAKE_SPEC]
INCLUDEPATH += \ INCLUDEPATH += \
# /usr/include/vulkan \
$$PWD/third_party \ $$PWD/third_party \
# $$PWD/third_party/vkbootstrap \ # $$PWD/third_party/vkbootstrap \
# $$PWD/third_party/vkbootstrap/build \ # $$PWD/third_party/vkbootstrap/build \
@ -15,8 +12,6 @@ INCLUDEPATH += \
# $$PWD/third_party/fmt/build # $$PWD/third_party/fmt/build
LIBS += \ LIBS += \
-lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi \
-lvulkan \
# -L$$PWD/third_party/pugixml/build -lpugixml \ # -L$$PWD/third_party/pugixml/build -lpugixml \
# -lSDL2main -lSDL2 -lvk-bootstrap \ # -lSDL2main -lSDL2 -lvk-bootstrap \
# -L$$PWD/third_party/fmt/build -lfmt # -L$$PWD/third_party/fmt/build -lfmt
@ -47,9 +42,17 @@ DISTFILES += \
shaders/VulkanTutorial1.0/HelloTriangle/vert.spv shaders/VulkanTutorial1.0/HelloTriangle/vert.spv
contains(QMAKE_SPEC_T,.*android.*) { android {
QT += QT += \
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
INCLUDEPATH += \
LIBS += -landroid -llog
DEFINES += VK_USE_PLATFORM_ANDROID_KHR
OTHER_FILES += android/src/Vulkan \ OTHER_FILES += android/src/Vulkan \
android/AndroidManifest.xml \ android/AndroidManifest.xml \
android/build.gradle \ android/build.gradle \
@ -59,8 +62,12 @@ contains(QMAKE_SPEC_T,.*android.*) {
android/gradlew.bat \ android/gradlew.bat \
android/res/values/libs.xml android/res/values/libs.xml
} }
contains(QMAKE_SPEC_T,.*linux.*) { linux64 {
QT += x11extras QT += x11extrass
LIBS += \
-lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi \
-lvulkan \
INCLUDEPATH += \ INCLUDEPATH += \
/usr/include/vulkan \ /usr/include/vulkan \

9
VulkanTutorial1.0/Types.h

@ -3,15 +3,6 @@
#pragma once #pragma once
#if defined(Q_OS_ANDROID)
#define VK_USE_PLATFORM_ANDROID_KHR // Enable Vulkan support for Android
#elif defined(Q_OS_LINUX)
#define VK_USE_PLATFORM_XCB_KHR // Enable Vulkan support for Linux (XCB)
#include <xcb/xcb.h>
#endif
#include <vulkan/vulkan.h> #include <vulkan/vulkan.h>
#include <iostream> #include <iostream>

4
VulkanTutorial1.0/VulkanWindow.h

@ -9,11 +9,11 @@
#if defined(Q_OS_ANDROID) #if defined(Q_OS_ANDROID)
#define VK_USE_PLATFORM_ANDROID_KHR // Enable Vulkan support for Android #define VK_USE_PLATFORM_ANDROID_KHR // Enable Vulkan support for Android
#include <vulkan_android.h> #include <vulkan/vulkan_android.h>
#elif defined(Q_OS_LINUX) #elif defined(Q_OS_LINUX)
#include <xcb/xcb.h> #include <xcb/xcb.h>
#define VK_USE_PLATFORM_XCB_KHR // Enable Vulkan support for Linux (XCB) #define VK_USE_PLATFORM_XCB_KHR // Enable Vulkan support for Linux (XCB)
#include <vulkan_xcb.h> #include <vulkan/vulkan_xcb.h>
#include <QX11Info> #include <QX11Info>
#endif #endif

Loading…
Cancel
Save