ecere and 3rd Party Library - using SDL

Forum for discussing getting Ecere running on other platforms (iPhone, FreeBSD, SunOS, consoles...) and improving support on existing platforms (e.g. Mac OS X)
Post Reply
sanyaade
Posts: 11
Joined: Thu Jul 22, 2010 6:13 pm

ecere and 3rd Party Library - using SDL

Post by sanyaade »

I have been playing with ecere sdk recently and for few days tinkering with 3rd parties like SDl and Allegro. I am even going to try it out with scripting engine like falcon and haxes. But I have also trying out various odds and unusual code runners with the sdk just to see how more with the C language since c++ is no go and dynace library also come closer.

So the following compiles in ecere:

#include <stdio.h>
#include <stdlib.h>

struct sprite {

char *Name;
int *Value;

};

void Main()

{
sprite *MoreSprite;
printf("Sprite is loaded\n");
system("PAUSE");
getch();

}

if Main is change to main then a redefinition error flag come up pointing to the out file in which ecere output the translated c code --> :o . Not too bad but the program runs with no output being display and the pause instruction not effective. The same effect occured if Main is changed to anything you like (dain, dmain, ecere, etc..). The program still compiles and run --> :roll:

It means that it is possible to run C library from ecere sdk. The search continues.

Wrapping void Main inside a class made the program to perform better. So the next thing is to wrap a 3rd party library inside classes that then subclass from ecere Application class.

I need to check if ecere supports namespace which would make it possible to extend it external library.


God blesses!!!

Best regards,
Sanyaade
jerome
Site Admin
Posts: 608
Joined: Sat Jan 16, 2010 11:16 pm

Re: ecere and 3rd Party Library - using SDL

Post by jerome »

Hi Sanyaade,

First, I'm a bit puzzled what you're wanting to use SDL and Allegro for.
They are both cross-platform game libraries like Ecere aims to be, so which functionality is missing from Ecere that you hope to use with those external libraries?

Ecere provides all the graphics support you should need, and for anything extra you could always write OpenGL code directly.
As far as sound is concerned, the basic audio support in Ecere, or the OpenAL interface would be the best way to go.

Secondly, I know I haven't kept up for the last coursework, but I'm a bit lost now where you're at with your class. We're getting into the basic object orientation concepts, which are of course the key topics of the class, and also key for understanding how to use the Ecere API.

We haven't delved into the Ecere API yet, because that object orientation contents was not covered yet. I will try to prepare coursework for the next Monday's class.
The 3 next chapters are key: Inheritance, Polymorphism and virtual methods, Properties

I will see how far I can get with the course preparation, if we can cover some of these 3 key topics.

It would be great if your students could have covered the material before I get there, and then I could answer any questions they have on the topics and review it with them.
Also, it would be nice if I could guide them through the development of a small game using eC and Ecere during these 2 classes I would attend. If there is a possibility to hold an extra class or 2 while I'm there for interested students, we could cover the material in more details.

As for the application entry point of an eC application, as soon as you add a .ec file to your project, a symbol loader / main() function gets automatically created. In Windows projects, I believe it's actually a WinMain(), which could get overridden by a main() function inside a .c file.
Of course you can only have a single entry point, and I'm not sure here if you actually want to use an eC entry point or the entry point of some other C source...
If your application is predominantly an eC application, I assume you want to use the regular eC entry point. If you just want to provide some functionality in eC modules, then those could always be isolated inside a shared library.

eC does support namespaces, although at the moment it's mostly for organization purposes.
By default, eC automatically resolves identifiers through all accessible namespaces (unless the 'strict namespaces' option is specified for the compiler). This makes conflicts still happen when things are named the same in two separate namespaces. There is some improvements to bring in that area.

All the best,

Jerome
sanyaade
Posts: 11
Joined: Thu Jul 22, 2010 6:13 pm

Re: ecere and 3rd Party Library - using SDL

Post by sanyaade »

Hi Jerome,

The problem I am solving is not all that of or related to ecere per see. This is my investigation of using and extending an environment. Ecere does openGL but it does not mean that it cannot use other library. The main issue is Mingw32 and path problems. I personally will like to use other kits plus Ecere just to learn more, to abstract and to delve into some articles, handouts, tutorials on Game and Multitouch Programming.

The SDL, SFML and Allegro has large user bases with plenty tutorials that could be ported or adapted to ecere environment so using them them from inside ecere will make this possible. No programming tool or environment solves everything. The SDL, SFML, Allegro, etc.. all also make use of other 3rd party libraries and programming languages as extensions to them, its good to see that way.

I am also writing some small, small handouts by adapting and adding to what you have sent to me. This is really well appreciated as this enable me to learn more about ecere. I am knowing the ecere more now than before and the only way is to write for it inside/outside. The next few days before my returning to college from half break means to learn more about what ecere can do for me and how to extend it with others --> "Just my curiosity" but also to learn.

I am currently examining C libraries and to see that a lot of package now have FFI for C++ and other languages as well. Then I went and bought a book --> C interfaces and Implementations by David R. Hanson. So experimenting and learning.

OpenGL abstraction at a very high level is also being sorted after as these students are at A level (advanced GCSE) only.

I hope this clear the way a bit.

I get sym link error but could not find on the forum something related to it:

Code: Select all

SDLTry1-Debug.Makefile - Project has been modified. Updating makefile for Debug config...
Rebuilding project SDLTry1 using the Debug configuration...
Target and object files deleted
Generating symbols...
SDlTryou1.ec
Compiling...
SDlTryou1.ec
   [b]SDlTryou1.ec:1:1: error: Couldn't open obj/debug.win32\SDlTryou1.sym[/b]

SDLTry1.exe (Debug) - 1 error, no warning         
Any help will be appreciated. I think general MingW in Windows environment is a problem. Some of my other work within MingW32 has to do with path problems. Mingw unable to locate lib, include and nested folders even in other environment like Codeblocks, Dev-C++ and Codelite.

Just Curious --> has anybody try this out: using ecere as a library from other IDE or from other environment?


God blesses!!!

Best regards,
Sanyaade
Post Reply