On Thu, Jan 19, 2012 at 4:20 AM, Fabrizio Giudici <[email protected]> wrote: > On Thu, 19 Jan 2012 04:09:06 +0100, Josh Berry <[email protected]> wrote: > > >> And, again, read what you wrote. You read massive arrays of >> *primitives* into memory. Now... what if that primitive was an image >> and you'd like to treat it as such? In java, you're hosed. It is >> getting copied to the heap. > > > Perhaps I didn't understand the point, but in Java you can used memory > mapped I/O and have it accessible outside of the heap.
My impression was that you can do this, but as soon as you pull that something out of the bytebuffer, it is now on the heap. There are tricks, of course, you can provide a wrapper around a bytebuffer, evidently, and always just use getters and setters on the bytes that you want wrapped. However.... to offer this as some sort of valid replacement for just being able to define a struct is.... well, a bit laughable. I mean, Java already gets a reputation for being verbose. Bean style classes with getters on top of a bytebuffer takes that to a new level. > Honestly I have also other questions. I only had a short experience with > gaming (from the programming point of view) between 1992-1995, across my > primary graduation, when I was writing for fun a flight simulator. It was > DOS time, accessing memory beyond 640K was already a problem and I started > with a drawLine() getting up to the (gamish) simulation of a US supercarrier > getting attacked by a USSR Tupolef Bear. I did all the primitives by myself, > also trying alternate ways than the state of the art, and I had things that > other games of the time didn't have, such as full 3D cockpits and Doppler > effect on digital audio (of course, the application had never been polished > enough for being commercialized, since it was just fun). So, I have an idea > of what pulling the CPU power from any bit means. But is it today still the > same thing? I understand that games are much more complex, but we have > specialized hardware for graphics and sound... Are really technical the > reasons for preferring C# to Java? Or maybe the reason game developers > prefer C# is simply the fact that Microsoft has created since many years a > gaming business segment, and Sun just didn't? Again, just posing the question here is to do so rhetorically. The reasons are almost certainly partially technical, but not necessarily because Sun ignored the ball and Microsoft created an environment. Similarly, there is a reason there were few java applet games compared to flash. Hell, I struggle to remember any applets of note. There is certainly no reason java could not have done better there, either. (There are reasons, but they did not have to be.) That said, games are much much more complicated than they ever were. And I'm behind on games. Just really played the first Uncharted game recently, and even that is enough to convince me that things are complicated. -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
