x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

FViewport::GetWindow override

Hey,

I'm just browsing the UE4 source code (I've downloaded the latest from the github), and I don't understand something. Hope this is the place where I can ask this.

So there is the FViewport class which has a pure virtual GetWindow function. This function is used when creating the actual RHIViewport (Runtime/Engine/Private/UnrealClient.cpp). However there are only 2 implementation of the FViewport class: the FDummyViewport and the FSceneViewport. Both overrides this function with returning a null pointer.

Besides that in the UGameViewportClient class (Runtime/Engine/Private/GameViewportClient.cpp) the GetCursor function uses the GetWindow() and casts it to a Windows-specific HWND.

The actual implementation of the RHIViewport depends on return value of the FViewport::GetWindow(). But I don't know how it will get a valid value.

Am I missing something?

edit: I've searched it for a long time before I post this question. And I think I've just found it: The SlateRHIRenderer is used to create the viewport where the window handle is available (from the NativeWindow->GetOSWindowHandle()).

So it could work when calling from the slate class. But what happens when calling FViewport::InitRHI()? It creates a new ViewportRHI with a null pointer as a window handle.

Product Version: UE 4.10
Tags:
more ▼

asked Dec 16 '15 at 08:05 AM in Rendering

avatar image

csisyadam
6 1 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question