This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Can be used on buttons to allow single click in some period of time, for example limit to few clicks per second. | |
#define DEBOUNCE(s, ...) \ | |
static bool bActive; \ | |
if (!bActive) { \ | |
bActive = true; \ | |
__VA_ARGS__; \ | |
FTimerHandle DebounceTimerHandle; \ | |
GetWorld()->GetTimerManager().SetTimer(DebounceTimerHandle, FTimerDelegate().CreateLambda([](){\ | |
bActive = false; \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2021 Impossibility Labs Inc. https://github.com/ArtheonVR. | |
// Created by Egor Pristavka. | |
// Macro definition: | |
#if PLATFORM_ANDROID | |
#include "AndroidPermissionFunctionLibrary.h" | |
#include "AndroidPermissionCallbackProxy.h" | |
#define RUN_WITH_PERMISSION(perm, ...)\ | |
LogF("AndroidPermission: Checking %s permission.", perm);\ | |
if (!UAndroidPermissionFunctionLibrary::CheckPermission(perm)) {\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2021 Impossibility Labs Inc. https://github.com/ArtheonVR. | |
// Based on: https://answers.unrealengine.com/questions/607129/how-do-you-generate-mips-at-runtime.html | |
void FAsyncTaskDownloadTexture::GenerateMipmaps() const { | |
const int32 Width = Texture->GetSizeX(); | |
const int32 Height = Texture->GetSizeY(); | |
// Texture bytes. | |
TArray<uint8> TextureByteArray; | |
TextureByteArray.AddUninitialized(Texture->PlatformData->Mips[0].BulkData.GetElementCount()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8.12) | |
project(PowerIK) | |
option(BUILD_ANDROID "Build for Android" OFF) | |
# Build using Unix. At Windows I used WSL. | |
if(BUILD_ANDROID) | |
set(CMAKE_SYSTEM_NAME Android) | |
set(CMAKE_SYSTEM_VERSION 29) # API level |