Tilengine - The 2D retro graphics engine forum

Full Version: Hi and two questions regarding C#
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, new user here Smile

I got Tilengine on itch.io, but then also built from source on Linux (PopOs). Everything worked and also the samples were successfully built and run without major problems (I am seeing some screen tearing).
Now I downloaded the CsTilengine, but here though it seems the two samples were built successfully too, I get an error message when I try to run them:

Code:
Tilengine v2.8.5 64-bit built Nov 19 2020 21:01:27
X Error of failed request:  BadValue (integer parameter out of range for operation)
 Major opcode of failed request:  151 (GLX)
 Minor opcode of failed request:  3 (X_GLXCreateContext)
 Value in failed request:  0x0
 Serial number of failed request:  108
 Current serial number in output stream:  109

And here's another question, it is so small that I don't want to make a new post: Is the Mario CSharp Clone repo compatible with the newest version of the engine? It seems to be the only resource showing how to work with the engine in C#.

Thank you!
Jan/mbbmbbmm

Edit - didn't try Tilengine on Windows yet, this is all about Linux/PopOs
Hi and welcome!

First error is somewhat related to graphics subsystem of your linux distro. Tilengine uses SDL2 as a back-end to manage the window and the OpenGL context (GLX). You're getting errors from GLX, that is between SDL2 and graphics driver. I have Ubuntu in my dev environment and have never had any issue of this kind.

SuperMarioClone is binary compatible with the latest release of Tilengine library. I take care of not breaking compatibility with newer releases, unless it is a must. I've just tested it right now. I use Windows, again I don't know what happens on other OS/distros...

Let me know!
(11-21-2020, 07:38 AM)megamarc Wrote: [ -> ]First error is somewhat related to graphics subsystem of your linux distro. Tilengine uses SDL2 as a back-end to manage the window and the OpenGL context (GLX). You're getting errors from GLX, that is between SDL2 and graphics driver. I have Ubuntu in my dev environment and have never had any issue of this kind.

Oh I see. So it is a coincidence that it only happened with the C#-based samples and not the C-based samples? I've chosen PopOS because from what I understand it is pretty directly based on Ubuntu with some convenient additions. I might put Ubuntu on a different PC and see how it goes there. 

(11-21-2020, 07:38 AM)megamarc Wrote: [ -> ]SuperMarioClone is binary compatible with the latest release of Tilengine library. I take care of not breaking compatibility with newer releases, unless it is a must. I've just tested it right now. I use Windows, again I don't know what happens on other OS/distros...

That is nice! How much has the API changed from the example? Can SuperMarioClone still be used as a rough guide for using the C#-API or will it be too confusing?
I have a dual boot with Windows since I am pretty new to Linux, so can always go there if necessary. I just like Linux for working, because it feels much less noisy and more focused in my experience..

Thanks!
(11-22-2020, 02:42 PM)mbbmbbmm Wrote: [ -> ]Oh I see. So it is a coincidence that it only happened with the C#-based samples and not the C-based samples?

That's strange, because the window and graphics context are created inside native code in Tilengine, the C# binding doesn't handle it. Dynamic link (shared) libraries work different in Windows and Linux, I haven't checked what happens in Ubuntu with the C# binding. Under linux I build and test the main library, not the bindings, as they are supposed to be source and binary cross-platform. I'll check it.


(11-22-2020, 02:42 PM)mbbmbbmm Wrote: [ -> ]That is nice! How much has the API changed from the example? Can SuperMarioClone still be used as a rough guide for using the C#-API or will it be too confusing?


I've introduced many new features into the main library since the creation of SuperMarioClone. These new features aren't used in the example, but they don't harm either: what it showcases is still valid. I recently had to introduce some breaking changes into the animation engine, but as the example doesn't use those features, it's not affected. However it would greatly benefit from new features, as now there are ways to automate and ease things that had to be done by hand.



Best way to have a glimpse of new features are to make a diff in Git, of Tilengine.h since release 1.20, or check the history log: http://www.tilengine.org/changelog.htm
I've just checked SuperMarioClone under Ubuntu, and I can tell that it runs without problem. I've tested with up-to-date versions of both repositories (main library and C# example). I have Ubuntu 16.04 LTS x64
(11-22-2020, 07:06 PM)megamarc Wrote: [ -> ]I've just checked SuperMarioClone under Ubuntu, and I can tell that it runs without problem. I've tested with up-to-date versions of both repositories (main library and C# example). I have Ubuntu 16.04 LTS x64

I think the PopOS version on my PC it is 20.04 LTS, based on Ubuntu 20.04 LTS. I'll check that when I am back home in a couple of weeks. I could then also try with vanilla Ubuntu and see how that goes.

(11-22-2020, 06:28 PM)megamarc Wrote: [ -> ]I've introduced many new features into the main library since the creation of SuperMarioClone. These new features aren't used in the example, but they don't harm either: what it showcases is still valid. I recently had to introduce some breaking changes into the animation engine, but as the example doesn't use those features, it's not affected. However it would greatly benefit from new features, as now there are ways to automate and ease things that had to be done by hand.

Best way to have a glimpse of new features are to make a diff in Git, of Tilengine.h since release 1.20, or check the history log: http://www.tilengine.org/changelog.htm

Ok that sounds good, thanks a lot!
(11-25-2020, 09:12 PM)mbbmbbmm Wrote: [ -> ]I think the PopOS version on my PC it is 20.04 LTS, based on Ubuntu 20.04 LTS. I'll check that when I am back

Different versions of the same distro tend to have different versions of standard packages. Maybe something related to libsdl2 or mono is causing some incompatibility issues. Are you using the engine built from source by yourself, or downloaded prebuild from itch.io?
I built from source myself.
Hi,
Any progress with the issue? Are you still stuck?