User avatar
jsantos
Site Admin
Posts: 2906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Some pre beginning questions

20 Jan 2020, 18:48

If you are already linking against our App library, then it is just doing:
// Register app components. We need a few in this example, like Display and RenderContext
NoesisApp::Launcher::RegisterAppComponents();
 
Roest
Topic Author
Posts: 28
Joined: 15 Jan 2020, 15:30

Re: Some pre beginning questions

20 Jan 2020, 19:10

Edit: haven't seen the answer from jsantos before typing this, so trying that now
 
Roest
Topic Author
Posts: 28
Joined: 15 Jan 2020, 15:30

Re: Some pre beginning questions

20 Jan 2020, 19:19

If you are already linking against our App library, then it is just doing:
// Register app components. We need a few in this example, like Display and RenderContext
NoesisApp::Launcher::RegisterAppComponents();
Cool thanks that worked. Really appreciate your help. I'm down to a last set of errors :)
19:15:19:217 [D] [NOESIS] E 'Converter<.?AVBaseComponent@Noesis@@>' binding converter failed to convert value 'ToggleButton: New Game' (type 'ToggleButton')
19:15:19:221 [D] [NOESIS] E 'Converter<.?AVBaseComponent@Noesis@@>' binding converter failed to convert value 'ToggleButton: Settings' (type 'ToggleButton')
19:15:19:224 [D] [NOESIS] E 'Converter<.?AVBaseComponent@Noesis@@>' binding converter failed to convert value 'ToggleButton: Exit' (type 'ToggleButton')
19:15:19:232 [D] [NOESIS] E Binding failed: Path=Settings, Source=null(''), Target=ToggleButton('Settings'), TargetProperty=ButtonBase.Command
 
User avatar
sfernandez
Site Admin
Posts: 1918
Joined: 22 Dec 2011, 19:20

Re: Some pre beginning questions

20 Jan 2020, 20:38

Binding failed: Path=Settings, Source=null(''), Target=ToggleButton('Settings'), TargetProperty=ButtonBase.Command
This binding error can happen when loading a xaml before the DataContext is set, nothing to worry about.
'Converter<.?AVBaseComponent@Noesis@@>' binding converter failed to convert value 'ToggleButton: New Game' (type 'ToggleButton')
'Converter<.?AVBaseComponent@Noesis@@>' binding converter failed to convert value 'ToggleButton: Settings' (type 'ToggleButton')
'Converter<.?AVBaseComponent@Noesis@@>' binding converter failed to convert value 'ToggleButton: Exit' (type 'ToggleButton')
Those are from binding IsEnabled property to a ToggleButton like in <ContentControl Content="...." IsEnabled="{Binding ElementName=Start}"/>.
What are you trying to do here? Maybe you forgot to set the binding path to IsMouseOver and use some style that hides that text when IsEnabled is false?
<Style x:Key="HintStyle" TargetType="{x:Type ContentControl}">
  <Setter Property="Visibility" Value="Visible"/>
  <Style.Triggers>
    <Trigger Property="IsEnabled" Value="False">
      <Setter Property="Visibility" Value="Hidden"/>
    </Trigger>
  </Style.Triggers>
</Style>
...
<ContentControl Style="{StaticResource HintStyle}" Content="Dive straight into the adventure." IsEnabled="{Binding IsMouseOver, ElementName=Start}"/>
<ContentControl Style="{StaticResource HintStyle}" Content="Configure the settings for the demo." IsEnabled="{Binding IsMouseOver, ElementName=Settings}"/>
<ContentControl Style="{StaticResource HintStyle}" Content="Exit the demo." IsEnabled="{Binding IsMouseOver, ElementName=Exit}"/>
 
Roest
Topic Author
Posts: 28
Joined: 15 Jan 2020, 15:30

Re: Some pre beginning questions

20 Jan 2020, 21:18

Cool all errors gone, thanks again guys you've been great help.
What are you trying to do here?
If only I knew that myself. Trying to show some explanation when mouse overing buttons like in your Menu3D example. But I'm happy for now that I have the framework integrated, no more errors and it'll be just learning and expanding.
 
User avatar
jsantos
Site Admin
Posts: 2906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Some pre beginning questions

21 Jan 2020, 00:10

Glad to know you are making progress! Just a few clarifications.
'Converter<.?AVBaseComponent@Noesis@@>' binding converter failed to convert value 'ToggleButton: New Game' (type 'ToggleButton')
The ugly string Converter<.?AVBaseComponent@Noesis@@> in the log message is not happening in the next major version.

