Agrarsense
UnrealWindowViewportClient.h
Go to the documentation of this file.
1// Copyright (c) 2023 FrostBit Software Lab at the Lapland University of Applied Sciences
2//
3// This work is licensed under the terms of the MIT license.
4// For a copy, see <https://opensource.org/licenses/MIT>.
5
6#pragma once
7
8#include "CoreMinimal.h"
9#include "Core.h"
10#include "Engine/World.h"
11#include "UnrealClient.h"
12#include "RenderResource.h"
13#include "Engine/TextureRenderTarget2D.h"
14#include "ViewportClient.h"
15
20class FUnrealWindowViewportClient : public FViewportClient
21{
22
23public:
24
26 virtual void Draw(FViewport* Viewport, FCanvas* Canvas) override;
27 virtual bool InputKey(FViewport* Viewport, int32 ControllerId, FKey Key, EInputEvent Event, float AmountDepressed = 1.0f, bool bGamepad = false) override;
28 virtual bool InputAxis(FViewport* Viewport, int32 ControllerId, FKey Key, float Delta, float DeltaTime, int32 NumSamples = 1, bool bGamepad = false) override;
29 virtual bool InputGesture(FViewport* Viewport, EGestureEvent GestureType, const FVector2D& GestureDelta, bool bIsDirectionInvertedFromDevice) override;
30 virtual UWorld* GetWorld() const override { return nullptr; }
31 virtual void RedrawRequested(FViewport* Viewport) override { Viewport->Draw(); }
32
33 TWeakObjectPtr<UTextureRenderTarget2D> TextRenderTarget2D;
34 FTexture* texture = nullptr;
35 int width = 1280;
36 int height = 720;
37};
virtual void RedrawRequested(FViewport *Viewport) override
virtual bool InputGesture(FViewport *Viewport, EGestureEvent GestureType, const FVector2D &GestureDelta, bool bIsDirectionInvertedFromDevice) override
TWeakObjectPtr< UTextureRenderTarget2D > TextRenderTarget2D
virtual bool InputAxis(FViewport *Viewport, int32 ControllerId, FKey Key, float Delta, float DeltaTime, int32 NumSamples=1, bool bGamepad=false) override
virtual UWorld * GetWorld() const override
virtual void Draw(FViewport *Viewport, FCanvas *Canvas) override
virtual bool InputKey(FViewport *Viewport, int32 ControllerId, FKey Key, EInputEvent Event, float AmountDepressed=1.0f, bool bGamepad=false) override