Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Microsoft Windows integration?
#1
So how would tilengine be setup to render into a native win32 application? 
I'm familiar with how to setup a win32 program and make a window/process messages.
Reply
#2
Hi,

I don't quite understand what you mean with a "native win32 application". When you compile a program that uses Tilengine with Visual Studio or mingw32, the resulting executable is a native win32 application, you cannot run in under linux or in a raspberry. The generated window is a native win32 window too.
Reply
#3
(12-10-2020, 05:34 PM)megamarc Wrote: Hi,

I don't quite understand what you mean with a "native win32 application". When you compile a program that uses Tilengine with Visual Studio or mingw32, the resulting executable is a native win32 application, you cannot run in under linux or in a raspberry. The generated window is a native win32 window too.

Hi, well in the docs it uses a built-in tilengine function to make a window without invoking win32 api functions, but
afaict the docs say you can use the tilengine with any operating system to render to their native windows.
For instance  
Code:
HWND window;
CreateWindowExW();
using the HWND surface as the render target instead of the tileengines
Code:
TLN_createwindow()
In other words setting up the win32 app like normal but then just using the tilengine to render. I thought
the docs say you can use tilengine as a slave renderer?
I was under the impression it was used much like Vulkan in that you can use a win32 surface and then make a compatible surface with vulkan to render to.
Reply
#4
It uses SDL2 to display graphics.
not sure if it uses hardware acceleration to display them, but it may use Open GL since it's open source and cross-platform, but again, not sure at all.

Update : It uses OpenGL
Reply
#5
Hi,
Yes, you can use Tilengine without its built-in window. In this case is up to you, the integrator, to create the render target in your windowing environment. Tilengine expects a 32-bit RGBA surface. This chapter in the documentation gives the details:
http://www.tilengine.org/doc/md_rendering.html

In Windows, you must use DirectDraw, Direct3D, OpenGL or whatever graphics API that allows you to create and use RGBA surfaces. The built-in window uses the cross-platform library SDL2, that in turn selects the best graphics API available on host operating system. Tilengine itself doesn't require any kind of graphic acceleration, you can even draw to a memory buffer.

This example showcases how to draw to a Java applet:
https://github.com/megamarc/JTilengine/b...Panel.java

And here is a tutorial on how to integrate inside a Unity project:
http://madwonder.com/tilengine-embedding-unity/

Even if you check the source code of Window.c, you can see how the built-in window uses SDL2:
https://github.com/megamarc/Tilengine/bl...dow.c#L999
Reply
#6
Does the base Tilengine use hardware acceleration?
Reply
#7
No, the base Tilengine doesn't use hardware acceleration at all, it's entirely software based on CPU alone. SDL2 library that underpins the built-in window does use hardware acceleration.
Reply
#8
Ah I understand why it takes half of my GPU now. How can I enable it?
Reply
#9
Sorry I don't understand the question. Enable what?
If GPU usage is high, you may have a low-end system. Disable CRT effect (enabled by default) by pressing "backspace" key once
Reply
#10
Sorry if my question wasn't clear, I meant, how can I enable hardware acceleration support?
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)