Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualngoaho91

Posted 04 January 2013 - 09:44 PM

hi, i've catch the same problem before.

so if you want to reuse your code, write it independently. i mean, don't do any render, or use any class, library... like sfml. use basic data structure.

for example: if you want to render a character, create 'Character' class, hold infomation for position(int), name(string), class(string), etc. your class should not have any field like Sprite, Font, Model, or any class from sfml(or any library)

and, for each library you use, create a new class named 'CharacterRender' that render the 'Character' class above. and of course, it should have Sprite, Font, Model...


#1ngoaho91

Posted 04 January 2013 - 09:43 PM

hi, i've catch the same problem before.

so if you want to reuse your code, write it independently. i mean, don't do any render, or use any class, library... like sfml. use basic data structure.

for example: if you want to render a character, create 'Character' class, hold infomation for position(int), name(string), class(string), etc. your class should not have any field like Sprite, Font, Model, or any class from sfml(or any library)

and, for each library you use, create a new class named 'CharacterRender' that render the 'Character' class above.


PARTNERS