Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Java 2D Abstraction Layer (J2DA!)  (Read 3095 times)
0 Members and 1 Guest are viewing this topic.
Offline kevglass

JGO Kernel


Medals: 186
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Posted 2003-08-16 10: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.

Offline tortoise

Junior Duke




<3 Shmups


« Reply #1 - Posted 2003-08-16 13:44:54 »

hmmmm, interesting idea you've got there.
Offline Backmask

Junior Duke




586: The average IQ needed to understand a PC


« Reply #2 - Posted 2003-08-18 05: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!
Legends of Yore - The Casual Retro Roguelike
Offline krypto

Junior Duke




while(true) { self.caffeinate (); }


« Reply #3 - Posted 2003-08-18 07: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. Grin

JRPG Users -  General Users Site
JRPG Developers -  The JRPG Project's Home
Offline kevglass

JGO Kernel


Medals: 186
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #4 - Posted 2003-08-18 08: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 Smiley

Kev

Offline krypto

Junior Duke




while(true) { self.caffeinate (); }


« Reply #5 - Posted 2003-08-18 08:35:03 »

Quote
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 Smiley

Kev
Is that fix in the latest webstart ?

JRPG Users -  General Users Site
JRPG Developers -  The JRPG Project's Home
Offline kevglass

JGO Kernel


Medals: 186
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #6 - Posted 2003-08-18 08: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 Smiley).

If you want to try something out:

http://www.newdawnsoftware.com/astroprime/test/JoglModeTest.zip

Should 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

Offline troggan

Junior Duke




no guts no glory


« Reply #7 - Posted 2003-08-18 14: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 Wink.

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

(http://www.wannawork.de) - Will work for food
(http://tvbrowser.org) - Java EPG
Offline krypto

Junior Duke




while(true) { self.caffeinate (); }


« Reply #8 - Posted 2003-08-19 08:08:11 »

Quote


If you want to try something out:

http://www.newdawnsoftware.com/astroprime/test/JoglModeTest.zip

Should 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


Works on some modes, although It says I have no hardware acceleration?

JRPG Users -  General Users Site
JRPG Developers -  The JRPG Project's Home
Offline kevglass

JGO Kernel


Medals: 186
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #9 - Posted 2003-08-19 08: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!
Legends of Yore - The Casual Retro Roguelike
Offline krypto

Junior Duke




while(true) { self.caffeinate (); }


« Reply #10 - Posted 2003-08-19 09:31:15 »

I quess it has opengl, some of the jogl demos run...Very few though.

JRPG Users -  General Users Site
JRPG Developers -  The JRPG Project's Home
Offline troggan

Junior Duke




no guts no glory


« Reply #11 - Posted 2003-08-31 11:34:46 »

kev and i just released the first early alpha of j2da. it's usable, but the api could change every moment Wink.

you will find the first release there:
https://sourceforge.net/projects/j2da

sourceforge has some problems (they had a raid crashed) that makes it impossible to post a homepage for it Sad.

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;

/**
 * A small example for j2da
 * @author bodo tasche
 */

public class Main implements GameFrameRenderer {
      ResourceFactory factory;
      BitmapFont font;
      GeomDrawer drawer;
     
      AnimatedSprite animspr;
     
      public Main() {
            // Create a JOGL-Factory
            factory = GameFactory.getResourceFactory(GameFactory.JOGL);
            // Creates the Frame
            GameFrame frame = factory.getGameFrame(this, "Test Game", 300, 240, true);
      }

      // This is called from the frame created above
      public void init(GameFrame gameFrame) {
            try {
                  // creating geomDrawer
                  drawer = factory.getGeomDrawer(gameFrame);
                  // creating Font
                  font = factory.getBitmapFont(gameFrame, "bobfonts.png",16,8);
                 
                  // Creating an animated Sprite
                  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();
            }
           
      }

      // this is called by the GameFrame to draw the Frame
      public void draw(GameFrame gameFrame) {
            // draw a filled rectangle
            drawer.fillRect(10,10,150,150,J2DAColor.pureBlue, false);
            // draw a animated sprite
            animspr.draw(100, 100, 0);

            if (font != null) {
                  // draw the font
                  font.draw(10,100,"All your base are belong to us");
                  // draw the fps
                  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 Wink

troggan

(http://www.wannawork.de) - Will work for food
(http://tvbrowser.org) - Java EPG
Offline troggan

Junior Duke




no guts no glory


« Reply #12 - Posted 2003-08-31 16: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 Smiley

troggan

(http://www.wannawork.de) - Will work for food
(http://tvbrowser.org) - Java EPG
Offline kevglass

JGO Kernel


Medals: 186
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #13 - Posted 2003-09-02 19: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!!! Smiley

I've also updates the J2DA javadoc, so it should be much more readable/useful now.

Kev

Offline thaaks
« Reply #14 - Posted 2003-09-03 17: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

Offline kevglass

JGO Kernel


Medals: 186
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #15 - Posted 2003-09-03 17: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

Offline troggan

Junior Duke




no guts no glory


« Reply #16 - Posted 2003-09-05 16: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 Sad.

(http://www.wannawork.de) - Will work for food
(http://tvbrowser.org) - Java EPG
Offline whome

Junior Duke




Carte Noir Java


« Reply #17 - Posted 2003-09-05 17:16:01 »

Is there avail bobfonts.png and sprite gifs files somewhere in j2da site?
I could test a testprogram posted above.
thx
Offline kevglass

JGO Kernel


Medals: 186
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #18 - Posted 2003-09-05 20:16:35 »

All the sprites and font files should be in the resources direction in CVS.

Kev

Offline troggan

Junior Duke




no guts no glory


« Reply #19 - Posted 2003-09-07 15: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 Wink.

And don't forget: this game library is actually used by me and kev to write our games Cheesy.

(http://www.wannawork.de) - Will work for food
(http://tvbrowser.org) - Java EPG
Offline troggan

Junior Duke




no guts no glory


« Reply #20 - Posted 2003-09-13 16: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

(http://www.wannawork.de) - Will work for food
(http://tvbrowser.org) - Java EPG
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (41 views)
2014-10-17 03:59:02

Norakomi (33 views)
2014-10-16 15:22:06

Norakomi (26 views)
2014-10-16 15:20:20

lcass (30 views)
2014-10-15 16:18:58

TehJavaDev (59 views)
2014-10-14 00:39:48

TehJavaDev (60 views)
2014-10-14 00:35:47

TehJavaDev (50 views)
2014-10-14 00:32:37

BurntPizza (66 views)
2014-10-11 23:24:42

BurntPizza (38 views)
2014-10-11 23:10:45

BurntPizza (80 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!