Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualKarsten_

Posted 17 August 2013 - 06:08 AM

Using C for games certainly isn't impossible but I find myself just recrafting a toy version of C++ with macros etc...

 

The following was a small prototype game developed using C a while back (compiled using Clang/Emscripten)

http://50.57.98.84:8080/legfria/

 

Some notes...

- I really missed exceptions.

- One level of inheritance is possible (using update, draw function pointers) but more gets really fiddly

- Works great with SDL (and OpenGL) and don't need to worry about fiddly unique_ptr deleter functions etc...

- Compiles in a fraction of the time as C++. Probably about 10% time taken (with Emscripten).

- Much smaller output size (matters more with Emscripten than a .bin for Linux or .so for Android)

- Compiles with minor tweaks in any "C family compiler" Objective-C, C++ (so quite portable perhaps)

- glm maths library is C++... this was a pain because I like using a "standard" maths library rather than a hand rolled one.

- Debugging C with lldb or gdb is trivial compared to C++.


#6Karsten_

Posted 17 August 2013 - 06:07 AM

Using C for games certainly isn't impossible but I find myself just recrafting a toy version of C++ with macros etc...

 

The following was a small prototype game developed using C (compiled using Clang/Emscripten)

http://50.57.98.84:8080/legfria/

 

Some notes...

- I really missed exceptions.

- One level of inheritance is possible (using update, draw function pointers) but more gets really fiddly

- Works great with SDL (and OpenGL) and don't need to worry about fiddly unique_ptr deleter functions etc...

- Compiles in a fraction of the time as C++. Probably about 10% time taken (with Emscripten).

- Much smaller output size (matters more with Emscripten than a .bin for Linux or .so for Android)

- Compiles with minor tweaks in any "C family compiler" Objective-C, C++ (so quite portable perhaps)

- glm maths library is C++... this was a pain because I like using a "standard" maths library rather than a hand rolled one.

- Debugging C with lldb or gdb is trivial compared to C++.


#5Karsten_

Posted 17 August 2013 - 05:56 AM

Using C for games certainly isn't impossible but I find myself just recrafting a toy version of C++ with macros etc...

 

The following was a small prototype of using C to develop a game (compiled using Clang/Emscripten)

http://50.57.98.84:8080/legfria/

 

Some notes...

- I really missed exceptions.

- One level of inheritance is possible (using update, draw function pointers) but more gets really fiddly

- Works great with SDL (and OpenGL) and don't need to worry about fiddly unique_ptr deleter functions etc...

- Compiles in a fraction of the time as C++. Probably about 10% time taken (with Emscripten).

- Much smaller output size (matters more with Emscripten than a .bin for Linux or .so for Android)

- Compiles with minor tweaks in any "C family compiler" Objective-C, C++ (so quite portable perhaps)

- glm maths library is C++... this was a pain because I like using a "standard" maths library rather than a hand rolled one.

- Debugging C with lldb or gdb is trivial compared to C++.


#4Karsten_

Posted 17 August 2013 - 05:53 AM

Using C for games certainly isn't impossible but I find myself just recrafting a toy version of C++ with macros etc...

 

The following was a small prototype of using C to develop a game (compiled using Clang/Emscripten)

http://50.57.98.84:8080/legfria/

 

Some notes...

- I really missed exceptions.

- One level of inheritance is possible (using update, draw function pointers) but more gets really fiddly

- Works great with SDL (and OpenGL) and don't need to worry about fiddly unique_ptr deleter functions etc...

- Compiles in a fraction of the time as C++. Probably about 10% time taken (with Emscripten).

- Much smaller output size (matters more with Emscripten than a .bin for Linux or .so for Android)

- Compiles with minor tweaks in any "C family compiler" Objective-C, C++ (so quite portable perhaps)

- glm maths library is C++... this was a pain because I like using a "standard" maths library rather than a hand rolled one.


#3Karsten_

Posted 17 August 2013 - 05:53 AM

Using C for games certainly isn't impossible but I find myself just recrafting a toy version of C++ with macros etc...

 

The following was a small prototype of using C to develop a game (compiled using Clang/Emscripten)

http://50.57.98.84:8080/legfria/

 

Some notes...

- I really missed exceptions.

- One level of inheritance is possible (using update, draw function pointers) but more gets really fiddly

- Works great with SDL (and OpenGL) and don't need to worry about fiddly unique_ptr deleter functions etc...

- Compiles in a fraction of the time as C++. Probably about 10% time taken (with Emscripten).

- Compiles with minor tweaks in any "C family compiler" Objective-C, C++ (so quite portable perhaps)

- glm maths library is C++... this was a pain because I like using a "standard" maths library rather than a hand rolled one.


#2Karsten_

Posted 17 August 2013 - 05:52 AM

Using C for games certainly isn't impossible but I find myself just recrafting a toy version of C++ with macros etc...

 

The following was a small prototype of using C to develop a game a game (compiled using Clang/Emscripten)

http://50.57.98.84:8080/legfria/

 

Some notes...

- I really missed exceptions.

- One level of inheritance is possible (using update, draw function pointers) but more gets really fiddly

- Works great with SDL (and OpenGL) and don't need to worry about fiddly unique_ptr deleter functions etc...

- Compiles in a fraction of the time as C++. Probably about 10% time taken (with Emscripten).

- Compiles with minor tweaks in any "C family compiler" Objective-C, C++ (so quite portable perhaps)

- glm maths library is C++... this was a pain because I like using a "standard" maths library rather than a hand rolled one.


PARTNERS