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

Re: Noesis documentation and few question about 2.1.0 verison (C++)

19 Dec 2017, 05:07

Could you try with the latest beta? (b12). We fixed an issue related to the memory manager.
 
Wanderer
Topic Author
Posts: 168
Joined: 08 May 2017, 18:36

Re: Noesis documentation and few question about 2.1.0 verison (C++)

19 Dec 2017, 11:59

Yes, now memory issue dissapear. But I get another error, but maybe it is my bad code.
I use Dx9 render for Urho and this is how I initialize Noesis:
void MyNoesisINI()
{
	auto logHandler = [](const char*, uint32_t, uint32_t level, const char* channel,
		const char* message)
	{
		if (strcmp(channel, "") == 0)
		{
			// [TRACE] [DEBUG] [INFO] [WARNING] [ERROR]
			const char* prefixes[] = { "T", "D", "I", "W", "E" };
			const char* prefix = level < NS_COUNTOF(prefixes) ? prefixes[level] : " ";
			printf("[NOESIS/%s] %s\n", prefix, message);
		}
	};
	Noesis::GUI::Init(nullptr, logHandler, nullptr);
	
	auto xaml = Noesis::GUI::LoadXaml<Noesis::FrameworkElement>("Main.xaml");
	noesis_global_view = Noesis::GUI::CreateView(xaml.GetPtr());
	noesis_global_view->SetIsPPAAEnabled(true);
	Noesis::Ptr<NoesisApp::RenderContext> device = NoesisApp::FindBestRenderContext(); // Line 109
	noesis_global_context->SetVGContext(device->GetDevice()->GetVGContext()); // noesis_global_context is Noesis::RenderDevice
	noesis_global_view->GetRenderer()->Init(noesis_global_context.GetPtr());
}
This is error:
 	NoesisApp.dll!68b2d18c()	Unknown
 	[Frames below may be incorrect and/or missing, no symbols loaded for NoesisApp.dll]	
>	Urho-Noesis_d.exe!MyNoesisINI() Line 109	C++
 	Urho-Noesis_d.exe!MyApp::Start() Line 474	C++
 	Urho-Noesis_d.exe!Urho3D::Application::Run() Line 79	C++
 	Urho-Noesis_d.exe!RunApplication() Line 684	C++
 	Urho-Noesis_d.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * prevInstance, char * cmdLine, int showCmd) Line 684	C++
 	[External Code]	
>	Urho-Noesis_d.exe!MyNoesisINI() Line 109	C++
-		device	{mPtr=0x00000000 <NULL> }	Noesis::Ptr<NoesisApp::RenderContext>
-		mPtr	0x00000000 <NULL>	NoesisApp::RenderContext *
-		Noesis::BaseComponent	<struct at NULL>	Noesis::BaseComponent
-		Noesis::BaseRefCounted	<struct at NULL>	Noesis::BaseRefCounted
-		Noesis::BaseObject	<struct at NULL>	Noesis::BaseObject
		__vfptr	<Unable to read memory>	void * *
-		mRefCount	{...}	Noesis::Atomic<int>
-		Noesis::Atomic32<int>	{val=??? }	Noesis::Atomic32<int>
		val	<Unable to read memory>	

		logHandler	void <lambda>(const char * __formal, unsigned int __formal, unsigned int level, const char * channel, const char * message){...}	MyNoesisINI::__l2::void <lambda>(const char *, unsigned int, unsigned int, const char *, const char *)
+		xaml	{mPtr=0x00000000 <NULL> }	Noesis::Ptr<Noesis::FrameworkElement>
 
Wanderer
Topic Author
Posts: 168
Joined: 08 May 2017, 18:36

Re: Noesis documentation and few question about 2.1.0 verison (C++)

19 Dec 2017, 19:12

I rebuild Urho for OpenGL and I got this error:
>	ig4icd32.dll!513b7c40()	Unknown
 	[Frames below may be incorrect and/or missing, no symbols loaded for ig4icd32.dll]	
 	[External Code]	
My code:
auto xaml = Noesis::GUI::LoadXaml<Noesis::FrameworkElement>("Main.xaml");
	noesis_global_view = Noesis::GUI::CreateView(xaml.GetPtr());
	noesis_global_view->SetIsPPAAEnabled(true);
	noesis_global_device = NoesisApp::GLFactory::CreateDevice();
	noesis_global_view->GetRenderer()->Init(noesis_global_device.GetPtr());
