Alberth wrote:
FelipeFS wrote:
I don't know if most of people use OOP or structured language for game programming.
I don't see any difference here, so what do you mean?
If you write a class with only data, and another class that operates on that data, you are doing structured programming in an OOP language. If you have a C struct, and a set of functions, with the first argument a pointer to that struct, you are doing OOP in C.
OOP is about the idea that you have data and code that belongs together. You can do that with any language. The only difference is that some languages povide a little more support for you to do one style, but that's about it.
I agree. No matter how you slice it, a programming language is just syntactic sugar for machine code (either CPU-dependent machine code for a specific CPU instruction set; or, bytecode used to program a virtual machine). Machine code is just syntactic sugar for memory operations.
OOP programming languages use classes and objects. Non-OOP languages use primitive data types (and often structs). However, while these abstractions may look different, and may behave differently, they are more or less the same under the hood. They have to in order to interact with the underlying platform, which runs on CPU instructions and memory addresses. Assuming your library or framework exposes its innards in a meaningful way, its utilities can be accessed.
If you do some sort of "special" formatting (in the form of specific object structures) that is specific to a particular language, that might be problematic -- but depending on the intentions of your library, using this kind of formatting would probably be completely unnecessary (if not undesirable).
Long story short: As long as your library can be given meaningful data, understand how to process that data, and return a primitive result, the only limits are those imposed by outside code (i.e. platform security, user error, etc.).