Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


Alternative to SDL to use with TCC


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Dawoodoz   Members   -  Reputation: 331

Like
0Likes
Like

Posted 01 January 2014 - 06:48 AM

I am making a programming langauge that use the "Tiny C Compiler" as one of the backends and I try to find a suitable media layer for games.

I tried using "Simple Direct media Layer 2.0.1" because it was written in C and use the zlib license but it's redefinition of Main made it incompatible with TCC. The version specific workaround looks like a mess that no user of my language would accept. The resulting C code must be directly compatible with almost any C compiler without modifications so that beginners can recompile it.

My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz

"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."


Sponsor:

#2 Martins Mozeiko   Crossbones+   -  Reputation: 1422

Like
1Likes
Like

Posted 01 January 2014 - 12:31 PM

If you are not worried about Android/iOS/psp platforms, then you can simply define SDL_MAIN_HANDLED preprocessor symbol, and SDL won't override main.



#3 Dawoodoz   Members   -  Reputation: 331

Like
0Likes
Like

Posted 01 January 2014 - 01:03 PM

If you are not worried about Android/iOS/psp platforms, then you can simply define SDL_MAIN_HANDLED preprocessor symbol, and SDL won't override main.

 

Thanks! The compiler don't complain any more and this should be portable enough.

 

Is there any initiation and termination code that I have to call instead?


My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz

"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."


#4 Dawoodoz   Members   -  Reputation: 331

Like
0Likes
Like

Posted 01 January 2014 - 01:51 PM

I noticed another problem. SDL have a static library that needs to be linked from the compiler but the code for linking libraries is different for every C compiler.

 

I might have to change compiler to something with multiple target platforms so that I can use any essential compiler features but TCC is the only small C compiler that I know of.


Edited by Dawoodoz, 01 January 2014 - 02:01 PM.

My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz

"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."


#5 Martins Mozeiko   Crossbones+   -  Reputation: 1422

Like
1Likes
Like

Posted 03 January 2014 - 06:48 AM

You can always compile SDL to shared library - dll or so file. And use that instead of static lib.

 

As for initialization - only Android, iOS and PSP needs special code. Other platforms will work fine without SDL_main.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS