Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (775)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (856)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: 1 2 3 [4]
91  Java Game APIs & Engines / Tools Discussion / Re: C/C++ to Java translation on: 2003-04-07 10:51:02
I once looked at the c2j translator and found it useless if you want to continue to develop and maintain the code in Java. I don't know the other tool.

I've some experiences in manually translating C to Java.

I did this for the JRuby parser some time ago and I also ported the original Hack to Java as a kind of experiment to learn something about the difficulties of porting larger C applications.  I wrote an article/diary about this project in German language: http://www.3plus4software.de/sma/jrogue/index.html. Please try http://www.google.com/language_tools to translate it to your language.  (Don't bother to try the linked source code - it's old and buggy, I've a more recent and working version offline)

To summarize, if the C code doesn't contain to much pointer arithmetics or gotos, it's quite doable. I used some global copy/replace operations but otherwise did it "the hard way". Rogue was ported at about 400-800 lines an hour. I should have tried to not directly introduce booleans and String operations but to stay with the C way until everything runs. By modifying the semantics I introduced some stupid errors. I should have more used the advanced refactoring of Eclipse instead to make the source to more look like Java afterwards.
92  Discussions / General Discussions / OpenGL support for SWT on: 2003-04-07 10:37:56
I hope this qualifies as "Game News":

Perhaps some of you find it interesting that there's now experimental OpenGL support for SWT - the so called "standard widget toolkit" created as part of the Eclipse project as an alternative to AWT (and in parts to Swing). It works on Windows and on Linux and Solaris with the Motif version of SWT so far. So there's now yet another way to get fast 2D/3D graphics for Java Wink

I took this as a chance to finally start learning something about OpenGL and ported the first 10 lessons of the (famous) NeHe tutorials to SWT. You can find the source code here: http://www.3plus4software.de/news/20030407.html (German language, please try http://www.google.com/language_tools to translate it for yourself)

93  Discussions / General Discussions / Re: JDK1.4.2 beta posted on: 2003-04-05 12:27:37
Some noteworthy changes: General startup time shall be 10%-20% faster. Swing apps start noticable faster. When using the Windows LAF on Windows XP, you'll get a quite good (better than usual) emulation of the XP look (thanks to some native code it uses the real images right from the Windows XP skinning engine).  Client hotspot shall have a lower memory foot print.
94  Discussions / Miscellaneous Topics / Re: perl on: 2003-04-01 15:53:50
Quote
Java descends from Lisp?  I think not Smiley

Smalltalk and C maybe.


Actually, Smalltalk's root is Logo which is a simplified child of Lisp. Objective-C is a child of Smalltalk and C and Java has most of its features from that language. (I have to defend Lisp here which IMHO is one of the coolest languages Wink

And to answer the original poster's question: Please consider Ruby as an alternative to Perl. It's a very readable language combining the better features of Perl with the power of Smalltalk plus an easy to learn syntax.
95  Game Development / Performance Tuning / Re: Swing faster than AWT?? ZHUH? on: 2003-01-10 08:40:00
Quote
If you want pure performance and no frills, use pure LWJGL.


Will LWJGL open and manage its own windows? Can I set caption text, min/max/buttons, what's about (modal) dialogs? Browsing over the doc (only a few seconds I admit) I didn't find this functionallity.

Quote

If you want to mix a Java GUI with high-performance OpenGL, use GL4Java and AWT or Swing.


Cas, why do you think that SWT wouldn't be an option to be mixed with LWGL.   I thought, that your library would be kind-of a replacement for GL4Java, some way to get accelerated graphics for Java.  Having some "traditional" GUI framework might help to speed up development.

Or let me ask a different question: Let's say I'd like to create something like the original Warcraft or Battle Isle (both not requiring fancy 3D graphics) game. What would be the best approach in Java.  Let's further say, Windows is the most important platform and Linux would be a nice to have.

Quote

If you want to write productivity applications then SWT will probably work just as well as AWT.


Definitely better than AWT. Not so sure about Swing though. Here it depends on your requirements which one has more advantages.

Stefan
96  Game Development / Performance Tuning / Re: Swing faster than AWT?? ZHUH? on: 2003-01-10 08:25:35
Quote

I have never found Swing and AWT widgets all that exciting either.


I was joking. I agree, AWT doesn't look exciting, especially not on Linux. With Swing however, one can easily create custom looks which could look nice and exciting.

Quote

Are you using SWT for Motif or GTK?  [...] I think the Motif side of SWT will become deprecated some day though.  Sad


