您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ IsInGameThread函数代码示例

51自学网 2021-06-01 21:41:30
  C++
这篇教程C++ IsInGameThread函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中IsInGameThread函数的典型用法代码示例。如果您正苦于以下问题:C++ IsInGameThread函数的具体用法?C++ IsInGameThread怎么用?C++ IsInGameThread使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了IsInGameThread函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: check

void FUObjectArray::AllocateUObjectIndex(UObjectBase* Object, bool bMergingThreads /*= false*/){	int32 Index = INDEX_NONE;	check(Object->InternalIndex == INDEX_NONE || bMergingThreads);	// Special non- garbage collectable range.	if (OpenForDisregardForGC && DisregardForGCEnabled())	{		// Disregard from GC pool is only available from the game thread, at least for now		check(IsInGameThread());		Index = ++ObjLastNonGCIndex;		// Check if we're not out of bounds, unless there hasn't been any gc objects yet		UE_CLOG(ObjLastNonGCIndex >= MaxObjectsNotConsideredByGC && ObjFirstGCIndex >= 0, LogUObjectArray, Fatal, TEXT("Unable to add more objects to disregard for GC pool (Max: %d)"), MaxObjectsNotConsideredByGC);		// If we haven't added any GC objects yet, it's fine to keep growing the disregard pool past its initial size.		if (ObjLastNonGCIndex >= MaxObjectsNotConsideredByGC)		{			Index = ObjObjects.AddSingle();			check(Index == ObjLastNonGCIndex);		}		MaxObjectsNotConsideredByGC = FMath::Max(MaxObjectsNotConsideredByGC, ObjLastNonGCIndex + 1);	}	// Regular pool/ range.	else	{				int32* AvailableIndex = ObjAvailableList.Pop();		if (AvailableIndex)		{#if UE_GC_TRACK_OBJ_AVAILABLE			const int32 AvailableCount = ObjAvailableCount.Decrement();			checkSlow(AvailableCount >= 0);#endif			Index = (int32)(uintptr_t)AvailableIndex;			check(ObjObjects[Index].Object==nullptr);		}		else		{			// Make sure ObjFirstGCIndex is valid, otherwise we didn't close the disregard for GC set			check(ObjFirstGCIndex >= 0);#if THREADSAFE_UOBJECTS			FScopeLock ObjObjectsLock(&ObjObjectsCritical);#else			check(IsInGameThread());#endif			Index = ObjObjects.AddSingle();					}		check(Index >= ObjFirstGCIndex && Index > ObjLastNonGCIndex);	}	// Add to global table.	if (FPlatformAtomics::InterlockedCompareExchangePointer((void**)&ObjObjects[Index].Object, Object, NULL) != NULL) // we use an atomic operation to check for unexpected concurrency, verify alignment, etc	{		UE_LOG(LogUObjectArray, Fatal, TEXT("Unexpected concurency while adding new object"));	}	IndexToObject(Index)->ResetSerialNumberAndFlags();	Object->InternalIndex = Index;	//  @todo: threading: lock UObjectCreateListeners	for (int32 ListenerIndex = 0; ListenerIndex < UObjectCreateListeners.Num(); ListenerIndex++)	{		UObjectCreateListeners[ListenerIndex]->NotifyUObjectCreated(Object,Index);	}}
开发者ID:dineshone,项目名称:UnrealGameEngine,代码行数:60,


示例2: check

void FSlateTextureAtlas::InitAtlasData(){	check(RootNode == nullptr && AtlasData.Num() == 0);	RootNode = new FAtlasedTextureSlot(0, 0, AtlasWidth, AtlasHeight, GetPaddingAmount());	AtlasData.Reserve(AtlasWidth * AtlasHeight * BytesPerPixel);	AtlasData.AddZeroed(AtlasWidth * AtlasHeight * BytesPerPixel);	check(IsInGameThread() || IsInRenderingThread());	AtlasOwnerThread = (IsInGameThread()) ? ESlateTextureAtlasOwnerThread::Game : ESlateTextureAtlasOwnerThread::Render;	INC_MEMORY_STAT_BY(STAT_SlateTextureAtlasMemory, AtlasData.GetAllocatedSize());}
开发者ID:colwalder,项目名称:unrealengine,代码行数:13,


示例3: check

void FUObjectArray::AllocateUObjectIndex(UObjectBase* Object, bool bMergingThreads /*= false*/){	int32 Index = INDEX_NONE;	check(Object->InternalIndex == INDEX_NONE || bMergingThreads);	// Special non- garbage collectable range.	if (OpenForDisregardForGC && DisregardForGCEnabled())	{		// Disregard from GC pool is only available from the game thread, at least for now		check(IsInGameThread());		Index = ObjObjects.AddZeroed(1);		ObjLastNonGCIndex = Index;		ObjFirstGCIndex = FMath::Max(ObjFirstGCIndex, Index + 1);	}	// Regular pool/ range.	else	{				int32* AvailableIndex = ObjAvailableList.Pop();		if (AvailableIndex)		{#if WITH_EDITOR			ObjAvailableCount.Decrement();			checkSlow(ObjAvailableCount.GetValue() >= 0);#endif			Index = (int32)(uintptr_t)AvailableIndex;			check(ObjObjects[Index]==nullptr);		}		else		{#if THREADSAFE_UOBJECTS			FScopeLock ObjObjectsLock(&ObjObjectsCritical);#else			check(IsInGameThread());#endif			Index = ObjObjects.AddZeroed(1);		}		check(Index >= ObjFirstGCIndex);	}	// Add to global table.	if (FPlatformAtomics::InterlockedCompareExchangePointer((void**)&ObjObjects[Index], Object, NULL) != NULL) // we use an atomic operation to check for unexpected concurrency, verify alignment, etc	{		UE_LOG(LogUObjectArray, Fatal, TEXT("Unexpected concurency while adding new object"));	}	Object->InternalIndex = Index;	//  @todo: threading: lock UObjectCreateListeners	for (int32 ListenerIndex = 0; ListenerIndex < UObjectCreateListeners.Num(); ListenerIndex++)	{		UObjectCreateListeners[ListenerIndex]->NotifyUObjectCreated(Object,Index);	}}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:50,


示例4: check

void AndroidEGL::SetSharedContext(){	check(IsInGameThread());	PImplData->CurrentContextType = CONTEXT_Shared;	SetCurrentContext(PImplData->SharedContext.eglContext, PImplData->SharedContext.eglSurface);}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:7,


示例5: OpenGLRHI

FOpenGLViewport::FOpenGLViewport(FOpenGLDynamicRHI* InOpenGLRHI,void* InWindowHandle,uint32 InSizeX,uint32 InSizeY,bool bInIsFullscreen,EPixelFormat PreferredPixelFormat)	: OpenGLRHI(InOpenGLRHI)	, OpenGLContext(NULL)	, SizeX(0)	, SizeY(0)	, bIsFullscreen(false)	, PixelFormat(PreferredPixelFormat)	, bIsValid(true)	, FrameSyncEvent(InOpenGLRHI){	check(OpenGLRHI);    //@to-do spurious check for HTML5, will need to go away. #if !PLATFORM_HTML5	check(InWindowHandle);#endif 	check(IsInGameThread());	PlatformGlGetError();	// flush out old errors.	OpenGLRHI->Viewports.Add(this);	check(PlatformOpenGLCurrentContext(OpenGLRHI->PlatformDevice) == CONTEXT_Shared);	OpenGLContext = PlatformCreateOpenGLContext(OpenGLRHI->PlatformDevice, InWindowHandle);	Resize(InSizeX, InSizeY, bInIsFullscreen);	check(PlatformOpenGLCurrentContext(OpenGLRHI->PlatformDevice) == CONTEXT_Shared);	BeginInitResource(&FrameSyncEvent);}
开发者ID:magetron,项目名称:UnrealEngine4-mod,代码行数:25,


示例6: ensure

FModuleManager& FModuleManager::Get(){	// NOTE: The reason we initialize to NULL here is due to an issue with static initialization of variables with	// constructors/destructors across DLL boundaries, where a function called from a statically constructed object	// calls a function in another module (such as this function) that creates a static variable.  A crash can occur	// because the static initialization of this DLL has not yet happened, and the CRT's list of static destructors	// cannot be written to because it has not yet been initialized fully.	(@todo UE4 DLL)	static FModuleManager* ModuleManager = NULL;	if( ModuleManager == NULL )	{		// FModuleManager is not thread-safe		ensure(IsInGameThread());		ModuleManager = new FModuleManager();		//temp workaround for IPlatformFile being used for FPaths::DirectoryExists before main() sets up the commandline.#if PLATFORM_DESKTOP		// Ensure that dependency dlls can be found in restricted sub directories		const TCHAR* RestrictedFolderNames[] = { TEXT("NoRedist"), TEXT("NotForLicensees"), TEXT("CarefullyRedist") };		FString ModuleDir = FPlatformProcess::GetModulesDirectory();		for (const TCHAR* RestrictedFolderName : RestrictedFolderNames)		{			FString RestrictedFolder = ModuleDir / RestrictedFolderName;			if (FPaths::DirectoryExists(RestrictedFolder))			{				ModuleManager->AddBinariesDirectory(*RestrictedFolder, false);			}		}#endif	}	return *ModuleManager;}
开发者ID:mysheng8,项目名称:UnrealEngine,代码行数:34,


示例7: check

uint32 FRunnableThread::GetTlsSlot(){	check( IsInGameThread() );	uint32 TlsSlot = FPlatformTLS::AllocTlsSlot();	check( FPlatformTLS::IsValidTlsSlot( TlsSlot ) );	return TlsSlot;}
开发者ID:johndpope,项目名称:UE4,代码行数:7,


示例8: check

struct FStreamable* FStreamableManager::StreamInternal(FStringAssetReference const& InTargetName){	check(IsInGameThread());	UE_LOG(LogStreamableManager, Verbose, TEXT("Asynchronous load %s"), *InTargetName.AssetLongPathname);	if (FPackageName::IsShortPackageName(InTargetName.AssetLongPathname))	{		UE_LOG(LogStreamableManager, Error, TEXT("     Can't load invalid package name %s"), *InTargetName.AssetLongPathname);		return NULL;	}	FStringAssetReference TargetName = ResolveRedirects(InTargetName);	FStreamable* Existing = StreamableItems.FindRef(TargetName);	if (Existing)	{		if (Existing->bAsyncUnloadRequestOutstanding)		{			// It's valid to have a live pointer if an async loaded object was hard referenced later			check(!Existing->bAsyncLoadRequestOutstanding); // we should not be both loading and unloading			UE_LOG(LogStreamableManager, Verbose, TEXT("     Aborted unload for %s"), *TargetName.AssetLongPathname);			Existing->bAsyncUnloadRequestOutstanding = false;			check(Existing->Target || Existing->bLoadFailed); // should not be an unload request unless the target is valid			return Existing;		}		if (Existing->bAsyncLoadRequestOutstanding)		{			UE_LOG(LogStreamableManager, Verbose, TEXT("     Already in progress %s"), *TargetName.AssetLongPathname);			check(!Existing->bAsyncUnloadRequestOutstanding); // we should not be both loading and unloading			check(!Existing->Target); // should not be an load request unless the target is invalid			return Existing; // already have one in process		}		if (Existing->Target)		{			UE_LOG(LogStreamableManager, Verbose, TEXT("     Already Loaded %s"), *TargetName.AssetLongPathname);			return Existing; 		}	}	else	{		Existing = StreamableItems.Add(TargetName, new FStreamable());	}	FindInMemory(TargetName, Existing);	if (!Existing->Target)	{		FString Package = TargetName.AssetLongPathname;		int32 FirstDot = Package.Find(TEXT("."));		if (FirstDot != INDEX_NONE)		{			Package = Package.Left(FirstDot);		}		Existing->bAsyncLoadRequestOutstanding = true;		LoadPackageAsync(Package,			FLoadPackageAsyncDelegate::CreateStatic(&AsyncLoadCallbackWrapper, new FCallback(TargetName, this))			);	}	return Existing;}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:60,


示例9: check

void FGearVR::GetCurrentOrientationAndPosition(FQuat& CurrentOrientation, FVector& CurrentPosition){	// only supposed to be used from the game thread	check(IsInGameThread());	auto frame = GetFrame();	if (!frame)	{		CurrentOrientation = FQuat::Identity;		CurrentPosition = FVector::ZeroVector;		return;	}	//if (PositionScale != FVector::ZeroVector)	//{	//	frame->CameraScale3D = PositionScale;	//	frame->Flags.bCameraScale3DAlreadySet = true;	//}	const bool bUseOrienationForPlayerCamera = false, bUsePositionForPlayerCamera = false;	GetCurrentPose(CurrentOrientation, CurrentPosition, bUseOrienationForPlayerCamera, bUsePositionForPlayerCamera);	if (bUseOrienationForPlayerCamera)	{		frame->LastHmdOrientation = CurrentOrientation;		frame->Flags.bOrientationChanged = bUseOrienationForPlayerCamera;	}	if (bUsePositionForPlayerCamera)	{		frame->LastHmdPosition = CurrentPosition;		frame->Flags.bPositionChanged = bUsePositionForPlayerCamera;	}}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:29,


示例10: check

FOneSkyConnectionInfo FOneSkyLocalizationServiceSettings::GetConnectionInfo() const{	check(IsInGameThread());	FOneSkyConnectionInfo OutConnectionInfo = ConnectionInfo;	return OutConnectionInfo;}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:7,


示例11: DYNAMIC_CAST_D3D11RESOURCE

void FD3D11DynamicRHI::RHIResizeViewport(FViewportRHIParamRef ViewportRHI,uint32 SizeX,uint32 SizeY,bool bIsFullscreen){	DYNAMIC_CAST_D3D11RESOURCE(Viewport,Viewport);	check( IsInGameThread() );	Viewport->Resize(SizeX,SizeY,bIsFullscreen);}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:7,


示例12: IsInGameThread

bool FBuildPatchServicesModule::Tick( float Delta ){	// Using a local bool for this check will improve the assert message that gets displayed	// This one is unlikely to assert unless the FTicker's core tick is not ticked on the main thread for some reason	const bool bIsCalledFromMainThread = IsInGameThread();	check( bIsCalledFromMainThread );	// Call complete delegate on each finished installer	for(auto InstallerIt = BuildPatchInstallers.CreateIterator(); InstallerIt; ++InstallerIt)	{		if( (*InstallerIt).IsValid() && (*InstallerIt)->IsComplete() )		{			(*InstallerIt)->ExecuteCompleteDelegate();			(*InstallerIt).Reset();		}	}	// Remove completed (invalids) from the list	for(int32 BuildPatchInstallersIdx = 0; BuildPatchInstallersIdx < BuildPatchInstallers.Num(); ++BuildPatchInstallersIdx )	{		const FBuildPatchInstallerPtr* Installer = &BuildPatchInstallers[ BuildPatchInstallersIdx ];		if( !Installer->IsValid() )		{			BuildPatchInstallers.RemoveAt( BuildPatchInstallersIdx-- );		}	}	// More ticks	return true;}
开发者ID:mysheng8,项目名称:UnrealEngine,代码行数:30,


示例13: check

void UParticleModuleTrailSource::AutoPopulateInstanceProperties(UParticleSystemComponent* PSysComp){	check(IsInGameThread());	switch (SourceMethod)	{	case PET2SRCM_Actor:		{			bool	bFound	= false;			for (int32 i = 0; i < PSysComp->InstanceParameters.Num(); i++)			{				FParticleSysParam* Param = &(PSysComp->InstanceParameters[i]);								if (Param->Name == SourceName)				{					bFound	=	true;					break;				}			}			if (!bFound)			{				int32 NewParamIndex = PSysComp->InstanceParameters.AddZeroed();				PSysComp->InstanceParameters[NewParamIndex].Name		= SourceName;				PSysComp->InstanceParameters[NewParamIndex].ParamType	= PSPT_Actor;				PSysComp->InstanceParameters[NewParamIndex].Actor		= NULL;			}		}		break;	}}
开发者ID:colwalder,项目名称:unrealengine,代码行数:31,


示例14: check

void FTimerManager::InternalSetTimer(FTimerUnifiedDelegate const& InDelegate, float InRate, bool InbLoop){	// not currently threadsafe	check(IsInGameThread());	// if the timer is already set, just clear it and we'll re-add it, since 	// there's no data to maintain.	InternalClearTimer(InDelegate);	if (InRate > 0.f)	{		// set up the new timer		FTimerData NewTimerData;		NewTimerData.Rate = InRate;		NewTimerData.bLoop = InbLoop;		NewTimerData.TimerDelegate = InDelegate;				if( HasBeenTickedThisFrame() )		{			NewTimerData.ExpireTime = InternalTime + InRate;			NewTimerData.Status = ETimerStatus::Active;			ActiveTimerHeap.HeapPush(NewTimerData);		}		else		{			// Store time remaining in ExpireTime while pending			NewTimerData.ExpireTime = InRate;			NewTimerData.Status = ETimerStatus::Pending;			PendingTimerList.Add(NewTimerData);		}	}}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:32,


示例15: check

void FOnlineAsyncTaskManager::GameTick(){	// assert if not game thread	check(IsInGameThread());	FOnlineAsyncItem* Item = NULL;	int32 CurrentQueueSize = 0;	do 	{		Item = NULL;		// Grab a completed task from the queue		{			FScopeLock LockOutQueue(&OutQueueLock);			CurrentQueueSize = OutQueue.Num();			if (CurrentQueueSize > 0)			{				Item = OutQueue[0];				OutQueue.RemoveAt(0);			}		}		if (Item)		{			// Finish work and trigger delegates			Item->Finalize();			Item->TriggerDelegates();			delete Item;		}	}	while (Item != NULL);}
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:32,


示例16: CheckConnection

/*** Timer to periodically check for join/quit signals from client, and call* appropriate input handler.** @param DeltaTime Time taken by method*/bool CloudyWebAPIImpl::CheckConnection(float DeltaTime){    bool Success = false;    if (HasInputStrChanged)     {        if (GEngine->GameViewport != nullptr && GIsRunning && IsInGameThread())        {            UE_LOG(CloudyWebAPILog, Warning, TEXT("Success! input str: %s"), *InputStr);            GetCloudyWebData(InputStr);            UE_LOG(CloudyWebAPILog, Warning, TEXT("Success! Controllerid: %d command: %s"), ControllerId, *Command);            Success = CCloudyPanelPluginModule::Get().ExecuteCommand(Command, ControllerId, StreamingPort, StreamingIP, GameSessionId);            InputStr = "";            HasInputStrChanged = false;        }                // Send response to client        if (Success)        {            SendToClient(TCPConnection, SUCCESS_MSG);        }        else        {            SendToClient(TCPConnection, FAILURE_MSG);        }    }    return true; // continue timer to check for requests}
开发者ID:9gix,项目名称:CloudyGamePlugin,代码行数:35,


示例17: check

void FSlate3DRenderer::DrawWindow_GameThread(FSlateDrawBuffer& DrawBuffer){	check( IsInGameThread() );	const TSharedRef<FSlateFontCache> FontCache = SlateFontServices->GetGameThreadFontCache();	TArray<TSharedPtr<FSlateWindowElementList>>& WindowElementLists = DrawBuffer.GetWindowElementLists();	for ( int32 WindowIndex = 0; WindowIndex < WindowElementLists.Num(); WindowIndex++ )	{		FSlateWindowElementList& ElementList = *WindowElementLists[WindowIndex];		TSharedPtr<SWindow> Window = ElementList.GetWindow();		if ( Window.IsValid() )		{			const FVector2D WindowSize = Window->GetSizeInScreen();			if ( WindowSize.X > 0 && WindowSize.Y > 0 )			{				// Add all elements for this window to the element batcher				ElementBatcher->AddElements(ElementList);				// Update the font cache with new text after elements are batched				FontCache->UpdateCache();				// All elements for this window have been batched and rendering data updated				ElementBatcher->ResetBatches();			}		}	}}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:31,


示例18: check

void FPixelShaderUsageExample::ExecutePixelShader(UTextureRenderTarget2D* RenderTarget, FTexture2DRHIRef InputTexture, FColor EndColor, float TextureParameterBlendFactor){	check(IsInGameThread());	if (bIsUnloading || bIsPixelShaderExecuting) //Skip this execution round if we are already executing		return;	if (!RenderTarget)		return;	bIsPixelShaderExecuting = true;	if (TextureParameter != InputTexture)		bMustRegenerateSRV = true;	//Now set our runtime parameters!	VariableParameters.EndColor = FVector4(EndColor.R / 255.0, EndColor.G / 255.0, EndColor.B / 255.0, EndColor.A / 255.0);	VariableParameters.TextureParameterBlendFactor = TextureParameterBlendFactor;	CurrentRenderTarget = RenderTarget;	TextureParameter = InputTexture;	//This macro sends the function we declare inside to be run on the render thread. What we do is essentially just send this class and tell the render thread to run the internal render function as soon as it can.	//I am still not 100% Certain on the thread safety of this, if you are getting crashes, depending on how advanced code you have in the start of the ExecutePixelShader function, you might have to use a lock :)	ENQUEUE_UNIQUE_RENDER_COMMAND_ONEPARAMETER(		FPixelShaderRunner,		FPixelShaderUsageExample*, PixelShader, this,		{			PixelShader->ExecutePixelShaderInternal();		}
开发者ID:richmondx,项目名称:UE4ShaderPluginDemo,代码行数:30,


示例19: RequiresAdjacencyInformation

/** Returns true if the Material and Vertex Factory combination require adjacency information. */bool RequiresAdjacencyInformation( UMaterialInterface* Material, const FVertexFactoryType* VertexFactoryType, ERHIFeatureLevel::Type InFeatureLevel ){	EMaterialTessellationMode TessellationMode = MTM_NoTessellation;	bool bEnableCrackFreeDisplacement = false;	if ( RHISupportsTessellation(GShaderPlatformForFeatureLevel[InFeatureLevel]) && VertexFactoryType->SupportsTessellationShaders() && Material )	{		if ( IsInRenderingThread() )		{			FMaterialRenderProxy* MaterialRenderProxy = Material->GetRenderProxy( false, false );			check( MaterialRenderProxy );			const FMaterial* MaterialResource = MaterialRenderProxy->GetMaterial(InFeatureLevel);			check( MaterialResource );			TessellationMode = MaterialResource->GetTessellationMode();			bEnableCrackFreeDisplacement = MaterialResource->IsCrackFreeDisplacementEnabled();		}		else if ( IsInGameThread() )		{			UMaterial* BaseMaterial = Material->GetMaterial();			check( BaseMaterial );			TessellationMode = (EMaterialTessellationMode)BaseMaterial->D3D11TessellationMode;			bEnableCrackFreeDisplacement = BaseMaterial->bEnableCrackFreeDisplacement;		}		else		{			UMaterialInterface::TMicRecursionGuard RecursionGuard;			const UMaterial* BaseMaterial = Material->GetMaterial_Concurrent(RecursionGuard);			check( BaseMaterial );			TessellationMode = (EMaterialTessellationMode)BaseMaterial->D3D11TessellationMode;			bEnableCrackFreeDisplacement = BaseMaterial->bEnableCrackFreeDisplacement;		}	}	return TessellationMode == MTM_PNTriangles || ( TessellationMode == MTM_FlatTessellation && bEnableCrackFreeDisplacement );}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:35,


示例20: SubmitFrame

	/**	* Submits a frame to the video buffer	* @return true if this is the first frame submitted this engine tick, or false otherwise	*/	bool SubmitFrame(		int32 InWidth,		int32 InHeight,		const void* Buffer,		FIntRect Dirty)	{		check(IsInGameThread());		check(Buffer != nullptr);		const uint32 NumBytesPerPixel = 4;		FFrame& Frame = Frames[FrameWriteIndex];		// If the write buffer catches up to the read buffer, we need to release the read buffer and increment its index		if (FrameWriteIndex == FrameReadIndex && FrameCount > 0)		{			Frame.ReleaseTextureData();			FrameReadIndex = (FrameReadIndex + 1) % Frames.Num();		}		check(Frame.SlateTextureData == nullptr);		Frame.SlateTextureData = new FSlateTextureData((uint8*)Buffer, InWidth, InHeight, NumBytesPerPixel);		FrameWriteIndex = (FrameWriteIndex + 1) % Frames.Num();		FrameCount = FMath::Min(Frames.Num(), FrameCount + 1);		FrameCountThisEngineTick++;		return FrameCountThisEngineTick == 1;	}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:32,


示例21: GetResourceObject

UObject* FSlateSound::GetResourceObject( ) const{	// We might still be holding a legacy resource name, in which case we need to test that first and load it if required	if (LegacyResourceName_DEPRECATED != NAME_None)	{		// Do we still have a valid reference in our weak-ptr?		UObject* LegacyResourceObject = LegacyResourceObject_DEPRECATED.Get();		if (!LegacyResourceObject)		{			if (!IsInGameThread())			{				UE_LOG(LogSlate, Warning, TEXT("Can't find/load sound %s because Slate is being updated in another thread! (loading screen?)"), *LegacyResourceName_DEPRECATED.ToString());			}			else			{				// We can't check the object type against USoundBase as we don't have access to it here				// The user is required to cast the result of FSlateSound::GetResourceObject so we should be fine				LegacyResourceObject = StaticFindObject(UObject::StaticClass(), nullptr, *LegacyResourceName_DEPRECATED.ToString());				if (!ResourceObject)				{					LegacyResourceObject = StaticLoadObject(UObject::StaticClass(), nullptr, *LegacyResourceName_DEPRECATED.ToString());				}				// Cache this in the weak-ptr to try and avoid having to load it all the time				LegacyResourceObject_DEPRECATED = LegacyResourceObject;			}		}		return LegacyResourceObject;	}	return ResourceObject;}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:34,


示例22: ScopeLock

bool FNetworkPlatformFile::IsInLocalDirectory(const FString& Filename){	if (!bHasLoadedDDCDirectories)	{		// need to be careful here to avoid initializing the DDC from the wrong thread or using LocalDirectories while it is being initialized		FScopeLock ScopeLock(&LocalDirectoriesCriticalSection);		if (IsInGameThread() && GConfig && GConfig->IsReadyForUse())		{			// one time DDC directory initialization			// add any DDC directories to our list of local directories (local = inner platform file, it may			// actually live on a server, but it will use the platform's file system)			if (GetDerivedDataCache())			{				TArray<FString> DdcDirectories;				GetDerivedDataCacheRef().GetDirectories(DdcDirectories);				LocalDirectories.Append(DdcDirectories);			}			FPlatformMisc::MemoryBarrier();			bHasLoadedDDCDirectories = true;		}		return IsInLocalDirectoryUnGuarded(Filename);	}	// once the DDC is initialized, we don't need to lock a critical section anymore	return IsInLocalDirectoryUnGuarded(Filename);}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:31,


示例23: DisplayProfileVisualizer

void DisplayProfileVisualizer(TSharedPtr< FVisualizerEvent > InProfileData, const TCHAR* InProfilerType, const FText& HeaderMessageText = FText::GetEmpty(), const FLinearColor& HeaderMessageTextColor = FLinearColor::White){	check( IsInGameThread() );	if ( !GHasRegisteredVisualizerLayout )	{		TSharedRef<FTabManager::FLayout> Layout = FTabManager::NewLayout( "Visualizer_Layout" )		->AddArea		(			FTabManager::NewArea(720, 768)			->Split			(				FTabManager::NewStack()				->AddTab("VisualizerSpawnPoint", ETabState::ClosedTab)			)		);		FGlobalTabmanager::Get()->RestoreFrom( Layout, TSharedPtr<SWindow>() );		GHasRegisteredVisualizerLayout = true;	}	FFormatNamedArguments Args;	Args.Add( TEXT("ProfilerType"), FText::FromString( InProfilerType ) );	const FText WindowTitle = FText::Format( NSLOCTEXT("TaskGraph", "WindowTitle", "{ProfilerType} Visualizer"), Args );	const FText ProfilerType = FText::Format( NSLOCTEXT("TaskGraph", "ProfilerType", "{ProfilerType} Profile"), Args );	MakeTaskGraphVisualizerWindow( InProfileData, WindowTitle, ProfilerType, HeaderMessageText, HeaderMessageTextColor );	}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:30,


示例24: Super

UShaderPlatformQualitySettings::UShaderPlatformQualitySettings(const FObjectInitializer& ObjectInitializer)	: Super(ObjectInitializer){	// high quality overrides are always enabled by default	check(IsInGameThread());	GetQualityOverrides(EMaterialQualityLevel::High).bEnableOverride = true;}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:7,



注:本文中的IsInGameThread函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ IsInHitPhase函数代码示例
C++ IsInEffectHook函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。