jPCT-AE - a 3d engine for Android > Support

compatibility with desktop version

<< < (2/3) > >>

paulscode:
Would another option be to get rid of RGBColor and instead create a faux java.awt.Color for the AE version (and any other awt-related classes used in the desktop version)?  That way the compiler wouldn't generate NoSuchMethodError's.

EgonOlsen:
The idea was to make it portable on the source code level, not on the binary level. And i don't want to bind myself to the state of awt.Color. Once it changes, i would have to decide with which version to go...
Can't you simply create two projects (one desktop, one Android) and one additional source folder with the shared stuff that is linked into both, i.e. that will be compiled in both environments? That way, it's also easier to detect version mismatches at compile time instead of running into runtime errors.

raft:
i dont think adding java.awt.Color to AE is a good idea. if i remember correctly applications are not allowed to use java package name. it may work for now but may result in other problems in the future.

@egon, i can do that but if i dont miss anything, that will either result in duplicating code or abstracting such unshared actions via interfaces or so. it takes me where this thread started.

if i were you, i would add RGBColor to desktop, duplicate awt.Color methods and deprecate the old ones. i would do a similar thing for light and others if any. i agree that will clutter desktop api, but that's how api's evolve i suppose.

i found this a fairly big decisision. but for years you had struggled to keep SW and HW renderers aligned. this is something similar i suppose.

just my two cents..

EgonOlsen:
Maybe i'm a bit confused now, but how does adding a second source-directory with the shared source code to both of your projects differ from linking to the project in that aspect?

EgonOlsen:
This is what i mean:



...where the Hurgel.java is the one that comes from a shared src-directory somewhere but both projects are using it.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version