I was referring to SWT for GTK+ 2.0.  The Motif version might be faster (I think, you could also replace Motif with Lesstif but don't know which one is faster) but the Motif look out of the box is ugly.  I don't think, SWT for Motif will die soon, the Solaris and especially the AIX version of Eclipse depends on it.

Stefan
97  Game Development / Performance Tuning / Re: does Java combine screen paints? on: 2003-01-10 08:15:10
Quote

Does SWT render components and events in a seperate thread like the AWT?  If I remember right, I seen some code doing event polling manually....


You're right. SWT doesn't use a separate thread but uses a dispatch loop that normally is installed in the application's main thread. As the main thread is idle in most AWT applications, SWT is slightly more efficient here.  Like AWT, SWT can only manipulate components in that thread. Unlike AWT, SWT will throw errors if you try to do this from a different thread.  This helps catching programming errors.

Rendering is done based on OS callbacks. I can only talk about Windows here. Windows itself has a very efficient way to combine damage rectangles and builds up a damage region (a set of damage rectangles) which is then used to clip the drawings. This all happens outside of Java and directly in the ON_PAINT callback when Windows is in a state for fast damage repair.  And custom paint methods are called just once.

With AWT on the other hand, repaint requests are taken from the OS and queued for the AWT event thread. Windows is told that everthing is done and (I'm not sure here) Windows will do its default background painting.  Some time later, AWT will combine damage rectangles to a larger damage rectangle, if possible, but has no concept of a damage region which would be more efficient. Instead, it will call all paint methods multiple times for different rectangles which is obviously slower. AWT will explicitely setup a Graphics object somehow connected to a Windows GC and finally the damaged parts of the screen are repainted.  This is one reason that AWT and Swing often feel a little bit more sluggish.

Regarding animations, SWT uses DIBs and the GDI bitmap functions but no directX stuff.  Therefore, Swing might be faster.

I'm currently creating a tiny freecell-game with SWT and I'm quite satisfied with the drawing speed, it's okay even without double buffering and it feels a bit faster than AWT. I haven't tried.  

However, I'm only blitting static images. SWT has no concept of image producers or image sources. If you want to create your image by hand, you'd setup an ImageData object which is then converted into a real Image object which can then drawn on a Canvas object.  I don't know how fast this is compared to AWT.

Stefan
98  Game Development / Performance Tuning / Re: Swing faster than AWT?? ZHUH? on: 2003-01-09 09:21:13
Regarding SWT: While I'm a big fan of SWT, I don't really see how this framework would help developing game GUIs.

  • You can't use it for applets.
  • You can't go "full screen" or change the display mode.
  • You get these "boring" native controls (a good thing for business application but let's say for a fantasy RPG I'd like to see some medieval-looking UI).
  • Drawing performance isn't always better.

On Windows, drawing on an SWT canvas seems to be a little bit faster than drawing on an AWT canvas as it directly uses GDI calls and has a better damage redraw strategy. It's however not faster than Java2D calls which might use a lower level hardware accelerated API. On Linux, SWT seems to draw noticable slower than pure Java.

Whatever, some ideas:

One could of course create own custom drawn buttons, input fields, list boxes, etc. with any skin you could possible want (I'd even call this easy to do).  Unfortunately, SWT's drawing capabilities are primitive compared to the 2D API. There's for example no easy way to do transparency and no way I know to load a custom font.  On the other hand, you have full access to all platform fonts and platform font rendering like subpixel antialiasing.

If you don't care about using the lower level AWT methods, namely the Java2D API, you could combine its power with SWT.  This might the best way to go but it requires Java 2. If you can live without advanced 2D graphics, you could use gcj to compile an executable.

Another interesting idea might be to combine something like the LWGL with SWT. I'd assume that LWGL eventually draws upon a Windows GC. This is directly exposed in SWT so you could probably efficiently combine 3D hardware accelerated graphics with SWT.

This is something a lot of people might be interested in IIRC the comments on the eclipse.tools newsgroup. I've however no knowledge about 3D and can't estimate whether such a combo would be difficult.

Stefan
Pages: 1 2 3 [4]
 
EgonOlsen (1869 views)
2018-06-10 19:43:48

EgonOlsen (1901 views)
2018-06-10 19:43:44

EgonOlsen (1258 views)
2018-06-10 19:43:20

DesertCoockie (1703 views)
2018-05-13 18:23:11

nelsongames (1389 views)
2018-04-24 18:15:36

nelsongames (2003 views)
2018-04-24 18:14:32

ivj94 (2753 views)
2018-03-24 14:47:39

ivj94 (1955 views)
2018-03-24 14:46:31

ivj94 (3045 views)
2018-03-24 14:43:53

Solater (1090 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!