There are a few games done using the Java Monkey Engine http://www.jmonkeyengine.com/ http://www.renanse.com/blog/ Tom Clifford schrieb:
Richard:Java is viewed generally as slow; but in my tests so far, frame rates of up to 100 fps are possible with simple scene graphs, but I have a 2GHz machine with an ATI x1050 vid card (not the most powerful). I think it will be considered more in the near future, especially for its cross-platform capabilities.I'm currently experimenting with a messaging system, and viewplatform entry/exit behaviors. Once I get something presentable for simple gaming concepts, I'll publish it for review.But currently, some are available: http://www.frontiernet.net/~imaging/games_with_java3d.html http://www.java.com/en/games/ http://www.java-gaming.com/ If I come across more, I'll let everyone know.Thanks....Tom--- richard sabbarton <richard.sabbarton@xxxxxxxxx> wrote:Hi Tom, Ahhh... OK. So I could potentially use JPanel to create a double buffer for drawing. I guess that would be a lot quicker because I am assuming it would switch pointer of the JPanel rather than, in my example, copying the pixel data from one buffer to another. I will certainly look at it for my next project but I don't believe Iwill be pushing the boundries with my current task. I am really onlydoing it to get the hang of Java. (I'm normally a C++ Win32 kinda guy!) Can I ask... What your thoughts on the suitability of Java for Game Development? I think I might just be having trouble shaking some preconceptions I have through other (non-game related) experiences. Regards Richard On 05/02/2008, Tom Clifford <tjclifford@xxxxxxxxx> wrote:Hello Richard. I know that in the Killer Game Programming codetheauthor used a double-buffering command: setDoubleBuffered(true/false); which is from JPanel/JComponent, and this is also supposed to eliminate flicker, I believe. Anyway, a custom paint function would also work. I'm working on making some techniques work for a java game. I wish you luck with your efforts. Tom. --- richard sabbarton<richard.sabbarton@xxxxxxxxx>wrote:Hi Tom, I downloaded the Java3D API from Sun. It looksgoodbut I think itwas a bit much for what I was looking for.Anyway,after a little further digging I managed to work out how to dowhatI was trying to do. The key to getting rid of the flicker was notusingthe paint() function but instead, using my own. Firstly, I created a new Image and then obtainedtheGraphics interface for the image. This gave me myoffscreenlocation to assemble my GUI. I then use this image and drawitto the Graphics interface of my Applet // Variables and members Image offScreenImage; Graphics offScreenGraphics; Graphics onScreenGraphics; In the init function I run the following: offScreenImage = createImage( width, height);offScreenGraphics = offScreenImage.getGraphics(); onScreenGraphics = this.getGraphics(); I then setup a timer to keep the screenup-to-dateevery xxx milliseconds which basically runs the following: // Draw everything I need to my offscreen Graphics InterfaceoffScreenGraphics.drawImage( etc. etc. etc.);offScreenGraphics.drawImage( etc. etc. etc.);offScreenGraphics.drawImage( etc. etc. etc.);// Then draw the whole thing to screen withtheImage Interface onScreenGraphics.drawImage(offScreenImage,xxx ,yyyy , this ); Seems to work quite well for simple graphics andGUIetc. If I want anything more complex then I will go down theJava3Droute but for now this will do. Regards Richard On 04/02/2008, Tom Clifford<tjclifford@xxxxxxxxx>wrote:Java has it's own Java3D interface, found at: http://java.sun.com/products/java-media/3D/ It allows you to do what is called activerendering,which is similar to the c/c++ WinMain/WndProcloops,that uses double-buffering, or you can create the objects you want andallowJava3D to do the looping for you, while doing animation with their Behavior objects. There are some good java examples with source code, at Killer Game Programming with Java, by Andrew Davison O'Reilly, May 2005 ISBN: 0-596-00730-2 http://www.oreilly.com/catalog/killergame/ Web Site for the book: http://fivedots.coe.psu.ac.th/~ad/jg code downloads and instructions at: http://fivedots.coe.psu.ac.th/~ad/jg/code/ Tom C. --- richard sabbarton<richard.sabbarton@xxxxxxxxx>wrote:Hi Guys, In C++ on windows I would use animation bycreatinga compatible device context in memory withCreateCompatibleDC().I would write my game and all of its elements to the MemoryDCandthen use something like BitBlt() to push it to my main DC. I have recently started learning Java and Iwanttoperform a similar function. I want to write all of theelementstomemory and then transfer it to the screen every xmilliseconds.This is to eliminate flicker etc. I have been looking online through tutorialsetc.and I can't seem to find a description of how to do this. Do Ineed=== message truncated === ____________________________________________________________________________________Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs--------------------- To unsubscribe go to http://gameprogrammer.com/mailinglist.html
--------------------- To unsubscribe go to http://gameprogrammer.com/mailinglist.html