kevglass
|
 |
«
Posted
2003-08-16 12:15:43 » |
|
Troggan and myself have been considering commoning up some of the code we've written independantly wrt abstracting the 2D drawing layer and making it available as a reusable code base. Just wondering if anyone was interested in this sort of thing and hopefully if anyone would like to get involved (reviewing/dev). The basic scope is to provide sprites, fonts and other 2D game related paraphernalia in an abstract manner with a couple of implementations based using JOGL and Java2D (what about LWJGL?). Primarily this is to provide a simple starting place for writing 2D games, but additionally a way to allow swapping over to pure Java2D once it becomes a viable alternative (hopefully Tiger?). Kev PS. Not trying to step on the toes of GAGE here ( http://java.dnsalias.com), really do appreciate the good work that JBanes has done/is doing there.
|
|
|
|
tortoise
|
 |
«
Reply #1 - Posted
2003-08-16 15:44:54 » |
|
hmmmm, interesting idea you've got there.
|
|
|
|
|
Backmask
Junior Member  
586: The average IQ needed to understand a PC
|
 |
«
Reply #2 - Posted
2003-08-18 07:32:47 » |
|
I like the idea... Unfortante I don't have the time to help developing but I can help with testing/reviewing
|
|
|
|
Games published by our own members! Check 'em out!
|
|
krypto
Junior Member  
while(true) { self.caffeinate (); }
|
 |
«
Reply #3 - Posted
2003-08-18 09:57:04 » |
|
I can't get at CVS like a normal person can. But I would be glad to review/test for you. After all you've been more than helpful to me. BTW.. it seems to me like JBanes has no objections to his code being adapted. Maybe you should consider combining his codebase w/ yours in this process. Just a thought. Oh Yeah, If I'm gonna test the jogl stuff I'll need to know if you found a fix for the "Red Primitive" syndrome as I like to call it on my S3 card. 
|
|
|
|
kevglass
|
 |
«
Reply #4 - Posted
2003-08-18 10:08:36 » |
|
Yep, think there is a fix for that now, its just getting it to reliably work on your type of card and the "normal" cards without one or other crashing  Kev
|
|
|
|
krypto
Junior Member  
while(true) { self.caffeinate (); }
|
 |
«
Reply #5 - Posted
2003-08-18 10:35:03 » |
|
Yep, think there is a fix for that now, its just getting it to reliably work on your type of card and the "normal" cards without one or other crashing  Kev Is that fix in the latest webstart ?
|
|
|
|
kevglass
|
 |
«
Reply #6 - Posted
2003-08-18 10:44:54 » |
|
For astroprime? No, last time I tried it, it was having problems on some peoples machines, crashing the whole machine in fullscreen mode (so I took it out again  ). If you want to try something out: http://www.newdawnsoftware.com/astroprime/test/JoglModeTest.zipShould contain a little test program to let you try a selection of different modes. I think its to do with the selection of the accumulaters supported.... Kev
|
|
|
|
troggan
Junior Member  
no guts no glory
|
 |
«
Reply #7 - Posted
2003-08-18 16:59:47 » |
|
I have commited a very early version to the CVS on Sourceforge. There is no example, nor an Website explaining the Stuff. That will be comming in the later versions  . Sorry for everyone that has no CVS, but the current state is not ready for creating a real zip with everything you might need. http://sourceforge.net/projects/j2da/troggan
|
|
|
|
krypto
Junior Member  
while(true) { self.caffeinate (); }
|
 |
«
Reply #8 - Posted
2003-08-19 10:08:11 » |
|
Works on some modes, although It says I have no hardware acceleration?
|
|
|
|
kevglass
|
 |
«
Reply #9 - Posted
2003-08-19 10:47:44 » |
|
I guess thats what jogl see's your machine as then. Do you know if the driver you're using for your GFX card has any OpenGL support, or only DirectX ?
Kev
|
|
|
|
Games published by our own members! Check 'em out!
|
|
krypto
Junior Member  
while(true) { self.caffeinate (); }
|
 |
«
Reply #10 - Posted
2003-08-19 11:31:15 » |
|
I quess it has opengl, some of the jogl demos run...Very few though.
|
|
|
|
troggan
Junior Member  
no guts no glory
|
 |