If you are interest, I can provide my full source code project for Urho with Noesis. Urho Project working without Noesis.

Btw. I discover that if I use this:
NoesisApp::Launcher::RegisterAppComponents();
error dissappear from previous post (Line 109). Then other my code in previous post I think is bad.
 
User avatar
jsantos
Site Admin
Posts: 2909
Joined: 20 Jan 2012, 17:18
Contact:

Re: Noesis documentation and few question about 2.1.0 verison (C++)

21 Dec 2017, 13:56

Btw. I discover that if I use this:
NoesisApp::Launcher::RegisterAppComponents();
error dissappear from previous post (Line 109). Then other my code in previous post I think is bad.
That's for registering AppFramework components (Application, Window, RenderContext). You don't need that for integrating with an existing engine. Please, have a lookt at 'IntegrationGLUT' sample. Thanks!
 
Wanderer
Topic Author
Posts: 168
Joined: 08 May 2017, 18:36

Re: Noesis documentation and few question about 2.1.0 verison (C++)

21 Dec 2017, 19:35

Yes, I followed IntegrationGLUT sample, and what happend I described in my last previous post.
 
User avatar
jsantos
Site Admin
Posts: 2909
Joined: 20 Jan 2012, 17:18
Contact:

Re: Noesis documentation and few question about 2.1.0 verison (C++)

21 Dec 2017, 21:51

I assume our IntegrationGLUT is working fine, right? Then the only thing you need to change is the RenderDevice implementation. If your integration doesn't work then a) start from IntegrationGLUT and do changes step by step b) pay attention to every message you receive in the logging handler. Thanks!
 
Wanderer
Topic Author
Posts: 168
Joined: 08 May 2017, 18:36

Re: Noesis documentation and few question about 2.1.0 verison (C++)

21 Dec 2017, 23:13

Hmm, I don't try compile it (I'll try it tomorrow), but I played with integrationGLUT.exe and it worked.
What means RenderDevice implementation? That means, I need write own GLRender.h and .cpp? Maybe I am don't understand this RenderDevice, but some library like ImageMagick or similar like libraries have some buffer. I can obtain this buffer and add it in to SDLTexture(as example) and then display it for exmaple. Is the RenderDevice something similar? If you have time, please explain.
 
Athos
Posts: 7
Joined: 17 May 2016, 18:57

Re: Noesis documentation and few question about 2.1.0 verison (C++)

22 Dec 2017, 13:17

Wanderer, I highly recommend you to build Urho3D (and remove all Urho3D's default UI) as a library and then implement Noesis when developing the application (or game).
Also, you said you are using dx9 for Urho3D; in that case you'll need to write your own RenderDevice implementation.
After you are set with the graphics api (OGL, DX, etc) you initialize noesis with Urho3D's graphics context;
 
Wanderer
Topic Author
Posts: 168
Joined: 08 May 2017, 18:36

Re: Noesis documentation and few question about 2.1.0 verison (C++)

22 Dec 2017, 15:15

I compile IntegrationGLUT sample, and it working without problem.
Wanderer, I highly recommend you to build Urho3D (and remove all Urho3D's default UI) as a library
You mean Urho as dll ?
Also, you said you are using dx9 for Urho3D; in that case you'll need to write your own RenderDevice implementation.
I now use OpenGL for Urho (I change it because there is some RenderDevice for GL implementation).

And now I discover, xaml files are not loaded. I don't use the XamlProvider because I don't know how to use it (there are some examples but without understand), there was SetResourceProvider (in Noesis 2.0.2) and now it is changed.
 
User avatar
jsantos
Site Admin
Posts: 2909
Joined: 20 Jan 2012, 17:18
Contact:

Re: Noesis documentation and few question about 2.1.0 verison (C++)

22 Dec 2017, 19:08

And now I discover, xaml files are not loaded. I don't use the XamlProvider because I don't know how to use it (there are some examples but without understand), there was SetResourceProvider (in Noesis 2.0.2) and now it is changed.
The change is that now instead of setting the three providers (Xaml, Texture and Font) in one shot, you can set them separately. More information about resource providers.

Who is online

Users browsing this forum: Google [Bot] and 1 guest