Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Alternative to SDL to use with TCC

4: Adsense

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   

459
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.

"App". is an acronym and must always be followed by a dot.

https://en.oxforddictionaries.com/punctuation/punctuation-in-abbreviations


#2 Martins Mozeiko   Members   

1436
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   

459
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?


"App". is an acronym and must always be followed by a dot.

https://en.oxforddictionaries.com/punctuation/punctuation-in-abbreviations


#4 Dawoodoz   Members   

459
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.

"App". is an acronym and must always be followed by a dot.

https://en.oxforddictionaries.com/punctuation/punctuation-in-abbreviations


#5 Martins Mozeiko   Members   

1436
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.