«
Reply #11 - Posted
2003-08-31 13:34:46 » |
|
kev and i just released the first early alpha of j2da. it's usable, but the api could change every moment  . you will find the first release there: https://sourceforge.net/projects/j2dasourceforge has some problems (they had a raid crashed) that makes it impossible to post a homepage for it  . if you want to use it, this might help : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
| package j2daexample;
import java.io.File;
import net.sf.j2da.graphic.AnimatedSprite; import net.sf.j2da.graphic.BitmapFont; import net.sf.j2da.graphic.GameFactory; import net.sf.j2da.graphic.GameFrame; import net.sf.j2da.graphic.GameFrameRenderer; import net.sf.j2da.graphic.GeomDrawer; import net.sf.j2da.graphic.ResourceFactory; import net.sf.j2da.util.J2DAColor;
public class Main implements GameFrameRenderer { ResourceFactory factory; BitmapFont font; GeomDrawer drawer; AnimatedSprite animspr; public Main() { factory = GameFactory.getResourceFactory(GameFactory.JOGL); GameFrame frame = factory.getGameFrame(this, "Test Game", 300, 240, true); }
public void init(GameFrame gameFrame) { try { drawer = factory.getGeomDrawer(gameFrame); font = factory.getBitmapFont(gameFrame, "bobfonts.png",16,8); animspr = new AnimatedSprite(); animspr.addImage(factory, gameFrame, "weiss-os201.gif", 250); animspr.addImage(factory, gameFrame, "weiss-os202.gif", 50); animspr.addImage(factory, gameFrame, "weiss-os203.gif", 50); animspr.addImage(factory, gameFrame, "weiss-os204.gif", 50); } catch (Exception ex) { ex.printStackTrace(); } }
public void draw(GameFrame gameFrame) { drawer.fillRect(10,10,150,150,J2DAColor.pureBlue, false); animspr.draw(100, 100, 0);
if (font != null) { font.draw(10,100,"All your base are belong to us"); font.draw(10,70, ""+gameFrame.getFPS()); } }
public static void main(String[] args) { System.out.println("J2DA Test"); Main test = new Main(); }
} |
as you see it's quit easy to use. hope you enjoy the stuff. feel free to comment this stuff  troggan
|
|
|
|
troggan
Junior Member  
no guts no glory
|
 |
«
Reply #12 - Posted
2003-08-31 18:01:04 » |
|
If someone is interested in creating the LWJGL-part of this, please leave me a message. I think it's not too hard to do. Simply take the jogl part and change a few gl calls  troggan
|
|
|
|
kevglass
|
 |
«
Reply #13 - Posted
2003-09-02 21:35:34 » |
|
I think we'd need to wrap the event system to support abstracting LWJGL. But thats only what I remember from my brief look at it. Incidently, AstroPrime now runs on J2DA!!!  I've also updates the J2DA javadoc, so it should be much more readable/useful now. Kev
|
|
|
|
thaaks
|
 |
«
Reply #14 - Posted
2003-09-03 19:08:16 » |
|
Hi, just curious but how do you currently deal with player input (keyboard, mouse)? Don't you need wrapper classes for this?
But I really like your idea of J2DA - please keep on going!
Tommy
|
|
|
|
kevglass
|
 |
«
Reply #15 - Posted
2003-09-03 19:14:43 » |
|
This is what I was trying to get at above. At the moment we have a method called getActiveComponent() on GameFrame which returns a java.awt.Componet.
You can then add event listeners to that component and expect the event notifications to flow. However, if we were to go and implement a LWJGL version we'd have to support the input polling style event.
But thinking about it, we'd also want to do input and visual seperatly since you might want to use a combination of JInput and another rendering technology.
Kev
|
|
|
|
troggan
Junior Member  
no guts no glory
|
 |
«
Reply #16 - Posted
2003-09-05 18:29:59 » |
|
The Homepage is running now. It can be reached at http://j2da.sf.net. Kevglass has coded a small example on how to use it ( http://www.cokeandcode.com/j2da-dash/), and I will create a Tutorial based on that. Before releasing a new 0.2 release we have to fix one thing: Is it possible to draw a image with another Color? We have a Image with a white Letter, but it should be drawn in Red. We need that Stuff for the FontEngine. In OpenGL it was very easy, but we don't know a way to do it in Java2D  .
|
|
|
|
whome
Junior Member  
Carte Noir Java
|
 |
«
Reply #17 - Posted
2003-09-05 19:16:01 » |
|
Is there avail bobfonts.png and sprite gifs files somewhere in j2da site? I could test a testprogram posted above. thx
|
|
|
|
|
kevglass
|
 |
«
Reply #18 - Posted
2003-09-05 22:16:35 » |
|
All the sprites and font files should be in the resources direction in CVS.
Kev
|
|
|
|
troggan
Junior Member  
no guts no glory
|
 |
«
Reply #19 - Posted
2003-09-07 17:22:19 » |
|
Finaly Version 0.2 is out ! You can grab it here : http://j2da.sf.net. Now 2 Examples are included: the class I have posted here and the BoulderDash clone made by kev. Hope you all like it. Comments are welcome, Developers too  . And don't forget: this game library is actually used by me and kev to write our games  .
|
|
|
|
troggan
Junior Member  
no guts no glory
|
 |
«
Reply #20 - Posted
2003-09-13 18:17:56 » |
|
I added a small tutorial to the site and released the javadoc as external zip-file.
Thanks for the reactions from all of you !
troggan
|
|
|
|
|