I also think that our Integration sample if very simple regarding logging, the channel parameter is being ignored and all the binding messages are being sent to that channel. Those messages can be silenced by default because they are quite verbose and only useful when you are trying to debug binding issues. This is the way we are handling logs in the Launcher (also included with source code in the App Framework):
SetLogHandler([](const char*, uint32_t, uint32_t level, const char* channel, const char* msg)
{
    // By default only global channel is dumped
    bool filter = !StrIsNullOrEmpty(channel);

    // Enable "Binding" channel by command line
    if (gCommandLine.HasOption("log_binding"))
    {
        if (StrEquals(channel, "Binding"))
        {
            filter = false;
        }
    }

    if (!filter)
    {
        level = level > NS_LOG_LEVEL_ERROR ? NS_LOG_LEVEL_ERROR : level;

#if defined(NS_PLATFORM_ANDROID)
        const int priority[] = { ANDROID_LOG_VERBOSE, ANDROID_LOG_DEBUG, ANDROID_LOG_INFO,
            ANDROID_LOG_WARN, ANDROID_LOG_ERROR};
        (void)__android_log_print(priority[level], "Noesis", "%s", msg);

#elif defined(NS_PLATFORM_EMSCRIPTEN)
        const int flags[] = { 0, 0, 0, EM_LOG_WARN, EM_LOG_ERROR };
        const char* prefixes[] = { "T", "D", "I", "W", "E" };
        emscripten_log(EM_LOG_CONSOLE | flags[level], "[NOESIS/%s] %s", prefixes[level], msg);

#else
        char out[512];
        const char* prefixes[] = { "T", "D", "I", "W", "E" };
        snprintf(out, sizeof(out), "[NOESIS/%s] %s\n", prefixes[level], msg);

    #ifdef NS_PLATFORM_WINDOWS
        OutputDebugString(out); 
    #else
        fprintf(stderr, "%s", out);
    #endif
#endif
    }
});
 
Roest
Topic Author
Posts: 28
Joined: 15 Jan 2020, 15:30

Re: Some pre beginning questions

22 Jan 2020, 20:47

All going well it's starting to shape up. Getting an understanding of how things work and slowly starting to build some stuff.

Now I have two problems here. First the Vertical ScrollBar never shows up. No matter how much stuff I put in the the StackPanel. Is that possibly a problem with the ViewBox scaling things?

Second, when I click into TextBox the game stops responding. I'm not passing anything else but MouseDown and MouseUp to the view yet.
<ViewBox Grid.Row="1" Grid.Column="1">
	<TabControl Width="500">
		<TabItem Header="World">
			<ScrollViewer VerticalScrollBarVisibility="Auto">
				<StackPanel>
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="1*"/>
							<ColumnDefinition Width="3*"/>
							<ColumnDefinition Width="1*"/>
						</Grid.ColumnDefinitions>
						<TextBlock Grid.Column="0" Text="Kingdom name:" Margin="0,0,0,5"/>
						<TextBox Grid.Column="1" x:Name="KingdomName" Content="Land of lands"/>
						<Button Grid.Column="2" x:Name="RandomName"  Content="Random" />
					</Grid>
					<...more options...>
				</StackPanel>
			</ScrollViewer>
		</TabItem>
		<...some more tabs...>
	</TabControl>
</ViewBox>
 
User avatar
jsantos
Site Admin
Posts: 2906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Some pre beginning questions

22 Jan 2020, 21:25

Second, when I click into TextBox the game stops responding. I'm not passing anything else but MouseDown and MouseUp to the view yet.
Almost for sure this is happening because you are not restoring the framebuffer after invoking RenderOffscreen. It is also explained in our Integration Guide but I think we should put more emphasis on this so I will find time to review the documentation and sample.
 
Roest
Topic Author
Posts: 28
Joined: 15 Jan 2020, 15:30

Re: Some pre beginning questions

22 Jan 2020, 22:27

Second, when I click into TextBox the game stops responding. I'm not passing anything else but MouseDown and MouseUp to the view yet.
Almost for sure this is happening because you are not restoring the framebuffer after invoking RenderOffscreen. It is also explained in our Integration Guide but I think we should put more emphasis on this so I will find time to review the documentation and sample.
Yea that's a bit of a strange one. if I call
glBindFramebuffer(GL_FRAMEBUFFER, 0);
nothing gets rendered. Which is strange as it should set the render target to the default frame buffer again. So copying in your example code in again
// Offscreen rendering phase populates textures needed by the on-screen rendering
		m_view->GetRenderer()->UpdateRenderTree();
		m_view->GetRenderer()->RenderOffscreen();

		// If you are going to render here with your own engine you need to restore the GPU state
		// because noesis changes it. In this case only framebuffer and viewport need to be restored
		//paintContent();
	
		glBindFramebuffer(GL_FRAMEBUFFER, 0);
		glViewport(0, 0, this->width(), this->height() );

		glClearColor(0.0f, 0.0f, 0.25f, 0.0f);
		glClearStencil(0);
		glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);


		// Rendering is done in the active framebuffer
		m_view->GetRenderer()->Render();
paintContent() will then render my stuff and is deactivated for now. So the result is a dark blue screen which shows that the glClear() is working and the window is showing that but it's not rendering the noesis stuff either. When I comment out the line with glBindFrameBuffer everything works fine, I can move sliders, tab widget works, just clicking into a TextBox locks up.
 
User avatar
jsantos
Site Admin
Posts: 2906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Some pre beginning questions

23 Jan 2020, 01:01

Are you able to repro this in our example? If not, I recommend using Renderdoc to understand what’s going on.

https://renderdoc.org/

Who is online

Users browsing this forum: No registered users and 0 guests