Agrarsense
UnrealWindowViewportClient.cpp
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
7
8#include "CanvasItem.h"
9#include "CanvasTypes.h"
10
11void FUnrealWindowViewportClient::Draw(FViewport* Viewport, FCanvas* Canvas)
12{
13 if (texture != nullptr)
14 {
15 // Draw texture to canvas
16 FCanvasTileItem TileItem(FVector2D(0, 0), texture, FVector2D(width, height), FLinearColor::White);
17 TileItem.BlendMode = ESimpleElementBlendMode::SE_BLEND_Opaque;
18 Canvas->DrawItem(TileItem);
19 }
20 else
21 {
22 Canvas->Clear(FLinearColor::Black);
23 }
24}
25
26bool FUnrealWindowViewportClient::InputKey(FViewport* Viewport, int32 ControllerId, FKey Key, EInputEvent Event, float AmountDepressed, bool bGamepad)
27{
28 return false;
29}
30
31bool FUnrealWindowViewportClient::InputAxis(FViewport* Viewport, int32 ControllerId, FKey Key, float Delta, float DeltaTime, int32 NumSamples, bool bGamepad)
32{
33 return false;
34}
35
36bool FUnrealWindowViewportClient::InputGesture(FViewport* Viewport, EGestureEvent GestureType, const FVector2D & GestureDelta, bool bIsDirectionInvertedFromDevice)
37{
38 return false;
39}
virtual bool InputGesture(FViewport *Viewport, EGestureEvent GestureType, const FVector2D &GestureDelta, bool bIsDirectionInvertedFromDevice) override
virtual bool InputAxis(FViewport *Viewport, int32 ControllerId, FKey Key, float Delta, float DeltaTime, int32 NumSamples=1, bool bGamepad=false) 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